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

#include <VelocityCorrectionScheme.h>

Inheritance diagram for Nektar::VelocityCorrectionScheme:
[legend]

Public Member Functions

 VelocityCorrectionScheme (const LibUtilities::SessionReaderSharedPtr &pSession, const SpatialDomains::MeshGraphSharedPtr &pGraph)
 Constructor. More...
 
virtual ~VelocityCorrectionScheme ()
 
virtual void v_InitObject ()
 Init object for UnsteadySystem class. More...
 
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, 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
virtual ~IncNavierStokes ()
 
int GetNConvectiveFields (void)
 
Array< OneD, int > & GetVelocity (void)
 
void AddForcing (const SolverUtils::ForcingSharedPtr &pForce)
 
virtual void GetPressure (const Array< OneD, const Array< OneD, NekDouble > > &physfield, Array< OneD, NekDouble > &pressure)
 Extract array with pressure from physfield. More...
 
virtual void GetDensity (const Array< OneD, const Array< OneD, NekDouble > > &physfield, Array< OneD, NekDouble > &density)
 Extract array with density from physfield. More...
 
virtual bool HasConstantDensity ()
 
virtual void GetVelocity (const Array< OneD, const Array< OneD, NekDouble > > &physfield, Array< OneD, Array< OneD, NekDouble > > &velocity)
 Extract array with velocity from physfield. More...
 
- Public Member Functions inherited from Nektar::SolverUtils::AdvectionSystem
SOLVER_UTILS_EXPORT AdvectionSystem (const LibUtilities::SessionReaderSharedPtr &pSession, const SpatialDomains::MeshGraphSharedPtr &pGraph)
 
virtual SOLVER_UTILS_EXPORT ~AdvectionSystem ()
 
SOLVER_UTILS_EXPORT AdvectionSharedPtr GetAdvObject ()
 Returns the advection object held by this instance. More...
 
SOLVER_UTILS_EXPORT Array< OneD, NekDoubleGetElmtCFLVals (void)
 
SOLVER_UTILS_EXPORT NekDouble GetCFLEstimate (int &elmtid)
 
- Public Member Functions inherited from Nektar::SolverUtils::UnsteadySystem
virtual SOLVER_UTILS_EXPORT ~UnsteadySystem ()
 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...
 
- Public Member Functions inherited from Nektar::SolverUtils::EquationSystem
virtual SOLVER_UTILS_EXPORT ~EquationSystem ()
 Destructor. More...
 
SOLVER_UTILS_EXPORT void SetUpTraceNormals (void)
 
SOLVER_UTILS_EXPORT void InitObject ()
 Initialises the members of this object. More...
 
SOLVER_UTILS_EXPORT void DoInitialise ()
 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 NekDouble LinfError (unsigned int field, const Array< OneD, NekDouble > &exactsoln=NullNekDouble1DArray)
 Linf error computation. 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 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 GetFinalTime ()
 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 NekDouble GetTimeStep ()
 
SOLVER_UTILS_EXPORT void CopyFromPhysField (const int i, Array< OneD, NekDouble > &output)
 
SOLVER_UTILS_EXPORT void CopyToPhysField (const int i, Array< OneD, NekDouble > &output)
 
SOLVER_UTILS_EXPORT void SetSteps (const int steps)
 
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 void SetTime (const NekDouble time)
 
SOLVER_UTILS_EXPORT void SetInitialStep (const int step)
 
SOLVER_UTILS_EXPORT void SetBoundaryConditions (NekDouble time)
 Evaluates the boundary conditions at the given time. More...
 
virtual SOLVER_UTILS_EXPORT bool v_NegatedOp ()
 Virtual function to identify if operator is negated in DoSolve. More...
 

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 Attributes

static std::string className
 Name of class. More...
 

Protected Member Functions

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...
 
virtual bool v_PostIntegrate (int step)
 
virtual void v_GenerateSummary (SolverUtils::SummaryList &s)
 Print a summary of time stepping parameters. More...
 
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_DoInitialise (void)
 Sets up initial conditions. More...
 
virtual Array< OneD, bool > v_GetSystemSingularChecks ()
 
virtual int v_GetForceDimension ()
 
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, Array< OneD, Array< OneD, NekDouble > > &outarray, const NekDouble aii_Dt)
 
virtual void v_EvaluateAdvection_SetPressureBCs (const Array< OneD, const Array< OneD, NekDouble > > &inarray, Array< OneD, Array< OneD, NekDouble > > &outarray, const NekDouble time)
 
virtual bool v_RequireFwdTrans ()
 
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)
 
- Protected Member Functions inherited from Nektar::IncNavierStokes
 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, NekDoublev_GetMaxStdVelocity ()
 
virtual bool v_PreIntegrate (int step)
 
- 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 NekDouble MaxTimeStepEstimator ()
 Get the maximum timestep estimator for cfl control. More...
 
virtual SOLVER_UTILS_EXPORT void v_DoSolve ()
 Solves an unsteady problem. 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...
 
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...
 
- 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 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_Output (void)
 
virtual SOLVER_UTILS_EXPORT void v_ExtraFldOutput (std::vector< Array< OneD, NekDouble > > &fieldcoeffs, std::vector< std::string > &variables)
 

Protected Attributes

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...
 
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
 
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...
 
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
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...
 
- Protected Attributes inherited from Nektar::SolverUtils::EquationSystem
LibUtilities::CommSharedPtr m_comm
 Communicator. More...
 
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...
 
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...
 

Additional Inherited Members

- Public Attributes inherited from Nektar::SolverUtils::UnsteadySystem
NekDouble m_cflSafetyFactor
 CFL safety factor (comprise between 0 to 1). More...
 
- Protected Types inherited from Nektar::SolverUtils::EquationSystem
enum  HomogeneousType { eHomogeneous1D, eHomogeneous2D, eHomogeneous3D, eNotHomogeneous }
 Parameter for homogeneous expansions. More...
 
- Static Protected Attributes inherited from Nektar::SolverUtils::EquationSystem
static std::string equationSystemTypeLookupIds []
 

Detailed Description

Definition at line 42 of file VelocityCorrectionScheme.h.

Constructor & Destructor Documentation

◆ VelocityCorrectionScheme()

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

Constructor.

Constructor. Creates ...

Parameters

Definition at line 60 of file VelocityCorrectionScheme.cpp.

63  : UnsteadySystem(pSession, pGraph),
64  IncNavierStokes(pSession, pGraph),
66  {
67 
68  }
IncNavierStokes(const LibUtilities::SessionReaderSharedPtr &pSession, const SpatialDomains::MeshGraphSharedPtr &pGraph)
Constructor.
SOLVER_UTILS_EXPORT UnsteadySystem(const LibUtilities::SessionReaderSharedPtr &pSession, const SpatialDomains::MeshGraphSharedPtr &pGraph)
Initialises UnsteadySystem class members.
static VarCoeffMap NullVarCoeffMap
Definition: StdRegions.hpp:265
StdRegions::VarCoeffMap m_varCoeffLap
Variable Coefficient map for the Laplacian which can be activated as part of SVV or otherwise...

◆ ~VelocityCorrectionScheme()

Nektar::VelocityCorrectionScheme::~VelocityCorrectionScheme ( void  )
virtual

Destructor

Definition at line 480 of file VelocityCorrectionScheme.cpp.

481  {
482  }

Member Function Documentation

◆ AppendSVVFactors()

void Nektar::VelocityCorrectionScheme::AppendSVVFactors ( StdRegions::ConstFactorMap factors,
MultiRegions::VarFactorsMap varFactorsMap 
)
protected

Definition at line 1082 of file VelocityCorrectionScheme.cpp.

References Nektar::StdRegions::eFactorSVVCutoffRatio, Nektar::StdRegions::eFactorSVVDGKerDiffCoeff, Nektar::StdRegions::eFactorSVVDiffCoeff, Nektar::StdRegions::eFactorSVVPowerKerDiffCoeff, m_IsSVVPowerKernel, Nektar::IncNavierStokes::m_kinvis, m_sVVCutoffRatio, m_sVVDiffCoeff, m_svvVarDiffCoeff, m_useSpecVanVisc, and Nektar::NullNekDouble1DArray.

Referenced by v_SolveViscous().

1085  {
1086 
1087  if(m_useSpecVanVisc)
1088  {
1092  {
1093  if(m_IsSVVPowerKernel)
1094  {
1097  }
1098  else
1099  {
1100  varFactorsMap[StdRegions::eFactorSVVDGKerDiffCoeff] =
1102  }
1103  }
1104  }
1105 
1106  }
static Array< OneD, NekDouble > NullNekDouble1DArray
NekDouble m_kinvis
Kinematic viscosity.
NekDouble m_sVVDiffCoeff
Diffusion coefficient of SVV modes.
bool m_IsSVVPowerKernel
Identifier for Power Kernel otherwise DG kernel.
Array< OneD, NekDouble > m_svvVarDiffCoeff
Array of coefficient if power kernel is used in SVV.
NekDouble m_sVVCutoffRatio
cutt off ratio from which to start decayhing modes
bool m_useSpecVanVisc
bool to identify if spectral vanishing viscosity is active.

◆ create()

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

Creates an instance of this class.

Definition at line 47 of file VelocityCorrectionScheme.h.

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

50  {
53  pSession, pGraph);
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.

◆ EvaluateAdvection_SetPressureBCs()

void Nektar::VelocityCorrectionScheme::EvaluateAdvection_SetPressureBCs ( const Array< OneD, const Array< OneD, NekDouble > > &  inarray,
Array< OneD, Array< OneD, NekDouble > > &  outarray,
const NekDouble  time 
)
inline

Definition at line 105 of file VelocityCorrectionScheme.h.

References v_EvaluateAdvection_SetPressureBCs().

Referenced by v_InitObject().

109  {
110  v_EvaluateAdvection_SetPressureBCs( inarray, outarray, time);
111  }
virtual void v_EvaluateAdvection_SetPressureBCs(const Array< OneD, const Array< OneD, NekDouble > > &inarray, Array< OneD, Array< OneD, NekDouble > > &outarray, const NekDouble time)

◆ MeasureFlowrate()

NekDouble Nektar::VelocityCorrectionScheme::MeasureFlowrate ( const Array< OneD, Array< OneD, NekDouble > > &  inarray)
protected

Measure the volumetric flow rate through the volumetric flow rate reference surface.

This routine computes the volumetric flow rate

\[ Q(\mathbf{u}) = \frac{1}{\mu(R)} \int_R \mathbf{u} \cdot d\mathbf{s} \]

through the boundary region \( R \).

Definition at line 405 of file VelocityCorrectionScheme.cpp.

