Nektar++
Static Public Member Functions | Static Public Attributes | Protected Member Functions | Protected Attributes | Static Protected Attributes | Friends | List of all members
Nektar::VCSImplicit Class Reference

#include <VelocityCorrectionSchemeImplicit.h>

Inheritance diagram for Nektar::VCSImplicit:
[legend]

Static Public Member Functions

static SolverUtils::EquationSystemSharedPtr create (const LibUtilities::SessionReaderSharedPtr &pSession, const SpatialDomains::MeshGraphSharedPtr &pGraph)
 Creates an instance of this class. More...
 
- Static Public Member Functions inherited from Nektar::VelocityCorrectionScheme
static SolverUtils::EquationSystemSharedPtr create (const LibUtilities::SessionReaderSharedPtr &pSession, const SpatialDomains::MeshGraphSharedPtr &pGraph)
 Creates an instance of this class. More...
 

Static Public Attributes

static std::string className
 Name of class. More...
 
- Static Public Attributes inherited from Nektar::VelocityCorrectionScheme
static std::string className
 Name of class. More...
 
- Static Public Attributes inherited from Nektar::SolverUtils::UnsteadySystem
static std::string cmdSetStartTime
 
static std::string cmdSetStartChkNum
 

Protected Member Functions

 VCSImplicit (const LibUtilities::SessionReaderSharedPtr &pSession, const SpatialDomains::MeshGraphSharedPtr &pGraph)
 
 ~VCSImplicit () override=default
 
void v_GenerateSummary (SolverUtils::SummaryList &s) override
 Print a summary of time stepping parameters. More...
 
void v_SetUpPressureForcing (const Array< OneD, const Array< OneD, NekDouble > > &fields, Array< OneD, Array< OneD, NekDouble > > &Forcing, const NekDouble aii_Dt) override
 
void v_SetUpViscousForcing (const Array< OneD, const Array< OneD, NekDouble > > &inarray, Array< OneD, Array< OneD, NekDouble > > &Forcing, const NekDouble aii_Dt) override
 
void v_SolvePressure (const Array< OneD, NekDouble > &Forcing) override
 
void v_SolveViscous (const Array< OneD, const Array< OneD, NekDouble > > &Forcing, const Array< OneD, const Array< OneD, NekDouble > > &inarray, Array< OneD, Array< OneD, NekDouble > > &outarray, const NekDouble aii_Dt) override
 
void v_DoInitialise (bool dumpInitialConditions) override
 Sets up initial conditions. More...
 
std::string v_GetExtrapolateStr (void) override
 
void v_EvaluateAdvection_SetPressureBCs (const Array< OneD, const Array< OneD, NekDouble > > &inarray, Array< OneD, Array< OneD, NekDouble > > &outarray, const NekDouble time) override
 
void AddImplicitSkewSymAdvection (StdRegions::VarCoeffMap varcoeffs, NekDouble aii_Dt)
 
void CheckUnsetGlobalLinSys (Array< OneD, int32_t > &unsetGlobalLinSys)
 
- Protected Member Functions inherited from Nektar::VelocityCorrectionScheme
 VelocityCorrectionScheme (const LibUtilities::SessionReaderSharedPtr &pSession, const SpatialDomains::MeshGraphSharedPtr &pGraph)
 
 ~VelocityCorrectionScheme () override=default
 
void v_InitObject (bool DeclareField=true) override
 Initialisation object for EquationSystem. More...
 
void SetupFlowrate (NekDouble aii_dt)
 Set up the Stokes solution used to impose constant flowrate through a boundary. More...
 
NekDouble MeasureFlowrate (const Array< OneD, Array< OneD, NekDouble > > &inarray)
 Measure the volumetric flow rate through the volumetric flow rate reference surface. More...
 
bool v_PostIntegrate (int step) override
 
void v_GenerateSummary (SolverUtils::SummaryList &s) override
 Print a summary of time stepping parameters. More...
 
void v_TransCoeffToPhys (void) override
 Virtual function for transformation to physical space. More...
 
void v_TransPhysToCoeff (void) override
 Virtual function for transformation to coefficient space. More...
 
void v_DoInitialise (bool dumpInitialConditions=true) override
 Sets up initial conditions. More...
 
Array< OneD, bool > v_GetSystemSingularChecks () override
 
int v_GetForceDimension () override
 
virtual void v_SetUpPressureForcing (const Array< OneD, const Array< OneD, NekDouble > > &fields, Array< OneD, Array< OneD, NekDouble > > &Forcing, const NekDouble aii_Dt)
 
virtual void v_SetUpViscousForcing (const Array< OneD, const Array< OneD, NekDouble > > &inarray, Array< OneD, Array< OneD, NekDouble > > &Forcing, const NekDouble aii_Dt)
 
virtual void v_SolvePressure (const Array< OneD, NekDouble > &Forcing)
 
virtual void v_SolveViscous (const Array< OneD, const Array< OneD, NekDouble > > &Forcing, const Array< OneD, const Array< OneD, NekDouble > > &inarray, Array< OneD, Array< OneD, NekDouble > > &outarray, const NekDouble aii_Dt)
 
virtual void v_SolveUnsteadyStokesSystem (const Array< OneD, const Array< OneD, NekDouble > > &inarray, Array< OneD, Array< OneD, NekDouble > > &outarray, const NekDouble time, const NekDouble a_iixDt)
 
virtual void v_EvaluateAdvection_SetPressureBCs (const Array< OneD, const Array< OneD, NekDouble > > &inarray, Array< OneD, Array< OneD, NekDouble > > &outarray, const NekDouble time)
 
bool v_RequireFwdTrans () override
 
virtual std::string v_GetExtrapolateStr (void)
 
virtual std::string v_GetSubSteppingExtrapolateStr (const std::string &instr)
 
void SetUpSVV (void)
 
void SetUpExtrapolation (void)
 
void SVVVarDiffCoeff (const NekDouble velmag, Array< OneD, NekDouble > &diffcoeff, const Array< OneD, Array< OneD, NekDouble > > &vel=NullNekDoubleArrayOfArray)
 
void AppendSVVFactors (StdRegions::ConstFactorMap &factors, MultiRegions::VarFactorsMap &varFactorsMap)
 
void ComputeGJPNormalVelocity (const Array< OneD, const Array< OneD, NekDouble > > &inarray, StdRegions::VarCoeffMap &varcoeffs)
 
- Protected Member Functions inherited from Nektar::IncNavierStokes
 IncNavierStokes (const LibUtilities::SessionReaderSharedPtr &pSession, const SpatialDomains::MeshGraphSharedPtr &pGraph)
 Constructor. More...
 
 ~IncNavierStokes () override=default
 
void v_InitObject (bool DeclareField=true) override
 Initialisation object for EquationSystem. More...
 
void v_GetPressure (const Array< OneD, const Array< OneD, NekDouble > > &physfield, Array< OneD, NekDouble > &pressure) override
 
void v_GetDensity (const Array< OneD, const Array< OneD, NekDouble > > &physfield, Array< OneD, NekDouble > &density) override
 
bool v_HasConstantDensity () override
 
void v_GetVelocity (const Array< OneD, const Array< OneD, NekDouble > > &physfield, Array< OneD, Array< OneD, NekDouble > > &velocity) override
 
void v_SetMovingFrameVelocities (const Array< OneD, NekDouble > &vFrameVels, const int step) override
 
bool v_GetMovingFrameVelocities (Array< OneD, NekDouble > &vFrameVels, const int step) override
 
void v_SetMovingFrameDisp (const Array< OneD, NekDouble > &vFrameDisp, const int step) override
 
void v_SetMovingFramePivot (const Array< OneD, NekDouble > &vFramePivot) override
 
bool v_GetMovingFrameDisp (Array< OneD, NekDouble > &vFrameDisp, const int step) override
 
void v_SetAeroForce (Array< OneD, NekDouble > forces) override
 
void v_GetAeroForce (Array< OneD, NekDouble > forces) override
 
void EvaluateAdvectionTerms (const Array< OneD, const Array< OneD, NekDouble > > &inarray, Array< OneD, Array< OneD, NekDouble > > &outarray, const NekDouble time)
 
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...
 
MultiRegions::ExpListSharedPtr v_GetPressure () override
 
void v_TransCoeffToPhys (void) override
 Virtual function for transformation to physical space. More...
 
void v_TransPhysToCoeff (void) override
 Virtual function for transformation to coefficient space. More...
 
virtual int v_GetForceDimension ()=0
 
Array< OneD, NekDoublev_GetMaxStdVelocity (const NekDouble SpeedSoundFactor) override
 
bool v_PreIntegrate (int step) override
 
SOLVER_UTILS_EXPORT void v_InitObject (bool DeclareField=true) override
 Initialisation object for EquationSystem. More...
 
SOLVER_UTILS_EXPORT bool v_PostIntegrate (int step) override
 
virtual SOLVER_UTILS_EXPORT Array< OneD, NekDoublev_GetMaxStdVelocity (const NekDouble SpeedSoundFactor=1.0)
 
- Protected Member Functions inherited from Nektar::SolverUtils::UnsteadySystem
SOLVER_UTILS_EXPORT UnsteadySystem (const LibUtilities::SessionReaderSharedPtr &pSession, const SpatialDomains::MeshGraphSharedPtr &pGraph)
 Initialises UnsteadySystem class members. More...
 
SOLVER_UTILS_EXPORT void v_InitObject (bool DeclareField=true) override
 Init object for UnsteadySystem class. More...
 
SOLVER_UTILS_EXPORT void v_DoSolve () override
 Solves an unsteady problem. More...
 
virtual SOLVER_UTILS_EXPORT void v_PrintStatusInformation (const int step, const NekDouble cpuTime)
 Print Status Information. More...
 
virtual SOLVER_UTILS_EXPORT void v_PrintSummaryStatistics (const NekDouble intTime)
 Print Summary Statistics. More...
 
