Saras
Finite Difference Solver for Fluid Dynamics Simulations
|
The derived class from the hydro base class to solve the incompressible NSE in 3D. More...
#include "lib/hydro.h"
Public Member Functions | |
hydro_d3 (const grid &mesh, const parser &solParam, parallel &mpiParam) | |
Constructor of the hydro_d3 class derived from the base hydro class. More... | |
void | solvePDE () |
The core publicly accessible function of the hydro class to solve the Navier-Stokes equations. More... | |
real | testPeriodic () |
Function to test whether periodic BC is being implemented properly. More... | |
![]() | |
hydro (const grid &mesh, const parser &solParam, parallel &mpiParam) | |
Constructor of the base hydro class. More... | |
Additional Inherited Members | |
![]() | |
vfield | V |
The vector field that stores the velocity field. | |
sfield | P |
The scalar field that stores the pressure field. | |
force * | vForcing |
Instance of force class to handle velocity field forcing. | |
![]() | |
void | checkPeriodic () |
Function to enable/disable periodic data transfer as per the problem. More... | |
void | setCoefficients () |
Function to set the coefficients used for solving the implicit equations of U, V and W. More... | |
void | initVBC () |
Function to initialize the boundary conditions for velocity. More... | |
void | imposeUBCs () |
Function to impose the boundary conditions for the X-component of velocity. More... | |
void | imposeVBCs () |
Function to impose the boundary conditions for the Y-component of velocity. More... | |
void | imposeWBCs () |
Function to impose the boundary conditions for the Z-component of velocity. More... | |
void | initVForcing () |
Function to initialize the forcing terms for velocity. More... | |
![]() | |
int | timeStepCount |
Integer value for the number of time-steps elapsed - it is incremented by 1 in each time-step. | |
int | maxIterations |
Maximum number of iterations for the iterative solvers hydro::solveVx, hydro::solveVy and hydro::solveVz. | |
real | time |
real | dt |
real | hx |
real | hy |
real | hz |
real | hx2 |
real | hz2 |
real | hz2hx2 |
real | hx2hy2 |
real | hy2hz2 |
real | hx2hy2hz2 |
const grid & | mesh |
const parser & | inputParams |
const real | inverseRe |
probes * | dataProbe |
Instance of the probe class to collect data from probes in the domain. | |
boundary * | uLft |
Instances of the boundary class to impose boundary conditions on all the 6 walls for the 3 components of the velocity field. | |
boundary * | uRgt |
boundary * | uFrn |
boundary * | uBak |
boundary * | uTop |
boundary * | uBot |
boundary * | vLft |
boundary * | vRgt |
boundary * | vFrn |
boundary * | vBak |
boundary * | vTop |
boundary * | vBot |
boundary * | wLft |
boundary * | wRgt |
boundary * | wFrn |
boundary * | wBak |
boundary * | wTop |
boundary * | wBot |
parallel & | mpiData |
Instance of the parallel class that holds the MPI-related data like rank, xRank, etc. | |
plainsf | Pp |
Plain scalar field into which the pressure correction is calculated and written by the Poisson solver. | |
plainsf | mgRHS |
Plain scalar field into which the RHS for pressure Poisson equation is written and passed to the Poisson solver. | |
plainvf | nseRHS |
Plain vector field into which the RHS of the Navier-Stokes equation is written and stored. | |
plainvf | velocityLaplacian |
Plain vector field into which the RHS of the implicit equation for velocities are calculated during iterative solving. | |
plainvf | pressureGradient |
Plain vector field which stores the pressure gradient term. | |
plainvf | guessedVelocity |
Plain vector field which serves as a temporary array during iterative solution procedure for velocity terms. | |
The derived class from the hydro base class to solve the incompressible NSE in 3D.
Certain paramters to be used in the implicit calculation of velocity are defined separately from within the class. Moreover, it imposes boundary conditions on all the three faces of the computational domain.
Constructor of the hydro_d3 class derived from the base hydro class.
The constructor passes its arguments to the base hydro class and then initializes all the scalar and vector fields necessary for solving the NS equations. The various coefficients for solving the equations are also set by a call to the \ref setCoefficients function. Based on the problem type specified by the user in the parameters file, and stored by the \ref parser class as \ref parser#probType "probType", the appropriate boundary conditions are specified.
mesh | is a const reference to the global data contained in the grid class |
solParam | is a const reference to the user-set parameters contained in the parser class |
|
virtual |
The core publicly accessible function of the hydro class to solve the Navier-Stokes equations.
The NSE are integrated in time from within this function by calling \ref hydro#timeAdvance in a loop. The function keeps track of the non-dimensional time with \ref time and number of iterations with \ref iterCount. Both these values are continuously incremented from within the loop, and finally, when \ref time has reached the user-ser value in \ref parser#tMax "tMax", the time-integration loop is broken and the program exits.
Reimplemented from hydro.
|
virtual |
Function to test whether periodic BC is being implemented properly.
The function populates the arrays with predetermined values at all locations. It then calls imposeUBCs, imposeVBCs and imposeWBCs functions and checks if the correct values of the functions are imposed at boundaries
Reimplemented from hydro.