References Nektar::SolverUtils::EquationSystem::eHomogeneous1D, Nektar::SolverUtils::EquationSystem::m_comm, Nektar::SolverUtils::EquationSystem::m_fields, m_flowrateArea, m_flowrateBnd, m_flowrateBndID, m_homd1DFlowinPlane, Nektar::SolverUtils::EquationSystem::m_HomogeneousType, m_planeID, Nektar::SolverUtils::EquationSystem::m_session, Nektar::SolverUtils::EquationSystem::m_spacedim, and Nektar::LibUtilities::ReduceSum.

Referenced by SetupFlowrate(), and SolveUnsteadyStokesSystem().

407  {
408  NekDouble flowrate = 0.0;
409 
410  if (m_flowrateBnd && m_flowrateBndID >= 0)
411  {
412  // If we're an actual boundary, calculate the vector flux through
413  // the boundary.
414  Array<OneD, Array<OneD, NekDouble> > boundary(m_spacedim);
415 
417  {
418  // General case
419  for (int i = 0; i < m_spacedim; ++i)
420  {
421  m_fields[i]->ExtractPhysToBnd(m_flowrateBndID, inarray[i],
422  boundary[i]);
423  }
424  flowrate = m_flowrateBnd->VectorFlux(boundary);
425  }
426  else if(m_planeID == 0)
427  {
428  //Homogeneous with forcing in plane. Calculate flux only on
429  // the meanmode - calculateFlux necessary for hybrid
430  // parallelisation.
431  for (int i = 0; i < m_spacedim; ++i)
432  {
433  m_fields[i]->GetPlane(m_planeID)->ExtractPhysToBnd(
434  m_flowrateBndID, inarray[i], boundary[i]);
435  }
436 
437  // the flowrate is calculated on the mean mode so it needs to be
438  // multiplied by LZ to be consistent with the general case.
439  flowrate = m_flowrateBnd->VectorFlux(boundary) *
440  m_session->GetParameter("LZ");
441  }
442  }
443  else if (m_flowrateBnd && !m_homd1DFlowinPlane)
444  {
445  // 3DH1D case with no Flowrate boundary defined: compute flux
446  // through the zero-th (mean) plane.
447  flowrate = m_flowrateBnd->Integral(inarray[2]);
448  }
449 
450  // Communication to obtain the total flowrate
452  {
453  m_comm->GetColumnComm()->AllReduce(flowrate, LibUtilities::ReduceSum);
454  }
455  else
456  {
457  m_comm->AllReduce(flowrate, LibUtilities::ReduceSum);
458  }
459  return flowrate / m_flowrateArea;
460  }
LibUtilities::CommSharedPtr m_comm
Communicator.
MultiRegions::ExpListSharedPtr m_flowrateBnd
Flowrate reference surface.
NekDouble m_flowrateArea
Area of the boundary through which we are measuring the flowrate.
int m_spacedim
Spatial dimension (>= expansion dim).
double NekDouble
Array< OneD, MultiRegions::ExpListSharedPtr > m_fields
Array holding all dependent variables.
LibUtilities::SessionReaderSharedPtr m_session
The session reader.
int m_flowrateBndID
Boundary ID of the flowrate reference surface.
int m_planeID
Plane ID for cases with homogeneous expansion.
enum HomogeneousType m_HomogeneousType

◆ SetUpExtrapolation()

void Nektar::VelocityCorrectionScheme::SetUpExtrapolation ( void  )
protected

Definition at line 126 of file VelocityCorrectionScheme.cpp.

References Nektar::LibUtilities::NekFactory< tKey, tBase, tParam >::CreateInstance(), Nektar::eUnsteadyNavierStokes, Nektar::eUnsteadyStokes, Nektar::GetExtrapolateFactory(), Nektar::SolverUtils::AdvectionSystem::m_advObject, Nektar::IncNavierStokes::m_equationType, Nektar::IncNavierStokes::m_extrapolation, Nektar::SolverUtils::EquationSystem::m_fields, Nektar::SolverUtils::UnsteadySystem::m_intScheme, Nektar::IncNavierStokes::m_pressure, Nektar::SolverUtils::EquationSystem::m_session, Nektar::IncNavierStokes::m_velocity, v_GetExtrapolateStr(), and v_GetSubSteppingExtrapolateStr().

Referenced by v_InitObject().

127  {
128  // creation of the extrapolation object
131  {
132  std::string vExtrapolation = v_GetExtrapolateStr();
133  if (m_session->DefinesSolverInfo("Extrapolation"))
134  {
135  vExtrapolation = v_GetSubSteppingExtrapolateStr(
136  m_session->GetSolverInfo("Extrapolation"));
137  }
139  vExtrapolation,
140  m_session,
141  m_fields,
142  m_pressure,
143  m_velocity,
144  m_advObject);
145 
146  m_extrapolation->SubSteppingTimeIntegration(
147  m_intScheme->GetIntegrationMethod(), m_intScheme);
148  m_extrapolation->GenerateHOPBCMap(m_session);
149  }
150  }
EquationType m_equationType
equation type;
SolverUtils::AdvectionSharedPtr m_advObject
Advection term.
ExtrapolateFactory & GetExtrapolateFactory()
Definition: Extrapolate.cpp:49
Array< OneD, int > m_velocity
int which identifies which components of m_fields contains the velocity (u,v,w);
ExtrapolateSharedPtr m_extrapolation
virtual std::string v_GetSubSteppingExtrapolateStr(const std::string &instr)
virtual std::string v_GetExtrapolateStr(void)
tBaseSharedPtr CreateInstance(tKey idKey, tParam... args)
Create an instance of the class referred to by idKey.
Definition: NekFactory.hpp:144
Array< OneD, MultiRegions::ExpListSharedPtr > m_fields
Array holding all dependent variables.
LibUtilities::SessionReaderSharedPtr m_session
The session reader.
LibUtilities::TimeIntegrationWrapperSharedPtr m_intScheme
Wrapper to the time integration scheme.
MultiRegions::ExpListSharedPtr m_pressure
Pointer to field holding pressure field.

◆ SetupFlowrate()

void Nektar::VelocityCorrectionScheme::SetupFlowrate ( NekDouble  aii_dt)
protected

Set up the Stokes solution used to impose constant flowrate through a boundary.

This routine solves a Stokes equation using a unit forcing direction, specified by the user to be in the desired flow direction. This field can then be used to correct the end of each timestep to impose a constant volumetric flow rate through a user-defined boundary.

There are three modes of operation:

  • Standard two-dimensional or three-dimensional simulations (e.g. pipes or channels)
  • 3DH1D simulations where the forcing is not in the homogeneous direction (e.g. channel flow, where the y-direction of the 2D mesh is perpendicular to the wall);
  • 3DH1D simulations where the forcing is in the homogeneous direction (e.g. pipe flow in the z-direction).

In the first two cases, the user should define:

  • the Flowrate parameter, which dictates the volumetric flux through the reference area
  • tag a boundary region with the Flowrate user-defined type to define the reference area
  • define a FlowrateForce function with components ForceX, ForceY and ForceZ that defines a unit forcing in the appropriate direction.

In the latter case, the user should define only the Flowrate; the reference area is taken to be the homogeneous plane and the force is assumed to be the unit z-vector \( \hat{e}_z \).

This routine solves a single timestep of the Stokes problem (premultiplied by the backwards difference coefficient):

\[ \frac{\partial\mathbf{u}}{\partial t} = -\nabla p + \nu\nabla^2\mathbf{u} + \mathbf{f} \]

with a zero initial condition to obtain a field \( \mathbf{u}_s \). The flowrate is then corrected at each timestep \( n \) by adding the correction \( \alpha\mathbf{u}_s \) where

\[ \alpha = \frac{\overline{Q} - Q(\mathbf{u^n})}{Q(\mathbf{u}_s)} \]

where \( Q(\cdot)\) is the volumetric flux through the appropriate surface or line, which is implemented in VelocityCorrectionScheme::MeasureFlowrate. For more details, see chapter 3.2 of the thesis of D. Moxey (University of Warwick, 2011).

Definition at line 200 of file VelocityCorrectionScheme.cpp.

References ASSERTL0, ASSERTL1, Nektar::LibUtilities::NekFactory< tKey, tBase, tParam >::CreateInstance(), Nektar::SolverUtils::EquationSystem::eHomogeneous1D, Nektar::GetExtrapolateFactory(), Nektar::SolverUtils::EquationSystem::GetNcoeffs(), Nektar::SolverUtils::AdvectionSystem::m_advObject, Nektar::SolverUtils::EquationSystem::m_comm, Nektar::IncNavierStokes::m_extrapolation, Nektar::SolverUtils::EquationSystem::m_fields, m_flowrateAiidt, m_flowrateArea, m_flowrateBnd, m_flowrateBndID, m_flowrateSteps, m_flowrateStokes, m_flowrateStream, m_greenFlux, m_homd1DFlowinPlane, Nektar::SolverUtils::EquationSystem::m_HomogeneousType, m_planeID, Nektar::IncNavierStokes::m_pressure, Nektar::SolverUtils::EquationSystem::m_session, Nektar::SolverUtils::EquationSystem::m_spacedim, Nektar::IncNavierStokes::m_velocity, MeasureFlowrate(), Nektar::LibUtilities::ReduceMax, SolveUnsteadyStokesSystem(), and Vmath::Zero().

Referenced by SolveUnsteadyStokesSystem().