SOLVER_UTILS_EXPORT void v_DoInitialise (bool dumpInitialConditions=true) override
 Sets up initial conditions. More...
 
SOLVER_UTILS_EXPORT void v_GenerateSummary (SummaryList &s) override
 Print a summary of time stepping parameters. 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_PreIntegrate (int step)
 
virtual SOLVER_UTILS_EXPORT bool v_PostIntegrate (int step)
 
virtual SOLVER_UTILS_EXPORT bool v_RequireFwdTrans ()
 
virtual SOLVER_UTILS_EXPORT void v_SteadyStateResidual (int step, Array< OneD, NekDouble > &L2)
 
virtual SOLVER_UTILS_EXPORT bool v_UpdateTimeStepCheck ()
 
SOLVER_UTILS_EXPORT NekDouble MaxTimeStepEstimator ()
 Get the maximum timestep estimator for cfl control. More...
 
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 void DoDummyProjection (const Array< OneD, const Array< OneD, NekDouble > > &inarray, Array< OneD, Array< OneD, NekDouble > > &outarray, const NekDouble time)
 Perform dummy projection. More...
 
- Protected Member Functions inherited from Nektar::SolverUtils::EquationSystem
SOLVER_UTILS_EXPORT EquationSystem (const LibUtilities::SessionReaderSharedPtr &pSession, const SpatialDomains::MeshGraphSharedPtr &pGraph)
 Initialises EquationSystem class members. More...
 
virtual SOLVER_UTILS_EXPORT void v_InitObject (bool DeclareFeld=true)
 Initialisation object for EquationSystem. More...
 
virtual SOLVER_UTILS_EXPORT void v_DoInitialise (bool dumpInitialConditions=true)
 Virtual function for initialisation implementation. More...
 
virtual SOLVER_UTILS_EXPORT void v_DoSolve ()
 Virtual function for solve implementation. 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 NekDouble v_H1Error (unsigned int field, const Array< OneD, NekDouble > &exactsoln=NullNekDouble1DArray, bool Normalised=false)
 Virtual function for the H_1 error computation between fields and a given exact solution. More...
 
virtual SOLVER_UTILS_EXPORT void v_TransCoeffToPhys ()
 Virtual function for transformation to physical space. More...
 
virtual SOLVER_UTILS_EXPORT void v_TransPhysToCoeff ()
 Virtual function for transformation to coefficient space. More...
 
virtual SOLVER_UTILS_EXPORT void v_GenerateSummary (SummaryList &l)
 Virtual function for generating summary information. 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_Output (void)
 
virtual SOLVER_UTILS_EXPORT MultiRegions::ExpListSharedPtr v_GetPressure (void)
 
virtual SOLVER_UTILS_EXPORT bool v_NegatedOp (void)
 Virtual function to identify if operator is negated in DoSolve. More...
 
virtual SOLVER_UTILS_EXPORT void v_ExtraFldOutput (std::vector< Array< OneD, NekDouble > > &fieldcoeffs, std::vector< std::string > &variables)
 
virtual SOLVER_UTILS_EXPORT void v_GetVelocity (const Array< OneD, const Array< OneD, NekDouble > > &physfield, Array< OneD, Array< OneD, NekDouble > > &velocity)=0
 
virtual SOLVER_UTILS_EXPORT bool v_HasConstantDensity ()=0
 
virtual SOLVER_UTILS_EXPORT void v_GetDensity (const Array< OneD, const Array< OneD, NekDouble > > &physfield, Array< OneD, NekDouble > &density)=0
 
virtual SOLVER_UTILS_EXPORT void v_GetPressure (const Array< OneD, const Array< OneD, NekDouble > > &physfield, Array< OneD, NekDouble > &pressure)=0
 
virtual SOLVER_UTILS_EXPORT void v_SetMovingFrameVelocities (const Array< OneD, NekDouble > &vFrameVels, const int step)
 
virtual SOLVER_UTILS_EXPORT bool v_GetMovingFrameVelocities (Array< OneD, NekDouble > &vFrameVels, const int step)
 
virtual SOLVER_UTILS_EXPORT void v_SetMovingFrameDisp (const Array< OneD, NekDouble > &vFrameDisp, const int step)
 
virtual SOLVER_UTILS_EXPORT void v_SetMovingFramePivot (const Array< OneD, NekDouble > &vFramePivot)
 
virtual SOLVER_UTILS_EXPORT bool v_GetMovingFrameDisp (Array< OneD, NekDouble > &vFrameDisp, const int step)
 
virtual SOLVER_UTILS_EXPORT void v_SetAeroForce (Array< OneD, NekDouble > forces)
 
virtual SOLVER_UTILS_EXPORT void v_GetAeroForce (Array< OneD, NekDouble > forces)
 

Protected Attributes

Array< OneD, Array< OneD, NekDouble > > m_advection
 2D Array for Advection Velocities [dir][dof] More...
 
Array< OneD, Array< OneD, NekDouble > > m_AdvVel
 
Array< OneD, Array< OneD, Array< OneD, NekDouble > > > m_extVel
 3D Array for extrapolated Advection Velocities [dir][time-levle][dof] More...
 
bool m_advectionVelocity
 bool to identify implicit scheme ie advection velocity More...
 
bool m_implicitSkewSymAdvection
 bool to identify advection operator More...
 
int m_intOrder
 integer for advection velocity More...
 
std::string m_convectiveType
 
Array< OneD, int32_tm_unsetGlobalLinSys
 Array checking whether GlobalLinSys needs to be unset. More...
 
- Protected Attributes inherited from Nektar::VelocityCorrectionScheme
bool m_useHomo1DSpecVanVisc
 bool to identify if spectral vanishing viscosity is active. More...
 
bool m_useSpecVanVisc
 bool to identify if spectral vanishing viscosity is active. More...
 
bool m_useGJPStabilisation
 bool to identify if GJP semi-implicit is active. More...
 
bool m_useGJPNormalVel
 bool to identify if GJP normal Velocity should be applied in explicit approach More...
 
NekDouble m_GJPJumpScale
 
NekDouble m_sVVCutoffRatio
 cutt off ratio from which to start decayhing modes More...
 
NekDouble m_sVVDiffCoeff
 Diffusion coefficient of SVV modes. More...
 
NekDouble m_sVVCutoffRatioHomo1D
 
NekDouble m_sVVDiffCoeffHomo1D
 Diffusion coefficient of SVV modes in homogeneous 1D Direction. More...
 
Array< OneD, NekDoublem_svvVarDiffCoeff
 Array of coefficient if power kernel is used in SVV. More...
 
bool m_IsSVVPowerKernel
 Identifier for Power Kernel otherwise DG kernel. More...
 
Array< OneD, NekDoublem_diffCoeff
 Diffusion coefficients (will be kinvis for velocities) More...
 
StdRegions::VarCoeffMap m_varCoeffLap
 Variable Coefficient map for the Laplacian which can be activated as part of SVV or otherwise. More...
 
NekDouble m_flowrate
 Desired volumetric flowrate. More...
 
NekDouble m_flowrateArea
 Area of the boundary through which we are measuring the flowrate. More...
 
bool m_homd1DFlowinPlane
 
NekDouble m_greenFlux
 Flux of the Stokes function solution. More...
 
NekDouble m_alpha
 Current flowrate correction. More...
 
int m_flowrateBndID
 Boundary ID of the flowrate reference surface. More...
 
int m_planeID
 Plane ID for cases with homogeneous expansion. More...
 
MultiRegions::ExpListSharedPtr m_flowrateBnd
 Flowrate reference surface. More...
 
Array< OneD, Array< OneD, NekDouble > > m_flowrateStokes
 Stokes solution used to impose flowrate. More...
 
std::ofstream m_flowrateStream
 Output stream to record flowrate. More...
 
int m_flowrateSteps
 Interval at which to record flowrate data. More...
 
NekDouble m_flowrateAiidt
 Value of aii_dt used to compute Stokes flowrate solution. More...
 
Array< OneD, Array< OneD, NekDouble > > m_F
 
- Protected Attributes inherited from Nektar::IncNavierStokes
ExtrapolateSharedPtr m_extrapolation
 
IncBoundaryConditionsSharedPtr m_IncNavierStokesBCs
 
std::ofstream m_mdlFile
 modal energy file More...
 
bool m_SmoothAdvection
 bool to identify if advection term smoothing is requested More...
 
std::vector< SolverUtils::ForcingSharedPtrm_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...
 
Array< OneD, NekDoublem_pivotPoint
 pivot point for moving reference frame More...
 
Array< OneD, NekDoublem_aeroForces
 
std::map< int, std::map< int, WomersleyParamsSharedPtr > > m_womersleyParams
 Womersley parameters if required. More...
 
- Protected Attributes inherited from Nektar::SolverUtils::AdvectionSystem
SolverUtils::AdvectionSharedPtr m_advObject
 Advection term. More...
 
- Protected Attributes inherited from Nektar::SolverUtils::UnsteadySystem
LibUtilities::TimeIntegrationSchemeSharedPtr m_intScheme
 Wrapper to the time integration scheme. More...
 
LibUtilities::TimeIntegrationSchemeOperators m_ode
 The time integration scheme operators to use. More...
 
Array< OneD, Array< OneD, NekDouble > > m_previousSolution
 Storage for previous solution for steady-state check. More...
 
std::vector< int > m_intVariables
 
NekDouble m_cflSafetyFactor
 CFL safety factor (comprise between 0 to 1). More...
 
NekDouble m_CFLGrowth
 CFL growth rate. More...
 
NekDouble m_CFLEnd
 Maximun cfl in cfl growth. More...
 
int m_abortSteps
 Number of steps between checks for abort conditions. More...
 
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...
 
int m_steadyStateSteps
 Check for steady state at step interval. More...
 
NekDouble m_steadyStateTol
 Tolerance to which steady state should be evaluated at. More...
 
