Nektar++
Public Member Functions | Protected Member Functions | Protected Attributes | Static Protected Attributes | List of all members
Nektar::IncNavierStokes Class Referenceabstract

This class is the base class for Navier Stokes problems. More...

#include <IncNavierStokes.h>

Inheritance diagram for Nektar::IncNavierStokes:
[legend]

Public Member Functions

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 Member Functions

 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
 
- Protected Member Functions inherited from Nektar::SolverUtils::AdvectionSystem
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

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 eqTypeLookupIds []
 
- Static Protected Attributes inherited from Nektar::SolverUtils::EquationSystem
static std::string equationSystemTypeLookupIds []
 
static std::string projectionTypeLookupIds []
 

Additional Inherited Members

- Static Public Attributes inherited from Nektar::SolverUtils::UnsteadySystem
static std::string cmdSetStartTime
 
static std::string cmdSetStartChkNum
 
- Protected Types inherited from Nektar::SolverUtils::EquationSystem
enum  HomogeneousType { eHomogeneous1D , eHomogeneous2D , eHomogeneous3D , eNotHomogeneous }
 Parameter for homogeneous expansions. More...
 

Detailed Description

This class is the base class for Navier Stokes problems.

Definition at line 146 of file IncNavierStokes.h.

Constructor & Destructor Documentation

◆ IncNavierStokes()

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

Constructor.

Constructor. Creates ...

Parameters

param

Definition at line 81 of file IncNavierStokes.cpp.

84 : UnsteadySystem(pSession, pGraph), AdvectionSystem(pSession, pGraph),
86{
87}
bool m_SmoothAdvection
bool to identify if advection term smoothing is requested
SOLVER_UTILS_EXPORT AdvectionSystem(const LibUtilities::SessionReaderSharedPtr &pSession, const SpatialDomains::MeshGraphSharedPtr &pGraph)
SOLVER_UTILS_EXPORT UnsteadySystem(const LibUtilities::SessionReaderSharedPtr &pSession, const SpatialDomains::MeshGraphSharedPtr &pGraph)
Initialises UnsteadySystem class members.

◆ ~IncNavierStokes()

Nektar::IncNavierStokes::~IncNavierStokes ( )
overrideprotecteddefault

Member Function Documentation

◆ AddForcing()

void Nektar::IncNavierStokes::AddForcing ( const SolverUtils::ForcingSharedPtr pForce)

Add an additional forcing term programmatically.

Definition at line 801 of file IncNavierStokes.cpp.

802{
803 m_forcing.push_back(pForce);
804}
std::vector< SolverUtils::ForcingSharedPtr > m_forcing
Forcing terms.

References m_forcing.

Referenced by Nektar::VortexWaveInteraction::ExecuteRoll().

◆ DefinedForcing()

bool Nektar::IncNavierStokes::DefinedForcing ( const std::string &  sForce)

Function to check the type of forcing

Definition at line 985 of file IncNavierStokes.cpp.

986{
987 std::vector<std::string> vForceList;
988 bool hasForce{false};
989
990 if (!m_session->DefinesElement("Nektar/Forcing"))
991 {
992 return hasForce;
993 }
994
995 TiXmlElement *vForcing = m_session->GetElement("Nektar/Forcing");
996 if (vForcing)
997 {
998 TiXmlElement *vForce = vForcing->FirstChildElement("FORCE");
999 while (vForce)
1000 {
1001 std::string vType = vForce->Attribute("TYPE");
1002
1003 vForceList.push_back(vType);
1004 vForce = vForce->NextSiblingElement("FORCE");
1005 }
1006 }
1007
1008 for (auto &f : vForceList)
1009 {
1010 if (boost::iequals(f, sForce))
1011 {
1012 hasForce = true;
1013 }
1014 }
1015
1016 return hasForce;
1017}
LibUtilities::SessionReaderSharedPtr m_session
The session reader.

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

Referenced by v_InitObject().

◆ EvaluateAdvectionTerms()

void Nektar::IncNavierStokes::EvaluateAdvectionTerms ( const Array< OneD, const Array< OneD, NekDouble > > &  inarray,
Array< OneD, Array< OneD, NekDouble > > &  outarray,
const NekDouble  time 
)
protected

Evaluation -N(V) for all fields except pressure using m_velocity

Definition at line 298 of file IncNavierStokes.cpp.

301{
302 size_t VelDim = m_velocity.size();
303 Array<OneD, Array<OneD, NekDouble>> velocity(VelDim);
304
305 size_t npoints = m_fields[0]->GetNpoints();
306 for (size_t i = 0; i < VelDim; ++i)
307 {
308 velocity[i] = Array<OneD, NekDouble>(npoints);
309 Vmath::Vcopy(npoints, inarray[m_velocity[i]], 1, velocity[i], 1);
310 }
311 for (auto &x : m_forcing)
312 {
313 x->PreApply(m_fields, velocity, velocity, time);
314 }
315
316 m_advObject->Advect(m_nConvectiveFields, m_fields, velocity, inarray,
317 outarray, time);
318}
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;.
SolverUtils::AdvectionSharedPtr m_advObject
Advection term.
Array< OneD, MultiRegions::ExpListSharedPtr > m_fields
Array holding all dependent variables.
void Vcopy(int n, const T *x, const int incx, T *y, const int incy)
Definition: Vmath.hpp:825

References Nektar::SolverUtils::AdvectionSystem::m_advObject, Nektar::SolverUtils::EquationSystem::m_fields, m_forcing, m_nConvectiveFields, m_velocity, and Vmath::Vcopy().

Referenced by Nektar::CoupledLinearNS::EvaluateAdvection(), Nektar::CoupledLinearNS::EvaluateNewtonRHS(), Nektar::VelocityCorrectionScheme::v_EvaluateAdvection_SetPressureBCs(), Nektar::VCSMapping::v_EvaluateAdvection_SetPressureBCs(), and Nektar::VCSImplicit::v_EvaluateAdvection_SetPressureBCs().

◆ GetNConvectiveFields()

int Nektar::IncNavierStokes::GetNConvectiveFields ( void  )
inline

Definition at line 150 of file IncNavierStokes.h.

151 {
152 return m_nConvectiveFields;
153 }

References m_nConvectiveFields.

◆ SetBoundaryConditions()

void Nektar::IncNavierStokes::SetBoundaryConditions ( NekDouble  time)
protected

time dependent boundary conditions updating

Time dependent boundary conditions updating

Definition at line 323 of file IncNavierStokes.cpp.

324{
325 size_t i, n;
326 std::string varName;
327 size_t nvariables = m_fields.size();
328
329 for (i = 0; i < nvariables; ++i)
330 {
331 for (n = 0; n < m_fields[i]->GetBndConditions().size(); ++n)
332 {
333 if (m_fields[i]->GetBndConditions()[n]->IsTimeDependent())
334 {
335 varName = m_session->GetVariable(i);
336 m_fields[i]->EvaluateBoundaryConditions(time, varName);
337 }
338 else if (boost::istarts_with(
339 m_fields[i]->GetBndConditions()[n]->GetUserDefined(),
340 "Womersley"))
341 {
343 }
344 }
345
346 // Set Radiation conditions if required
348 }
349
350 // Enforcing the boundary conditions (Inlet and wall) for the
351 // Moving reference frame
353}
void SetWomersleyBoundary(const int fldid, const int bndid)
Set Womersley Profile if specified.
void SetZeroNormalVelocity()
Set Normal Velocity Component to Zero.
void SetRadiationBoundaryForcing(int fieldid)
Set Radiation forcing term.