201  {
202  m_flowrateBndID = -1;
203  m_flowrateArea = 0.0;
204 
205  const Array<OneD, const SpatialDomains::BoundaryConditionShPtr> &bcs =
206  m_fields[0]->GetBndConditions();
207 
208  std::string forces[] = { "X", "Y", "Z" };
209  Array<OneD, NekDouble> flowrateForce(m_spacedim, 0.0);
210 
211  // Set up flowrate forces.
212  bool defined = true;
213  for (int i = 0; i < m_spacedim; ++i)
214  {
215  std::string varName = std::string("Force") + forces[i];
216  defined = m_session->DefinesFunction("FlowrateForce", varName);
217 
218  if (!defined && m_HomogeneousType == eHomogeneous1D)
219  {
220  break;
221  }
222 
223  ASSERTL0(defined,
224  "A 'FlowrateForce' function must defined with components "
225  "[ForceX, ...] to define direction of flowrate forcing");
226 
228  = m_session->GetFunction("FlowrateForce", varName);
229  flowrateForce[i] = ffunc->Evaluate();
230  }
231 
232  // Define flag for case with homogeneous expansion and forcing not in the
233  // z-direction
234  m_homd1DFlowinPlane = false;
235  if (defined && m_HomogeneousType == eHomogeneous1D)
236  {
237  m_homd1DFlowinPlane = true;
238  }
239 
240  // For 3DH1D simulations, if force isn't defined then assume in
241  // z-direction.
242  if (!defined)
243  {
244  flowrateForce[2] = 1.0;
245  }
246 
247  // Find the boundary condition that is tagged as the flowrate boundary.
248  for (int i = 0; i < bcs.num_elements(); ++i)
249  {
250  if (boost::iequals(bcs[i]->GetUserDefined(), "Flowrate"))
251  {
252  m_flowrateBndID = i;
253  break;
254  }
255  }
256 
257  int tmpBr = m_flowrateBndID;
258  m_comm->AllReduce(tmpBr, LibUtilities::ReduceMax);
259  ASSERTL0(tmpBr >= 0 || m_HomogeneousType == eHomogeneous1D,
260  "One boundary region must be marked using the 'Flowrate' "
261  "user-defined type to monitor the volumetric flowrate.");
262 
263  // Extract an appropriate expansion list to represents the boundary.
264  if (m_flowrateBndID >= 0)
265  {
266  // For a boundary, extract the boundary itself.
267  m_flowrateBnd = m_fields[0]->GetBndCondExpansions()[m_flowrateBndID];
268  }
270  {
271  // For 3DH1D simulations with no force specified, find the mean
272  // (0th) plane.
273  Array<OneD, unsigned int> zIDs = m_fields[0]->GetZIDs();
274  int tmpId = -1;
275 
276  for (int i = 0; i < zIDs.num_elements(); ++i)
277  {
278  if (zIDs[i] == 0)
279  {
280  tmpId = i;
281  break;
282  }
283  }
284 
285  ASSERTL1(tmpId <= 0, "Should be either at location 0 or -1 if not "
286  "found");
287 
288  if (tmpId != -1)
289  {
290  m_flowrateBnd = m_fields[0]->GetPlane(tmpId);
291  }
292  }
293 
294  // At this point, some processors may not have m_flowrateBnd set if they
295  // don't contain the appropriate boundary. To calculate the area, we
296  // integrate 1.0 over the boundary (which has been set up with the
297  // appropriate subcommunicator to avoid deadlock), and then communicate
298  // this to the other processors with an AllReduce.
299  if (m_flowrateBnd)
300  {
301  Array<OneD, NekDouble> inArea(m_flowrateBnd->GetNpoints(), 1.0);
302  m_flowrateArea = m_flowrateBnd->Integral(inArea);
303  }
305 
306  // In homogeneous case with forcing not aligned to the z-direction,
307  // redefine m_flowrateBnd so it is a 1D expansion
310  {
311  // For 3DH1D simulations with no force specified, find the mean
312  // (0th) plane.
313  Array<OneD, unsigned int> zIDs = m_fields[0]->GetZIDs();
314  m_planeID = -1;
315 
316  for (int i = 0; i < zIDs.num_elements(); ++i)
317  {
318  if (zIDs[i] == 0)
319  {
320  m_planeID = i;
321  break;
322  }
323  }
324 
325  ASSERTL1(m_planeID <= 0, "Should be either at location 0 or -1 if not "
326  "found");
327 
328  if (m_planeID != -1)
329  {
331  ->GetBndCondExpansions()[m_flowrateBndID]
332  ->GetPlane(m_planeID);
333  }
334  }
335 
336  // Set up some storage for the Stokes solution (to be stored in
337  // m_flowrateStokes) and its initial condition (inTmp), which holds the
338  // unit forcing.
339  int nqTot = m_fields[0]->GetNpoints();
340  Array<OneD, Array<OneD, NekDouble> > inTmp(m_spacedim);
341  m_flowrateStokes = Array<OneD, Array<OneD, NekDouble> >(m_spacedim);
342 
343  for (int i = 0; i < m_spacedim; ++i)
344  {
345  inTmp[i] = Array<OneD, NekDouble>(
346  nqTot, flowrateForce[i] * aii_dt);
347  m_flowrateStokes[i] = Array<OneD, NekDouble>(nqTot, 0.0);
348 
350  {
351  Array<OneD, NekDouble> inTmp2(nqTot);
352  m_fields[i]->HomogeneousFwdTrans(inTmp[i], inTmp2);
353  m_fields[i]->SetWaveSpace(true);
354  inTmp[i] = inTmp2;
355  }
356 
357  Vmath::Zero(
358  m_fields[i]->GetNcoeffs(), m_fields[i]->UpdateCoeffs(), 1);
359  }
360 
361  // Create temporary extrapolation object to avoid issues with
362  // m_extrapolation for HOPBCs using higher order timestepping schemes.
365  "Standard", m_session, m_fields, m_pressure, m_velocity,
366  m_advObject);
367 
368  // Finally, calculate the solution and the flux of the Stokes
369  // solution. We set m_greenFlux to maximum numeric limit, which signals
370  // to SolveUnsteadyStokesSystem that we don't need to apply a flowrate
371  // force.
372  m_greenFlux = numeric_limits<NekDouble>::max();
373  m_flowrateAiidt = aii_dt;
374  SolveUnsteadyStokesSystem(inTmp, m_flowrateStokes, 0.0, aii_dt);
376 
377  // If the user specified IO_FlowSteps, open a handle to store output.
378  if (m_comm->GetRank() == 0 && m_flowrateSteps &&
379  !m_flowrateStream.is_open())
380  {
381  std::string filename = m_session->GetSessionName();
382  filename += ".prs";
383  m_flowrateStream.open(filename.c_str());
384  m_flowrateStream.setf(ios::scientific, ios::floatfield);
385  m_flowrateStream << "# step time dP" << endl
386  << "# -------------------------------------------"
387  << endl;
388  }
389 
390  m_extrapolation = tmpExtrap;
391  }
NekDouble MeasureFlowrate(const Array< OneD, Array< OneD, NekDouble > > &inarray)
Measure the volumetric flow rate through the volumetric flow rate reference surface.
#define ASSERTL0(condition, msg)
Definition: ErrorUtil.hpp:216
Array< OneD, Array< OneD, NekDouble > > m_flowrateStokes
Stokes solution used to impose flowrate.
SolverUtils::AdvectionSharedPtr m_advObject
Advection term.
void SolveUnsteadyStokesSystem(const Array< OneD, const Array< OneD, NekDouble > > &inarray, Array< OneD, Array< OneD, NekDouble > > &outarray, const NekDouble time, const NekDouble a_iixDt)
ExtrapolateFactory & GetExtrapolateFactory()
Definition: Extrapolate.cpp:49
std::shared_ptr< Extrapolate > ExtrapolateSharedPtr
Definition: Extrapolate.h:59
Array< OneD, int > m_velocity
int which identifies which components of m_fields contains the velocity (u,v,w);
ExtrapolateSharedPtr m_extrapolation
LibUtilities::CommSharedPtr m_comm
Communicator.
MultiRegions::ExpListSharedPtr m_flowrateBnd
Flowrate reference surface.
NekDouble m_flowrateAiidt
Value of aii_dt used to compute Stokes flowrate solution.
std::ofstream m_flowrateStream
Output stream to record flowrate.
tBaseSharedPtr CreateInstance(tKey idKey, tParam... args)
Create an instance of the class referred to by idKey.
Definition: NekFactory.hpp:144
NekDouble m_flowrateArea
Area of the boundary through which we are measuring the flowrate.
int m_spacedim
Spatial dimension (>= expansion dim).
std::shared_ptr< Equation > EquationSharedPtr
Definition: Equation.h:131
Array< OneD, MultiRegions::ExpListSharedPtr > m_fields
Array holding all dependent variables.
LibUtilities::SessionReaderSharedPtr m_session
The session reader.
SOLVER_UTILS_EXPORT int GetNcoeffs()
int m_flowrateSteps
Interval at which to record flowrate data.
MultiRegions::ExpListSharedPtr m_pressure
Pointer to field holding pressure field.
NekDouble m_greenFlux
Flux of the Stokes function solution.
void Zero(int n, T *x, const int incx)
Zero vector.
Definition: Vmath.cpp:376
#define ASSERTL1(condition, msg)
Assert Level 1 – Debugging which is used whether in FULLDEBUG or DEBUG compilation mode...
Definition: ErrorUtil.hpp:250
int m_flowrateBndID
Boundary ID of the flowrate reference surface.
int m_planeID
Plane ID for cases with homogeneous expansion.
enum HomogeneousType m_HomogeneousType

◆ SetUpPressureForcing()

void Nektar::VelocityCorrectionScheme::SetUpPressureForcing ( const Array< OneD, const Array< OneD, NekDouble > > &  fields,
Array< OneD, Array< OneD, NekDouble > > &  Forcing,
const NekDouble  aii_Dt 
)
inline

Definition at line 70 of file VelocityCorrectionScheme.h.

References v_SetUpPressureForcing().

Referenced by SolveUnsteadyStokesSystem().

74  {
75  v_SetUpPressureForcing( fields, Forcing, aii_Dt);
76  }
virtual void v_SetUpPressureForcing(const Array< OneD, const Array< OneD, NekDouble > > &fields, Array< OneD, Array< OneD, NekDouble > > &Forcing, const NekDouble aii_Dt)

◆ SetUpSVV()

void Nektar::VelocityCorrectionScheme::SetUpSVV ( void  )
protected

Definition at line 834 of file VelocityCorrectionScheme.cpp.

References ASSERTL0, Nektar::SolverUtils::EquationSystem::eHomogeneous1D, Nektar::SolverUtils::EquationSystem::GetFunction(), Nektar::SolverUtils::EquationSystem::m_comm, Nektar::SolverUtils::EquationSystem::m_fields, Nektar::SolverUtils::EquationSystem::m_HomogeneousType, m_IsSVVPowerKernel, Nektar::IncNavierStokes::m_kinvis, Nektar::IncNavierStokes::m_nConvectiveFields, Nektar::SolverUtils::EquationSystem::m_session, m_sVVCutoffRatio, m_sVVCutoffRatioHomo1D, m_sVVDiffCoeff, m_sVVDiffCoeffHomo1D, m_svvVarDiffCoeff, m_useHomo1DSpecVanVisc, m_useSpecVanVisc, Nektar::IncNavierStokes::m_velocity, Nektar::NullNekDouble1DArray, Nektar::NullNekDoubleArrayofArray, and SVVVarDiffCoeff().

Referenced by v_InitObject().