int m_filtersInfosteps
 Number of time steps between outputting filters information. More...
 
std::vector< std::pair< std::string, FilterSharedPtr > > m_filters
 
bool m_homoInitialFwd
 Flag to determine if simulation should start in homogeneous forward transformed state. More...
 
std::ofstream m_errFile
 
NekDouble m_epsilon
 Diffusion coefficient. More...
 
- Protected Attributes inherited from Nektar::SolverUtils::EquationSystem
LibUtilities::CommSharedPtr m_comm
 Communicator. More...
 
bool m_verbose
 
LibUtilities::SessionReaderSharedPtr m_session
 The session reader. More...
 
std::map< std::string, SolverUtils::SessionFunctionSharedPtrm_sessionFunctions
 Map of known SessionFunctions. More...
 
LibUtilities::FieldIOSharedPtr m_fld
 Field input/output. More...
 
Array< OneD, MultiRegions::ExpListSharedPtrm_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...
 
NekDouble m_lastCheckTime
 
NekDouble m_TimeIncrementFactor
 
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_infosteps
 Number of time steps between outputting status information. More...
 
int m_iterPIT = 0
 Number of parallel-in-time time iteration. More...
 
int m_windowPIT = 0
 Index of windows for parallel-in-time time iteration. 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...
 
Array< OneD, NekDoublem_movingFrameData
 Moving reference frame status in the inertial frame X, Y, Z, Theta_x, Theta_y, Theta_z, U, V, W, Omega_x, Omega_y, Omega_z, A_x, A_y, A_z, DOmega_x, DOmega_y, DOmega_z, pivot_x, pivot_y, pivot_z. More...
 
std::vector< std::string > m_strFrameData
 variable name in m_movingFrameData 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...
 
- Protected Attributes inherited from Nektar::SolverUtils::ALEHelper
Array< OneD, MultiRegions::ExpListSharedPtrm_fieldsALE
 
Array< OneD, Array< OneD, NekDouble > > m_gridVelocity
 
Array< OneD, Array< OneD, NekDouble > > m_gridVelocityTrace
 
std::vector< ALEBaseShPtrm_ALEs
 
bool m_ALESolver = false
 
bool m_ImplicitALESolver = false
 
NekDouble m_prevStageTime = 0.0
 
int m_spaceDim
 

Static Protected Attributes

static std::string solverTypeLookupId
 
- Static Protected Attributes inherited from Nektar::VelocityCorrectionScheme
static std::string solverTypeLookupId
 
- Static Protected Attributes inherited from Nektar::IncNavierStokes
static std::string eqTypeLookupIds []
 
- Static Protected Attributes inherited from Nektar::SolverUtils::EquationSystem
static std::string equationSystemTypeLookupIds []
 
static std::string projectionTypeLookupIds []
 

Friends

class MemoryManager< VCSImplicit >
 

Additional Inherited Members

- Public Member Functions inherited from Nektar::VelocityCorrectionScheme
void SetUpPressureForcing (const Array< OneD, const Array< OneD, NekDouble > > &fields, Array< OneD, Array< OneD, NekDouble > > &Forcing, const NekDouble aii_Dt)
 
void SetUpViscousForcing (const Array< OneD, const Array< OneD, NekDouble > > &inarray, Array< OneD, Array< OneD, NekDouble > > &Forcing, const NekDouble aii_Dt)
 
void SolvePressure (const Array< OneD, NekDouble > &Forcing)
 
void SolveViscous (const Array< OneD, const Array< OneD, NekDouble > > &Forcing, const Array< OneD, const Array< OneD, NekDouble > > &inarray, Array< OneD, Array< OneD, NekDouble > > &outarray, const NekDouble aii_Dt)
 
void SolveUnsteadyStokesSystem (const Array< OneD, const Array< OneD, NekDouble > > &inarray, Array< OneD, Array< OneD, NekDouble > > &outarray, const NekDouble time, const NekDouble a_iixDt)
 
void EvaluateAdvection_SetPressureBCs (const Array< OneD, const Array< OneD, NekDouble > > &inarray, Array< OneD, Array< OneD, NekDouble > > &outarray, const NekDouble time)
 
- Public Member Functions inherited from Nektar::IncNavierStokes
int GetNConvectiveFields (void)
 
void AddForcing (const SolverUtils::ForcingSharedPtr &pForce)
 
bool DefinedForcing (const std::string &sForce)
 
- Public Member Functions inherited from Nektar::SolverUtils::AdvectionSystem
SOLVER_UTILS_EXPORT AdvectionSystem (const LibUtilities::SessionReaderSharedPtr &pSession, const SpatialDomains::MeshGraphSharedPtr &pGraph)
 
SOLVER_UTILS_EXPORT ~AdvectionSystem () override=default
 
SOLVER_UTILS_EXPORT AdvectionSharedPtr GetAdvObject ()
 Returns the advection object held by this instance. More...
 
SOLVER_UTILS_EXPORT Array< OneD, NekDoubleGetElmtCFLVals (const bool FlagAcousticCFL=true)
 
SOLVER_UTILS_EXPORT NekDouble GetCFLEstimate (int &elmtid)
 
- Public Member Functions inherited from Nektar::SolverUtils::UnsteadySystem
SOLVER_UTILS_EXPORT ~UnsteadySystem () override=default
 Destructor. More...
 
SOLVER_UTILS_EXPORT NekDouble GetTimeStep (const Array< OneD, const Array< OneD, NekDouble > > &inarray)
 Calculate the larger time-step mantaining the problem stable. More...
 
SOLVER_UTILS_EXPORT NekDouble GetTimeStep ()
 
SOLVER_UTILS_EXPORT void SetTimeStep (const NekDouble timestep)
 
SOLVER_UTILS_EXPORT void SteadyStateResidual (int step, Array< OneD, NekDouble > &L2)
 
SOLVER_UTILS_EXPORT LibUtilities::TimeIntegrationSchemeSharedPtrGetTimeIntegrationScheme ()
 Returns the time integration scheme. More...
 
SOLVER_UTILS_EXPORT LibUtilities::TimeIntegrationSchemeOperatorsGetTimeIntegrationSchemeOperators ()
 Returns the time integration scheme operators. More...
 
- Public Member Functions inherited from Nektar::SolverUtils::EquationSystem
virtual SOLVER_UTILS_EXPORT ~EquationSystem ()
 Destructor. More...
 
SOLVER_UTILS_EXPORT void InitObject (bool DeclareField=true)
 Initialises the members of this object. More...
 
SOLVER_UTILS_EXPORT void DoInitialise (bool dumpInitialConditions=true)
 Perform any initialisation necessary before solving the problem. More...
 
SOLVER_UTILS_EXPORT void DoSolve ()
 Solve the problem. More...
 
SOLVER_UTILS_EXPORT void TransCoeffToPhys ()
 Transform from coefficient to physical space. More...
 
SOLVER_UTILS_EXPORT void TransPhysToCoeff ()
 Transform from physical to coefficient space. More...
 
SOLVER_UTILS_EXPORT void Output ()
 Perform output operations after solve. More...
 
SOLVER_UTILS_EXPORT std::string GetSessionName ()
 Get Session name. More...
 
template<class T >
std::shared_ptr< T > as ()
 
SOLVER_UTILS_EXPORT void ResetSessionName (std::string newname)
 Reset Session name. More...
 
SOLVER_UTILS_EXPORT LibUtilities::SessionReaderSharedPtr GetSession ()
 Get Session name. More...
 
SOLVER_UTILS_EXPORT MultiRegions::ExpListSharedPtr GetPressure ()
 Get pressure field if available. More...
 
SOLVER_UTILS_EXPORT void ExtraFldOutput (std::vector< Array< OneD, NekDouble > > &fieldcoeffs, std::vector< std::string > &variables)
 
SOLVER_UTILS_EXPORT void PrintSummary (std::ostream &out)
 Print a summary of parameters and solver characteristics. More...
 
SOLVER_UTILS_EXPORT void SetLambda (NekDouble lambda)
 Set parameter m_lambda. More...
 
SOLVER_UTILS_EXPORT SessionFunctionSharedPtr GetFunction (std::string name, const MultiRegions::ExpListSharedPtr &field=MultiRegions::NullExpListSharedPtr, bool cache=false)
 Get a SessionFunction by name. More...
 
SOLVER_UTILS_EXPORT void SetInitialConditions (NekDouble initialtime=0.0, bool dumpInitialConditions=true, const int domain=0)
 Initialise the data in the dependent fields. More...
 
SOLVER_UTILS_EXPORT void EvaluateExactSolution (int field, Array< OneD, NekDouble > &outfield, const NekDouble time)
 Evaluates an exact solution. More...
 
SOLVER_UTILS_EXPORT NekDouble L2Error (unsigned int field, const Array< OneD, NekDouble > &exactsoln, bool Normalised=false)
 Compute the L2 error between fields and a given exact solution. More...
 
SOLVER_UTILS_EXPORT NekDouble L2Error (unsigned int field, bool Normalised=false)
 Compute the L2 error of the fields. More...
 
SOLVER_UTILS_EXPORT NekDouble LinfError (unsigned int field, const Array< OneD, NekDouble > &exactsoln=NullNekDouble1DArray)
 Linf error computation. More...
 
SOLVER_UTILS_EXPORT NekDouble H1Error (unsigned int field, const Array< OneD, NekDouble > &exactsoln, bool Normalised=false)
 Compute the H1 error between fields and a given exact solution. More...
 
SOLVER_UTILS_EXPORT Array< OneD, NekDoubleErrorExtraPoints (unsigned int field)
 Compute error (L2 and L_inf) over an larger set of quadrature points return [L2 Linf]. More...
 
SOLVER_UTILS_EXPORT void Checkpoint_Output (const int n)
 Write checkpoint file of m_fields. More...
 
