Nektar++
|
#include <CoupledLinearNS.h>
Static Public Member Functions | |
static SolverUtils::EquationSystemSharedPtr | create (const LibUtilities::SessionReaderSharedPtr &pSession, const SpatialDomains::MeshGraphSharedPtr &pGraph) |
Creates an instance of this class. More... | |
Public Attributes | |
Array< OneD, Array< OneD, NekDouble > > | m_ForcingTerm |
Array< OneD, Array< OneD, NekDouble > > | m_ForcingTerm_Coeffs |
Array< OneD, CoupledLocalToGlobalC0ContMapSharedPtr > | m_locToGloMap |
![]() | |
NekDouble | m_cflSafetyFactor |
CFL safety factor (comprise between 0 to 1). More... | |
Static Public Attributes | |
static std::string | className = SolverUtils::GetEquationSystemFactory().RegisterCreatorFunction("CoupledLinearisedNS", CoupledLinearNS::create) |
Name of class. More... | |
Protected Member Functions | |
CoupledLinearNS (const LibUtilities::SessionReaderSharedPtr &pSesssion, const SpatialDomains::MeshGraphSharedPtr &pGraph) | |
virtual void | v_InitObject () |
Init object for UnsteadySystem class. More... | |
![]() | |
IncNavierStokes (const LibUtilities::SessionReaderSharedPtr &pSession, const SpatialDomains::MeshGraphSharedPtr &pGraph) | |
Constructor. More... | |
EquationType | GetEquationType (void) |
void | EvaluateAdvectionTerms (const Array< OneD, const Array< OneD, NekDouble > > &inarray, Array< OneD, Array< OneD, NekDouble > > &outarray) |
void | WriteModalEnergy (void) |
void | SetBoundaryConditions (NekDouble time) |
time dependent boundary conditions updating More... | |
void | SetRadiationBoundaryForcing (int fieldid) |
Set Radiation forcing term. More... | |
void | SetZeroNormalVelocity () |
Set Normal Velocity Component to Zero. More... | |
void | SetWomersleyBoundary (const int fldid, const int bndid) |
Set Womersley Profile if specified. More... | |
void | SetUpWomersley (const int fldid, const int bndid, std::string womstr) |
Set Up Womersley details. More... | |
virtual MultiRegions::ExpListSharedPtr | v_GetPressure () |
virtual Array< OneD, NekDouble > | v_GetMaxStdVelocity () |
virtual bool | v_PreIntegrate (int step) |
![]() | |
virtual SOLVER_UTILS_EXPORT bool | v_PostIntegrate (int step) |
![]() | |
SOLVER_UTILS_EXPORT | UnsteadySystem (const LibUtilities::SessionReaderSharedPtr &pSession, const SpatialDomains::MeshGraphSharedPtr &pGraph) |
Initialises UnsteadySystem class members. More... | |
SOLVER_UTILS_EXPORT NekDouble | MaxTimeStepEstimator () |
Get the maximum timestep estimator for cfl control. More... | |
virtual SOLVER_UTILS_EXPORT void | v_AppendOutput1D (Array< OneD, Array< OneD, NekDouble >> &solution1D) |
Print the solution at each solution point in a txt file. More... | |
virtual SOLVER_UTILS_EXPORT NekDouble | v_GetTimeStep (const Array< OneD, const Array< OneD, NekDouble >> &inarray) |
Return the timestep to be used for the next step in the time-marching loop. More... | |
virtual SOLVER_UTILS_EXPORT bool | v_RequireFwdTrans () |
SOLVER_UTILS_EXPORT void | CheckForRestartTime (NekDouble &time, int &nchk) |
SOLVER_UTILS_EXPORT void | SVVVarDiffCoeff (const Array< OneD, Array< OneD, NekDouble >> vel, StdRegions::VarCoeffMap &varCoeffMap) |
Evaluate the SVV diffusion coefficient according to Moura's paper where it should proportional to h time velocity. More... | |
![]() | |
SOLVER_UTILS_EXPORT | EquationSystem (const LibUtilities::SessionReaderSharedPtr &pSession, const SpatialDomains::MeshGraphSharedPtr &pGraph) |
Initialises EquationSystem class members. More... | |
virtual SOLVER_UTILS_EXPORT NekDouble | v_LinfError (unsigned int field, const Array< OneD, NekDouble > &exactsoln=NullNekDouble1DArray) |
Virtual function for the L_inf error computation between fields and a given exact solution. More... | |
virtual SOLVER_UTILS_EXPORT NekDouble | v_L2Error (unsigned int field, const Array< OneD, NekDouble > &exactsoln=NullNekDouble1DArray, bool Normalised=false) |
Virtual function for the L_2 error computation between fields and a given exact solution. More... | |
virtual SOLVER_UTILS_EXPORT void | v_SetInitialConditions (NekDouble initialtime=0.0, bool dumpInitialConditions=true, const int domain=0) |
virtual SOLVER_UTILS_EXPORT void | v_EvaluateExactSolution (unsigned int field, Array< OneD, NekDouble > &outfield, const NekDouble time) |
virtual SOLVER_UTILS_EXPORT void | v_ExtraFldOutput (std::vector< Array< OneD, NekDouble > > &fieldcoeffs, std::vector< std::string > &variables) |
Private Member Functions | |
void | SetUpCoupledMatrix (const NekDouble lambda, const Array< OneD, Array< OneD, NekDouble > > &Advfield, bool IsLinearNSEquation, const int HomogeneousMode, CoupledSolverMatrices &mat, CoupledLocalToGlobalC0ContMapSharedPtr &locToGloMap, const NekDouble lambda_imag=NekConstants::kNekUnsetDouble) |
virtual void | v_GenerateSummary (SolverUtils::SummaryList &s) |
Print a summary of time stepping parameters. More... | |
virtual void | v_DoInitialise (void) |
Sets up initial conditions. More... | |
virtual void | v_DoSolve (void) |
Solves an unsteady problem. More... | |
virtual bool | v_NegatedOp (void) |
virtual void | v_TransCoeffToPhys (void) |
Virtual function for transformation to physical space. More... | |
virtual void | v_TransPhysToCoeff (void) |
Virtual function for transformation to coefficient space. More... | |
virtual void | v_Output (void) |
virtual int | v_GetForceDimension (void) |
Private Attributes | |
bool | m_zeroMode |
Id to identify when single mode is mean mode (i.e. beta=0);. More... | |
int | m_counter |
bool | m_initialStep |
NekDouble | m_tol |
int | m_maxIt |
int | m_Restart |
int | m_MatrixSetUpStep |
NekDouble | m_kinvisMin |
NekDouble | m_kinvisStep |
NekDouble | m_KinvisPercentage |
Array< OneD, CoupledSolverMatrices > | m_mat |
Friends | |
class | MemoryManager< CoupledLinearNS > |
Additional Inherited Members | |
![]() | |
enum | HomogeneousType { eHomogeneous1D, eHomogeneous2D, eHomogeneous3D, eNotHomogeneous } |
Parameter for homogeneous expansions. More... | |
![]() | |
ExtrapolateSharedPtr | m_extrapolation |
std::ofstream | m_mdlFile |
modal energy file More... | |
bool | m_SmoothAdvection |
bool to identify if advection term smoothing is requested More... | |
std::vector< SolverUtils::ForcingSharedPtr > | m_forcing |
Forcing terms. More... | |
int | m_nConvectiveFields |
Number of fields to be convected;. More... | |
Array< OneD, int > | m_velocity |
int which identifies which components of m_fields contains the velocity (u,v,w); More... | |
MultiRegions::ExpListSharedPtr | m_pressure |
Pointer to field holding pressure field. More... | |
NekDouble | m_kinvis |
Kinematic viscosity. More... | |
int | m_energysteps |
dump energy to file at steps time More... | |
EquationType | m_equationType |
equation type; More... | |
Array< OneD, Array< OneD, int > > | m_fieldsBCToElmtID |
Mapping from BCs to Elmt IDs. More... | |
Array< OneD, Array< OneD, int > > | m_fieldsBCToTraceID |
Mapping from BCs to Elmt Edge IDs. More... | |
Array< OneD, Array< OneD, NekDouble > > | m_fieldsRadiationFactor |
RHS Factor for Radiation Condition. More... | |
int | m_intSteps |
Number of time integration steps AND Order of extrapolation for pressure boundary conditions. More... | |
std::map< int, std::map< int, WomersleyParamsSharedPtr > > | m_womersleyParams |
Womersley parameters if required. More... | |
![]() | |
SolverUtils::AdvectionSharedPtr | m_advObject |
Advection term. More... | |
![]() | |
int | m_infosteps |
Number of time steps between outputting status information. More... | |
int | m_abortSteps |
Number of steps between checks for abort conditions. More... | |
int | m_filtersInfosteps |
Number of time steps between outputting filters information. More... | |
int | m_nanSteps |
LibUtilities::TimeIntegrationWrapperSharedPtr | m_intScheme |
Wrapper to the time integration scheme. More... | |
LibUtilities::TimeIntegrationSchemeOperators | m_ode |
The time integration scheme operators to use. More... | |
LibUtilities::TimeIntegrationSolutionSharedPtr | m_intSoln |
NekDouble | m_epsilon |
bool | m_explicitDiffusion |
Indicates if explicit or implicit treatment of diffusion is used. More... | |
bool | m_explicitAdvection |
Indicates if explicit or implicit treatment of advection is used. More... | |
bool | m_explicitReaction |
Indicates if explicit or implicit treatment of reaction is used. More... | |
bool | m_homoInitialFwd |
Flag to determine if simulation should start in homogeneous forward transformed state. More... | |
NekDouble | m_steadyStateTol |
Tolerance to which steady state should be evaluated at. More... | |
int | m_steadyStateSteps |
Check for steady state at step interval. More... | |
Array< OneD, Array< OneD, NekDouble > > | m_previousSolution |
Storage for previous solution for steady-state check. More... | |
std::ofstream | m_errFile |
std::vector< int > | m_intVariables |
std::vector< std::pair< std::string, FilterSharedPtr > > | m_filters |
NekDouble | m_filterTimeWarning |
Number of time steps between outputting status information. More... | |
![]() | |
LibUtilities::CommSharedPtr | m_comm |
Communicator. More... | |
LibUtilities::SessionReaderSharedPtr | m_session |
The session reader. More... | |
std::map< std::string, SolverUtils::SessionFunctionSharedPtr > | m_sessionFunctions |
Map of known SessionFunctions. More... | |
LibUtilities::FieldIOSharedPtr | m_fld |
Field input/output. More... | |
Array< OneD, MultiRegions::ExpListSharedPtr > | m_fields |
Array holding all dependent variables. More... | |
SpatialDomains::BoundaryConditionsSharedPtr | m_boundaryConditions |
Pointer to boundary conditions object. More... | |
SpatialDomains::MeshGraphSharedPtr | m_graph |
Pointer to graph defining mesh. More... | |
std::string | m_sessionName |
Name of the session. More... | |
NekDouble | m_time |
Current time of simulation. More... | |
int | m_initialStep |
Number of the step where the simulation should begin. More... | |
NekDouble | m_fintime |
Finish time of the simulation. More... | |
NekDouble | m_timestep |
Time step size. More... | |
NekDouble | m_lambda |
Lambda constant in real system if one required. More... | |
NekDouble | m_checktime |
Time between checkpoints. More... | |
int | m_nchk |
Number of checkpoints written so far. More... | |
int | m_steps |
Number of steps to take. More... | |
int | m_checksteps |
Number of steps between checkpoints. More... | |
int | m_spacedim |
Spatial dimension (>= expansion dim). More... | |
int | m_expdim |
Expansion dimension. More... | |
bool | m_singleMode |
Flag to determine if single homogeneous mode is used. More... | |
bool | m_halfMode |
Flag to determine if half homogeneous mode is used. More... | |
bool | m_multipleModes |
Flag to determine if use multiple homogenenous modes are used. More... | |
bool | m_useFFT |
Flag to determine if FFT is used for homogeneous transform. More... | |
bool | m_homogen_dealiasing |
Flag to determine if dealiasing is used for homogeneous simulations. More... | |
bool | m_specHP_dealiasing |
Flag to determine if dealisising is usde for the Spectral/hp element discretisation. More... | |
enum MultiRegions::ProjectionType | m_projectionType |
Type of projection; e.g continuous or discontinuous. More... | |
Array< OneD, Array< OneD, NekDouble > > | m_traceNormals |
Array holding trace normals for DG simulations in the forwards direction. More... | |
Array< OneD, bool > | m_checkIfSystemSingular |
Flag to indicate if the fields should be checked for singularity. More... | |
LibUtilities::FieldMetaDataMap | m_fieldMetaDataMap |
Map to identify relevant solver info to dump in output fields. More... | |
int | m_NumQuadPointsError |
Number of Quadrature points used to work out the error. More... | |
enum HomogeneousType | m_HomogeneousType |
NekDouble | m_LhomX |
physical length in X direction (if homogeneous) More... | |
NekDouble | m_LhomY |
physical length in Y direction (if homogeneous) More... | |
NekDouble | m_LhomZ |
physical length in Z direction (if homogeneous) More... | |
int | m_npointsX |
number of points in X direction (if homogeneous) More... | |
int | m_npointsY |
number of points in Y direction (if homogeneous) More... | |
int | m_npointsZ |
number of points in Z direction (if homogeneous) More... | |
int | m_HomoDirec |
number of homogenous directions More... | |
![]() | |
static std::string | equationSystemTypeLookupIds [] |
Set up expansion field for velocity and pressure, the local to global mapping arrays and the basic memory definitions for coupled matrix system
Definition at line 87 of file CoupledLinearNS.h.
|
protected |
Definition at line 58 of file CoupledLinearNS.cpp.
Definition at line 1660 of file CoupledLinearNS.cpp.
References Nektar::SolverUtils::EquationSystem::m_fields, Nektar::IncNavierStokes::m_kinvis, m_KinvisPercentage, Nektar::IncNavierStokes::m_velocity, SetUpCoupledMatrix(), Vmath::Smul(), SolveLinearNS(), and Vmath::Vadd().
Referenced by v_DoSolve().
|
inlinestatic |
Creates an instance of this class.
Definition at line 93 of file CoupledLinearNS.h.
References Nektar::MemoryManager< DataType >::AllocateSharedPtr(), and CellMLToNektar.cellml_metadata::p.
Definition at line 1532 of file CoupledLinearNS.cpp.
References Nektar::SolverUtils::EquationSystem::GetFunction(), Nektar::SolverUtils::EquationSystem::m_boundaryConditions, Nektar::SolverUtils::EquationSystem::m_fields, m_ForcingTerm, m_ForcingTerm_Coeffs, Nektar::SolverUtils::EquationSystem::m_session, and Nektar::IncNavierStokes::m_velocity.
Referenced by v_DoInitialise().
void Nektar::CoupledLinearNS::EvaluateAdvection | ( | const Array< OneD, const Array< OneD, NekDouble > > & | inarray, |
Array< OneD, Array< OneD, NekDouble > > & | outarray, | ||
const NekDouble | time | ||
) |
Definition at line 1353 of file CoupledLinearNS.cpp.
References Nektar::IncNavierStokes::EvaluateAdvectionTerms(), Nektar::SolverUtils::EquationSystem::m_fields, and Nektar::IncNavierStokes::m_forcing.
Referenced by v_DoInitialise().
void Nektar::CoupledLinearNS::EvaluateNewtonRHS | ( | Array< OneD, Array< OneD, NekDouble > > & | Velocity, |
Array< OneD, Array< OneD, NekDouble > > & | outarray | ||
) |
Definition at line 1738 of file CoupledLinearNS.cpp.
References Nektar::IncNavierStokes::EvaluateAdvectionTerms(), Nektar::SolverUtils::EquationSystem::m_fields, m_ForcingTerm, Nektar::IncNavierStokes::m_kinvis, Nektar::IncNavierStokes::m_velocity, Vmath::Smul(), Vmath::Vadd(), and Vmath::Vsub().
Referenced by SolveSteadyNavierStokes().
const SpatialDomains::ExpansionMap & Nektar::CoupledLinearNS::GenPressureExp | ( | const SpatialDomains::ExpansionMap & | VelExp | ) |
Definition at line 1782 of file CoupledLinearNS.cpp.
References Nektar::MemoryManager< DataType >::AllocateSharedPtr(), ASSERTL0, Nektar::LibUtilities::BasisKey::GetBasisType(), Nektar::LibUtilities::BasisKey::GetNumModes(), Nektar::LibUtilities::BasisKey::GetPointsKey(), and Nektar::SolverUtils::EquationSystem::m_graph.
Referenced by v_InitObject().
void Nektar::CoupledLinearNS::InfNorm | ( | Array< OneD, Array< OneD, NekDouble > > & | inarray, |
Array< OneD, NekDouble > & | outarray | ||
) |
Definition at line 1705 of file CoupledLinearNS.cpp.
References Nektar::IncNavierStokes::m_velocity.
void Nektar::CoupledLinearNS::L2Norm | ( | Array< OneD, Array< OneD, NekDouble > > & | inarray, |
Array< OneD, NekDouble > & | outarray | ||
) |
Definition at line 1722 of file CoupledLinearNS.cpp.
References Nektar::IncNavierStokes::m_velocity.
Referenced by SolveSteadyNavierStokes().
void Nektar::CoupledLinearNS::SetUpCoupledMatrix | ( | const NekDouble | lambda = 0.0 , |
const Array< OneD, Array< OneD, NekDouble > > & | Advfield = NullNekDoubleArrayofArray , |
||
bool | IsLinearNSEquation = true |
||
) |
Generate the linearised Navier Stokes solver based on the static condensation of the interior velocity space and pressure modes.
Set up a coupled linearised Naviers-Stokes solve. Primarily a wrapper fuction around the full mode by mode version of SetUpCoupledMatrix.
Definition at line 181 of file CoupledLinearNS.cpp.
References ASSERTL1, Nektar::NekConstants::kNekUnsetDouble, Nektar::IncNavierStokes::m_kinvis, Nektar::SolverUtils::EquationSystem::m_LhomZ, m_locToGloMap, m_mat, Nektar::SolverUtils::EquationSystem::m_npointsZ, Nektar::SolverUtils::EquationSystem::m_session, Nektar::SolverUtils::EquationSystem::m_singleMode, and m_zeroMode.
Referenced by Continuation(), SolveSteadyNavierStokes(), SolveUnsteadyStokesSystem(), and v_DoInitialise().
|
private |
Generate the linearised Navier Stokes solver based on the static condensation of the interior velocity space and pressure modes. This call also allows for a Fourier mode to be specified, however if HomogeneneousMode= 0 then can be used for a standared 2D and hopefully 3D (in the future).
Set up a coupled linearised Naviers-Stokes solve in the following manner:
Consider the linearised Navier-Stokes element matrix denoted as
\[ \left [ \begin{array}{ccc} A & -D_{bnd}^T & B\\ -D_{bnd}& 0 & -D_{int}\\ \tilde{B}^T & -D_{int}^T & C \end{array} \right ] \left [ \begin{array}{c} {\bf v}_{bnd} \\ p\\ {\bf v}_{int} \end{array} \right ] = \left [ \begin{array}{c} {\bf f}_{bnd} \\ 0\\ {\bf f}_{int} \end{array} \right ] \]
where \({\bf v}_{bnd}, {\bf f}_{bnd}\) denote the degrees of freedom of the elemental velocities on the boundary of the element, \({\bf v}_{int}, {\bf f}_{int}\) denote the degrees of freedom of the elemental velocities on the interior of the element and \(p\) is the piecewise continuous pressure. The matrices have the interpretation
\[ A[n,m] = (\nabla \phi^b_n, \nu \nabla \phi^b_m) + (\phi^b_n,{\bf U \cdot \nabla} \phi^b_m) + (\phi^b_n \nabla^T {\bf U} \phi^b_m), \]
\[ B[n,m] = (\nabla \phi^b_n, \nu \nabla \phi^i_m) + (\phi^b_n,{\bf U \cdot \nabla} \phi^i_m) + (\phi^b_n \nabla^T {\bf U} \phi^i_m),\]
\[\tilde{B}^T[n,m] = (\nabla \phi^i_n, \nu \nabla \phi^b_m) + (\phi^i_n,{\bf U \cdot \nabla} \phi^b_m) + (\phi^i_n \nabla^T {\bf U} \phi^b_m) \]
\[ C[n,m] = (\nabla \phi^i_n, \nu \nabla \phi^i_m) + (\phi^i_n,{\bf U \cdot \nabla} \phi^i_m) + (\phi^i_n \nabla^T {\bf U} \phi^i_m),\]
\[ D_{bnd}[n,m] = (\psi_m,\nabla \phi^b),\]
\[ D_{int}[n,m] = (\psi_m,\nabla \phi^i) \]
where \(\psi\) is the space of pressures typically at order \(P-2\) and \(\phi\) is the velocity vector space of polynomial order \(P\). (Note the above definitions for the transpose terms shoudl be interpreted with care since we have used a tensor differential for the \(\nabla^T \) terms)
Note \(B = \tilde{B}^T\) if just considering the stokes operator and then \(C\) is also symmetric. Also note that \(A,B\) and \(C\) are block diagonal in the Oseen equation when \(\nabla^T {\bf U}\) are zero.
Since \(C\) is invertible we can premultiply the governing elemental equation by the following matrix:
\[ \left [ \begin{array}{ccc} I & 0 & -BC^{-1}\\ 0& I & D_{int}C^{-1}\\ 0 & 0 & I \end{array} \right ] \left \{ \left [ \begin{array}{ccc} A & -D_{bnd}^T & B\\ -D_{bnd}& 0 & -D_{int}\\ \tilde{B}^T & -D_{int}^T & C \end{array} \right ] \left [ \begin{array}{c} {\bf v}_{bnd} \\ p\\ {\bf v_{int}} \end{array} \right ] = \left [ \begin{array}{c} {\bf f}_{bnd} \\ 0\\ {\bf f_{int}} \end{array} \right ] \right \} \]
which if we multiply out the matrix equation we obtain
\[ \left [ \begin{array}{ccc} A - B C^{-1}\tilde{B}^T & -D_{bnd}^T +B C^{-1} D_{int}^T& 0\\ -D_{bnd}+D_{int} C^{-1} \tilde{B}^T & -D_{int} C^{-1} D_{int}^T & 0\\ \tilde{B}^T & -D_{int}^T & C \end{array} \right ] \left [ \begin{array}{c} {\bf v}_{bnd} \\ p\\ {\bf v_{int}} \end{array} \right ] = \left [ \begin{array}{c} {\bf f}_{bnd} -B C^{-1} {\bf f}_{int}\\ f_p = D_{int} C^{-1} {\bf f}_{int}\\ {\bf f_{int}} \end{array} \right ] \]
In the above equation the \({\bf v}_{int}\) degrees of freedom are decoupled and so we need to solve for the \({\bf v}_{bnd}, p\) degrees of freedom. The final step is to perform a second level of static condensation but where we will lump the mean pressure mode (or a pressure degree of freedom containing a mean component) with the velocity boundary degrees of freedom. To do we define \({\bf b} = [{\bf v}_{bnd}, p_0]\) where \(p_0\) is the mean pressure mode and \(\hat{p}\) to be the remainder of the pressure space. We now repartition the top \(2 \times 2\) block of matrices of previous matrix equation as
\[ \left [ \begin{array}{cc} \hat{A} & \hat{B}\\ \hat{C} & \hat{D} \end{array} \right ] \left [ \begin{array}{c} {\bf b} \\ \hat{p} \end{array} \right ] = \left [ \begin{array}{c} \hat{\bf f}_{bnd} \\ \hat{f}_p \end{array} \right ] \label{eqn.linNS_fac2} \]
where
\[ \hat{A}_{ij} = \left [ \begin{array}{cc} A - B C^{-1}\tilde{B}^T & [-D_{bnd}^T +B C^{-1} D_{int}^T]_{i0}\\ {[}-D_{bnd}+D_{int} C^{-1} \tilde{B}^T]_{0j} & -[D_{int} C^{-1} D_{int}^T ]_{00} \end{array} \right ] \]
\[ \hat{B}_{ij} = \left [ \begin{array}{c} [-D_{bnd}^T +B C^{-1} D_{int}^T]_{i,j+1} \\ {[} -D_{int} C^{-1} D^T_{int} ]_{0j}\end{array} \right ] \]
\[ \hat{C}_{ij} = \left [\begin{array}{cc} -D_{bnd} + D_{int} C^{-1} \tilde{B}^T, & {[} -D_{int} C^{-1} D^T_{int} ]_{i+1,0}\end{array} \right ] \]
\[ \hat{D}_{ij} = \left [\begin{array}{c} {[} -D_{int} C^{-1} D^T_{int} ]_{i+1,j+1}\end{array} \right ] \]
and
\[ fh\_{bnd} = \left [ \begin{array}{c} {\bf f}_{bnd} -B C^{-1} {\bf f}_{int}\\ {[}D_{int} C^{-1} {\bf f}_{int}]_0 \end{array}\right ] \hspace{1cm} [fh\_p_{i} = \left [ \begin{array}{c} {[}D_{int} C^{-1} {\bf f}_{iint}]_{i+1} \end{array}\right ] \]
Since the \(\hat{D}\) is decoupled and invertible we can now statically condense the previous matrix equationto decouple \({\bf b}\) from \(\hat{p}\) by solving the following system
\[ \left [ \begin{array}{cc} \hat{A} - \hat{B} \hat{D}^{-1} \hat{C} & 0 \\ \hat{C} & \hat{D} \end{array} \right ] \left [ \begin{array}{c} {\bf b} \\ \hat{p} \end{array} \right ] = \left [ \begin{array}{c} \hat{\bf f}_{bnd} - \hat{B} \hat{D}^{-1} \hat{f}_p\\ \hat{f}_p \end{array} \right ] \]
The matrix \(\hat{A} - \hat{B} \hat{D}^{-1} \hat{C}\) has to be globally assembled and solved iteratively or directly. One we obtain the solution to \({\bf b}\) we can use the second row of equation fourth matrix equation to solve for \(\hat{p}\) and finally the last row of equation second matrix equation to solve for \({\bf v}_{int}\).
Definition at line 377 of file CoupledLinearNS.cpp.
References Nektar::MemoryManager< DataType >::AllocateSharedPtr(), Blas::Dcopy(), Blas::Dgemm(), Nektar::MultiRegions::DirCartesianMap, Nektar::eDIAGONAL, Nektar::StdRegions::eFactorLambda, Nektar::StdRegions::eHelmholtz, Nektar::SolverUtils::EquationSystem::eHomogeneous1D, Nektar::StdRegions::eLinearAdvectionReaction, Nektar::StdRegions::eMass, Nektar::SolverUtils::EquationSystem::GetTotPoints(), Nektar::NekConstants::kNekUnsetDouble, Nektar::coupledSolverMatrices::m_BCinv, Nektar::coupledSolverMatrices::m_Btilde, Nektar::coupledSolverMatrices::m_Cinv, Nektar::coupledSolverMatrices::m_CoupledBndSys, Nektar::coupledSolverMatrices::m_D_bnd, Nektar::coupledSolverMatrices::m_D_int, Nektar::SolverUtils::EquationSystem::m_fields, Nektar::SolverUtils::EquationSystem::m_HomogeneousType, Nektar::IncNavierStokes::m_kinvis, Nektar::SolverUtils::EquationSystem::m_LhomZ, Nektar::IncNavierStokes::m_pressure, Nektar::SolverUtils::EquationSystem::m_singleMode, Nektar::IncNavierStokes::m_velocity, Vmath::Neg(), Nektar::NullNekDoubleArrayofArray, Vmath::Smul(), Nektar::LibUtilities::Timer::Start(), Nektar::LibUtilities::Timer::Stop(), Nektar::LibUtilities::Timer::TimePerTest(), Nektar::Transpose(), Vmath::Vmul(), and Vmath::Zero().
Definition at line 1504 of file CoupledLinearNS.cpp.
References Nektar::SolverUtils::EquationSystem::m_fields, Nektar::IncNavierStokes::m_forcing, Nektar::IncNavierStokes::m_velocity, and SolveLinearNS().
Referenced by v_DoInitialise(), and v_DoSolve().
void Nektar::CoupledLinearNS::SolveLinearNS | ( | const Array< OneD, Array< OneD, NekDouble > > & | forcing | ) |
Solve the coupled linear Navier-Stokes solve using matrix systems set up at construction. The solution is stored in m_velocity and m_pressure.
forcing | A list of forcing functions for each velocity component |
The routine involves two levels of static condensations. Initially we require a statically condensed forcing function which requires the following manipulation
\[ {F\_bnd} = {\bf f}_{bnd} -m\_B \,m\_Cinv\, {\bf f}_{int}, \hspace{1cm} F\_p = m\_D\_{int}\, m\_Cinv\, {\bf f}_{int} \]
Where \({\bf f}_{bnd}\) denote the forcing degrees of freedom of the elemental velocities on the boundary of the element, \({\bf f}_{int}\) denote the forcing degrees of freedom of the elemental velocities on the interior of the element. (see detailed description for more details).
This vector is further manipulated into
\[ Fh\_{bnd} = \left [ \begin{array}{c} f\_{bnd} -m\_B \, m\_Cinv\, {\bf f}_{int}\\ \left [m\_D\_{int} \, m\_Cinv \,{\bf f}_{int} \right]_0 \end{array}\right ] \hspace{1cm} [Fh\_p]_{i} = \begin{array}{c} [m\_D\_{int} \, m\_Cinv \, {\bf f}_{int}]_{i+1} \end{array} \]
where \(-{[}m\_D\_{int}^T\, m\_Cinv \,{\bf f}_{int}]_0\) which is corresponds to the mean mode of the pressure degrees of freedom and is now added to the boundary system and the remainder of the block becomes the interior forcing for the inner static condensation (see detailed description for more details) which is set up in a GlobalLinSysDirectStaticCond class.
Finally we perform the final maniplation of the forcing to using hte
\[ Fh\_{bnd} = Fh\_{bnd} - m\_Bh \,m\_Chinv \, Fh\_p \]
We can now call the solver to the global coupled boundary system (through the call to #m_CoupledBndSys->Solve) to obtain the velocity boundary solution as the mean pressure solution, i.e.
\[ {\cal A}^T(\hat{A} - \hat{C}^T \hat{D}^{-1} \hat{B} ){\cal A} \, Bnd = Fh\_{bnd} \]
Once we know the solution to the above the rest of the pressure modes are recoverable thorugh
\[ Ph = m\_Dhinv\, (Bnd - m\_Ch^T \, Fh_{bnd}) \]
We can now unpack \( Fh\_{bnd} \) (last elemental mode) and \( Ph \) into m_pressure and \( F_p\) and \( Fh\_{bnd}\) into a closed pack list of boundary velocoity degrees of freedom stored in \( F\_bnd\).
Finally the interior velocity degrees of freedom are then obtained through the relationship
\[ F\_{int} = m\_Cinv\ ( F\_{int} + m\_D\_{int}^T\, F\_p - m\_Btilde^T\, Bnd) \]
We then unpack the solution back to the MultiRegion structures m_velocity and m_pressure
Definition at line 1881 of file CoupledLinearNS.cpp.
References Nektar::SolverUtils::EquationSystem::eHomogeneous1D, Nektar::SolverUtils::EquationSystem::m_fields, Nektar::SolverUtils::EquationSystem::m_HomogeneousType, Nektar::SolverUtils::EquationSystem::m_npointsZ, Nektar::IncNavierStokes::m_pressure, and Nektar::IncNavierStokes::m_velocity.
Referenced by Continuation(), Solve(), SolveSteadyNavierStokes(), and SolveUnsteadyStokesSystem().
void Nektar::CoupledLinearNS::SolveLinearNS | ( | const Array< OneD, Array< OneD, NekDouble > > & | forcing, |
Array< OneD, MultiRegions::ExpListSharedPtr > & | fields, | ||
MultiRegions::ExpListSharedPtr & | pressure, | ||
const int | HomogeneousMode = 0 |
||
) |
Definition at line 1920 of file CoupledLinearNS.cpp.
References Nektar::SpatialDomains::eDirichlet, Nektar::SolverUtils::EquationSystem::eHomogeneous1D, Nektar::SpatialDomains::ePeriodic, Nektar::eSteadyNavierStokes, Nektar::eWrapper, Nektar::SolverUtils::EquationSystem::GetNcoeffs(), Nektar::IncNavierStokes::m_equationType, Nektar::SolverUtils::EquationSystem::m_fields, Nektar::SolverUtils::EquationSystem::m_HomogeneousType, m_initialStep, m_locToGloMap, m_mat, Nektar::SolverUtils::EquationSystem::m_singleMode, Nektar::IncNavierStokes::m_velocity, Nektar::Transpose(), and Vmath::Zero().
Definition at line 1562 of file CoupledLinearNS.cpp.
References ASSERTL0, EvaluateNewtonRHS(), L2Norm(), m_counter, Nektar::SolverUtils::EquationSystem::m_fields, m_initialStep, Nektar::IncNavierStokes::m_kinvis, m_MatrixSetUpStep, m_tol, Nektar::IncNavierStokes::m_velocity, SetUpCoupledMatrix(), SolveLinearNS(), Nektar::LibUtilities::Timer::Start(), Nektar::LibUtilities::Timer::Stop(), Nektar::LibUtilities::Timer::TimePerTest(), and Vmath::Vadd().
Referenced by v_DoSolve().
void Nektar::CoupledLinearNS::SolveUnsteadyStokesSystem | ( | const Array< OneD, const Array< OneD, NekDouble > > & | inarray, |
Array< OneD, Array< OneD, NekDouble > > & | outarray, | ||
const NekDouble | time, | ||
const NekDouble | a_iixDt | ||
) |
Definition at line 1366 of file CoupledLinearNS.cpp.
References Nektar::SolverUtils::EquationSystem::GetNcoeffs(), Nektar::SolverUtils::EquationSystem::m_fields, Nektar::IncNavierStokes::m_nConvectiveFields, Nektar::IncNavierStokes::m_velocity, SetUpCoupledMatrix(), Vmath::Smul(), and SolveLinearNS().
Referenced by v_DoInitialise().
Sets up initial conditions.
Sets the initial conditions.
Reimplemented from Nektar::SolverUtils::UnsteadySystem.
Definition at line 1208 of file CoupledLinearNS.cpp.
References ASSERTL0, DefineForcingTerm(), Nektar::LibUtilities::TimeIntegrationSchemeOperators::DefineImplicitSolve(), Nektar::LibUtilities::TimeIntegrationSchemeOperators::DefineOdeRhs(), Nektar::eNoEquationType, Nektar::eSteadyLinearisedNS, Nektar::eSteadyNavierStokes, Nektar::eSteadyOseen, Nektar::eSteadyStokes, Nektar::eUnsteadyNavierStokes, Nektar::eUnsteadyStokes, EvaluateAdvection(), Nektar::SolverUtils::EquationSystem::GetFunction(), Nektar::SolverUtils::EquationSystem::m_boundaryConditions, m_counter, Nektar::IncNavierStokes::m_equationType, Nektar::SolverUtils::EquationSystem::m_fields, m_initialStep, Nektar::IncNavierStokes::m_kinvis, m_kinvisMin, m_KinvisPercentage, Nektar::SolverUtils::EquationSystem::m_lambda, m_MatrixSetUpStep, m_maxIt, Nektar::SolverUtils::UnsteadySystem::m_ode, m_Restart, Nektar::SolverUtils::EquationSystem::m_session, m_tol, Nektar::IncNavierStokes::m_velocity, Nektar::SolverUtils::EquationSystem::SetInitialConditions(), SetUpCoupledMatrix(), Solve(), and SolveUnsteadyStokesSystem().
Solves an unsteady problem.
Initialises the time integration scheme (as specified in the session file), and perform the time integration.
Reimplemented from Nektar::SolverUtils::UnsteadySystem.
Definition at line 1430 of file CoupledLinearNS.cpp.
References ASSERTL0, Nektar::SolverUtils::EquationSystem::Checkpoint_Output(), Continuation(), Nektar::eNoEquationType, Nektar::eSteadyLinearisedNS, Nektar::eSteadyNavierStokes, Nektar::eSteadyOseen, Nektar::eSteadyStokes, Nektar::eUnsteadyNavierStokes, Nektar::eUnsteadyStokes, Nektar::IncNavierStokes::m_equationType, Nektar::IncNavierStokes::m_kinvis, m_kinvisMin, Solve(), SolveSteadyNavierStokes(), Nektar::LibUtilities::Timer::Start(), Nektar::LibUtilities::Timer::Stop(), Nektar::LibUtilities::Timer::TimePerTest(), and Nektar::SolverUtils::UnsteadySystem::v_DoSolve().
|
privatevirtual |
Print a summary of time stepping parameters.
Prints a summary with some information regards the time-stepping.
Reimplemented from Nektar::SolverUtils::UnsteadySystem.
Definition at line 1203 of file CoupledLinearNS.cpp.
References Nektar::SolverUtils::AddSummaryItem().
|
privatevirtual |
Implements Nektar::IncNavierStokes.
Definition at line 2236 of file CoupledLinearNS.cpp.
References Nektar::SolverUtils::EquationSystem::m_session.
|
protectedvirtual |
Init object for UnsteadySystem class.
Initialization object for UnsteadySystem class.
Reimplemented from Nektar::IncNavierStokes.
Definition at line 67 of file CoupledLinearNS.cpp.
References Nektar::MemoryManager< DataType >::AllocateSharedPtr(), ASSERTL0, ASSERTL1, Nektar::LibUtilities::NekFactory< tKey, tBase, tParam >::CreateInstance(), Nektar::SolverUtils::EquationSystem::eHomogeneous1D, Nektar::eUnsteadyNavierStokes, GenPressureExp(), Nektar::GetExtrapolateFactory(), Nektar::SolverUtils::AdvectionSystem::m_advObject, Nektar::SolverUtils::EquationSystem::m_boundaryConditions, Nektar::IncNavierStokes::m_equationType, Nektar::IncNavierStokes::m_extrapolation, Nektar::SolverUtils::EquationSystem::m_fields, Nektar::SolverUtils::EquationSystem::m_graph, Nektar::SolverUtils::EquationSystem::m_homogen_dealiasing, Nektar::SolverUtils::EquationSystem::m_HomogeneousType, Nektar::SolverUtils::EquationSystem::m_LhomZ, m_locToGloMap, Nektar::IncNavierStokes::m_nConvectiveFields, Nektar::SolverUtils::EquationSystem::m_npointsZ, Nektar::IncNavierStokes::m_pressure, Nektar::SolverUtils::EquationSystem::m_session, Nektar::SolverUtils::EquationSystem::m_singleMode, Nektar::SolverUtils::EquationSystem::m_useFFT, Nektar::IncNavierStokes::m_velocity, m_zeroMode, and Nektar::IncNavierStokes::v_InitObject().
|
privatevirtual |
Virtual function to define if operator in DoSolve is negated with regard to the strong form. This is currently only used in Arnoldi solves. For Coupledd solver this is true since Stokes operator is set up as a LHS rather than RHS operation
Reimplemented from Nektar::SolverUtils::EquationSystem.
Definition at line 1499 of file CoupledLinearNS.cpp.
Write the field data to file. The file is named according to the session name with the extension .fld appended.
Reimplemented from Nektar::SolverUtils::EquationSystem.
Definition at line 2198 of file CoupledLinearNS.cpp.
References Nektar::SolverUtils::EquationSystem::GetNcoeffs(), Nektar::SolverUtils::EquationSystem::m_boundaryConditions, Nektar::SolverUtils::EquationSystem::m_fields, Nektar::IncNavierStokes::m_pressure, Nektar::SolverUtils::EquationSystem::m_sessionName, Nektar::SolverUtils::EquationSystem::m_singleMode, and Nektar::SolverUtils::EquationSystem::WriteFld().
Virtual function for transformation to physical space.
Reimplemented from Nektar::IncNavierStokes.
Definition at line 1406 of file CoupledLinearNS.cpp.
References Nektar::SolverUtils::EquationSystem::m_fields.
Virtual function for transformation to coefficient space.
Reimplemented from Nektar::IncNavierStokes.
Definition at line 1418 of file CoupledLinearNS.cpp.
References Nektar::SolverUtils::EquationSystem::m_fields.
|
friend |
Definition at line 90 of file CoupledLinearNS.h.
|
static |
Name of class.
Definition at line 102 of file CoupledLinearNS.h.
|
private |
Definition at line 172 of file CoupledLinearNS.h.
Referenced by SolveSteadyNavierStokes(), and v_DoInitialise().
Definition at line 157 of file CoupledLinearNS.h.
Referenced by DefineForcingTerm(), and EvaluateNewtonRHS().
Definition at line 158 of file CoupledLinearNS.h.
Referenced by DefineForcingTerm().
|
private |
Definition at line 173 of file CoupledLinearNS.h.
Referenced by SolveLinearNS(), SolveSteadyNavierStokes(), and v_DoInitialise().
|
private |
Definition at line 178 of file CoupledLinearNS.h.
Referenced by v_DoInitialise(), and v_DoSolve().
|
private |
Definition at line 180 of file CoupledLinearNS.h.
Referenced by Continuation(), and v_DoInitialise().
|
private |
Definition at line 179 of file CoupledLinearNS.h.
Array<OneD, CoupledLocalToGlobalC0ContMapSharedPtr> Nektar::CoupledLinearNS::m_locToGloMap |
Definition at line 160 of file CoupledLinearNS.h.
Referenced by SetUpCoupledMatrix(), SolveLinearNS(), and v_InitObject().
|
private |
Definition at line 185 of file CoupledLinearNS.h.
Referenced by SetUpCoupledMatrix(), and SolveLinearNS().
|
private |
Definition at line 177 of file CoupledLinearNS.h.
Referenced by SolveSteadyNavierStokes(), and v_DoInitialise().
|
private |
Definition at line 175 of file CoupledLinearNS.h.
Referenced by v_DoInitialise().
|
private |
Definition at line 176 of file CoupledLinearNS.h.
Referenced by v_DoInitialise().
|
private |
Definition at line 174 of file CoupledLinearNS.h.
Referenced by SolveSteadyNavierStokes(), and v_DoInitialise().
|
private |
Id to identify when single mode is mean mode (i.e. beta=0);.
Definition at line 170 of file CoupledLinearNS.h.
Referenced by SetUpCoupledMatrix(), and v_InitObject().