835  {
836 
837  m_session->MatchSolverInfo("SpectralVanishingViscosity",
838  "PowerKernel", m_useSpecVanVisc, false);
839 
840  if(m_useSpecVanVisc)
841  {
842  m_useHomo1DSpecVanVisc = true;
843  }
844  else
845  {
846  m_session->MatchSolverInfo("SpectralVanishingViscositySpectralHP",
847  "PowerKernel", m_useSpecVanVisc, false);
848  }
849 
850  if(m_useSpecVanVisc)
851  {
852  m_IsSVVPowerKernel = true;
853  }
854  else
855  {
856  m_session->MatchSolverInfo("SpectralVanishingViscosity","DGKernel",
857  m_useSpecVanVisc, false);
858  if(m_useSpecVanVisc)
859  {
860  m_useHomo1DSpecVanVisc = true;
861  }
862  else
863  {
864  m_session->MatchSolverInfo("SpectralVanishingViscositySpectralHP",
865  "DGKernel", m_useSpecVanVisc, false);
866  }
867 
868  if(m_useSpecVanVisc)
869  {
870  m_IsSVVPowerKernel = false;
871  }
872  }
873 
874  //set up varcoeff kernel if PowerKernel or DG is specified
875  if(m_useSpecVanVisc)
876  {
877  Array<OneD, Array<OneD, NekDouble> > SVVVelFields = NullNekDoubleArrayofArray;
878  if(m_session->DefinesFunction("SVVVelocityMagnitude"))
879  {
880  if (m_comm->GetRank() == 0)
881  {
882  cout << "Seting up SVV velocity from "
883  "SVVVelocityMagnitude section in session file" << endl;
884  }
885  int nvel = m_velocity.num_elements();
886  int phystot = m_fields[0]->GetTotPoints();
887  SVVVelFields = Array<OneD, Array<OneD, NekDouble> >(nvel);
888  vector<string> vars;
889  for(int i = 0; i < nvel; ++i)
890  {
891  SVVVelFields[i] = Array<OneD, NekDouble>(phystot);
892  vars.push_back(m_session->GetVariable(m_velocity[i]));
893  }
894 
895  // Load up files into m_fields;
896  GetFunction("SVVVelocityMagnitude")
897  ->Evaluate(vars,SVVVelFields);
898  }
899 
900  m_svvVarDiffCoeff = Array<OneD, NekDouble>(m_fields[0]->GetNumElmts());
901  SVVVarDiffCoeff(1.0,m_svvVarDiffCoeff,SVVVelFields);
902  m_session->LoadParameter("SVVDiffCoeff", m_sVVDiffCoeff, 1.0);
903  }
904  else
905  {
907  m_session->LoadParameter("SVVDiffCoeff", m_sVVDiffCoeff, 0.1);
908  }
909 
910  // Load parameters for Spectral Vanishing Viscosity
911  if(m_useSpecVanVisc == false)
912  {
913  m_session->MatchSolverInfo("SpectralVanishingViscosity","True",
914  m_useSpecVanVisc, false);
915  if(m_useSpecVanVisc == false)
916  {
917  m_session->MatchSolverInfo("SpectralVanishingViscosity","ExpKernel",
918  m_useSpecVanVisc, false);
919  }
921 
922  if(m_useSpecVanVisc == false)
923  {
924  m_session->MatchSolverInfo("SpectralVanishingViscositySpectralHP","True",
925  m_useSpecVanVisc, false);
926  if(m_useSpecVanVisc == false)
927  {
928  m_session->MatchSolverInfo("SpectralVanishingViscositySpectralHP","ExpKernel",
929  m_useSpecVanVisc, false);
930  }
931  }
932  }
933 
934 
935  // Case of only Homo1D kernel
936  if(m_session->DefinesSolverInfo("SpectralVanishingViscosityHomo1D"))
937  {
938  m_session->MatchSolverInfo("SpectralVanishingViscosityHomo1D",
939  "True", m_useHomo1DSpecVanVisc, false);
940  if(m_useHomo1DSpecVanVisc == false)
941  {
942  m_session->MatchSolverInfo("SpectralVanishingViscosityHomo1D",
943  "ExpKernel", m_useHomo1DSpecVanVisc, false);
944  }
945  }
946 
947  m_session->LoadParameter("SVVCutoffRatio",m_sVVCutoffRatio,0.75);
948  m_session->LoadParameter("SVVCutoffRatioHomo1D",m_sVVCutoffRatioHomo1D,m_sVVCutoffRatio);
949  m_session->LoadParameter("SVVDiffCoeffHomo1D", m_sVVDiffCoeffHomo1D, m_sVVDiffCoeff);
950 
952  {
954  "Expect to have three velocity fields with homogenous expansion");
955 
957  {
958  Array<OneD, unsigned int> planes;
959  planes = m_fields[0]->GetZIDs();
960 
961  int num_planes = planes.num_elements();
962  Array<OneD, NekDouble> SVV(num_planes,0.0);
963  NekDouble fac;
964  int kmodes = m_fields[0]->GetHomogeneousBasis()->GetNumModes();
965  int pstart;
966 
967  pstart = m_sVVCutoffRatioHomo1D*kmodes;
968 
969  for(int n = 0; n < num_planes; ++n)
970  {
971  if(planes[n] > pstart)
972  {
973  fac = (NekDouble)((planes[n] - kmodes)*(planes[n] - kmodes))/
974  ((NekDouble)((planes[n] - pstart)*(planes[n] - pstart)));
975  SVV[n] = m_sVVDiffCoeffHomo1D*exp(-fac)/m_kinvis;
976  }
977  }
978 
979  for(int i = 0; i < m_velocity.num_elements(); ++i)
980  {
981  m_fields[m_velocity[i]]->SetHomo1DSpecVanVisc(SVV);
982  }
983  }
984  }
985 
986  }
#define ASSERTL0(condition, msg)
Definition: ErrorUtil.hpp:216
static Array< OneD, NekDouble > NullNekDouble1DArray
NekDouble m_kinvis
Kinematic viscosity.
Array< OneD, int > m_velocity
int which identifies which components of m_fields contains the velocity (u,v,w);
bool m_useHomo1DSpecVanVisc
bool to identify if spectral vanishing viscosity is active.
NekDouble m_sVVDiffCoeff
Diffusion coefficient of SVV modes.
bool m_IsSVVPowerKernel
Identifier for Power Kernel otherwise DG kernel.
int m_nConvectiveFields
Number of fields to be convected;.
LibUtilities::CommSharedPtr m_comm
Communicator.
double NekDouble
Array< OneD, NekDouble > m_svvVarDiffCoeff
Array of coefficient if power kernel is used in SVV.
void SVVVarDiffCoeff(const NekDouble velmag, Array< OneD, NekDouble > &diffcoeff, const Array< OneD, Array< OneD, NekDouble > > &vel=NullNekDoubleArrayofArray)
SOLVER_UTILS_EXPORT SessionFunctionSharedPtr GetFunction(std::string name, const MultiRegions::ExpListSharedPtr &field=MultiRegions::NullExpListSharedPtr, bool cache=false)
Get a SessionFunction by name.
NekDouble m_sVVCutoffRatio
cutt off ratio from which to start decayhing modes
Array< OneD, MultiRegions::ExpListSharedPtr > m_fields
Array holding all dependent variables.
bool m_useSpecVanVisc
bool to identify if spectral vanishing viscosity is active.
LibUtilities::SessionReaderSharedPtr m_session
The session reader.
NekDouble m_sVVDiffCoeffHomo1D
Diffusion coefficient of SVV modes in homogeneous 1D Direction.
static Array< OneD, Array< OneD, NekDouble > > NullNekDoubleArrayofArray
enum HomogeneousType m_HomogeneousType

◆ SetUpViscousForcing()

void Nektar::VelocityCorrectionScheme::SetUpViscousForcing ( const Array< OneD, const Array< OneD, NekDouble > > &  inarray,
Array< OneD, Array< OneD, NekDouble > > &  Forcing,
const NekDouble  aii_Dt 
)
inline

Definition at line 78 of file VelocityCorrectionScheme.h.

References v_SetUpViscousForcing().

Referenced by SolveUnsteadyStokesSystem().

82  {
83  v_SetUpViscousForcing( inarray, Forcing, aii_Dt);
84  }
virtual void v_SetUpViscousForcing(const Array< OneD, const Array< OneD, NekDouble > > &inarray, Array< OneD, Array< OneD, NekDouble > > &Forcing, const NekDouble aii_Dt)

◆ SolvePressure()

void Nektar::VelocityCorrectionScheme::SolvePressure ( const Array< OneD, NekDouble > &  Forcing)
inline

Definition at line 86 of file VelocityCorrectionScheme.h.

References v_SolvePressure().

Referenced by SolveUnsteadyStokesSystem().

87  {
88  v_SolvePressure( Forcing);
89  }
virtual void v_SolvePressure(const Array< OneD, NekDouble > &Forcing)

◆ SolveUnsteadyStokesSystem()

void Nektar::VelocityCorrectionScheme::SolveUnsteadyStokesSystem ( const Array< OneD, const Array< OneD, NekDouble > > &  inarray,
Array< OneD, Array< OneD, NekDouble > > &  outarray,
const NekDouble  time,
const NekDouble  aii_Dt 
)

Implicit part of the method - Poisson + nConv*Helmholtz

Definition at line 676 of file VelocityCorrectionScheme.cpp.

References m_alpha, Nektar::IncNavierStokes::m_extrapolation, m_F, Nektar::SolverUtils::EquationSystem::m_fields, m_flowrate, m_flowrateAiidt, m_flowrateStokes, m_greenFlux, Nektar::IncNavierStokes::m_kinvis, Nektar::SolverUtils::EquationSystem::m_spacedim, MeasureFlowrate(), SetupFlowrate(), SetUpPressureForcing(), SetUpViscousForcing(), SolvePressure(), SolveViscous(), and Vmath::Svtvp().

Referenced by SetupFlowrate(), SolveViscous(), and v_InitObject().