References Nektar::SolverUtils::EquationSystem::m_fields, Nektar::SolverUtils::EquationSystem::m_session, SetRadiationBoundaryForcing(), SetWomersleyBoundary(), and SetZeroNormalVelocity().

Referenced by Nektar::VelocityCorrectionScheme::v_DoInitialise(), and v_PreIntegrate().

◆ SetRadiationBoundaryForcing()

void Nektar::IncNavierStokes::SetRadiationBoundaryForcing ( int  fieldid)
protected

Set Radiation forcing term.

Probably should be pushed back into ContField?

Definition at line 358 of file IncNavierStokes.cpp.

359{
360 size_t i, n;
361
362 Array<OneD, const SpatialDomains::BoundaryConditionShPtr> BndConds;
363 Array<OneD, MultiRegions::ExpListSharedPtr> BndExp;
364
365 BndConds = m_fields[fieldid]->GetBndConditions();
366 BndExp = m_fields[fieldid]->GetBndCondExpansions();
367
370
371 size_t cnt;
372 size_t elmtid, nq, offset, boundary;
373 Array<OneD, NekDouble> Bvals, U;
374 size_t cnt1 = 0;
375
376 for (cnt = n = 0; n < BndConds.size(); ++n)
377 {
378 std::string type = BndConds[n]->GetUserDefined();
379
380 if ((BndConds[n]->GetBoundaryConditionType() ==
382 (boost::iequals(type, "Radiation")))
383 {
384 size_t nExp = BndExp[n]->GetExpSize();
385 for (i = 0; i < nExp; ++i, cnt++)
386 {
387 elmtid = m_fieldsBCToElmtID[m_velocity[fieldid]][cnt];
388 elmt = m_fields[fieldid]->GetExp(elmtid);
389 offset = m_fields[fieldid]->GetPhys_Offset(elmtid);
390
391 U = m_fields[fieldid]->UpdatePhys() + offset;
392 Bc = BndExp[n]->GetExp(i);
393
394 boundary = m_fieldsBCToTraceID[fieldid][cnt];
395
396 // Get edge values and put into ubc
397 nq = Bc->GetTotPoints();
398 Array<OneD, NekDouble> ubc(nq);
399 elmt->GetTracePhysVals(boundary, Bc, U, ubc);
400
401 Vmath::Vmul(nq,
403 [fieldid][cnt1 + BndExp[n]->GetPhys_Offset(i)],
404 1, &ubc[0], 1, &ubc[0], 1);
405
406 Bvals =
407 BndExp[n]->UpdateCoeffs() + BndExp[n]->GetCoeff_Offset(i);
408
409 Bc->IProductWRTBase(ubc, Bvals);
410 }
411 cnt1 += BndExp[n]->GetTotPoints();
412 }
413 else
414 {
415 cnt += BndExp[n]->GetExpSize();
416 }
417 }
418}
Array< OneD, Array< OneD, int > > m_fieldsBCToTraceID
Mapping from BCs to Elmt Edge IDs.
Array< OneD, Array< OneD, NekDouble > > m_fieldsRadiationFactor
RHS Factor for Radiation Condition.
Array< OneD, Array< OneD, int > > m_fieldsBCToElmtID
Mapping from BCs to Elmt IDs.
SOLVER_UTILS_EXPORT int GetPhys_Offset(int n)
std::shared_ptr< Expansion > ExpansionSharedPtr
Definition: Expansion.h:66
std::shared_ptr< StdExpansion > StdExpansionSharedPtr
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.hpp:72

References Nektar::SpatialDomains::eRobin, Nektar::SolverUtils::EquationSystem::GetPhys_Offset(), Nektar::SolverUtils::EquationSystem::m_fields, m_fieldsBCToElmtID, m_fieldsBCToTraceID, m_fieldsRadiationFactor, m_velocity, and Vmath::Vmul().

Referenced by SetBoundaryConditions().

◆ SetUpWomersley()

void Nektar::IncNavierStokes::SetUpWomersley ( const int  fldid,
const int  bndid,
std::string  womstr 
)
protected

Set Up Womersley details.

Error value returned by TinyXML.

Definition at line 577 of file IncNavierStokes.cpp.

579{
580 std::string::size_type indxBeg = womStr.find_first_of(':') + 1;
581 std::string filename = womStr.substr(indxBeg, std::string::npos);
582
583 TiXmlDocument doc(filename);
584
585 bool loadOkay = doc.LoadFile();
586 ASSERTL0(loadOkay,
587 (std::string("Failed to load file: ") + filename).c_str());
588
589 TiXmlHandle docHandle(&doc);
590
591 int err; /// Error value returned by TinyXML.
592
593 TiXmlElement *nektar = doc.FirstChildElement("NEKTAR");
594 ASSERTL0(nektar, "Unable to find NEKTAR tag in file.");
595
596 TiXmlElement *wombc = nektar->FirstChildElement("WOMERSLEYBC");
597 ASSERTL0(wombc, "Unable to find WOMERSLEYBC tag in file.");
598
599 // read womersley parameters
600 TiXmlElement *womparam = wombc->FirstChildElement("WOMPARAMS");
601 ASSERTL0(womparam, "Unable to find WOMPARAMS tag in file.");
602
603 // Input coefficients
604 TiXmlElement *params = womparam->FirstChildElement("W");
605 std::map<std::string, std::string> Wparams;
606
607 // read parameter list
608 while (params)
609 {
610
611 std::string propstr;
612 propstr = params->Attribute("PROPERTY");
613
614 ASSERTL0(!propstr.empty(),
615 "Failed to read PROPERTY value Womersley BC Parameter");
616
617 std::string valstr;
618 valstr = params->Attribute("VALUE");
619
620 ASSERTL0(!valstr.empty(),
621 "Failed to read VALUE value Womersley BC Parameter");
622
623 std::transform(propstr.begin(), propstr.end(), propstr.begin(),
624 ::toupper);
625 Wparams[propstr] = valstr;
626
627 params = params->NextSiblingElement("W");
628 }
629 bool parseGood;
630
631 // Read parameters
632
633 ASSERTL0(
634 Wparams.count("RADIUS") == 1,
635 "Failed to find Radius parameter in Womersley boundary conditions");
636 std::vector<NekDouble> rad;
637 ParseUtils::GenerateVector(Wparams["RADIUS"], rad);
638 m_womersleyParams[fldid][bndid]->m_radius = rad[0];
639
640 ASSERTL0(
641 Wparams.count("PERIOD") == 1,
642 "Failed to find period parameter in Womersley boundary conditions");
643 std::vector<NekDouble> period;
644 parseGood = ParseUtils::GenerateVector(Wparams["PERIOD"], period);
645 m_womersleyParams[fldid][bndid]->m_period = period[0];
646
647 ASSERTL0(
648 Wparams.count("AXISNORMAL") == 1,
649 "Failed to find axisnormal parameter in Womersley boundary conditions");
650 std::vector<NekDouble> anorm;
651 parseGood = ParseUtils::GenerateVector(Wparams["AXISNORMAL"], anorm);
652 m_womersleyParams[fldid][bndid]->m_axisnormal[0] = anorm[0];
653 m_womersleyParams[fldid][bndid]->m_axisnormal[1] = anorm[1];
654 m_womersleyParams[fldid][bndid]->m_axisnormal[2] = anorm[2];
655
656 ASSERTL0(
657 Wparams.count("AXISPOINT") == 1,
658 "Failed to find axispoint parameter in Womersley boundary conditions");
659 std::vector<NekDouble> apt;
660 parseGood = ParseUtils::GenerateVector(Wparams["AXISPOINT"], apt);
661 m_womersleyParams[fldid][bndid]->m_axispoint[0] = apt[0];
662 m_womersleyParams[fldid][bndid]->m_axispoint[1] = apt[1];
663 m_womersleyParams[fldid][bndid]->m_axispoint[2] = apt[2];
664
665 // Read Temporal Fourier Coefficients.
666
667 // Find the FourierCoeff tag
668 TiXmlElement *coeff = wombc->FirstChildElement("FOURIERCOEFFS");
669
670 // Input coefficients
671 TiXmlElement *fval = coeff->FirstChildElement("F");
672
673 int indx;
674
675 while (fval)
676 {
677 TiXmlAttribute *fvalAttr = fval->FirstAttribute();
678 std::string attrName(fvalAttr->Name());
679
680 ASSERTL0(attrName == "ID",
681 (std::string("Unknown attribute name: ") + attrName).c_str());
682
683 err = fvalAttr->QueryIntValue(&indx);
684 ASSERTL0(err == TIXML_SUCCESS, "Unable to read attribute ID.");
685
686 std::string coeffStr = fval->FirstChild()->ToText()->ValueStr();
687 std::vector<NekDouble> coeffvals;
688
689 parseGood = ParseUtils::GenerateVector(coeffStr, coeffvals);
690 ASSERTL0(
691 parseGood,
692 (std::string("Problem reading value of fourier coefficient, ID=") +
693 boost::lexical_cast<std::string>(indx))
694 .c_str());
695 ASSERTL1(
696 coeffvals.size() == 2,
697 (std::string(
698 "Have not read two entries of Fourier coefficicent from ID=" +
699 boost::lexical_cast<std::string>(indx))
700 .c_str()));
701
702 m_womersleyParams[fldid][bndid]->m_wom_vel.push_back(
703 NekComplexDouble(coeffvals[0], coeffvals[1]));
704
705 fval = fval->NextSiblingElement("F");
706 }
707
708 // starting point of precalculation
709 size_t i, j, k;
710 // M fourier coefficients
711 size_t M_coeffs = m_womersleyParams[fldid][bndid]->m_wom_vel.size();
712 NekDouble R = m_womersleyParams[fldid][bndid]->m_radius;
713 NekDouble T = m_womersleyParams[fldid][bndid]->m_period;
714 Array<OneD, NekDouble> x0 = m_womersleyParams[fldid][bndid]->m_axispoint;
715
717 // Womersley Number
718 NekComplexDouble omega_c(2.0 * M_PI / T, 0.0);
719 NekComplexDouble alpha_c(R * sqrt(omega_c.real() / m_kinvis), 0.0);
720 NekComplexDouble z1(1.0, 0.0);
721 NekComplexDouble i_pow_3q2(-1.0 / sqrt(2.0), 1.0 / sqrt(2.0));
722
724 BndCondExp = m_fields[fldid]->GetBndCondExpansions()[bndid];
725
727 size_t cnt = 0;
728 size_t nfq;
729 Array<OneD, NekDouble> Bvals;
730
731 size_t exp_npts = BndCondExp->GetExpSize();
732 Array<OneD, NekDouble> wbc(exp_npts, 0.0);
733
734 // allocate time indepedent variables
735 m_womersleyParams[fldid][bndid]->m_poiseuille =
736 Array<OneD, Array<OneD, NekDouble>>(exp_npts);
737 m_womersleyParams[fldid][bndid]->m_zvel =
738 Array<OneD, Array<OneD, Array<OneD, NekComplexDouble>>>(exp_npts);
739 // could use M_coeffs - 1 but need to avoid complicating things
740 Array<OneD, NekComplexDouble> zJ0(M_coeffs);
741 Array<OneD, NekComplexDouble> lamda_n(M_coeffs);
742 Array<OneD, NekComplexDouble> k_c(M_coeffs);
743 NekComplexDouble zJ0r;
744
745 for (k = 1; k < M_coeffs; k++)
746 {
747 k_c[k] = NekComplexDouble((NekDouble)k, 0.0);
748 lamda_n[k] = i_pow_3q2 * alpha_c * sqrt(k_c[k]);
749 zJ0[k] = Polylib::ImagBesselComp(0, lamda_n[k]);
750 }
751
752 // Loop over each element in an expansion
753 for (i = 0; i < exp_npts; ++i, cnt++)
754 {
755 // Get Boundary and trace expansion
756 bc = BndCondExp->GetExp(i);
757 nfq = bc->GetTotPoints();
758
759 Array<OneD, NekDouble> x(nfq, 0.0);
760 Array<OneD, NekDouble> y(nfq, 0.0);
761 Array<OneD, NekDouble> z(nfq, 0.0);
762 bc->GetCoords(x, y, z);
763
764 m_womersleyParams[fldid][bndid]->m_poiseuille[i] =
765 Array<OneD, NekDouble>(nfq);
766 m_womersleyParams[fldid][bndid]->m_zvel[i] =
767 Array<OneD, Array<OneD, NekComplexDouble>>(nfq);
768
769 // Compute coefficients
770 for (j = 0; j < nfq; j++)
771 {
772 rqR = NekComplexDouble(sqrt((x[j] - x0[0]) * (x[j] - x0[0]) +
773 (y[j] - x0[1]) * (y[j] - x0[1]) +
774 (z[j] - x0[2]) * (z[j] - x0[2])) /
775 R,
776 0.0);
777
778 // Compute Poiseulle Flow
779 m_womersleyParams[fldid][bndid]->m_poiseuille[i][j] =
780 m_womersleyParams[fldid][bndid]->m_wom_vel[0].real() *
781 (1. - rqR.real() * rqR.real());
782
783 m_womersleyParams[fldid][bndid]->m_zvel[i][j] =
784 Array<OneD, NekComplexDouble>(M_coeffs);
785
786 // compute the velocity information
787 for (k = 1; k < M_coeffs; k++)
788 {
789 zJ0r = Polylib::ImagBesselComp(0, rqR * lamda_n[k]);
790 m_womersleyParams[fldid][bndid]->m_zvel[i][j][k] =
791 m_womersleyParams[fldid][bndid]->m_wom_vel[k] *
792 (z1 - (zJ0r / zJ0[k]));
793 }
794 }
795 }
796}
#define ASSERTL0(condition, msg)
Definition: ErrorUtil.hpp:208
#define ASSERTL1(condition, msg)
Assert Level 1 – Debugging which is used whether in FULLDEBUG or DEBUG compilation mode....
Definition: ErrorUtil.hpp:242
std::map< int, std::map< int, WomersleyParamsSharedPtr > > m_womersleyParams
Womersley parameters if required.
NekDouble m_kinvis
Kinematic viscosity.
static bool GenerateVector(const std::string &str, std::vector< T > &out)
Takes a comma-separated string and converts it to entries in a vector.
Definition: ParseUtils.cpp:130
static NekDouble rad(NekDouble x, NekDouble y)
std::shared_ptr< ExpList > ExpListSharedPtr
Shared pointer to an ExpList object.
std::vector< double > z(NPUPPER)
std::complex< double > NekComplexDouble
double NekDouble
std::complex< Nektar::NekDouble > ImagBesselComp(int n, std::complex< Nektar::NekDouble > y)
Calcualte the bessel function of the first kind with complex double input y. Taken from Numerical Rec...
Definition: Polylib.cpp:1559
scalarT< T > sqrt(scalarT< T > in)
Definition: scalar.hpp:285

References ASSERTL0, ASSERTL1, Nektar::ParseUtils::GenerateVector(), Polylib::ImagBesselComp(), Nektar::SolverUtils::EquationSystem::m_fields, m_kinvis, m_womersleyParams, Nektar::LibUtilities::rad(), tinysimd::sqrt(), and Nektar::UnitTests::z().

Referenced by v_InitObject().

◆ SetWomersleyBoundary()

void Nektar::IncNavierStokes::SetWomersleyBoundary ( const int  fldid,
const int  bndid 
)
protected

Set Womersley Profile if specified.

Womersley boundary condition defintion

Definition at line 508 of file IncNavierStokes.cpp.

509{
510 ASSERTL1(m_womersleyParams.count(bndid) == 1,
511 "Womersley parameters for this boundary have not been set up");
512
513 WomersleyParamsSharedPtr WomParam = m_womersleyParams[fldid][bndid];
514 NekComplexDouble zvel;
515 size_t i, j, k;
516
517 size_t M_coeffs = WomParam->m_wom_vel.size();
518
519 NekDouble T = WomParam->m_period;
520 NekDouble axis_normal = WomParam->m_axisnormal[fldid];
521
522 // Womersley Number
523 NekComplexDouble omega_c(2.0 * M_PI / T, 0.0);
524 NekComplexDouble k_c(0.0, 0.0);
525 NekComplexDouble m_time_c(m_time, 0.0);
526 NekComplexDouble zi(0.0, 1.0);
527 NekComplexDouble i_pow_3q2(-1.0 / sqrt(2.0), 1.0 / sqrt(2.0));
528
530 BndCondExp = m_fields[fldid]->GetBndCondExpansions()[bndid];
531
533 size_t cnt = 0;
534 size_t nfq;
535 Array<OneD, NekDouble> Bvals;
536 size_t exp_npts = BndCondExp->GetExpSize();
537 Array<OneD, NekDouble> wbc(exp_npts, 0.0);
538
539 Array<OneD, NekComplexDouble> zt(M_coeffs);
540
541 // preallocate the exponent
542 for (k = 1; k < M_coeffs; k++)
543 {
544 k_c = NekComplexDouble((NekDouble)k, 0.0);
545 zt[k] = std::exp(zi * omega_c * k_c * m_time_c);
546 }
547
548 // Loop over each element in an expansion
549 for (i = 0; i < exp_npts; ++i, cnt++)
550 {
551 // Get Boundary and trace expansion
552 bc = BndCondExp->GetExp(i);
553 nfq = bc->GetTotPoints();
554 Array<OneD, NekDouble> wbc(nfq, 0.0);
555
556 // Compute womersley solution
557 for (j = 0; j < nfq; j++)
558 {
559 wbc[j] = WomParam->m_poiseuille[i][j];
560 for (k = 1; k < M_coeffs; k++)
561 {
562 zvel = WomParam->m_zvel[i][j][k] * zt[k];
563 wbc[j] = wbc[j] + zvel.real();
564 }
565 }
566
567 // Multiply w by normal to get u,v,w component of velocity
568 Vmath::Smul(nfq, axis_normal, wbc, 1, wbc, 1);
569 // get the offset
570 Bvals = BndCondExp->UpdateCoeffs() + BndCondExp->GetCoeff_Offset(i);
571
572 // Push back to Coeff space
573 bc->FwdTrans(wbc, Bvals);
574 }
575}
NekDouble m_time
Current time of simulation.
std::shared_ptr< WomersleyParams > WomersleyParamsSharedPtr
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 ASSERTL1, Nektar::SolverUtils::EquationSystem::m_fields, Nektar::SolverUtils::EquationSystem::m_time, m_womersleyParams, Vmath::Smul(), and tinysimd::sqrt().

Referenced by SetBoundaryConditions().

◆ SetZeroNormalVelocity()

void Nektar::IncNavierStokes::SetZeroNormalVelocity ( )
protected

Set Normal Velocity Component to Zero.

Definition at line 420 of file IncNavierStokes.cpp.

421{
422 // use static trip since cannot use UserDefinedTag for zero
423 // velocity and have time dependent conditions
424 static bool Setup = false;
425
426 if (Setup == true)
427 {
428 return;
429 }
430 Setup = true;
431
432 size_t i, n;
433
434 Array<OneD, Array<OneD, const SpatialDomains::BoundaryConditionShPtr>>
435 BndConds(m_spacedim);
436 Array<OneD, Array<OneD, MultiRegions::ExpListSharedPtr>> BndExp(m_spacedim);
437
438 for (int i = 0; i < m_spacedim; ++i)
439 {
440 BndConds[i] = m_fields[m_velocity[i]]->GetBndConditions();
441 BndExp[i] = m_fields[m_velocity[i]]->GetBndCondExpansions();
442 }
443
445
446 size_t cnt;
447 size_t elmtid, nq, boundary;
448
449 Array<OneD, Array<OneD, NekDouble>> normals;
450 Array<OneD, NekDouble> Bphys, Bcoeffs;
451
452 size_t fldid = m_velocity[0];
453
454 for (cnt = n = 0; n < BndConds[0].size(); ++n)
455 {
456 if ((BndConds[0][n]->GetBoundaryConditionType() ==
458 (boost::iequals(BndConds[0][n]->GetUserDefined(),
459 "ZeroNormalComponent")))
460 {
461 size_t nExp = BndExp[0][n]->GetExpSize();
462 for (i = 0; i < nExp; ++i, cnt++)
463 {
464 elmtid = m_fieldsBCToElmtID[fldid][cnt];
465 elmt = m_fields[0]->GetExp(elmtid);
466 boundary = m_fieldsBCToTraceID[fldid][cnt];
467
468 normals = elmt->GetTraceNormal(boundary);
469
470 nq = BndExp[0][n]->GetExp(i)->GetTotPoints();
471 Array<OneD, NekDouble> normvel(nq, 0.0);
472
473 for (int k = 0; k < m_spacedim; ++k)
474 {
475 Bphys = BndExp[k][n]->UpdatePhys() +
476 BndExp[k][n]->GetPhys_Offset(i);
477 Bc = BndExp[k][n]->GetExp(i);
478 Vmath::Vvtvp(nq, normals[k], 1, Bphys, 1, normvel, 1,
479 normvel, 1);
480 }
481
482 // negate normvel for next step
483 Vmath::Neg(nq, normvel, 1);
484
485 for (int k = 0; k < m_spacedim; ++k)
486 {
487 Bphys = BndExp[k][n]->UpdatePhys() +
488 BndExp[k][n]->GetPhys_Offset(i);
489 Bcoeffs = BndExp[k][n]->UpdateCoeffs() +
490 BndExp[k][n]->GetCoeff_Offset(i);
491 Bc = BndExp[k][n]->GetExp(i);
492 Vmath::Vvtvp(nq, normvel, 1, normals[k], 1, Bphys, 1, Bphys,
493 1);
494 Bc->FwdTransBndConstrained(Bphys, Bcoeffs);
495 }
496 }
497 }
498 else
499 {
500 cnt += BndExp[0][n]->GetExpSize();
501 }
502 }
503}
int m_spacedim
Spatial dimension (>= expansion dim).
void Neg(int n, T *x, const int incx)
Negate x = -x.
Definition: Vmath.hpp:292
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.hpp:366

References Nektar::SpatialDomains::eDirichlet, Nektar::SolverUtils::EquationSystem::m_fields, m_fieldsBCToElmtID, m_fieldsBCToTraceID, Nektar::SolverUtils::EquationSystem::m_spacedim, m_velocity, Vmath::Neg(), and Vmath::Vvtvp().

Referenced by SetBoundaryConditions().

◆ v_GetAeroForce()

void Nektar::IncNavierStokes::v_GetAeroForce ( Array< OneD, NekDouble forces)
overrideprotectedvirtual

Reimplemented from Nektar::SolverUtils::FluidInterface.

Definition at line 974 of file IncNavierStokes.cpp.

975{
976 if (m_aeroForces.size() >= 6)
977 {
978 Vmath::Vcopy(6, m_aeroForces, 1, forces, 1);
979 }
980}
Array< OneD, NekDouble > m_aeroForces

References m_aeroForces, and Vmath::Vcopy().

◆ v_GetDensity()

void Nektar::IncNavierStokes::v_GetDensity ( const Array< OneD, const Array< OneD, NekDouble > > &  physfield,
Array< OneD, NekDouble > &  density 
)
overrideprotectedvirtual

Implements Nektar::SolverUtils::FluidInterface.

Definition at line 858 of file IncNavierStokes.cpp.

861{
862 int nPts = physfield[0].size();
863 Vmath::Fill(nPts, 1.0, density, 1);
864}
void Fill(int n, const T alpha, T *x, const int incx)
Fill a vector with a constant value.
Definition: Vmath.hpp:54

References Vmath::Fill().

◆ v_GetForceDimension()

virtual int Nektar::IncNavierStokes::v_GetForceDimension ( )
protectedpure virtual

◆ v_GetMaxStdVelocity()

Array< OneD, NekDouble > Nektar::IncNavierStokes::v_GetMaxStdVelocity ( const NekDouble  SpeedSoundFactor)
overrideprotectedvirtual

Reimplemented from Nektar::SolverUtils::AdvectionSystem.

Definition at line 809 of file IncNavierStokes.cpp.

811{
812 size_t nvel = m_velocity.size();
813 size_t nelmt = m_fields[0]->GetExpSize();
814
815 Array<OneD, NekDouble> stdVelocity(nelmt, 0.0);
816 Array<OneD, Array<OneD, NekDouble>> velfields;
817
818 if (m_HomogeneousType == eHomogeneous1D) // just do check on 2D info
819 {
820 velfields = Array<OneD, Array<OneD, NekDouble>>(2);
821
822 for (size_t i = 0; i < 2; ++i)
823 {
824 velfields[i] = m_fields[m_velocity[i]]->UpdatePhys();
825 }
826 }
827 else
828 {
829 velfields = Array<OneD, Array<OneD, NekDouble>>(nvel);
830
831 for (size_t i = 0; i < nvel; ++i)
832 {
833 velfields[i] = m_fields[m_velocity[i]]->UpdatePhys();
834 }
835 }
836
837 stdVelocity = m_extrapolation->GetMaxStdVelocity(velfields);
838
839 return stdVelocity;
840}
ExtrapolateSharedPtr m_extrapolation
enum HomogeneousType m_HomogeneousType

References Nektar::SolverUtils::EquationSystem::eHomogeneous1D, m_extrapolation, Nektar::SolverUtils::EquationSystem::m_fields, Nektar::SolverUtils::EquationSystem::m_HomogeneousType, and m_velocity.

◆ v_GetMovingFrameDisp()

bool Nektar::IncNavierStokes::v_GetMovingFrameDisp ( Array< OneD, NekDouble > &  vFrameDisp,
const int  step 
)
overrideprotectedvirtual

Function to get the angles between the moving frame of reference and stationary inertial reference frame

Reimplemented from Nektar::SolverUtils::FluidInterface.

Definition at line 937 of file IncNavierStokes.cpp.

939{
940 if (m_movingFrameData.size())
941 {
942 ASSERTL0(
943 vFrameDisp.size() == 6,
944 "Arrays have different size, cannot get moving frame displacement");
945 Vmath::Vcopy(vFrameDisp.size(), m_movingFrameData + 21 * step, 1,
946 vFrameDisp, 1);
947 return true;
948 }
949 else
950 {
951 return false;
952 }
953}
Array< OneD, NekDouble > m_movingFrameData
Moving reference frame status in the inertial frame X, Y, Z, Theta_x, Theta_y, Theta_z,...

References ASSERTL0, Nektar::SolverUtils::EquationSystem::m_movingFrameData, and Vmath::Vcopy().

◆ v_GetMovingFrameVelocities()

bool Nektar::IncNavierStokes::v_GetMovingFrameVelocities ( Array< OneD, NekDouble > &  vFrameVels,
const int  step 
)
overrideprotectedvirtual

Reimplemented from Nektar::SolverUtils::FluidInterface.

Definition at line 898 of file IncNavierStokes.cpp.

900{
901 if (m_movingFrameData.size())
902 {
903 ASSERTL0(vFrameVels.size() == 12,
904 "Arrays have different dimensions, cannot get moving frame "
905 "velocities");
906 Vmath::Vcopy(vFrameVels.size(), m_movingFrameData + 6 + 21 * step, 1,
907 vFrameVels, 1);
908 return true;
909 }
910 else
911 {
912 return false;
913 }
914}

References ASSERTL0, Nektar::SolverUtils::EquationSystem::m_movingFrameData, and Vmath::Vcopy().

◆ v_GetPressure() [1/2]

MultiRegions::ExpListSharedPtr Nektar::IncNavierStokes::v_GetPressure ( void  )
inlineoverrideprotectedvirtual

Reimplemented from Nektar::SolverUtils::EquationSystem.

Definition at line 269 of file IncNavierStokes.h.

270 {
271 return m_pressure;
272 }
MultiRegions::ExpListSharedPtr m_pressure
Pointer to field holding pressure field.

References m_pressure.

◆ v_GetPressure() [2/2]

void Nektar::IncNavierStokes::v_GetPressure ( const Array< OneD, const Array< OneD, NekDouble > > &  physfield,
Array< OneD, NekDouble > &  pressure 
)
overrideprotectedvirtual

Implements Nektar::SolverUtils::FluidInterface.

Definition at line 845 of file IncNavierStokes.cpp.

848{
849 if (physfield.size())
850 {
851 pressure = physfield[physfield.size() - 1];
852 }
853}

References CG_Iterations::pressure.

◆ v_GetVelocity()

void Nektar::IncNavierStokes::v_GetVelocity ( const Array< OneD, const Array< OneD, NekDouble > > &  physfield,
Array< OneD, Array< OneD, NekDouble > > &  velocity 
)
overrideprotectedvirtual

Implements Nektar::SolverUtils::FluidInterface.

Definition at line 869 of file IncNavierStokes.cpp.

872{
873 for (int i = 0; i < m_spacedim; ++i)
874 {
875 velocity[i] = physfield[i];
876 }
877}

References Nektar::SolverUtils::EquationSystem::m_spacedim.

◆ v_HasConstantDensity()

bool Nektar::IncNavierStokes::v_HasConstantDensity ( )
inlineoverrideprotectedvirtual

Implements Nektar::SolverUtils::FluidInterface.

Definition at line 223 of file IncNavierStokes.h.

224 {
225 return true;
226 }

◆ v_InitObject()

void Nektar::IncNavierStokes::v_InitObject ( bool  DeclareFeld = true)
overrideprotectedvirtual

Initialisation object for EquationSystem.

Continuous field

Setting up the normals

Setting up the normals

Reimplemented from Nektar::SolverUtils::AdvectionSystem.

Reimplemented in Nektar::SmoothedProfileMethod, Nektar::VCSMapping, and Nektar::VelocityCorrectionScheme.

Definition at line 89 of file IncNavierStokes.cpp.

90{
92
93 int i, j;
94 int numfields = m_fields.size();
95 std::string velids[] = {"u", "v", "w"};
96
97 // Set up Velocity field to point to the first m_expdim of m_fields;
98 m_velocity = Array<OneD, int>(m_spacedim);
99
100 for (i = 0; i < m_spacedim; ++i)
101 {
102 for (j = 0; j < numfields; ++j)
103 {
104 std::string var = m_boundaryConditions->GetVariable(j);
105 if (boost::iequals(velids[i], var))
106 {
107 m_velocity[i] = j;
108 break;
109 }
110
111 ASSERTL0(j != numfields, "Failed to find field: " + var);
112 }
113 }
114
115 // Set up equation type enum using kEquationTypeStr
116 for (i = 0; i < (int)eEquationTypeSize; ++i)
117 {
118 bool match;
119 m_session->MatchSolverInfo("EQTYPE", kEquationTypeStr[i], match, false);
120 if (match)
121 {
123 break;
124 }
125 }
126 ASSERTL0(i != eEquationTypeSize, "EQTYPE not found in SOLVERINFO section");
127
128 m_session->LoadParameter("Kinvis", m_kinvis);
129
130 // Default advection type per solver
131 std::string vConvectiveType;
132 switch (m_equationType)
133 {
134 case eUnsteadyStokes:
136 vConvectiveType = "NoAdvection";
137 break;
140 vConvectiveType = "Convective";
141 break;
143 vConvectiveType = "Linearised";
144 break;
145 default:
146 break;
147 }
148
149 // Check if advection type overridden
150 if (m_session->DefinesTag("AdvectiveType") &&
153 {
154 vConvectiveType = m_session->GetTag("AdvectiveType");
155 }
156
157 // Initialise advection
159 vConvectiveType, vConvectiveType);
160 m_advObject->InitObject(m_session, m_fields);
161
162 // Set up arrays for moving reference frame
163 // Note: this must be done before the forcing
164 if (DefinedForcing("MovingReferenceFrame"))
165 {
166 // 0-5(inertial disp), 6-11(inertial vel), 12-17(inertial acce) current
167 // 18-21(body pivot)
168 // 21-26(inertial disp), 27-32(body vel), 33-38(body acce) next step
169 // 39-41(body pivot)
171 "X", "Y", "Z", "Theta_x", "Theta_y", "Theta_z",
172 "U", "V", "W", "Omega_x", "Omega_y", "Omega_z",
173 "A_x", "A_y", "A_z", "DOmega_x", "DOmega_y", "DOmega_z",
174 "X0", "Y0", "Z0"};
175 m_movingFrameData = Array<OneD, NekDouble>(42, 0.0);
176 m_aeroForces = Array<OneD, NekDouble>(6, 0.0);
177 }
178
179 // Forcing terms
180 m_forcing = SolverUtils::Forcing::Load(m_session, shared_from_this(),
182
183 // check to see if any Robin boundary conditions and if so set
184 // up m_field to boundary condition maps;
185 m_fieldsBCToElmtID = Array<OneD, Array<OneD, int>>(numfields);
186 m_fieldsBCToTraceID = Array<OneD, Array<OneD, int>>(numfields);
187 m_fieldsRadiationFactor = Array<OneD, Array<OneD, NekDouble>>(numfields);
188
189 for (size_t i = 0; i < m_fields.size(); ++i)
190 {
191 bool Set = false;
192
193 Array<OneD, const SpatialDomains::BoundaryConditionShPtr> BndConds;
194 Array<OneD, MultiRegions::ExpListSharedPtr> BndExp;
195 int radpts = 0;
196
197 BndConds = m_fields[i]->GetBndConditions();
198 BndExp = m_fields[i]->GetBndCondExpansions();
199 for (size_t n = 0; n < BndConds.size(); ++n)
200 {
201 if (boost::iequals(BndConds[n]->GetUserDefined(), "Radiation"))
202 {
203 ASSERTL0(
204 BndConds[n]->GetBoundaryConditionType() ==
206 "Radiation boundary condition must be of type Robin <R>");
207
208 if (Set == false)
209 {
210 m_fields[i]->GetBoundaryToElmtMap(m_fieldsBCToElmtID[i],
212 Set = true;
213 }
214 radpts += BndExp[n]->GetTotPoints();
215 }
216 if (boost::iequals(BndConds[n]->GetUserDefined(),
217 "ZeroNormalComponent"))
218 {
219 ASSERTL0(BndConds[n]->GetBoundaryConditionType() ==
221 "Zero Normal Component boundary condition option must "
222 "be of type Dirichlet <D>");
223
224 if (Set == false)
225 {
226 m_fields[i]->GetBoundaryToElmtMap(m_fieldsBCToElmtID[i],
228 Set = true;
229 }
230 }
231 }
232
233 m_fieldsRadiationFactor[i] = Array<OneD, NekDouble>(radpts);
234
235 radpts = 0; // reset to use as a counter
236
237 for (size_t n = 0; n < BndConds.size(); ++n)
238 {
239 if (boost::iequals(BndConds[n]->GetUserDefined(), "Radiation"))
240 {
241
242 int npoints = BndExp[n]->GetNpoints();
243 Array<OneD, NekDouble> x0(npoints, 0.0);
244 Array<OneD, NekDouble> x1(npoints, 0.0);
245 Array<OneD, NekDouble> x2(npoints, 0.0);
246 Array<OneD, NekDouble> tmpArray;
247
248 BndExp[n]->GetCoords(x0, x1, x2);
249
250 LibUtilities::Equation coeff =
251 std::static_pointer_cast<
252 SpatialDomains::RobinBoundaryCondition>(BndConds[n])
253 ->m_robinPrimitiveCoeff;
254
255 coeff.Evaluate(x0, x1, x2, m_time,
256 tmpArray = m_fieldsRadiationFactor[i] + radpts);
257 // Vmath::Neg(npoints,tmpArray = m_fieldsRadiationFactor[i]+
258 // radpts,1);
259 radpts += npoints;
260 }
261 }
262 }
263
264 // Set up maping for womersley BC - and load variables
265 for (size_t i = 0; i < m_fields.size(); ++i)
266 {
267 for (size_t n = 0; n < m_fields[i]->GetBndConditions().size(); ++n)
268 {
269 if (boost::istarts_with(
270 m_fields[i]->GetBndConditions()[n]->GetUserDefined(),
271 "Womersley"))
272 {
273 // assumes that boundary condition is applied in normal
274 // direction and is decomposed for each direction. There could
275 // be a unique file for each direction
276 m_womersleyParams[i][n] =
278 m_spacedim);
279 // Read in fourier coeffs and precompute coefficients
281 i, n, m_fields[i]->GetBndConditions()[n]->GetUserDefined());
282
283 m_fields[i]->GetBoundaryToElmtMap(m_fieldsBCToElmtID[i],
285 }
286 }
287 }
288
289 // Set up Field Meta Data for output files
290 m_fieldMetaDataMap["Kinvis"] = boost::lexical_cast<std::string>(m_kinvis);
291 m_fieldMetaDataMap["TimeStep"] =
292 boost::lexical_cast<std::string>(m_timestep);
293}
virtual int v_GetForceDimension()=0
bool DefinedForcing(const std::string &sForce)
void SetUpWomersley(const int fldid, const int bndid, std::string womstr)
Set Up Womersley details.
EquationType m_equationType
equation type;
tBaseSharedPtr CreateInstance(tKey idKey, tParam... args)
Create an instance of the class referred to by idKey.
static std::shared_ptr< DataType > AllocateSharedPtr(const Args &...args)
Allocate a shared pointer from the memory pool.
SOLVER_UTILS_EXPORT void v_InitObject(bool DeclareField=true) override
Initialisation object for EquationSystem.
NekDouble m_timestep
Time step size.
std::vector< std::string > m_strFrameData
variable name in m_movingFrameData
LibUtilities::FieldMetaDataMap m_fieldMetaDataMap
Map to identify relevant solver info to dump in output fields.
SpatialDomains::BoundaryConditionsSharedPtr m_boundaryConditions
Pointer to boundary conditions object.
static SOLVER_UTILS_EXPORT std::vector< ForcingSharedPtr > Load(const LibUtilities::SessionReaderSharedPtr &pSession, const std::weak_ptr< EquationSystem > &pEquation, const Array< OneD, MultiRegions::ExpListSharedPtr > &pFields, const unsigned int &pNumForcingFields=0)
Definition: Forcing.cpp:76
AdvectionFactory & GetAdvectionFactory()
Gets the factory for initialising advection objects.
Definition: Advection.cpp:43
@ eSteadyNavierStokes
@ eUnsteadyStokes
@ eUnsteadyNavierStokes
@ eSteadyLinearisedNS
@ eUnsteadyLinearisedNS
@ eEquationTypeSize
const std::string kEquationTypeStr[]

References Nektar::MemoryManager< DataType >::AllocateSharedPtr(), ASSERTL0, Nektar::LibUtilities::NekFactory< tKey, tBase, tParam >::CreateInstance(), DefinedForcing(), Nektar::SpatialDomains::eDirichlet, Nektar::eEquationTypeSize, Nektar::SpatialDomains::eRobin, Nektar::eSteadyLinearisedNS, Nektar::eSteadyNavierStokes, Nektar::eUnsteadyLinearisedNS, Nektar::eUnsteadyNavierStokes, Nektar::eUnsteadyStokes, Nektar::LibUtilities::Equation::Evaluate(), Nektar::SolverUtils::GetAdvectionFactory(), Nektar::kEquationTypeStr, Nektar::SolverUtils::Forcing::Load(), Nektar::SolverUtils::AdvectionSystem::m_advObject, m_aeroForces, Nektar::SolverUtils::EquationSystem::m_boundaryConditions, m_equationType, Nektar::SolverUtils::EquationSystem::m_fieldMetaDataMap, Nektar::SolverUtils::EquationSystem::m_fields, m_fieldsBCToElmtID, m_fieldsBCToTraceID, m_fieldsRadiationFactor, m_forcing, m_kinvis, Nektar::SolverUtils::EquationSystem::m_movingFrameData, Nektar::SolverUtils::EquationSystem::m_session, Nektar::SolverUtils::EquationSystem::m_spacedim, Nektar::SolverUtils::EquationSystem::m_strFrameData, Nektar::SolverUtils::EquationSystem::m_time, Nektar::SolverUtils::EquationSystem::m_timestep, m_velocity, m_womersleyParams, SetUpWomersley(), v_GetForceDimension(), and Nektar::SolverUtils::AdvectionSystem::v_InitObject().

Referenced by Nektar::CoupledLinearNS::v_InitObject(), and Nektar::VelocityCorrectionScheme::v_InitObject().

◆ v_PreIntegrate()

bool Nektar::IncNavierStokes::v_PreIntegrate ( int  step)
overrideprotectedvirtual

Perform the extrapolation.

Reimplemented from Nektar::SolverUtils::UnsteadySystem.

Definition at line 1022 of file IncNavierStokes.cpp.

1023{
1024 m_extrapolation->SubStepSaveFields(step);
1025 m_extrapolation->SubStepAdvance(step, m_time);
1027 return false;
1028}
void SetBoundaryConditions(NekDouble time)
time dependent boundary conditions updating

References m_extrapolation, Nektar::SolverUtils::EquationSystem::m_time, Nektar::SolverUtils::EquationSystem::m_timestep, and SetBoundaryConditions().

◆ v_SetAeroForce()

void Nektar::IncNavierStokes::v_SetAeroForce ( Array< OneD, NekDouble forces)
overrideprotectedvirtual

Reimplemented from Nektar::SolverUtils::FluidInterface.

Definition at line 966 of file IncNavierStokes.cpp.

967{
968 if (m_aeroForces.size() >= 6)
969 {
970 Vmath::Vcopy(6, forces, 1, m_aeroForces, 1);
971 }
972}

References m_aeroForces, and Vmath::Vcopy().

◆ v_SetMovingFrameDisp()

void Nektar::IncNavierStokes::v_SetMovingFrameDisp ( const Array< OneD, NekDouble > &  vFrameDisp,
const int  step 
)
overrideprotectedvirtual

Function to set the angles between the moving frame of reference and stationary inertial reference frame

Reimplemented from Nektar::SolverUtils::FluidInterface.

Definition at line 920 of file IncNavierStokes.cpp.

922{
923 if (m_movingFrameData.size())
924 {
925 ASSERTL0(
926 vFrameDisp.size() == 6,
927 "Arrays have different size, cannot set moving frame displacement");
928 Array<OneD, NekDouble> temp = m_movingFrameData + 21 * step;
929 Vmath::Vcopy(vFrameDisp.size(), vFrameDisp, 1, temp, 1);
930 }
931}

References ASSERTL0, Nektar::SolverUtils::EquationSystem::m_movingFrameData, and Vmath::Vcopy().

◆ v_SetMovingFramePivot()

void Nektar::IncNavierStokes::v_SetMovingFramePivot ( const Array< OneD, NekDouble > &  vFramePivot)
overrideprotectedvirtual

Reimplemented from Nektar::SolverUtils::FluidInterface.

Definition at line 955 of file IncNavierStokes.cpp.

957{
958 ASSERTL0(vFramePivot.size() == 3,
959 "Arrays have different size, cannot set moving frame pivot");
960 Array<OneD, NekDouble> temp = m_movingFrameData + 18;
961 Vmath::Vcopy(vFramePivot.size(), vFramePivot, 1, temp, 1);
962 temp = m_movingFrameData + 39;
963 Vmath::Vcopy(vFramePivot.size(), vFramePivot, 1, temp, 1);
964}

References ASSERTL0, Nektar::SolverUtils::EquationSystem::m_movingFrameData, and Vmath::Vcopy().

◆ v_SetMovingFrameVelocities()

void Nektar::IncNavierStokes::v_SetMovingFrameVelocities ( const Array< OneD, NekDouble > &  vFrameVels,
const int  step 
)
overrideprotectedvirtual

Function to set the moving frame velocities calucated in the forcing this gives access to the moving reference forcing to set the velocities to be later used in enforcing the boundary condition in IncNavierStokes class

Reimplemented from Nektar::SolverUtils::FluidInterface.

Definition at line 885 of file IncNavierStokes.cpp.

887{
888 if (m_movingFrameData.size())
889 {
890 ASSERTL0(vFrameVels.size() == 12,
891 "Arrays have different dimensions, cannot set moving frame "
892 "velocities");
893 Array<OneD, NekDouble> temp = m_movingFrameData + 6 + 21 * step;
894 Vmath::Vcopy(vFrameVels.size(), vFrameVels, 1, temp, 1);
895 }
896}

References ASSERTL0, Nektar::SolverUtils::EquationSystem::m_movingFrameData, and Vmath::Vcopy().

◆ v_TransCoeffToPhys()

void Nektar::IncNavierStokes::v_TransCoeffToPhys ( void  )
inlineoverrideprotectedvirtual

Virtual function for transformation to physical space.

Reimplemented from Nektar::SolverUtils::EquationSystem.

Reimplemented in Nektar::VelocityCorrectionScheme.

Definition at line 274 of file IncNavierStokes.h.

275 {
276 ASSERTL0(false, "This method is not defined in this class");
277 }

References ASSERTL0.

◆ v_TransPhysToCoeff()

void Nektar::IncNavierStokes::v_TransPhysToCoeff ( void  )
inlineoverrideprotectedvirtual

Virtual function for transformation to coefficient space.

Reimplemented from Nektar::SolverUtils::EquationSystem.

Reimplemented in Nektar::VelocityCorrectionScheme.

Definition at line 279 of file IncNavierStokes.h.

280 {
281 ASSERTL0(false, "This method is not defined in this class");
282 }

References ASSERTL0.

◆ WriteModalEnergy()

void Nektar::IncNavierStokes::WriteModalEnergy ( void  )
protected

Member Data Documentation

◆ eqTypeLookupIds

std::string Nektar::IncNavierStokes::eqTypeLookupIds
staticprotected
Initial value:
= {
"EqType", "SteadyNavierStokes", eSteadyNavierStokes),
"EqType", "SteadyLinearisedNS", eSteadyLinearisedNS),
"EqType", "UnsteadyNavierStokes", eUnsteadyNavierStokes),
static std::string RegisterEnumValue(std::string pEnum, std::string pString, int pEnumValue)
Registers an enumeration value.

Definition at line 205 of file IncNavierStokes.h.

◆ m_aeroForces

Array<OneD, NekDouble> Nektar::IncNavierStokes::m_aeroForces
protected

Definition at line 203 of file IncNavierStokes.h.

Referenced by v_GetAeroForce(), v_InitObject(), and v_SetAeroForce().

◆ m_energysteps

int Nektar::IncNavierStokes::m_energysteps
protected

dump energy to file at steps time

Definition at line 185 of file IncNavierStokes.h.

◆ m_equationType

EquationType Nektar::IncNavierStokes::m_equationType
protected

◆ m_extrapolation

ExtrapolateSharedPtr Nektar::IncNavierStokes::m_extrapolation
protected

◆ m_fieldsBCToElmtID

Array<OneD, Array<OneD, int> > Nektar::IncNavierStokes::m_fieldsBCToElmtID
protected

Mapping from BCs to Elmt IDs.

Definition at line 191 of file IncNavierStokes.h.

Referenced by SetRadiationBoundaryForcing(), SetZeroNormalVelocity(), and v_InitObject().

◆ m_fieldsBCToTraceID

Array<OneD, Array<OneD, int> > Nektar::IncNavierStokes::m_fieldsBCToTraceID
protected

Mapping from BCs to Elmt Edge IDs.

Definition at line 193 of file IncNavierStokes.h.

Referenced by SetRadiationBoundaryForcing(), SetZeroNormalVelocity(), and v_InitObject().

◆ m_fieldsRadiationFactor

Array<OneD, Array<OneD, NekDouble> > Nektar::IncNavierStokes::m_fieldsRadiationFactor
protected

RHS Factor for Radiation Condition.

Definition at line 195 of file IncNavierStokes.h.

Referenced by SetRadiationBoundaryForcing(), and v_InitObject().

◆ m_forcing

std::vector<SolverUtils::ForcingSharedPtr> Nektar::IncNavierStokes::m_forcing
protected

◆ m_IncNavierStokesBCs

IncBoundaryConditionsSharedPtr Nektar::IncNavierStokes::m_IncNavierStokesBCs
protected

◆ m_intSteps

int Nektar::IncNavierStokes::m_intSteps
protected

Number of time integration steps AND Order of extrapolation for pressure boundary conditions.

Definition at line 199 of file IncNavierStokes.h.

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

◆ m_kinvis

NekDouble Nektar::IncNavierStokes::m_kinvis
protected

◆ m_mdlFile

std::ofstream Nektar::IncNavierStokes::m_mdlFile
protected

modal energy file

Definition at line 165 of file IncNavierStokes.h.

◆ m_nConvectiveFields

int Nektar::IncNavierStokes::m_nConvectiveFields
protected

◆ m_pivotPoint

Array<OneD, NekDouble> Nektar::IncNavierStokes::m_pivotPoint
protected

pivot point for moving reference frame

Definition at line 202 of file IncNavierStokes.h.

◆ m_pressure

MultiRegions::ExpListSharedPtr Nektar::IncNavierStokes::m_pressure
protected

◆ m_SmoothAdvection

bool Nektar::IncNavierStokes::m_SmoothAdvection
protected

◆ m_velocity

Array<OneD, int> Nektar::IncNavierStokes::m_velocity
protected

int which identifies which components of m_fields contains the velocity (u,v,w);

Definition at line 178 of file IncNavierStokes.h.

Referenced by Nektar::VCSImplicit::AddImplicitSkewSymAdvection(), Nektar::CoupledLinearNS::Continuation(), Nektar::CoupledLinearNS::DefineForcingTerm(), EvaluateAdvectionTerms(), Nektar::CoupledLinearNS::EvaluateNewtonRHS(), Nektar::CoupledLinearNS::InfNorm(), Nektar::CoupledLinearNS::L2Norm(), Nektar::SmoothedProfileMethod::ReadPhi(), Nektar::SmoothedProfileMethod::SetCorrectionPressureBCs(), SetRadiationBoundaryForcing(), Nektar::SmoothedProfileMethod::SetUpCorrectionPressure(), Nektar::CoupledLinearNS::SetUpCoupledMatrix(), Nektar::SmoothedProfileMethod::SetUpExpansions(), Nektar::VelocityCorrectionScheme::SetUpExtrapolation(), Nektar::VelocityCorrectionScheme::SetUpSVV(), SetZeroNormalVelocity(), Nektar::CoupledLinearNS::Solve(), Nektar::SmoothedProfileMethod::SolveCorrectedVelocity(), Nektar::CoupledLinearNS::SolveLinearNS(), Nektar::CoupledLinearNS::SolveSteadyNavierStokes(), Nektar::CoupledLinearNS::SolveUnsteadyStokesSystem(), Nektar::SmoothedProfileMethod::UpdateForcing(), Nektar::VCSImplicit::v_DoInitialise(), Nektar::CoupledLinearNS::v_DoInitialise(), Nektar::VCSImplicit::v_EvaluateAdvection_SetPressureBCs(), v_GetMaxStdVelocity(), Nektar::CoupledLinearNS::v_InitObject(), v_InitObject(), Nektar::SmoothedProfileMethod::v_InitObject(), Nektar::VCSMapping::v_InitObject(), Nektar::VelocityCorrectionScheme::v_SetUpPressureForcing(), Nektar::VCSImplicit::v_SetUpPressureForcing(), Nektar::VelocityCorrectionScheme::v_SetUpViscousForcing(), Nektar::VCSMapping::v_SetUpViscousForcing(), Nektar::VCSImplicit::v_SetUpViscousForcing(), and Nektar::VCSImplicit::v_SolveViscous().

◆ m_womersleyParams

std::map<int, std::map<int, WomersleyParamsSharedPtr> > Nektar::IncNavierStokes::m_womersleyParams
protected

Womersley parameters if required.

Definition at line 267 of file IncNavierStokes.h.

Referenced by SetUpWomersley(), SetWomersleyBoundary(), and v_InitObject().