SOLVER_UTILS_EXPORT void Checkpoint_Output (const int n, MultiRegions::ExpListSharedPtr &field, std::vector< Array< OneD, NekDouble > > &fieldcoeffs, std::vector< std::string > &variables)
 Write checkpoint file of custom data fields. More...
 
SOLVER_UTILS_EXPORT void Checkpoint_BaseFlow (const int n)
 Write base flow file of m_fields. More...
 
SOLVER_UTILS_EXPORT void WriteFld (const std::string &outname)
 Write field data to the given filename. More...
 
SOLVER_UTILS_EXPORT void WriteFld (const std::string &outname, MultiRegions::ExpListSharedPtr &field, std::vector< Array< OneD, NekDouble > > &fieldcoeffs, std::vector< std::string > &variables)
 Write input fields to the given filename. More...
 
SOLVER_UTILS_EXPORT void ImportFld (const std::string &infile, Array< OneD, MultiRegions::ExpListSharedPtr > &pFields)
 Input field data from the given file. More...
 
SOLVER_UTILS_EXPORT void ImportFldToMultiDomains (const std::string &infile, Array< OneD, MultiRegions::ExpListSharedPtr > &pFields, const int ndomains)
 Input field data from the given file to multiple domains. More...
 
SOLVER_UTILS_EXPORT void ImportFld (const std::string &infile, std::vector< std::string > &fieldStr, Array< OneD, Array< OneD, NekDouble > > &coeffs)
 Output a field. Input field data into array from the given file. More...
 
SOLVER_UTILS_EXPORT void ImportFld (const std::string &infile, MultiRegions::ExpListSharedPtr &pField, std::string &pFieldName)
 Output a field. Input field data into ExpList from the given file. More...
 
SOLVER_UTILS_EXPORT void SessionSummary (SummaryList &vSummary)
 Write out a session summary. More...
 
SOLVER_UTILS_EXPORT Array< OneD, MultiRegions::ExpListSharedPtr > & UpdateFields ()
 
SOLVER_UTILS_EXPORT LibUtilities::FieldMetaDataMapUpdateFieldMetaDataMap ()
 Get hold of FieldInfoMap so it can be updated. More...
 
SOLVER_UTILS_EXPORT NekDouble GetTime ()
 Return final time. More...
 
SOLVER_UTILS_EXPORT int GetNcoeffs ()
 
SOLVER_UTILS_EXPORT int GetNcoeffs (const int eid)
 
SOLVER_UTILS_EXPORT int GetNumExpModes ()
 
SOLVER_UTILS_EXPORT const Array< OneD, int > GetNumExpModesPerExp ()
 
SOLVER_UTILS_EXPORT int GetNvariables ()
 
SOLVER_UTILS_EXPORT const std::string GetVariable (unsigned int i)
 
SOLVER_UTILS_EXPORT int GetTraceTotPoints ()
 
SOLVER_UTILS_EXPORT int GetTraceNpoints ()
 
SOLVER_UTILS_EXPORT int GetExpSize ()
 
SOLVER_UTILS_EXPORT int GetPhys_Offset (int n)
 
SOLVER_UTILS_EXPORT int GetCoeff_Offset (int n)
 
SOLVER_UTILS_EXPORT int GetTotPoints ()
 
SOLVER_UTILS_EXPORT int GetTotPoints (int n)
 
SOLVER_UTILS_EXPORT int GetNpoints ()
 
SOLVER_UTILS_EXPORT int GetSteps ()
 
SOLVER_UTILS_EXPORT void SetSteps (const int steps)
 
SOLVER_UTILS_EXPORT NekDouble GetTimeStep ()
 
SOLVER_UTILS_EXPORT void CopyFromPhysField (const int i, Array< OneD, NekDouble > &output)
 
SOLVER_UTILS_EXPORT void CopyToPhysField (const int i, const Array< OneD, const NekDouble > &input)
 
SOLVER_UTILS_EXPORT Array< OneD, NekDouble > & UpdatePhysField (const int i)
 
SOLVER_UTILS_EXPORT void ZeroPhysFields ()
 
SOLVER_UTILS_EXPORT void FwdTransFields ()
 
SOLVER_UTILS_EXPORT void SetModifiedBasis (const bool modbasis)
 
SOLVER_UTILS_EXPORT int GetCheckpointNumber ()
 
SOLVER_UTILS_EXPORT void SetCheckpointNumber (int num)
 
SOLVER_UTILS_EXPORT int GetCheckpointSteps ()
 
SOLVER_UTILS_EXPORT void SetCheckpointSteps (int num)
 
SOLVER_UTILS_EXPORT int GetInfoSteps ()
 
SOLVER_UTILS_EXPORT void SetInfoSteps (int num)
 
SOLVER_UTILS_EXPORT void SetIterationNumberPIT (int num)
 
SOLVER_UTILS_EXPORT void SetWindowNumberPIT (int num)
 
SOLVER_UTILS_EXPORT Array< OneD, const Array< OneD, NekDouble > > GetTraceNormals ()
 
SOLVER_UTILS_EXPORT void SetTime (const NekDouble time)
 
SOLVER_UTILS_EXPORT void SetTimeStep (const NekDouble timestep)
 
SOLVER_UTILS_EXPORT void SetInitialStep (const int step)
 
SOLVER_UTILS_EXPORT void SetBoundaryConditions (NekDouble time)
 Evaluates the boundary conditions at the given time. More...
 
SOLVER_UTILS_EXPORT bool NegatedOp ()
 Identify if operator is negated in DoSolve. More...
 
- Public Member Functions inherited from Nektar::SolverUtils::ALEHelper
virtual ~ALEHelper ()=default
 
virtual SOLVER_UTILS_EXPORT void v_ALEInitObject (int spaceDim, Array< OneD, MultiRegions::ExpListSharedPtr > &fields)
 
SOLVER_UTILS_EXPORT void InitObject (int spaceDim, Array< OneD, MultiRegions::ExpListSharedPtr > &fields)
 
virtual SOLVER_UTILS_EXPORT void v_UpdateGridVelocity (const NekDouble &time)
 
virtual SOLVER_UTILS_EXPORT void v_ALEPreMultiplyMass (Array< OneD, Array< OneD, NekDouble > > &fields)
 
SOLVER_UTILS_EXPORT void ALEDoElmtInvMass (Array< OneD, Array< OneD, NekDouble > > &traceNormals, Array< OneD, Array< OneD, NekDouble > > &fields, NekDouble time)
 Update m_fields with u^n by multiplying by inverse mass matrix. That's then used in e.g. checkpoint output and L^2 error calculation. More...
 
SOLVER_UTILS_EXPORT void ALEDoElmtInvMassBwdTrans (const Array< OneD, const Array< OneD, NekDouble > > &inarray, Array< OneD, Array< OneD, NekDouble > > &outarray)
 
SOLVER_UTILS_EXPORT void MoveMesh (const NekDouble &time, Array< OneD, Array< OneD, NekDouble > > &traceNormals)
 
const Array< OneD, const Array< OneD, NekDouble > > & GetGridVelocity ()
 
SOLVER_UTILS_EXPORT const Array< OneD, const Array< OneD, NekDouble > > & GetGridVelocityTrace ()
 
SOLVER_UTILS_EXPORT void ExtraFldOutputGridVelocity (std::vector< Array< OneD, NekDouble > > &fieldcoeffs, std::vector< std::string > &variables)
 
- Public Member Functions inherited from Nektar::SolverUtils::FluidInterface
virtual ~FluidInterface ()=default
 
SOLVER_UTILS_EXPORT void GetVelocity (const Array< OneD, const Array< OneD, NekDouble > > &physfield, Array< OneD, Array< OneD, NekDouble > > &velocity)
 Extract array with velocity from physfield. More...
 
SOLVER_UTILS_EXPORT bool HasConstantDensity ()
 
SOLVER_UTILS_EXPORT void GetDensity (const Array< OneD, const Array< OneD, NekDouble > > &physfield, Array< OneD, NekDouble > &density)
 Extract array with density from physfield. More...
 
SOLVER_UTILS_EXPORT void GetPressure (const Array< OneD, const Array< OneD, NekDouble > > &physfield, Array< OneD, NekDouble > &pressure)
 Extract array with pressure from physfield. More...
 
SOLVER_UTILS_EXPORT void SetMovingFrameVelocities (const Array< OneD, NekDouble > &vFrameVels, const int step)
 
SOLVER_UTILS_EXPORT bool GetMovingFrameVelocities (Array< OneD, NekDouble > &vFrameVels, const int step)
 
SOLVER_UTILS_EXPORT void SetMovingFrameDisp (const Array< OneD, NekDouble > &vFrameDisp, const int step)
 
SOLVER_UTILS_EXPORT void SetMovingFramePivot (const Array< OneD, NekDouble > &vFramePivot)
 
SOLVER_UTILS_EXPORT bool GetMovingFrameDisp (Array< OneD, NekDouble > &vFrameDisp, const int step)
 
SOLVER_UTILS_EXPORT void SetAeroForce (Array< OneD, NekDouble > forces)
 Set aerodynamic force and moment. More...
 
SOLVER_UTILS_EXPORT void GetAeroForce (Array< OneD, NekDouble > forces)
 Get aerodynamic force and moment. More...
 
- Protected Types inherited from Nektar::SolverUtils::EquationSystem
enum  HomogeneousType { eHomogeneous1D , eHomogeneous2D , eHomogeneous3D , eNotHomogeneous }
 Parameter for homogeneous expansions. More...
 

Detailed Description

Definition at line 42 of file VelocityCorrectionSchemeImplicit.h.

Constructor & Destructor Documentation

◆ VCSImplicit()

Nektar::VCSImplicit::VCSImplicit ( const LibUtilities::SessionReaderSharedPtr pSession,
const SpatialDomains::MeshGraphSharedPtr pGraph 
)
protected

Constructor. No special instructions here. v_DoInitialise sets the scheme up.

Parameters

param