681  {
682  // Set up flowrate if we're starting for the first time or the value of
683  // aii_Dt has changed.
684  if (m_flowrate > 0.0 && (aii_Dt != m_flowrateAiidt))
685  {
686  SetupFlowrate(aii_Dt);
687  }
688 
689  int physTot = m_fields[0]->GetTotPoints();
690 
691  // Substep the pressure boundary condition if using substepping
692  m_extrapolation->SubStepSetPressureBCs(inarray,aii_Dt,m_kinvis);
693 
694  // Set up forcing term for pressure Poisson equation
695  SetUpPressureForcing(inarray, m_F, aii_Dt);
696 
697  // Solve Pressure System
698  SolvePressure (m_F[0]);
699 
700  // Set up forcing term for Helmholtz problems
701  SetUpViscousForcing(inarray, m_F, aii_Dt);
702 
703  // Solve velocity system
704  SolveViscous( m_F, outarray, aii_Dt);
705 
706  // Apply flowrate correction
707  if (m_flowrate > 0.0 && m_greenFlux != numeric_limits<NekDouble>::max())
708  {
709  NekDouble currentFlux = MeasureFlowrate(outarray);
710  m_alpha = (m_flowrate - currentFlux) / m_greenFlux;
711 
712  for (int i = 0; i < m_spacedim; ++i)
713  {
714  Vmath::Svtvp(physTot, m_alpha, m_flowrateStokes[i], 1,
715  outarray[i], 1, outarray[i], 1);
716  }
717  }
718  }
void SetupFlowrate(NekDouble aii_dt)
Set up the Stokes solution used to impose constant flowrate through a boundary.
NekDouble MeasureFlowrate(const Array< OneD, Array< OneD, NekDouble > > &inarray)
Measure the volumetric flow rate through the volumetric flow rate reference surface.
Array< OneD, Array< OneD, NekDouble > > m_flowrateStokes
Stokes solution used to impose flowrate.
NekDouble m_kinvis
Kinematic viscosity.
void SolvePressure(const Array< OneD, NekDouble > &Forcing)
NekDouble m_flowrate
Desired volumetric flowrate.
ExtrapolateSharedPtr m_extrapolation
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.cpp:488
void SolveViscous(const Array< OneD, const Array< OneD, NekDouble > > &Forcing, Array< OneD, Array< OneD, NekDouble > > &outarray, const NekDouble aii_Dt)
void SetUpViscousForcing(const Array< OneD, const Array< OneD, NekDouble > > &inarray, Array< OneD, Array< OneD, NekDouble > > &Forcing, const NekDouble aii_Dt)
NekDouble m_flowrateAiidt
Value of aii_dt used to compute Stokes flowrate solution.
void SetUpPressureForcing(const Array< OneD, const Array< OneD, NekDouble > > &fields, Array< OneD, Array< OneD, NekDouble > > &Forcing, const NekDouble aii_Dt)
int m_spacedim
Spatial dimension (>= expansion dim).
double NekDouble
Array< OneD, Array< OneD, NekDouble > > m_F
Array< OneD, MultiRegions::ExpListSharedPtr > m_fields
Array holding all dependent variables.
NekDouble m_alpha
Current flowrate correction.
NekDouble m_greenFlux
Flux of the Stokes function solution.

◆ SolveViscous()

void Nektar::VelocityCorrectionScheme::SolveViscous ( const Array< OneD, const Array< OneD, NekDouble > > &  Forcing,
Array< OneD, Array< OneD, NekDouble > > &  outarray,
const NekDouble  aii_Dt 
)
inline

Definition at line 91 of file VelocityCorrectionScheme.h.

References SolveUnsteadyStokesSystem(), and v_SolveViscous().

Referenced by SolveUnsteadyStokesSystem().

95  {
96  v_SolveViscous( Forcing, outarray, aii_Dt);
97  }
virtual void v_SolveViscous(const Array< OneD, const Array< OneD, NekDouble > > &Forcing, Array< OneD, Array< OneD, NekDouble > > &outarray, const NekDouble aii_Dt)

◆ SVVVarDiffCoeff()

void Nektar::VelocityCorrectionScheme::SVVVarDiffCoeff ( const NekDouble  velmag,
Array< OneD, NekDouble > &  diffcoeff,
const Array< OneD, Array< OneD, NekDouble > > &  vel = NullNekDoubleArrayofArray 
)
protected

Definition at line 988 of file VelocityCorrectionScheme.cpp.

References Vmath::Fill(), Nektar::SolverUtils::EquationSystem::m_expdim, Nektar::SolverUtils::EquationSystem::m_fields, Nektar::NullNekDoubleArrayofArray, CellMLToNektar.cellml_metadata::p, Vmath::Vmul(), Vmath::Vsqrt(), and Vmath::Vvtvp().

Referenced by SetUpSVV().

992  {
993  int phystot = m_fields[0]->GetTotPoints();
994  int nel = m_fields[0]->GetNumElmts();
995  int nvel,cnt;
996 
997  Array<OneD, NekDouble> tmp;
998 
999  Vmath::Fill(nel,velmag,diffcoeff,1);
1000 
1001  if(vel != NullNekDoubleArrayofArray)
1002  {
1003  Array<OneD, NekDouble> Velmag(phystot);
1004  nvel = vel.num_elements();
1005  // calculate magnitude of v
1006  Vmath::Vmul(phystot,vel[0],1,vel[0],1,Velmag,1);
1007  for(int n = 1; n < nvel; ++n)
1008  {
1009  Vmath::Vvtvp(phystot,vel[n],1,vel[n],1,Velmag,1,
1010  Velmag,1);
1011  }
1012  Vmath::Vsqrt(phystot,Velmag,1,Velmag,1);
1013 
1014 
1015  cnt = 0;
1016  Array<OneD, NekDouble> tmp;
1017  // calculate mean value of vel mag.
1018  for(int i = 0; i < nel; ++i)
1019  {
1020  int nq = m_fields[0]->GetExp(i)->GetTotPoints();
1021  tmp = Velmag + cnt;
1022  diffcoeff[i] = m_fields[0]->GetExp(i)->Integral(tmp);
1023  Vmath::Fill(nq,1.0,tmp,1);
1024  NekDouble area = m_fields[0]->GetExp(i)->Integral(tmp);
1025  diffcoeff[i] = diffcoeff[i]/area;
1026  cnt += nq;
1027  }
1028  }
1029  else
1030  {
1031  nvel = m_expdim;
1032  }
1033 
1034  if(m_expdim == 3)
1035  {
1037  for (int e = 0; e < nel; e++)
1038  {
1039  exp3D = m_fields[0]->GetExp(e)->as<LocalRegions::Expansion3D>();
1040  NekDouble h = 0;
1041  for(int i = 0; i < exp3D->GetNedges(); ++i)
1042  {
1043 
1044  h = max(h, exp3D->GetGeom3D()->GetEdge(i)->GetVertex(0)->dist(
1045  *(exp3D->GetGeom3D()->GetEdge(i)->GetVertex(1))));
1046  }
1047 
1048  int p = 0;
1049  for(int i = 0; i < 3; ++i)
1050  {
1051  p = max(p,exp3D->GetBasisNumModes(i)-1);
1052  }
1053 
1054  diffcoeff[e] *= h/p;
1055  }
1056  }
1057  else
1058  {
1060  for (int e = 0; e < nel; e++)
1061  {
1062  exp2D = m_fields[0]->GetExp(e)->as<LocalRegions::Expansion2D>();
1063  NekDouble h = 0;
1064  for(int i = 0; i < exp2D->GetNedges(); ++i)
1065  {
1066 
1067  h = max(h, exp2D->GetGeom2D()->GetEdge(i)->GetVertex(0)->dist(
1068  *(exp2D->GetGeom2D()->GetEdge(i)->GetVertex(1))));
1069  }
1070 
1071  int p = 0;
1072  for(int i = 0; i < 2; ++i)
1073  {
1074  p = max(p,exp2D->GetBasisNumModes(i)-1);
1075  }
1076 
1077  diffcoeff[e] *= h/p;
1078  }
1079  }
1080  }
void Vsqrt(int n, const T *x, const int incx, T *y, const int incy)
sqrt y = sqrt(x)
Definition: Vmath.cpp:411
void Fill(int n, const T alpha, T *x, const int incx)
Fill a vector with a constant value.
Definition: Vmath.cpp:45
int m_expdim
Expansion dimension.
void Vvtvp(int n, const T *w, const int incw, const T *x, const int incx, const T *y, const int incy, T *z, const int incz)
vvtvp (vector times vector plus vector): z = w*x + y
Definition: Vmath.cpp:445
std::shared_ptr< Expansion3D > Expansion3DSharedPtr
Definition: Expansion2D.h:49
double NekDouble
Array< OneD, MultiRegions::ExpListSharedPtr > m_fields
Array holding all dependent variables.
std::shared_ptr< Expansion2D > Expansion2DSharedPtr
Definition: Expansion1D.h:47
static Array< OneD, Array< OneD, NekDouble > > NullNekDoubleArrayofArray
void Vmul(int n, const T *x, const int incx, const T *y, const int incy, T *z, const int incz)
Multiply vector z = x*y.
Definition: Vmath.cpp:186

◆ v_DoInitialise()

void Nektar::VelocityCorrectionScheme::v_DoInitialise ( void  )
protectedvirtual

Sets up initial conditions.

Sets the initial conditions.

Reimplemented from Nektar::SolverUtils::UnsteadySystem.

Reimplemented in Nektar::VCSMapping.

Definition at line 561 of file VelocityCorrectionScheme.cpp.

References m_F, Nektar::SolverUtils::EquationSystem::m_fieldMetaDataMap, Nektar::SolverUtils::EquationSystem::m_fields, m_flowrateAiidt, Nektar::IncNavierStokes::m_kinvis, Nektar::IncNavierStokes::m_nConvectiveFields, Nektar::SolverUtils::EquationSystem::m_time, Nektar::SolverUtils::EquationSystem::m_timestep, Nektar::IncNavierStokes::SetBoundaryConditions(), and Nektar::SolverUtils::UnsteadySystem::v_DoInitialise().

562  {
563  m_F = Array<OneD, Array<OneD, NekDouble> > (m_nConvectiveFields);
564 
565  for (int i = 0; i < m_nConvectiveFields; ++i)
566  {
567  m_F[i] = Array< OneD, NekDouble> (m_fields[0]->GetTotPoints(), 0.0);
568  }
569 
570  m_flowrateAiidt = 0.0;
571 
573 
574  // Set up Field Meta Data for output files
575  m_fieldMetaDataMap["Kinvis"] =
576  boost::lexical_cast<std::string>(m_kinvis);
577  m_fieldMetaDataMap["TimeStep"] =
578  boost::lexical_cast<std::string>(m_timestep);
579 
580  // set boundary conditions here so that any normal component
581  // correction are imposed before they are imposed on initial
582  // field below
584 
585  for(int i = 0; i < m_nConvectiveFields; ++i)
586  {
587  m_fields[i]->LocalToGlobal();
588  m_fields[i]->ImposeDirichletConditions(m_fields[i]->UpdateCoeffs());
589  m_fields[i]->GlobalToLocal();
590  m_fields[i]->BwdTrans(m_fields[i]->GetCoeffs(),
591  m_fields[i]->UpdatePhys());
592  }
593  }
void SetBoundaryConditions(NekDouble time)
time dependent boundary conditions updating
NekDouble m_time
Current time of simulation.
NekDouble m_kinvis
Kinematic viscosity.
NekDouble m_timestep
Time step size.
int m_nConvectiveFields
Number of fields to be convected;.
NekDouble m_flowrateAiidt
Value of aii_dt used to compute Stokes flowrate solution.
LibUtilities::FieldMetaDataMap m_fieldMetaDataMap
Map to identify relevant solver info to dump in output fields.
Array< OneD, Array< OneD, NekDouble > > m_F
Array< OneD, MultiRegions::ExpListSharedPtr > m_fields
Array holding all dependent variables.
virtual SOLVER_UTILS_EXPORT void v_DoInitialise()
Sets up initial conditions.

