|
numerics
|
#include <ns_solver.hpp>
Public Member Functions | |
| NSSolver (idx N_, real dt_, real nu_=0.0) | |
| void | init_shear_layer (real rho=0.05, real delta=0.05) |
| void | step () |
| Advance one time step (advect -> pressure -> project). | |
| real | vorticity (idx i, idx j) const |
| Vorticity omega = d_v/d_x - d_u/d_y at grid corner (i*h, j*h). | |
| real | speed (idx i, idx j) const |
| Velocity magnitude averaged to cell centre (i,j). | |
| real | interp_u (real px, real py) const |
| Interpolate x-velocity at physical point (px, py). | |
| real | interp_v (real px, real py) const |
| Interpolate y-velocity at physical point (px, py). | |
Public Attributes | |
| const idx | N |
| const real | h |
| const real | dt |
| const real | nu |
| num::Vector | u |
| num::Vector | v |
| num::Vector | p |
| velocity faces + cell-centre pressure, N*N each | |
| Stats | stats |
Definition at line 40 of file ns_solver.hpp.
| ns::NSSolver::NSSolver | ( | idx | N_, |
| real | dt_, | ||
| real | nu_ = 0.0 |
||
| ) |
| N_ | Grid resolution (NxN cells) |
| dt_ | Time step |
| nu_ | Kinematic viscosity (0 = inviscid Euler) |
Definition at line 15 of file ns_solver.cpp.
| void ns::NSSolver::init_shear_layer | ( | real | rho = 0.05, |
| real | delta = 0.05 |
||
| ) |
Double shear layer initial condition (Kelvin-Helmholtz instability). Two counter-flowing bands at y~=0.25 and y~=0.75 seed vortex roll-up.
| rho | Shear layer thickness (default 0.05) |
| delta | Perturbation amplitude (default 0.05) |
Definition at line 27 of file ns_solver.cpp.
Referenced by main().
| real ns::NSSolver::interp_u | ( | real | px, |
| real | py | ||
| ) | const |
Interpolate x-velocity at physical point (px, py).
Definition at line 254 of file ns_solver.cpp.
| real ns::NSSolver::interp_v | ( | real | px, |
| real | py | ||
| ) | const |
Interpolate y-velocity at physical point (px, py).
Definition at line 271 of file ns_solver.cpp.
| real ns::NSSolver::speed | ( | idx | i, |
| idx | j | ||
| ) | const |
Velocity magnitude averaged to cell centre (i,j).
Definition at line 298 of file ns_solver.cpp.
| void ns::NSSolver::step | ( | ) |
Advance one time step (advect -> pressure -> project).
Definition at line 50 of file ns_solver.cpp.
References nu, stats, and ns::Stats::total_ms.
Referenced by main().
| real ns::NSSolver::vorticity | ( | idx | i, |
| idx | j | ||
| ) | const |
| const real ns::NSSolver::dt |
Definition at line 69 of file ns_solver.hpp.
| const real ns::NSSolver::h |
Definition at line 69 of file ns_solver.hpp.
Referenced by init_shear_layer(), interp_u(), interp_v(), and vorticity().
| const idx ns::NSSolver::N |
Definition at line 68 of file ns_solver.hpp.
Referenced by init_shear_layer(), interp_u(), and interp_v().
| const real ns::NSSolver::nu |
Definition at line 69 of file ns_solver.hpp.
Referenced by step().
| num::Vector ns::NSSolver::p |
velocity faces + cell-centre pressure, N*N each
Definition at line 72 of file ns_solver.hpp.
Referenced by init_shear_layer().
| Stats ns::NSSolver::stats |
Definition at line 74 of file ns_solver.hpp.
| num::Vector ns::NSSolver::u |
Definition at line 72 of file ns_solver.hpp.
Referenced by init_shear_layer(), interp_u(), speed(), and vorticity().
| num::Vector ns::NSSolver::v |
Definition at line 72 of file ns_solver.hpp.
Referenced by init_shear_layer(), interp_v(), speed(), and vorticity().