Definition at line 63 of file VelocityCorrectionSchemeImplicit.cpp.

65 : UnsteadySystem(pSession, pGraph),
66 VelocityCorrectionScheme(pSession, pGraph)
67{
68}
SOLVER_UTILS_EXPORT UnsteadySystem(const LibUtilities::SessionReaderSharedPtr &pSession, const SpatialDomains::MeshGraphSharedPtr &pGraph)
Initialises UnsteadySystem class members.
VelocityCorrectionScheme(const LibUtilities::SessionReaderSharedPtr &pSession, const SpatialDomains::MeshGraphSharedPtr &pGraph)

◆ ~VCSImplicit()

Nektar::VCSImplicit::~VCSImplicit ( )
overrideprotecteddefault

Member Function Documentation

◆ AddImplicitSkewSymAdvection()

void Nektar::VCSImplicit::AddImplicitSkewSymAdvection ( StdRegions::VarCoeffMap  varcoeffs,
NekDouble  aii_Dt 
)
protected

Definition at line 514 of file VelocityCorrectionSchemeImplicit.cpp.

516{
518 {
519 return;
520 }
521
522 // Setup temporary storages
523 int nvel = m_velocity.size();
524 int phystot = m_fields[0]->GetTotPoints();
525 Array<OneD, NekDouble> divAdvVel(phystot, 0.0);
526 Array<OneD, NekDouble> tmpstore(phystot);
527 Array<OneD, NekDouble> ones(phystot, 1.0);
528
529 // Compute divergence of advection velocity: 1/\nu \tilde{u}
530 m_fields[0]->PhysDeriv(eX, m_AdvVel[0], divAdvVel);
531 for (int i = 1; i < nvel; ++i)
532 {
533 m_fields[i]->PhysDeriv(DirCartesianMap[i], m_AdvVel[i], tmpstore);
534 Vmath::Vadd(phystot, divAdvVel, 1, tmpstore, 1, divAdvVel, 1);
535 }
536 // Smul: 1/(2*lambda) * divAdvVel
537 NekDouble lambda = 1.0 / aii_Dt / m_diffCoeff[0];
538 Vmath::Smul(phystot, 1.0 / 2.0 / lambda, divAdvVel, 1, divAdvVel, 1);
539
540 // Vadd: 1 + 1/(2*lambda) * divAdvVel
541 Vmath::Vadd(phystot, ones, 1, divAdvVel, 1, divAdvVel, 1);
542
543 // Assign VarcoeffMass
544 varcoeffs[StdRegions::eVarCoeffMass] = divAdvVel;
545}
Array< OneD, int > m_velocity
int which identifies which components of m_fields contains the velocity (u,v,w);
Array< OneD, MultiRegions::ExpListSharedPtr > m_fields
Array holding all dependent variables.
Array< OneD, Array< OneD, NekDouble > > m_AdvVel
bool m_implicitSkewSymAdvection
bool to identify advection operator
Array< OneD, NekDouble > m_diffCoeff
Diffusion coefficients (will be kinvis for velocities)
MultiRegions::Direction const DirCartesianMap[]
Definition: ExpList.h:87
double NekDouble
void Vadd(int n, const T *x, const int incx, const T *y, const int incy, T *z, const int incz)
Add vector z = x+y.
Definition: Vmath.hpp:180
void Smul(int n, const T alpha, const T *x, const int incx, T *y, const int incy)
Scalar multiply y = alpha*x.
Definition: Vmath.hpp:100

References Nektar::MultiRegions::DirCartesianMap, Nektar::StdRegions::eVarCoeffMass, Nektar::MultiRegions::eX, m_AdvVel, Nektar::VelocityCorrectionScheme::m_diffCoeff, Nektar::SolverUtils::EquationSystem::m_fields, m_implicitSkewSymAdvection, Nektar::IncNavierStokes::m_velocity, Vmath::Smul(), and Vmath::Vadd().

Referenced by v_SolveViscous().

◆ CheckUnsetGlobalLinSys()

void Nektar::VCSImplicit::CheckUnsetGlobalLinSys ( Array< OneD, int32_t > &  unsetGlobalLinSys)
protected

Definition at line 547 of file VelocityCorrectionSchemeImplicit.cpp.

549{
550 // Loop over all convected Fields (excludes pressure)
551 for (int i = 0; i < m_nConvectiveFields; ++i)
552 {
553 // Always unset after last solve
554 if (i == m_nConvectiveFields - 1)
555 {
556 unsetGlobalLinSys[i] = 1;
557 continue;
558 }
559
560 auto contField =
561 std::dynamic_pointer_cast<MultiRegions::ContField>(m_fields[i]);
562 // Check against all solves after this one, whether same
563 // Global Linear system is required
564 for (int j = i + 1; j < m_nConvectiveFields; ++j)
565 {
566 // If same BCs (ie GlobalLinSys) in j-solves, save the GlobalLinSys
567 // for re-use
568 if (std::dynamic_pointer_cast<MultiRegions::ContField>(m_fields[j])
569 ->SameTypeOfBoundaryConditions(*contField))
570 {
571 unsetGlobalLinSys[i] = 0;
572 }
573 // If no same BCs (ie GlobalLinSys) in j-solves, UnsetGlobalLinSys()
574 // for i-solve
575 else
576 {
577 unsetGlobalLinSys[i] = 1;
578 }
579 }
580 }
581}
int m_nConvectiveFields
Number of fields to be convected;.

References Nektar::SolverUtils::EquationSystem::m_fields, and Nektar::IncNavierStokes::m_nConvectiveFields.

Referenced by v_DoInitialise().

◆ create()

static SolverUtils::EquationSystemSharedPtr Nektar::VCSImplicit::create ( const LibUtilities::SessionReaderSharedPtr pSession,
const SpatialDomains::MeshGraphSharedPtr pGraph 
)
inlinestatic

Creates an instance of this class.

Definition at line 48 of file VelocityCorrectionSchemeImplicit.h.

51 {
54 p->InitObject();
55 return p;
56 }
static std::shared_ptr< DataType > AllocateSharedPtr(const Args &...args)
Allocate a shared pointer from the memory pool.
std::shared_ptr< EquationSystem > EquationSystemSharedPtr
A shared pointer to an EquationSystem object.

References Nektar::MemoryManager< DataType >::AllocateSharedPtr(), and CellMLToNektar.cellml_metadata::p.

◆ v_DoInitialise()

void Nektar::VCSImplicit::v_DoInitialise ( bool  dumpInitialConditions)
overrideprotectedvirtual

Sets up initial conditions.

Sets the initial conditions.

Reimplemented from Nektar::VelocityCorrectionScheme.

Definition at line 160 of file VelocityCorrectionSchemeImplicit.cpp.