◆ v_EvaluateAdvection_SetPressureBCs()

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

Explicit part of the method - Advection, Forcing + HOPBCs

Reimplemented in Nektar::VCSMapping.

Definition at line 647 of file VelocityCorrectionScheme.cpp.

References Nektar::IncNavierStokes::EvaluateAdvectionTerms(), Nektar::IncNavierStokes::m_extrapolation, Nektar::SolverUtils::EquationSystem::m_fields, Nektar::IncNavierStokes::m_forcing, Nektar::IncNavierStokes::m_kinvis, Nektar::IncNavierStokes::m_nConvectiveFields, Nektar::IncNavierStokes::m_pressure, and Nektar::IncNavierStokes::m_SmoothAdvection.

Referenced by EvaluateAdvection_SetPressureBCs().

651  {
652  EvaluateAdvectionTerms(inarray, outarray);
653 
654  // Smooth advection
656  {
657  for(int i = 0; i < m_nConvectiveFields; ++i)
658  {
659  m_pressure->SmoothField(outarray[i]);
660  }
661  }
662 
663  // Add forcing terms
664  for (auto &x : m_forcing)
665  {
666  x->Apply(m_fields, inarray, outarray, time);
667  }
668 
669  // Calculate High-Order pressure boundary conditions
670  m_extrapolation->EvaluatePressureBCs(inarray,outarray,m_kinvis);
671  }
NekDouble m_kinvis
Kinematic viscosity.
ExtrapolateSharedPtr m_extrapolation
void EvaluateAdvectionTerms(const Array< OneD, const Array< OneD, NekDouble > > &inarray, Array< OneD, Array< OneD, NekDouble > > &outarray)
int m_nConvectiveFields
Number of fields to be convected;.
std::vector< SolverUtils::ForcingSharedPtr > m_forcing
Forcing terms.
bool m_SmoothAdvection
bool to identify if advection term smoothing is requested
Array< OneD, MultiRegions::ExpListSharedPtr > m_fields
Array holding all dependent variables.
MultiRegions::ExpListSharedPtr m_pressure
Pointer to field holding pressure field.

◆ v_GenerateSummary()

void Nektar::VelocityCorrectionScheme::v_GenerateSummary ( SolverUtils::SummaryList s)
protectedvirtual

Print a summary of time stepping parameters.

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

Reimplemented from Nektar::SolverUtils::UnsteadySystem.

Reimplemented in Nektar::VCSWeakPressure.

Definition at line 487 of file VelocityCorrectionScheme.cpp.

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

488  {
491  "Splitting Scheme", "Velocity correction (strong press. form)");
492 
493  if (m_extrapolation->GetSubStepIntegrationMethod() !=
495  {
496  SolverUtils::AddSummaryItem(s, "Substepping",
498  m_extrapolation->GetSubStepIntegrationMethod()]);
499  }
500 
501  string dealias = m_homogen_dealiasing ? "Homogeneous1D" : "";
503  {
504  dealias += (dealias == "" ? "" : " + ") + string("spectral/hp");
505  }
506  if (dealias != "")
507  {
508  SolverUtils::AddSummaryItem(s, "Dealiasing", dealias);
509  }
510 
511 
512  string smoothing = m_useSpecVanVisc ? "spectral/hp" : "";
513  if (smoothing != "")
514  {
516  {
518  s, "Smoothing-SpecHP", "SVV (" + smoothing +
519  " Exp Kernel(cut-off = "
520  + boost::lexical_cast<string>(m_sVVCutoffRatio)
521  + ", diff coeff = "
522  + boost::lexical_cast<string>(m_sVVDiffCoeff)+"))");
523  }
524  else
525  {
527  {
529  s, "Smoothing-SpecHP", "SVV (" + smoothing +
530  " Power Kernel (Power ratio ="
531  + boost::lexical_cast<string>(m_sVVCutoffRatio)
532  + ", diff coeff = "
533  + boost::lexical_cast<string>(m_sVVDiffCoeff)+"*Uh/p))");
534  }
535  else
536  {
538  s, "Smoothing-SpecHP", "SVV (" + smoothing +
539  " DG Kernel (diff coeff = "
540  + boost::lexical_cast<string>(m_sVVDiffCoeff)+"*Uh/p))");
541 
542  }
543  }
544 
545  }
546 
548  {
550  s, "Smoothing-Homo1D", "SVV (Homogeneous1D - Exp Kernel(cut-off = "
551  + boost::lexical_cast<string>(m_sVVCutoffRatioHomo1D)
552  + ", diff coeff = "
553  + boost::lexical_cast<string>(m_sVVDiffCoeffHomo1D)+"))");
554  }
555 
556  }
static Array< OneD, NekDouble > NullNekDouble1DArray
bool m_useHomo1DSpecVanVisc
bool to identify if spectral vanishing viscosity is active.
NekDouble m_sVVDiffCoeff
Diffusion coefficient of SVV modes.
bool m_IsSVVPowerKernel
Identifier for Power Kernel otherwise DG kernel.
ExtrapolateSharedPtr m_extrapolation
bool m_specHP_dealiasing
Flag to determine if dealisising is usde for the Spectral/hp element discretisation.
const char *const TimeIntegrationMethodMap[]
virtual SOLVER_UTILS_EXPORT void v_GenerateSummary(SummaryList &s)
Print a summary of time stepping parameters.
void AddSummaryItem(SummaryList &l, const std::string &name, const std::string &value)
Adds a summary item to the summary info list.
Definition: Misc.cpp:49
Array< OneD, NekDouble > m_svvVarDiffCoeff
Array of coefficient if power kernel is used in SVV.
bool m_homogen_dealiasing
Flag to determine if dealiasing is used for homogeneous simulations.
NekDouble m_sVVCutoffRatio
cutt off ratio from which to start decayhing modes
bool m_useSpecVanVisc
bool to identify if spectral vanishing viscosity is active.
NekDouble m_sVVDiffCoeffHomo1D
Diffusion coefficient of SVV modes in homogeneous 1D Direction.
enum HomogeneousType m_HomogeneousType

◆ v_GetExtrapolateStr()

virtual std::string Nektar::VelocityCorrectionScheme::v_GetExtrapolateStr ( void  )
inlineprotectedvirtual

Reimplemented in Nektar::VCSWeakPressure.

Definition at line 206 of file VelocityCorrectionScheme.h.

Referenced by SetUpExtrapolation().

207  {
208  return "Standard";
209  }

◆ v_GetForceDimension()

int Nektar::VelocityCorrectionScheme::v_GetForceDimension ( void  )
protectedvirtual

Implements Nektar::IncNavierStokes.

Definition at line 639 of file VelocityCorrectionScheme.cpp.

References Nektar::SolverUtils::EquationSystem::m_session.

640  {
641  return m_session->GetVariables().size() - 1;
642  }
LibUtilities::SessionReaderSharedPtr m_session
The session reader.

◆ v_GetSubSteppingExtrapolateStr()

virtual std::string Nektar::VelocityCorrectionScheme::v_GetSubSteppingExtrapolateStr ( const std::string &  instr)
inlineprotectedvirtual

Reimplemented in Nektar::VCSWeakPressure.

Definition at line 211 of file VelocityCorrectionScheme.h.

Referenced by SetUpExtrapolation().

213  {
214  return instr;
215  }

◆ v_GetSystemSingularChecks()

Array< OneD, bool > Nektar::VelocityCorrectionScheme::v_GetSystemSingularChecks ( )
protectedvirtual

Reimplemented from Nektar::SolverUtils::EquationSystem.

Definition at line 628 of file VelocityCorrectionScheme.cpp.

References Nektar::SolverUtils::EquationSystem::m_session.

629  {
630  int vVar = m_session->GetVariables().size();
631  Array<OneD, bool> vChecks(vVar, false);
632  vChecks[vVar-1] = true;
633  return vChecks;
634  }
LibUtilities::SessionReaderSharedPtr m_session
The session reader.

◆ v_InitObject()

void Nektar::VelocityCorrectionScheme::v_InitObject ( )
virtual

Init object for UnsteadySystem class.

Initialization object for UnsteadySystem class.

Reimplemented from Nektar::IncNavierStokes.

Reimplemented in Nektar::VCSMapping.

Definition at line 70 of file VelocityCorrectionScheme.cpp.

References ASSERTL0, Nektar::LibUtilities::TimeIntegrationSchemeOperators::DefineImplicitSolve(), Nektar::LibUtilities::TimeIntegrationSchemeOperators::DefineOdeRhs(), EvaluateAdvection_SetPressureBCs(), m_diffCoeff, Nektar::SolverUtils::UnsteadySystem::m_explicitDiffusion, Nektar::SolverUtils::EquationSystem::m_fields, m_flowrate, m_flowrateSteps, Nektar::SolverUtils::UnsteadySystem::m_intVariables, Nektar::IncNavierStokes::m_kinvis, Nektar::IncNavierStokes::m_nConvectiveFields, Nektar::SolverUtils::UnsteadySystem::m_ode, Nektar::IncNavierStokes::m_pressure, Nektar::SolverUtils::EquationSystem::m_session, Nektar::IncNavierStokes::m_SmoothAdvection, SetUpExtrapolation(), SetUpSVV(), SolveUnsteadyStokesSystem(), and Nektar::IncNavierStokes::v_InitObject().

Referenced by Nektar::VCSMapping::v_InitObject().

