cuIBM
A GPU-based Immersed Boundary Method code
|
Direct forcing method proposed by Fadlun et al (2000). More...
#include <FadlunEtAlSolver.h>
Public Member Functions | |
FadlunEtAlSolver (parameterDB *pDB=NULL, domain *dInfo=NULL) | |
Constructor. Copies the database and information about the computational grid. More... | |
virtual std::string | name () |
Returns the name of the solver as a string. More... | |
Public Member Functions inherited from DFModifiedSolver< memoryType > | |
DFModifiedSolver (parameterDB *pDB=NULL, domain *dInfo=NULL) | |
Constructor – get simulation parameters and grid. More... | |
Public Member Functions inherited from DirectForcingSolver< memoryType > | |
DirectForcingSolver (parameterDB *pDB=NULL, domain *dInfo=NULL) | |
Constructor. Initializes the simulation parameters and the domain info. More... | |
virtual void | initialise () |
Initialize the vectors used in the simulation. More... | |
virtual void | writeData () |
Writes the velocity, pressure, force and mass flux data at every save point. More... | |
Public Member Functions inherited from NSWithBody< memoryType > | |
virtual void | writeCommon () |
Writes flow variables and position of body points into files. More... | |
virtual void | shutDown () |
Closes iteration file and force file. More... | |
Public Member Functions inherited from NavierStokesSolver< memoryType > | |
NavierStokesSolver (parameterDB *pDB=NULL, domain *dInfo=NULL) | |
Constructor. Copies the database and information about the computational grid. More... | |
void | stepTime () |
Calculates the variables at the next time step. More... | |
bool | finished () |
Evaluates the condition required to stop the simulation. More... | |
Private Member Functions | |
virtual void | updateG () |
virtual void | generateQT () |
Generates the matrix QT , Q and G for FadlunEtAlSolver. More... | |
virtual void | calculateExplicitLambdaTerms () |
Add the pressure gradient to the right hand side of the momentum equation. More... | |
virtual void | generateC () |
Generates the matrix for the Poisson equation. More... | |
template<> | |
void | updateG () |
Update the gradient operator. More... | |
Private Attributes | |
cusp::coo_matrix< int, real, memoryType > | G |
gradient operator More... | |
Additional Inherited Members | |
Protected Member Functions inherited from DFModifiedSolver< memoryType > | |
virtual void | projectionStep () |
Project velocity field onto divergence-free space and update pressure. More... | |
Protected Member Functions inherited from DirectForcingSolver< memoryType > | |
void | tagPoints () |
void | tagPoints (real *bx, real *by, real *uB, real *vB) |
Tags all the forcing nodes required for the type of linear interpolation explained in the paper by Fadlun et al. (2000). More... | |
virtual void | generateA (real alpha) |
virtual void | generateL () |
void | generateQT (int *QTRows, int *QTCols, real *QTVals) |
void | updateQ () |
virtual void | assembleRHS1 () |
Assembles the matrix rhs1 for DirectForcingSolver. More... | |
void | updateRHS1 () |
virtual void | updateSolverState () |
Updates the matrices every time the body is moved. More... | |
void | writeMassFluxInfo () |
Prints the min, max and sum of the divergences of the velocity field in every cell of the domain. More... | |
template<> | |
void | generateA (real alpha) |
Generates the matrix A on the device. More... | |
template<> | |
void | generateL () |
Sets up the Laplacian matrix for the implicit diffusion term. Uses second order central differences on the non-uniform grid. More... | |
template<> | |
void | updateQ () |
Update the gradient operator (device). More... | |
template<> | |
void | tagPoints () |
Tags the forcing nodes among the velocity nodes, i.e. the nodes at which the velocity interpolation is performed. More... | |
template<> | |
void | updateRHS1 () |
Update the RHS of the velocity system. More... | |
Protected Member Functions inherited from NSWithBody< memoryType > | |
virtual void | calculateForce () |
void | initialiseBodies () |
Stores the parameters of the simulation and initializes the location and motion of each immersed bodies. More... | |
void | updateBodies () |
Updates location and motion of each immersed body at current time. More... | |
template<> | |
void | calculateForce () |
Calculates forces acting on an immersed body. More... | |
Protected Member Functions inherited from NavierStokesSolver< memoryType > | |
void | initialiseCommon () |
Initializes parameters common to all Navier-Stokes solvers. More... | |
void | initialiseArrays (int numQ, int numLambda) |
Initializes all arrays required to solve the Navier-Stokes equations. More... | |
virtual void | initialiseFluxes () |
virtual void | initialiseFluxes (real *q) |
Initializes velocity flux vectors. More... | |
void | initialiseBoundaryArrays () |
Initializes boundary velocity arrays with values stored in the database. More... | |
void | assembleMatrices () |
Assembles matrices of the intermediate flux solver and the Poisson solver. More... | |
void | generateM () |
void | generateBN () |
Generates approximate inverse of the matrix resulting from implicit velocity terms. More... | |
void | updateQ (real gamma) |
Doing nothing. More... | |
void | generateRN () |
Generates explicit terms of the momentum equation. More... | |
void | calculateExplicitQTerms () |
virtual void | generateBC1 () |
virtual void | generateBC2 () |
void | assembleRHS2 () |
Assembles the right hand-side of the Poisson system. More... | |
virtual void | solveIntermediateVelocity () |
Solves for the intermediate flux velocity. More... | |
virtual void | solvePoisson () |
Solves the Poisson system. More... | |
void | updateBoundaryConditions () |
Doing nothing. More... | |
template<> | |
void | generateA (real alpha) |
Assembles the matrix from implicit terms of momentum equation. More... | |
template<> | |
void | generateBC1 () |
Generates inhomogeneous boundary conditions from the discrete Laplacian operator. More... | |
template<> | |
void | generateBC2 () |
Generates inhomogeneous boundary conditions from the discrete continuity equation. More... | |
template<> | |
void | generateL () |
Generates the discrete Laplacian matrix. More... | |
template<> | |
void | generateM () |
Generates the mass matrix and its inverse. More... | |
template<> | |
void | generateQT () |
Generates the discrete divergence matrix. More... | |
template<> | |
void | calculateExplicitQTerms () |
Generates explicit terms that arise from the velocity fluxes. More... | |
template<> | |
void | initialiseFluxes () |
Initializes velocity flux vectors (on the device). More... | |
template<> | |
void | generateC () |
Generates the matrix of the Poisson solver. More... | |
Protected Attributes inherited from DirectForcingSolver< memoryType > | |
cusp::array1d< int, host_memory > | tags |
vector used to differentiate forcing points from regular ones (host) More... | |
cusp::array1d< int, host_memory > | tags2 |
vector used to differentiate forcing points from regular ones (host) More... | |
cusp::array1d< int, device_memory > | tagsD |
vector used to differentiate forcing points from regular ones (device) More... | |
cusp::array1d< int, device_memory > | tags2D |
vector used to differentiate forcing points from regular ones (device) More... | |
vecH | coeffs |
coefficients of interpolation (host) More... | |
vecH | coeffs2 |
other coefficients of interpolation; quadratic interpolation (host) More... | |
vecD | coeffsD |
coefficients of interpolation (device) More... | |
vecD | coeffs2D |
other coefficients of interpolation; quadratic interpolation (device) More... | |
vecH | uv |
velocity field (host) More... | |
vecD | uvD |
velocity field (device) More... | |
cusp::array1d< real, memoryType > | pressure |
pressure field More... | |
Protected Attributes inherited from NSWithBody< memoryType > | |
bodies< memoryType > | B |
bodies in the flow More... | |
real | forceX |
force acting on each body in the x-direction More... | |
real | forceY |
force acting on each body in the y-direction More... | |
std::ofstream | forceFile |
file to write the forces More... | |
Protected Attributes inherited from NavierStokesSolver< memoryType > | |
parameterDB * | paramDB |
database that contains all the simulation parameters More... | |
domain * | domInfo |
computational grid information More... | |
integrationScheme | intgSchm |
instance of the class integrationScheme More... | |
real | QCoeff |
cusp::coo_matrix< int, real, memoryType > | M |
diagonal mass matrix More... | |
cusp::coo_matrix< int, real, memoryType > | Minv |
inverse of the mass matrix More... | |
cusp::coo_matrix< int, real, memoryType > | L |
discrete Laplacian matrix More... | |
cusp::coo_matrix< int, real, memoryType > | A |
combination of mass and Laplacian matrices More... | |
cusp::coo_matrix< int, real, memoryType > | Q |
gradient matrix (and regularization matrix if immersed body) More... | |
cusp::coo_matrix< int, real, memoryType > | QT |
transposed gradient matrix (and interpolation matrix if immersed body) More... | |
cusp::coo_matrix< int, real, memoryType > | BN |
N-th order Taylor series expansion of the inverse of A . More... | |
cusp::coo_matrix< int, real, memoryType > | C |
matrix of the Poisson system More... | |
cusp::array1d< real, memoryType > | q |
velocity flux vector More... | |
cusp::array1d< real, memoryType > | qStar |
intermediate velocity flux vector More... | |
cusp::array1d< real, memoryType > | qOld |
velocity flux vector at the previous time-step More... | |
cusp::array1d< real, memoryType > | lambda |
pressure vector (and body forces if immersed body) More... | |
cusp::array1d< real, memoryType > | rn |
explicit terms of the momentum equation More... | |
cusp::array1d< real, memoryType > | bc1 |
inhomogeneous boundary conditions from the discrete Laplacian operator More... | |
cusp::array1d< real, memoryType > | bc2 |
inhomogeneous boundary conditions from the discrete continuity equation More... | |
cusp::array1d< real, memoryType > | rhs1 |
right hand-side of the system for the intermediate velocity flux vector More... | |
cusp::array1d< real, memoryType > | rhs2 |
right hand-side of the Poisson system More... | |
cusp::array1d< real, memoryType > | H |
hold convective terms from previous time step More... | |
cusp::array1d< real, memoryType > | temp1 |
temporary 1D Cusp array More... | |
cusp::array1d< real, memoryType > | temp2 |
temporary 1D Cusp array More... | |
cusp::array1d< real, memoryType > | bc [4] |
array that contains the boundary conditions of the rectangular domain More... | |
preconditioner< cusp::coo_matrix< int, real, memoryType > > * | PC1 |
preconditioner for the intermediate flux solver More... | |
preconditioner< cusp::coo_matrix< int, real, memoryType > > * | PC2 |
preconditioner for the Poisson solver More... | |
size_t | timeStep |
iteration number More... | |
size_t | subStep |
number of sub-iterations More... | |
size_t | iterationCount1 |
number of iteration to solve the intermediate fluxes More... | |
size_t | iterationCount2 |
number of iteration to solve the Poisson equation More... | |
Logger | logger |
instance of the class Logger to track time of different tasks More... | |
std::ofstream | iterationsFile |
file that contains the number of iterations More... | |
Direct forcing method proposed by Fadlun et al (2000).
This is the same method that Fadlun et al. used in their 2000 paper. An explicit pressure is used in the intermediate velocity step. The quantity obtained in the Poisson equation is the pressure correction, and has to be added to the pressure at the previous step to obtain the pressure at the next time step.
Inherits from DFModifiedSolver.
The Poisson equations solved the standard Poisson system for the entire domain. The divergence formula is the same in every cell. But the equation for the intermediate velocity involves both the momentum equation as well as the interpolation relations. Hence, both G and Q need to be defined separately, with G missing rows that correspond to the forcing nodes.
Definition at line 33 of file FadlunEtAlSolver.h.
FadlunEtAlSolver< memoryType >::FadlunEtAlSolver | ( | parameterDB * | pDB = NULL , |
domain * | dInfo = NULL |
||
) |
Constructor. Copies the database and information about the computational grid.
Definition at line 18 of file FadlunEtAlSolver.cu.
|
privatevirtual |
Add the pressure gradient to the right hand side of the momentum equation.
Reimplemented from DFModifiedSolver< memoryType >.
Definition at line 71 of file FadlunEtAlSolver.cu.
|
privatevirtual |
Generates the matrix for the Poisson equation.
Calls the function from NavierStokesSolver because it does not need to set any node inside the immersed boundary to zero.
Reimplemented from DirectForcingSolver< memoryType >.
Definition at line 87 of file FadlunEtAlSolver.cu.
References NavierStokesSolver< memoryType >::generateC().
|
privatevirtual |
Generates the matrix QT
, Q and G for FadlunEtAlSolver.
Reimplemented from DirectForcingSolver< memoryType >.
Definition at line 29 of file FadlunEtAlSolver.cu.
References NavierStokesSolver< memoryType >::generateQT().
|
inlinevirtual |
Returns the name of the solver as a string.
Reimplemented from DFModifiedSolver< memoryType >.
Definition at line 57 of file FadlunEtAlSolver.h.
|
privatevirtual |
|
private |
Update the gradient operator.
Zeros rows of G that correspond to the forcing nodes. Calls the function updateQ, but passes the matrix G to it.
Definition at line 44 of file FadlunEtAlSolver.cu.
|
private |
gradient operator
Definition at line 36 of file FadlunEtAlSolver.h.