161{
162 VelocityCorrectionScheme::v_DoInitialise(dumpInitialConditions);
163
164 // Get integration order for extrapolation
165 m_intOrder = m_intScheme->GetOrder();
166
167 // Initialise Advection velocity
168 m_AdvVel = Array<OneD, Array<OneD, NekDouble>>(m_velocity.size());
169 for (int i = 0; i < m_velocity.size(); i++)
170 {
171 m_AdvVel[i] = Array<OneD, NekDouble>(m_fields[i]->GetTotPoints(), 0.0);
172 }
173
174 // Initialise storage for explicit advection terms
175 m_advection = Array<OneD, Array<OneD, NekDouble>>(m_nConvectiveFields);
176 for (int i = 0; i < m_nConvectiveFields; i++)
177 {
178 m_advection[i] =
179 Array<OneD, NekDouble>(m_fields[i]->GetTotPoints(), 0.0);
180 }
181
182 // Check advection velocity: Extrapolated or Updated scheme
183 // Default to Extrapolated scheme
184 m_session->MatchSolverInfo("AdvectionVelocity", "Extrapolated",
185 m_advectionVelocity, true);
186
187 // Extrapolated velocity (for 2nd order scheme)
188 // Only initiliase for Extrapolated scheme
190 {
191 m_extVel =
192 Array<OneD, Array<OneD, Array<OneD, NekDouble>>>(m_velocity.size());
193 for (int i = 0; i < m_velocity.size(); i++)
194 {
195 m_extVel[i] = Array<OneD, Array<OneD, NekDouble>>(m_intOrder);
196 for (int j = 0; j < m_intOrder; j++)
197 {
198 m_extVel[i][j] =
199 Array<OneD, NekDouble>(m_fields[i]->GetTotPoints(), 0.0);
200 }
201 }
202 }
203
204 // Check whether multiple or single GlobalLinSys are
205 // required and when to delete them
206 // Initialise to always reset GlobalLinSys
207 m_unsetGlobalLinSys = Array<OneD, int32_t>(m_velocity.size(), 1);
209
210 // Check skew-symmetric advection operator
211 // Default to Convective operator = false
212 m_session->MatchSolverInfo("AdvectionOperator", "SkewSymmetric",
214}
LibUtilities::SessionReaderSharedPtr m_session
The session reader.
SOLVER_UTILS_EXPORT int GetTotPoints()
LibUtilities::TimeIntegrationSchemeSharedPtr m_intScheme
Wrapper to the time integration scheme.
Array< OneD, int32_t > m_unsetGlobalLinSys
Array checking whether GlobalLinSys needs to be unset.
Array< OneD, Array< OneD, Array< OneD, NekDouble > > > m_extVel
3D Array for extrapolated Advection Velocities [dir][time-levle][dof]
Array< OneD, Array< OneD, NekDouble > > m_advection
2D Array for Advection Velocities [dir][dof]
bool m_advectionVelocity
bool to identify implicit scheme ie advection velocity
void CheckUnsetGlobalLinSys(Array< OneD, int32_t > &unsetGlobalLinSys)
int m_intOrder
integer for advection velocity
void v_DoInitialise(bool dumpInitialConditions=true) override
Sets up initial conditions.

References CheckUnsetGlobalLinSys(), Nektar::SolverUtils::EquationSystem::GetTotPoints(), m_advection, m_advectionVelocity, m_AdvVel, m_extVel, Nektar::SolverUtils::EquationSystem::m_fields, m_implicitSkewSymAdvection, m_intOrder, Nektar::SolverUtils::UnsteadySystem::m_intScheme, Nektar::IncNavierStokes::m_nConvectiveFields, Nektar::SolverUtils::EquationSystem::m_session, m_unsetGlobalLinSys, Nektar::IncNavierStokes::m_velocity, and Nektar::VelocityCorrectionScheme::v_DoInitialise().

◆ v_EvaluateAdvection_SetPressureBCs()

void Nektar::VCSImplicit::v_EvaluateAdvection_SetPressureBCs ( const Array< OneD, const Array< OneD, NekDouble > > &  inarray,
Array< OneD, Array< OneD, NekDouble > > &  outarray,
const NekDouble  time 
)
overrideprotectedvirtual

Explicit part of the method - HOPBCs based on VCSWeakPressure. For the implicit scheme, we do not extrapolate the advection and rotational diffusion terms, see also S. Dong and J. Shen (2010).

Parameters
inarrayHolds the vector of previous solutions \( [u^n, v^n, \ldots] \).
outarrayIn the implicit scheme, currently an empty array. TODO Don't waste memory here.
timeHolds the new time \( t^{n+1} = (n+1) \Delta t \).

Reimplemented from Nektar::VelocityCorrectionScheme.

Definition at line 482 of file VelocityCorrectionSchemeImplicit.cpp.

485{
486 // Zero RHS derivatives, avoids undefined values
487 for (int i = 0; i < m_velocity.size(); ++i)
488 {
489 Vmath::Zero(outarray[i].size(), outarray[i], 1);
490 }
491
492 // Calculate High-Order pressure boundary conditions
493 LibUtilities::Timer timer;
494 timer.Start();
495 m_extrapolation->EvaluatePressureBCs(inarray, outarray, m_kinvis);
496 timer.Stop();
497 timer.AccumulateRegion("Pressure BCs");
498
499 // Extrapolate advection velocity with StifflyStableBeta coefficients
501 {
502 for (int i = 0; i < m_velocity.size(); ++i)
503 {
504 Vmath::Vcopy(inarray[i].size(), inarray[i], 1,
505 m_extVel[i][m_intOrder - 1], 1);
506 m_extrapolation->ExtrapolateArray(m_extVel[i]);
507 }
508 }
509
510 // Compute explicit advection terms
511 EvaluateAdvectionTerms(inarray, m_advection, time);
512}
NekDouble m_kinvis
Kinematic viscosity.
ExtrapolateSharedPtr m_extrapolation
void EvaluateAdvectionTerms(const Array< OneD, const Array< OneD, NekDouble > > &inarray, Array< OneD, Array< OneD, NekDouble > > &outarray, const NekDouble time)
void Zero(int n, T *x, const int incx)
Zero vector.
Definition: Vmath.hpp:273
void Vcopy(int n, const T *x, const int incx, T *y, const int incy)
Definition: Vmath.hpp:825

References Nektar::LibUtilities::Timer::AccumulateRegion(), Nektar::IncNavierStokes::EvaluateAdvectionTerms(), m_advection, m_advectionVelocity, Nektar::IncNavierStokes::m_extrapolation, m_extVel, m_intOrder, Nektar::IncNavierStokes::m_kinvis, Nektar::IncNavierStokes::m_velocity, Nektar::LibUtilities::Timer::Start(), Nektar::LibUtilities::Timer::Stop(), Vmath::Vcopy(), and Vmath::Zero().

◆ v_GenerateSummary()

void Nektar::VCSImplicit::v_GenerateSummary ( SolverUtils::SummaryList s)
overrideprotectedvirtual

Print a summary of time stepping parameters.

Prints a summary with some information regards the time-stepping.

Reimplemented from Nektar::VelocityCorrectionScheme.

Definition at line 73 of file VelocityCorrectionSchemeImplicit.cpp.

74{
76 SolverUtils::AddSummaryItem(s, "Splitting Scheme",
77 "Implicit velocity correction");
78
79 if (m_extrapolation->GetSubStepName().size())
80 {
81 SolverUtils::AddSummaryItem(s, "Substepping",
82 m_extrapolation->GetSubStepName());
83 }
84
85 string dealias = m_homogen_dealiasing ? "Homogeneous1D" : "";
87 {
88 dealias += (dealias == "" ? "" : " + ") + string("spectral/hp");
89 }
90 if (dealias != "")
91 {
92 SolverUtils::AddSummaryItem(s, "Dealiasing", dealias);
93 }
94
95 string smoothing = m_useSpecVanVisc ? "spectral/hp" : "";
96 if (smoothing != "")
97 {
99 {
101 s, "Smoothing-SpecHP",
102 "SVV (" + smoothing + " Exp Kernel(cut-off = " +
103 boost::lexical_cast<string>(m_sVVCutoffRatio) +
104 ", diff coeff = " +
105 boost::lexical_cast<string>(m_sVVDiffCoeff) + "))");
106 }
107 else
108 {
110 {
112 s, "Smoothing-SpecHP",
113 "SVV (" + smoothing + " Power Kernel (Power ratio =" +
114 boost::lexical_cast<string>(m_sVVCutoffRatio) +
115 ", diff coeff = " +
116 boost::lexical_cast<string>(m_sVVDiffCoeff) +
117 "*Uh/p))");
118 }
119 else
120 {
122 s, "Smoothing-SpecHP",
123 "SVV (" + smoothing + " DG Kernel (diff coeff = " +
124 boost::lexical_cast<string>(m_sVVDiffCoeff) +
125 "*Uh/p))");
126 }
127 }
128 }
129
131 {
133 s, "Smoothing-Homo1D",
134 "SVV (Homogeneous1D - Exp Kernel(cut-off = " +
135 boost::lexical_cast<string>(m_sVVCutoffRatioHomo1D) +
136 ", diff coeff = " +
137 boost::lexical_cast<string>(m_sVVDiffCoeffHomo1D) + "))");
138 }
139
141 {
143 s, "GJP Stab. Impl. ",
144 m_session->GetSolverInfo("GJPStabilisation"));
145 SolverUtils::AddSummaryItem(s, "GJP Stab. JumpScale", m_GJPJumpScale);
146
147 if (boost::iequals(m_session->GetSolverInfo("GJPStabilisation"),
148 "Explicit"))
149 {
151 s, "GJP Normal Velocity",
152 m_session->GetSolverInfo("GJPNormalVelocity"));
153 }
154 }
155}
bool m_specHP_dealiasing
Flag to determine if dealisising is usde for the Spectral/hp element discretisation.
enum HomogeneousType m_HomogeneousType
bool m_homogen_dealiasing
Flag to determine if dealiasing is used for homogeneous simulations.
SOLVER_UTILS_EXPORT void v_GenerateSummary(SummaryList &s) override
Print a summary of time stepping parameters.
Array< OneD, NekDouble > m_svvVarDiffCoeff
Array of coefficient if power kernel is used in SVV.
NekDouble m_sVVDiffCoeffHomo1D
Diffusion coefficient of SVV modes in homogeneous 1D Direction.
bool m_IsSVVPowerKernel
Identifier for Power Kernel otherwise DG kernel.
NekDouble m_sVVCutoffRatio
cutt off ratio from which to start decayhing modes
NekDouble m_sVVDiffCoeff
Diffusion coefficient of SVV modes.
bool m_useGJPStabilisation
bool to identify if GJP semi-implicit is active.
bool m_useSpecVanVisc
bool to identify if spectral vanishing viscosity is active.
bool m_useHomo1DSpecVanVisc
bool to identify if spectral vanishing viscosity is active.
void AddSummaryItem(SummaryList &l, const std::string &name, const std::string &value)
Adds a summary item to the summary info list.
Definition: Misc.cpp:47
static Array< OneD, NekDouble > NullNekDouble1DArray

References Nektar::SolverUtils::AddSummaryItem(), Nektar::SolverUtils::EquationSystem::eHomogeneous1D, Nektar::IncNavierStokes::m_extrapolation, Nektar::VelocityCorrectionScheme::m_GJPJumpScale, Nektar::SolverUtils::EquationSystem::m_homogen_dealiasing, Nektar::SolverUtils::EquationSystem::m_HomogeneousType, Nektar::VelocityCorrectionScheme::m_IsSVVPowerKernel, Nektar::SolverUtils::EquationSystem::m_session, Nektar::SolverUtils::EquationSystem::m_specHP_dealiasing, Nektar::VelocityCorrectionScheme::m_sVVCutoffRatio, Nektar::VelocityCorrectionScheme::m_sVVCutoffRatioHomo1D, Nektar::VelocityCorrectionScheme::m_sVVDiffCoeff, Nektar::VelocityCorrectionScheme::m_sVVDiffCoeffHomo1D, Nektar::VelocityCorrectionScheme::m_svvVarDiffCoeff, Nektar::VelocityCorrectionScheme::m_useGJPStabilisation, Nektar::VelocityCorrectionScheme::m_useHomo1DSpecVanVisc, Nektar::VelocityCorrectionScheme::m_useSpecVanVisc, Nektar::NullNekDouble1DArray, and Nektar::SolverUtils::UnsteadySystem::v_GenerateSummary().

◆ v_GetExtrapolateStr()

std::string Nektar::VCSImplicit::v_GetExtrapolateStr ( void  )
inlineoverrideprotectedvirtual

Reimplemented from Nektar::VelocityCorrectionScheme.

Definition at line 104 of file VelocityCorrectionSchemeImplicit.h.

105 {
106 return "Implicit"; // Use ImplicitExtrapolate.cpp
107 }

◆ v_SetUpPressureForcing()