71  {
72  int n;
73 
75  m_explicitDiffusion = false;
76 
77  // Set m_pressure to point to last field of m_fields;
78  if (boost::iequals(m_session->GetVariable(m_fields.num_elements()-1), "p"))
79  {
80  m_nConvectiveFields = m_fields.num_elements()-1;
82  }
83  else
84  {
85  ASSERTL0(false,"Need to set up pressure field definition");
86  }
87 
88  // Determine diffusion coefficients for each field
89  m_diffCoeff = Array<OneD, NekDouble> (m_nConvectiveFields, m_kinvis);
90  for (n = 0; n < m_nConvectiveFields; ++n)
91  {
92  std::string varName = m_session->GetVariable(n);
93  if ( m_session->DefinesFunction("DiffusionCoefficient", varName))
94  {
96  = m_session->GetFunction("DiffusionCoefficient", varName);
97  m_diffCoeff[n] = ffunc->Evaluate();
98  }
99  }
100 
101  // Integrate only the convective fields
102  for (n = 0; n < m_nConvectiveFields; ++n)
103  {
104  m_intVariables.push_back(n);
105  }
106 
108  SetUpSVV();
109 
110  m_session->MatchSolverInfo("SmoothAdvection", "True",
111  m_SmoothAdvection, false);
112 
113  // set explicit time-intregration class operators
116 
117  // set implicit time-intregration class operators
120 
121  // Set up bits for flowrate.
122  m_session->LoadParameter("Flowrate", m_flowrate, 0.0);
123  m_session->LoadParameter("IO_FlowSteps", m_flowrateSteps, 0);
124  }
#define ASSERTL0(condition, msg)
Definition: ErrorUtil.hpp:216
void EvaluateAdvection_SetPressureBCs(const Array< OneD, const Array< OneD, NekDouble > > &inarray, Array< OneD, Array< OneD, NekDouble > > &outarray, const NekDouble time)
void SolveUnsteadyStokesSystem(const Array< OneD, const Array< OneD, NekDouble > > &inarray, Array< OneD, Array< OneD, NekDouble > > &outarray, const NekDouble time, const NekDouble a_iixDt)
bool m_explicitDiffusion
Indicates if explicit or implicit treatment of diffusion is used.
NekDouble m_kinvis
Kinematic viscosity.
void DefineImplicitSolve(FuncPointerT func, ObjectPointerT obj)
NekDouble m_flowrate
Desired volumetric flowrate.
LibUtilities::TimeIntegrationSchemeOperators m_ode
The time integration scheme operators to use.
int m_nConvectiveFields
Number of fields to be convected;.
void DefineOdeRhs(FuncPointerT func, ObjectPointerT obj)
bool m_SmoothAdvection
bool to identify if advection term smoothing is requested
std::shared_ptr< Equation > EquationSharedPtr
Definition: Equation.h:131
Array< OneD, MultiRegions::ExpListSharedPtr > m_fields
Array holding all dependent variables.
LibUtilities::SessionReaderSharedPtr m_session
The session reader.
Array< OneD, NekDouble > m_diffCoeff
Diffusion coefficients (will be kinvis for velocities)
int m_flowrateSteps
Interval at which to record flowrate data.
MultiRegions::ExpListSharedPtr m_pressure
Pointer to field holding pressure field.
virtual void v_InitObject()
Init object for UnsteadySystem class.

◆ v_PostIntegrate()

bool Nektar::VelocityCorrectionScheme::v_PostIntegrate ( int  step)
protectedvirtual

Reimplemented from Nektar::SolverUtils::AdvectionSystem.

Definition at line 462 of file VelocityCorrectionScheme.cpp.

References m_alpha, Nektar::SolverUtils::EquationSystem::m_comm, m_flowrateSteps, m_flowrateStream, Nektar::SolverUtils::EquationSystem::m_time, and Nektar::SolverUtils::AdvectionSystem::v_PostIntegrate().

463  {
464  if (m_flowrateSteps > 0)
465  {
466  if (m_comm->GetRank() == 0 && (step + 1) % m_flowrateSteps == 0)
467  {
468  m_flowrateStream << setw(8) << step << setw(16) << m_time
469  << setw(16) << m_alpha << endl;
470  }
471  }
472 
474  }
NekDouble m_time
Current time of simulation.
LibUtilities::CommSharedPtr m_comm
Communicator.
std::ofstream m_flowrateStream
Output stream to record flowrate.
virtual SOLVER_UTILS_EXPORT bool v_PostIntegrate(int step)
int m_flowrateSteps
Interval at which to record flowrate data.
NekDouble m_alpha
Current flowrate correction.

◆ v_RequireFwdTrans()

virtual bool Nektar::VelocityCorrectionScheme::v_RequireFwdTrans ( )
inlineprotectedvirtual

Reimplemented from Nektar::SolverUtils::UnsteadySystem.

Definition at line 201 of file VelocityCorrectionScheme.h.

202  {
203  return false || m_flowrate > 0.0;
204  }
NekDouble m_flowrate
Desired volumetric flowrate.

◆ v_SetUpPressureForcing()

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

Forcing term for Poisson solver solver

Reimplemented in Nektar::VCSMapping, and Nektar::VCSWeakPressure.

Definition at line 723 of file VelocityCorrectionScheme.cpp.

References Nektar::MultiRegions::DirCartesianMap, Nektar::MultiRegions::eX, Nektar::SolverUtils::EquationSystem::m_fields, Nektar::IncNavierStokes::m_velocity, Vmath::Smul(), and Vmath::Vadd().

Referenced by SetUpPressureForcing(), and Nektar::VCSMapping::v_SetUpPressureForcing().

727  {
728  int i;
729  int physTot = m_fields[0]->GetTotPoints();
730  int nvel = m_velocity.num_elements();
731 
732  m_fields[0]->PhysDeriv(eX,fields[0], Forcing[0]);
733 
734  for(i = 1; i < nvel; ++i)
735  {
736  // Use Forcing[1] as storage since it is not needed for the pressure
737  m_fields[i]->PhysDeriv(DirCartesianMap[i],fields[i],Forcing[1]);
738  Vmath::Vadd(physTot,Forcing[1],1,Forcing[0],1,Forcing[0],1);
739  }
740 
741  Vmath::Smul(physTot,1.0/aii_Dt,Forcing[0],1,Forcing[0],1);
742  }
Array< OneD, int > m_velocity
int which identifies which components of m_fields contains the velocity (u,v,w);
void Smul(int n, const T alpha, const T *x, const int incx, T *y, const int incy)
Scalar multiply y = alpha*y.
Definition: Vmath.cpp:216
MultiRegions::Direction const DirCartesianMap[]
Definition: ExpList.h:88
Array< OneD, MultiRegions::ExpListSharedPtr > m_fields
Array holding all dependent variables.
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.cpp:302

◆ v_SetUpViscousForcing()

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

Forcing term for Helmholtz solver

Reimplemented in Nektar::VCSMapping.

Definition at line 747 of file VelocityCorrectionScheme.cpp.

References Blas::Daxpy(), Blas::Dscal(), m_diffCoeff, Nektar::SolverUtils::EquationSystem::m_fields, Nektar::IncNavierStokes::m_nConvectiveFields, Nektar::IncNavierStokes::m_pressure, Nektar::IncNavierStokes::m_velocity, and Vmath::Zero().

Referenced by SetUpViscousForcing().

751  {
752  NekDouble aii_dtinv = 1.0/aii_Dt;
753  int phystot = m_fields[0]->GetTotPoints();
754 
755  // Grad p
756  m_pressure->BwdTrans(m_pressure->GetCoeffs(),m_pressure->UpdatePhys());
757 
758  int nvel = m_velocity.num_elements();
759  if(nvel == 2)
760  {
761  m_pressure->PhysDeriv(m_pressure->GetPhys(),
762  Forcing[m_velocity[0]],
763  Forcing[m_velocity[1]]);
764  }
765  else
766  {
767  m_pressure->PhysDeriv(m_pressure->GetPhys(),
768  Forcing[m_velocity[0]],
769  Forcing[m_velocity[1]],
770  Forcing[m_velocity[2]]);
771  }
772 
773  // zero convective fields.
774  for(int i = nvel; i < m_nConvectiveFields; ++i)
775  {
776  Vmath::Zero(phystot,Forcing[i],1);
777  }
778 
779  // Subtract inarray/(aii_dt) and divide by kinvis. Kinvis will
780  // need to be updated for the convected fields.
781  for(int i = 0; i < m_nConvectiveFields; ++i)
782  {
783  Blas::Daxpy(phystot,-aii_dtinv,inarray[i],1,Forcing[i],1);
784  Blas::Dscal(phystot,1.0/m_diffCoeff[i],&(Forcing[i])[0],1);
785  }
786  }
Array< OneD, int > m_velocity
int which identifies which components of m_fields contains the velocity (u,v,w);
int m_nConvectiveFields
Number of fields to be convected;.
double NekDouble
static void Dscal(const int &n, const double &alpha, double *x, const int &incx)
BLAS level 1: x = alpha x.
Definition: Blas.hpp:125
Array< OneD, MultiRegions::ExpListSharedPtr > m_fields
Array holding all dependent variables.
Array< OneD, NekDouble > m_diffCoeff
Diffusion coefficients (will be kinvis for velocities)
MultiRegions::ExpListSharedPtr m_pressure
Pointer to field holding pressure field.
void Zero(int n, T *x, const int incx)
Zero vector.
Definition: Vmath.cpp:376
static void Daxpy(const int &n, const double &alpha, const double *x, const int &incx, const double *y, const int &incy)
BLAS level 1: y = alpha x plus y.
Definition: Blas.hpp:110

◆ v_SolvePressure()

void Nektar::VelocityCorrectionScheme::v_SolvePressure ( const Array< OneD, NekDouble > &  Forcing)
protectedvirtual

Solve pressure system

Reimplemented in Nektar::VCSMapping, and Nektar::VCSWeakPressure.

Definition at line 792 of file VelocityCorrectionScheme.cpp.

References Nektar::StdRegions::eFactorLambda, Nektar::IncNavierStokes::m_extrapolation, Nektar::IncNavierStokes::m_kinvis, Nektar::IncNavierStokes::m_pressure, and Nektar::NullFlagList.

Referenced by SolvePressure(), and Nektar::VCSMapping::v_SolvePressure().

794  {
796  // Setup coefficient for equation
797  factors[StdRegions::eFactorLambda] = 0.0;
798 
799  // Solver Pressure Poisson Equation
800  m_pressure->HelmSolve(Forcing, m_pressure->UpdateCoeffs(),
801  NullFlagList, factors);
802 
803  // Add presure to outflow bc if using convective like BCs
804  m_extrapolation->AddPressureToOutflowBCs(m_kinvis);
805  }
NekDouble m_kinvis
Kinematic viscosity.
ExtrapolateSharedPtr m_extrapolation
std::map< ConstFactorType, NekDouble > ConstFactorMap
Definition: StdRegions.hpp:294
MultiRegions::ExpListSharedPtr m_pressure
Pointer to field holding pressure field.
static FlagList NullFlagList
An empty flag list.

◆ v_SolveViscous()

void Nektar::VelocityCorrectionScheme::v_SolveViscous ( const Array< OneD, const Array< OneD, NekDouble > > &  Forcing,
Array< OneD, Array< OneD, NekDouble > > &  outarray,
const NekDouble  aii_Dt 
)
protectedvirtual

Solve velocity system

Reimplemented in Nektar::VCSMapping.

Definition at line 810 of file VelocityCorrectionScheme.cpp.

References AppendSVVFactors(), Nektar::StdRegions::eFactorLambda, m_diffCoeff, Nektar::SolverUtils::EquationSystem::m_fields, Nektar::IncNavierStokes::m_nConvectiveFields, Nektar::NullFlagList, Nektar::StdRegions::NullVarCoeffMap, and Nektar::MultiRegions::NullVarFactorsMap.