void Nektar::VCSImplicit::v_SetUpPressureForcing ( const Array< OneD, const Array< OneD, NekDouble > > &  fields,
Array< OneD, Array< OneD, NekDouble > > &  Forcing,
const NekDouble  aii_Dt 
)
overrideprotectedvirtual

Computes the forcing term for the pressure solve in VCSImplicit::v_SolvePressure(). It uses the weak pressure forcing similar to VCSWeakPressure (coefficient space).

Parameters
fieldsHolds the BDF formula of previous solutions \(\sum_q \frac{\alpha_q}{\gamma} [u^{n-q}, v^{n-q}, \ldots]\).
ForcingArray for the forcing term of the pressure solve. May contain temporary values on input. On output, Forcing = \( \int_\Omega \nabla \phi \cdot \left( \frac{1}{\Delta t} \sum_q \alpha_q \mathbf{u}^{n-q} + \mathbf{f}^{n+1} - N(\mathbf{u})^n \right) \).

Reimplemented from Nektar::VelocityCorrectionScheme.

Definition at line 229 of file VelocityCorrectionSchemeImplicit.cpp.

232{
233 int ncoeffs = m_pressure->GetNcoeffs();
234 int phystot = m_fields[0]->GetTotPoints();
235 int nvel = m_velocity.size();
236
237 // Add 1/dt \sum_q \alpha_q u^{n-q} - N(u^n)
238 for (int i = 0; i < nvel; i++)
239 {
240 Vmath::Svtvp(phystot, 1.0 / aii_Dt, fields[i], 1, m_advection[i], 1,
241 Forcing[i], 1);
242 }
243
244 // Add forcing terms
245 for (auto &x : m_forcing)
246 {
247 x->Apply(m_fields, Forcing, Forcing, m_time + m_timestep);
248 }
249
250 // Do Innerproduct with derivative base
251 m_pressure->IProductWRTDerivBase(Forcing, Forcing[0]);
252
253 // Negate to reverse negation in HelmSolve
254 Vmath::Neg(ncoeffs, Forcing[0], 1);
255}
MultiRegions::ExpListSharedPtr m_pressure
Pointer to field holding pressure field.
std::vector< SolverUtils::ForcingSharedPtr > m_forcing
Forcing terms.
NekDouble m_timestep
Time step size.
NekDouble m_time
Current time of simulation.
void Svtvp(int n, const T alpha, const T *x, const int incx, const T *y, const int incy, T *z, const int incz)
Svtvp (scalar times vector plus vector): z = alpha*x + y.
Definition: Vmath.hpp:396
void Neg(int n, T *x, const int incx)
Negate x = -x.
Definition: Vmath.hpp:292

References m_advection, Nektar::SolverUtils::EquationSystem::m_fields, Nektar::IncNavierStokes::m_forcing, Nektar::IncNavierStokes::m_pressure, Nektar::SolverUtils::EquationSystem::m_time, Nektar::SolverUtils::EquationSystem::m_timestep, Nektar::IncNavierStokes::m_velocity, Vmath::Neg(), and Vmath::Svtvp().

◆ v_SetUpViscousForcing()

void Nektar::VCSImplicit::v_SetUpViscousForcing ( const Array< OneD, const Array< OneD, NekDouble > > &  inarray,
Array< OneD, Array< OneD, NekDouble > > &  Forcing,
const NekDouble  aii_Dt 
)
overrideprotectedvirtual

Computes the forcing term and advection velocity for ADR solves.

Parameters
inarrayHolds the BDF formula of previous solutions \(\sum_q \frac{\alpha_q}{\gamma} [u^{n-q}, v^{n-q}, \ldots]\).
ForcingShared forcing array m_F. Used in pressure and velocity solve. On input, holds temporary values from pressure solve. On output: Forcing = \( - \frac{1}{\nu} \left( \frac{1}{\Delta t} \sum_q \alpha_q \mathbf{u}^{n-q} - \nabla p^{n+1} + \mathbf{f}^{n+1} \right) \).
aii_Dt\(\frac{\Delta t}{\gamma}\).

Additionally, the advection velocity \( \tilde{\mathbf{u}}^{n+1} \) is computed and handed to the velocity solve via the array m_AdvVel. It is computed as \( \tilde{\mathbf{u}}^{n+1} = \sum_q \frac{\alpha_q}{\gamma} \mathbf{u}^{n-q} - \frac{\Delta t}{\gamma} \left[ \nabla p^{n+1} - N(\mathbf{u})^n - \nu \nabla \times \omega^n + \mathbf{f}^{n+1} \right] \).

Reimplemented from Nektar::VelocityCorrectionScheme.

Definition at line 276 of file VelocityCorrectionSchemeImplicit.cpp.

279{
280 int phystot = m_fields[0]->GetTotPoints();
281 int nvel = m_velocity.size();
282
283 // Update (PhysSpace) pressure to n+1
284 m_pressure->BwdTrans(m_pressure->GetCoeffs(), m_pressure->UpdatePhys());
285
286 // Compute gradient \nabla p^{n+1}
287 if (nvel == 2)
288 {
289 m_pressure->PhysDeriv(m_pressure->GetPhys(), Forcing[m_velocity[0]],
290 Forcing[m_velocity[1]]);
291 }
292 else
293 {
294 m_pressure->PhysDeriv(m_pressure->GetPhys(), Forcing[m_velocity[0]],
295 Forcing[m_velocity[1]], Forcing[m_velocity[2]]);
296 }
297
298 // Negate pressure gradient: -1 * \nabla p
299 for (int i = 0; i < nvel; ++i)
300 {
301 Vmath::Neg(phystot, Forcing[i], 1);
302 }
303
304 // Zero convective fields
305 for (int i = nvel; i < m_nConvectiveFields; ++i)
306 {
307 Vmath::Zero(phystot, Forcing[i], 1);
308 }
309
310 // Add forcing terms: += f^{n+1}
311 for (auto &x : m_forcing)
312 {
313 x->Apply(m_fields, Forcing, Forcing, m_time + m_timestep);
314 }
315
316 // Build Advection Velocity
317 for (int i = 0; i < nvel; ++i)
318 {
319 // Extrapolated Advection Velocity = u^*n+1
321 {
322 Vmath::Smul(phystot, 1.0 / m_diffCoeff[i],
323 m_extVel[i][m_intOrder - 1], 1, m_AdvVel[i], 1);
324 }
325 // Updated Advection Velocity = u^*n+1 - (...)
326 else
327 {
328 // Get velocity fields [u^n, v^n, ..] for curl of vorticity
329 Array<OneD, Array<OneD, NekDouble>> velocity(nvel);
330 for (int i = 0; i < nvel; i++)
331 {
332 velocity[i] = Array<OneD, NekDouble>(m_fields[i]->GetPhys());
333 }
334 // Curl of vorticity \nabla \times \nabla \times [u^n, v^n, ..]
335 m_fields[0]->CurlCurl(velocity, velocity);
336
337 // \frac{\Delta t}{\gamma}(-\nabla p + f) + inarray
338 Vmath::Svtvp(phystot, aii_Dt, Forcing[i], 1, inarray[i], 1,
339 m_AdvVel[i], 1);
340 // += \frac{\Delta t}{\gamma} -N(u)
341 Vmath::Svtvp(phystot, aii_Dt, m_advection[i], 1, m_AdvVel[i], 1,
342 m_AdvVel[i], 1);
343 // += -\frac{\Delta t}{\gamma} CurlCurl(u)
344 Vmath::Svtvp(phystot, -aii_Dt * m_diffCoeff[i], velocity[i], 1,
345 m_AdvVel[i], 1, m_AdvVel[i], 1);
346 // *= 1/\nu
347 Vmath::Smul(phystot, 1.0 / m_diffCoeff[i], m_AdvVel[i], 1,
348 m_AdvVel[i], 1);
349 }
350 }
351
352 // Build Forcing term
353 for (int i = 0; i < nvel; ++i)
354 {
355 // \frac{\gamma}{\Delta t} * inarray - \nabla p + f
356 Vmath::Svtvp(phystot, 1.0 / aii_Dt, inarray[i], 1, Forcing[i], 1,
357 Forcing[i], 1);
358
359 // *= -1/kinvis
360 Vmath::Smul(phystot, -1.0 / m_diffCoeff[i], Forcing[i], 1, Forcing[i],
361 1);
362 }
363}

References m_advection, m_advectionVelocity, m_AdvVel, Nektar::VelocityCorrectionScheme::m_diffCoeff, m_extVel, Nektar::SolverUtils::EquationSystem::m_fields, Nektar::IncNavierStokes::m_forcing, m_intOrder, Nektar::IncNavierStokes::m_nConvectiveFields, Nektar::IncNavierStokes::m_pressure, Nektar::SolverUtils::EquationSystem::m_time, Nektar::SolverUtils::EquationSystem::m_timestep, Nektar::IncNavierStokes::m_velocity, Vmath::Neg(), Vmath::Smul(), Vmath::Svtvp(), and Vmath::Zero().

◆ v_SolvePressure()

void Nektar::VCSImplicit::v_SolvePressure ( const Array< OneD, NekDouble > &  Forcing)
overrideprotectedvirtual

Solve pressure system via a Poisson problem with ContField::HelmSolve(). Uses coefficient space forcing and hence sets the argument PhysSpaceForcing=false in ContFieldHelmSolve().

Parameters
ForcingSee output description in VCSImplicit::v_SetUpPressureForcing().

Reimplemented from Nektar::VelocityCorrectionScheme.

Definition at line 374 of file VelocityCorrectionSchemeImplicit.cpp.

375{
377 // Setup coefficient for equation, Lambda = 0 ensures Poisson instead of
378 // Helmholtz problem
380
381 // Solve Pressure Poisson Equation (with Weak Forcing)
382 m_pressure->HelmSolve(Forcing, m_pressure->UpdateCoeffs(), factors,
385 false);
386
387 // Add presure to outflow bc if using convective like BCs
388 m_extrapolation->AddPressureToOutflowBCs(m_kinvis);
389}
static VarFactorsMap NullVarFactorsMap
std::map< ConstFactorType, NekDouble > ConstFactorMap
Definition: StdRegions.hpp:430
static VarCoeffMap NullVarCoeffMap
Definition: StdRegions.hpp:376
StdRegions::ConstFactorMap factors

References Nektar::StdRegions::eFactorLambda, Nektar::VarcoeffHashingTest::factors, Nektar::IncNavierStokes::m_extrapolation, Nektar::IncNavierStokes::m_kinvis, Nektar::IncNavierStokes::m_pressure, Nektar::NullNekDouble1DArray, Nektar::StdRegions::NullVarCoeffMap, and Nektar::MultiRegions::NullVarFactorsMap.

◆ v_SolveViscous()

void Nektar::VCSImplicit::v_SolveViscous ( const Array< OneD, const Array< OneD, NekDouble > > &  Forcing,
const Array< OneD, const Array< OneD, NekDouble > > &  inarray,
Array< OneD, Array< OneD, NekDouble > > &  outarray,
const NekDouble  aii_Dt 
)
overrideprotectedvirtual

Solve velocity system via the ContField::LinearAdvectionDiffusionReactionSolve().

Parameters
ForcingHolds the forcing term for each velocity component. See output description in VCSImplicit::v_SetUpViscousForcing().
inarrayUnused in this routine. Still, holds \(\sum_q \frac{\alpha_q}{\gamma} [u^{n-q}, v^{n-q}, \ldots] \).
outarrayHolds vector of previous solution \( [u^n, v^n, \ldots] \). Overwritten upon output with new solution [u^{n+1}, v^{n+1}, \ldots].

Additionally, the advection velocity \( \tilde{\mathbf{u}}^{n+1} \) is handed to the velocity solve via the array m_AdvVel. It is computed in VCSImplicit::v_SetUpViscousForcing(). It is defined as \( \tilde{\mathbf{u}}^{n+1} = \sum_q \frac{\alpha_q}{\gamma} \mathbf{u}^{n-q} - \frac{\Delta t}{\gamma} \left[ \nabla p^{n+1} - N(\mathbf{u})^n - \nu \nabla \times \omega^n + \mathbf{f}^{n+1} \right] \).

Reimplemented from Nektar::VelocityCorrectionScheme.

Definition at line 410 of file VelocityCorrectionSchemeImplicit.cpp.

414{
416 StdRegions::VarCoeffMap varcoeffs;
418
419 AppendSVVFactors(factors, varfactors);
420 ComputeGJPNormalVelocity(inarray, varcoeffs);
421
422 // Compute mass varcoeff for implicit Skew-symmetric operator
423 AddImplicitSkewSymAdvection(varcoeffs, aii_Dt);
424
425 // Set advection velocities
429 for (int i = 0; i < m_velocity.size(); i++)
430 {
431 varcoeffs[varcoefftypes[i]] = m_AdvVel[i];
432 }
433
434 // Solve Advection-Diffusion-Reaction system
435 for (int i = 0; i < m_nConvectiveFields; ++i)
436 {
437 // Add diffusion coefficient to GJP matrix operator (Implicit part)
439 {
441 }
442
443 // \lambda = - /frac{\gamma}{\Delta t \nu}
444 factors[StdRegions::eFactorLambda] = -1.0 / aii_Dt / m_diffCoeff[i];
445
446 auto gkey = m_fields[i]->LinearAdvectionDiffusionReactionSolve(
447 Forcing[i], m_fields[i]->UpdateCoeffs(), factors, varcoeffs,
448 varfactors);
449
450 // Nuke GlobalLinSys to avoid memory leak
451 // The condition nukes, if:
452 // - Remove after last velocity solve (w-velocity in 3D,
453 // assumes same matrix for each velocity)
454 // - Catches Null return from 3DH1D solve by checking matrix type
455 // is a LinearADR matrix (variant)
456 if (m_unsetGlobalLinSys[i] &&
457 (gkey.GetMatrixType() ==
459 gkey.GetMatrixType() ==
461 {
462 m_fields[i]->UnsetGlobalLinSys(gkey, true);
463 }
464
465 // Transform solution to PhysSpace
466 m_fields[i]->BwdTrans(m_fields[i]->GetCoeffs(), outarray[i]);
467 }
468}
void AddImplicitSkewSymAdvection(StdRegions::VarCoeffMap varcoeffs, NekDouble aii_Dt)
void AppendSVVFactors(StdRegions::ConstFactorMap &factors, MultiRegions::VarFactorsMap &varFactorsMap)
void ComputeGJPNormalVelocity(const Array< OneD, const Array< OneD, NekDouble > > &inarray, StdRegions::VarCoeffMap &varcoeffs)
std::map< StdRegions::ConstFactorType, Array< OneD, NekDouble > > VarFactorsMap
@ eLinearAdvectionDiffusionReactionGJP
Definition: StdRegions.hpp:105
std::map< StdRegions::VarCoeffType, VarCoeffEntry > VarCoeffMap
Definition: StdRegions.hpp:375

References AddImplicitSkewSymAdvection(), Nektar::VelocityCorrectionScheme::AppendSVVFactors(), Nektar::VelocityCorrectionScheme::ComputeGJPNormalVelocity(), Nektar::StdRegions::eFactorGJP, Nektar::StdRegions::eFactorLambda, Nektar::StdRegions::eLinearAdvectionDiffusionReaction, Nektar::StdRegions::eLinearAdvectionDiffusionReactionGJP, Nektar::StdRegions::eVarCoeffVelX, Nektar::StdRegions::eVarCoeffVelY, Nektar::StdRegions::eVarCoeffVelZ, Nektar::VarcoeffHashingTest::factors, m_AdvVel, Nektar::VelocityCorrectionScheme::m_diffCoeff, Nektar::SolverUtils::EquationSystem::m_fields, Nektar::VelocityCorrectionScheme::m_GJPJumpScale, Nektar::IncNavierStokes::m_nConvectiveFields, m_unsetGlobalLinSys, Nektar::VelocityCorrectionScheme::m_useGJPStabilisation, Nektar::IncNavierStokes::m_velocity, and Nektar::MultiRegions::NullVarFactorsMap.

Friends And Related Function Documentation

◆ MemoryManager< VCSImplicit >

friend class MemoryManager< VCSImplicit >
friend

Definition at line 126 of file VelocityCorrectionSchemeImplicit.h.

Member Data Documentation

◆ className

string Nektar::VCSImplicit::className
static
Initial value:
=
"VCSImplicit", VCSImplicit::create)
tKey RegisterCreatorFunction(tKey idKey, CreatorFunction classCreator, std::string pDesc="")
Register a class with the factory.
static SolverUtils::EquationSystemSharedPtr create(const LibUtilities::SessionReaderSharedPtr &pSession, const SpatialDomains::MeshGraphSharedPtr &pGraph)
Creates an instance of this class.
EquationSystemFactory & GetEquationSystemFactory()

Name of class.

Definition at line 59 of file VelocityCorrectionSchemeImplicit.h.

◆ m_advection

Array<OneD, Array<OneD, NekDouble> > Nektar::VCSImplicit::m_advection
protected

2D Array for Advection Velocities [dir][dof]

Definition at line 63 of file VelocityCorrectionSchemeImplicit.h.

Referenced by v_DoInitialise(), v_EvaluateAdvection_SetPressureBCs(), v_SetUpPressureForcing(), and v_SetUpViscousForcing().

◆ m_advectionVelocity

bool Nektar::VCSImplicit::m_advectionVelocity
protected

bool to identify implicit scheme ie advection velocity

Definition at line 67 of file VelocityCorrectionSchemeImplicit.h.

Referenced by v_DoInitialise(), v_EvaluateAdvection_SetPressureBCs(), and v_SetUpViscousForcing().

◆ m_AdvVel

Array<OneD, Array<OneD, NekDouble> > Nektar::VCSImplicit::m_AdvVel
protected

◆ m_convectiveType

std::string Nektar::VCSImplicit::m_convectiveType
protected

Definition at line 72 of file VelocityCorrectionSchemeImplicit.h.

◆ m_extVel

Array<OneD, Array<OneD, Array<OneD, NekDouble> > > Nektar::VCSImplicit::m_extVel
protected

3D Array for extrapolated Advection Velocities [dir][time-levle][dof]

Definition at line 65 of file VelocityCorrectionSchemeImplicit.h.

Referenced by v_DoInitialise(), v_EvaluateAdvection_SetPressureBCs(), and v_SetUpViscousForcing().

◆ m_implicitSkewSymAdvection

bool Nektar::VCSImplicit::m_implicitSkewSymAdvection
protected

bool to identify advection operator

Definition at line 69 of file VelocityCorrectionSchemeImplicit.h.

Referenced by AddImplicitSkewSymAdvection(), and v_DoInitialise().

◆ m_intOrder

int Nektar::VCSImplicit::m_intOrder
protected

integer for advection velocity

Definition at line 71 of file VelocityCorrectionSchemeImplicit.h.

Referenced by v_DoInitialise(), v_EvaluateAdvection_SetPressureBCs(), and v_SetUpViscousForcing().

◆ m_unsetGlobalLinSys

Array<OneD, int32_t> Nektar::VCSImplicit::m_unsetGlobalLinSys
protected

Array checking whether GlobalLinSys needs to be unset.

Definition at line 74 of file VelocityCorrectionSchemeImplicit.h.

Referenced by v_DoInitialise(), and v_SolveViscous().

◆ solverTypeLookupId

string Nektar::VCSImplicit::solverTypeLookupId
staticprotected
Initial value:
=
static std::string RegisterEnumValue(std::string pEnum, std::string pString, int pEnumValue)
Registers an enumeration value.

Definition at line 114 of file VelocityCorrectionSchemeImplicit.h.