Referenced by SolveViscous(), and Nektar::VCSMapping::v_SolveViscous().

814  {
817  MultiRegions::VarFactorsMap varFactorsMap =
819 
820  AppendSVVFactors(factors,varFactorsMap);
821 
822  // Solve Helmholtz system and put in Physical space
823  for(int i = 0; i < m_nConvectiveFields; ++i)
824  {
825  // Setup coefficients for equation
826  factors[StdRegions::eFactorLambda] = 1.0/aii_Dt/m_diffCoeff[i];
827  m_fields[i]->HelmSolve(Forcing[i], m_fields[i]->UpdateCoeffs(),
828  NullFlagList, factors, varCoeffMap,
829  varFactorsMap);
830  m_fields[i]->BwdTrans(m_fields[i]->GetCoeffs(),outarray[i]);
831  }
832  }
static VarFactorsMap NullVarFactorsMap
std::map< ConstFactorType, NekDouble > ConstFactorMap
Definition: StdRegions.hpp:294
int m_nConvectiveFields
Number of fields to be convected;.
std::map< StdRegions::VarCoeffType, Array< OneD, NekDouble > > VarCoeffMap
Definition: StdRegions.hpp:264
Array< OneD, MultiRegions::ExpListSharedPtr > m_fields
Array holding all dependent variables.
Array< OneD, NekDouble > m_diffCoeff
Diffusion coefficients (will be kinvis for velocities)
void AppendSVVFactors(StdRegions::ConstFactorMap &factors, MultiRegions::VarFactorsMap &varFactorsMap)
static FlagList NullFlagList
An empty flag list.
static VarCoeffMap NullVarCoeffMap
Definition: StdRegions.hpp:265
std::map< StdRegions::ConstFactorType, Array< OneD, NekDouble > > VarFactorsMap

◆ v_TransCoeffToPhys()

void Nektar::VelocityCorrectionScheme::v_TransCoeffToPhys ( void  )
protectedvirtual

Virtual function for transformation to physical space.

Reimplemented from Nektar::IncNavierStokes.

Definition at line 599 of file VelocityCorrectionScheme.cpp.

References Nektar::SolverUtils::EquationSystem::m_fields.

600  {
601  int nfields = m_fields.num_elements() - 1;
602  for (int k=0 ; k < nfields; ++k)
603  {
604  //Backward Transformation in physical space for time evolution
605  m_fields[k]->BwdTrans_IterPerExp(m_fields[k]->GetCoeffs(),
606  m_fields[k]->UpdatePhys());
607  }
608  }
Array< OneD, MultiRegions::ExpListSharedPtr > m_fields
Array holding all dependent variables.

◆ v_TransPhysToCoeff()

void Nektar::VelocityCorrectionScheme::v_TransPhysToCoeff ( void  )
protectedvirtual

Virtual function for transformation to coefficient space.

Reimplemented from Nektar::IncNavierStokes.

Definition at line 613 of file VelocityCorrectionScheme.cpp.

References Nektar::SolverUtils::EquationSystem::m_fields.

614  {
615 
616  int nfields = m_fields.num_elements() - 1;
617  for (int k=0 ; k < nfields; ++k)
618  {
619  //Forward Transformation in physical space for time evolution
620  m_fields[k]->FwdTrans_IterPerExp(m_fields[k]->GetPhys(),
621  m_fields[k]->UpdateCoeffs());
622  }
623  }
Array< OneD, MultiRegions::ExpListSharedPtr > m_fields
Array holding all dependent variables.

Member Data Documentation

◆ className

string Nektar::VelocityCorrectionScheme::className
static
Initial value:

Name of class.

Definition at line 59 of file VelocityCorrectionScheme.h.

◆ m_alpha

NekDouble Nektar::VelocityCorrectionScheme::m_alpha
protected

Current flowrate correction.

Definition at line 144 of file VelocityCorrectionScheme.h.

Referenced by SolveUnsteadyStokesSystem(), and v_PostIntegrate().

◆ m_diffCoeff

Array<OneD, NekDouble> Nektar::VelocityCorrectionScheme::m_diffCoeff
protected

Diffusion coefficients (will be kinvis for velocities)

Definition at line 130 of file VelocityCorrectionScheme.h.

Referenced by v_InitObject(), v_SetUpViscousForcing(), and v_SolveViscous().

◆ m_F

Array<OneD, Array< OneD, NekDouble> > Nektar::VelocityCorrectionScheme::m_F
protected

◆ m_flowrate

NekDouble Nektar::VelocityCorrectionScheme::m_flowrate
protected

Desired volumetric flowrate.

Definition at line 136 of file VelocityCorrectionScheme.h.

Referenced by SolveUnsteadyStokesSystem(), and v_InitObject().

◆ m_flowrateAiidt

NekDouble Nektar::VelocityCorrectionScheme::m_flowrateAiidt
protected

Value of aii_dt used to compute Stokes flowrate solution.

Definition at line 158 of file VelocityCorrectionScheme.h.

Referenced by SetupFlowrate(), SolveUnsteadyStokesSystem(), and v_DoInitialise().

◆ m_flowrateArea

NekDouble Nektar::VelocityCorrectionScheme::m_flowrateArea
protected

Area of the boundary through which we are measuring the flowrate.

Definition at line 138 of file VelocityCorrectionScheme.h.

Referenced by MeasureFlowrate(), and SetupFlowrate().

◆ m_flowrateBnd

MultiRegions::ExpListSharedPtr Nektar::VelocityCorrectionScheme::m_flowrateBnd
protected

Flowrate reference surface.

Definition at line 150 of file VelocityCorrectionScheme.h.

Referenced by MeasureFlowrate(), and SetupFlowrate().

◆ m_flowrateBndID

int Nektar::VelocityCorrectionScheme::m_flowrateBndID
protected

Boundary ID of the flowrate reference surface.

Definition at line 146 of file VelocityCorrectionScheme.h.

Referenced by MeasureFlowrate(), and SetupFlowrate().

◆ m_flowrateSteps

int Nektar::VelocityCorrectionScheme::m_flowrateSteps
protected

Interval at which to record flowrate data.

Definition at line 156 of file VelocityCorrectionScheme.h.

Referenced by SetupFlowrate(), v_InitObject(), and v_PostIntegrate().

◆ m_flowrateStokes

Array<OneD, Array<OneD, NekDouble> > Nektar::VelocityCorrectionScheme::m_flowrateStokes
protected

Stokes solution used to impose flowrate.

Definition at line 152 of file VelocityCorrectionScheme.h.

Referenced by SetupFlowrate(), and SolveUnsteadyStokesSystem().

◆ m_flowrateStream

std::ofstream Nektar::VelocityCorrectionScheme::m_flowrateStream
protected

Output stream to record flowrate.

Definition at line 154 of file VelocityCorrectionScheme.h.

Referenced by SetupFlowrate(), and v_PostIntegrate().

◆ m_greenFlux

NekDouble Nektar::VelocityCorrectionScheme::m_greenFlux
protected

Flux of the Stokes function solution.

Definition at line 142 of file VelocityCorrectionScheme.h.

Referenced by SetupFlowrate(), and SolveUnsteadyStokesSystem().

◆ m_homd1DFlowinPlane

bool Nektar::VelocityCorrectionScheme::m_homd1DFlowinPlane
protected

Definition at line 140 of file VelocityCorrectionScheme.h.

Referenced by MeasureFlowrate(), and SetupFlowrate().

◆ m_IsSVVPowerKernel

bool Nektar::VelocityCorrectionScheme::m_IsSVVPowerKernel
protected

Identifier for Power Kernel otherwise DG kernel.

Definition at line 128 of file VelocityCorrectionScheme.h.

Referenced by AppendSVVFactors(), SetUpSVV(), and v_GenerateSummary().

◆ m_planeID

int Nektar::VelocityCorrectionScheme::m_planeID
protected

Plane ID for cases with homogeneous expansion.

Definition at line 148 of file VelocityCorrectionScheme.h.

Referenced by MeasureFlowrate(), and SetupFlowrate().

◆ m_sVVCutoffRatio

NekDouble Nektar::VelocityCorrectionScheme::m_sVVCutoffRatio
protected

cutt off ratio from which to start decayhing modes

Definition at line 119 of file VelocityCorrectionScheme.h.

Referenced by AppendSVVFactors(), SetUpSVV(), Nektar::VCSWeakPressure::v_GenerateSummary(), v_GenerateSummary(), and Nektar::VCSMapping::v_SolveViscous().

◆ m_sVVCutoffRatioHomo1D

NekDouble Nektar::VelocityCorrectionScheme::m_sVVCutoffRatioHomo1D
protected

Definition at line 122 of file VelocityCorrectionScheme.h.

Referenced by SetUpSVV(), and v_GenerateSummary().

◆ m_sVVDiffCoeff

NekDouble Nektar::VelocityCorrectionScheme::m_sVVDiffCoeff
protected

◆ m_sVVDiffCoeffHomo1D

NekDouble Nektar::VelocityCorrectionScheme::m_sVVDiffCoeffHomo1D
protected

Diffusion coefficient of SVV modes in homogeneous 1D Direction.

Definition at line 124 of file VelocityCorrectionScheme.h.

Referenced by SetUpSVV(), and v_GenerateSummary().

◆ m_svvVarDiffCoeff

Array<OneD, NekDouble> Nektar::VelocityCorrectionScheme::m_svvVarDiffCoeff
protected

Array of coefficient if power kernel is used in SVV.

Definition at line 126 of file VelocityCorrectionScheme.h.

Referenced by AppendSVVFactors(), SetUpSVV(), and v_GenerateSummary().

◆ m_useHomo1DSpecVanVisc

bool Nektar::VelocityCorrectionScheme::m_useHomo1DSpecVanVisc
protected

bool to identify if spectral vanishing viscosity is active.

Definition at line 115 of file VelocityCorrectionScheme.h.

Referenced by SetUpSVV(), Nektar::VCSWeakPressure::v_GenerateSummary(), and v_GenerateSummary().

◆ m_useSpecVanVisc

bool Nektar::VelocityCorrectionScheme::m_useSpecVanVisc
protected

bool to identify if spectral vanishing viscosity is active.

Definition at line 117 of file VelocityCorrectionScheme.h.

Referenced by AppendSVVFactors(), SetUpSVV(), Nektar::VCSWeakPressure::v_GenerateSummary(), v_GenerateSummary(), and Nektar::VCSMapping::v_SolveViscous().

◆ m_varCoeffLap

StdRegions::VarCoeffMap Nektar::VelocityCorrectionScheme::m_varCoeffLap
protected

Variable Coefficient map for the Laplacian which can be activated as part of SVV or otherwise.

Definition at line 133 of file VelocityCorrectionScheme.h.