Nektar++
Loading...
Searching...
No Matches
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.
 
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.
 
SOLVER_UTILS_EXPORT NekDouble GetTimeStep (const Array< OneD, const Array< OneD, NekDouble > > &inarray)
 Calculate the larger time-step mantaining the problem stable.
 
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.
 
SOLVER_UTILS_EXPORT LibUtilities::TimeIntegrationSchemeOperatorsGetTimeIntegrationSchemeOperators ()
 Returns the time integration scheme operators.
 
- Public Member Functions inherited from Nektar::SolverUtils::EquationSystem
virtual SOLVER_UTILS_EXPORT ~EquationSystem ()
 Destructor.
 
SOLVER_UTILS_EXPORT void InitObject (bool DeclareField=true)
 Initialises the members of this object.
 
SOLVER_UTILS_EXPORT void DoInitialise (bool dumpInitialConditions=true)
 Perform any initialisation necessary before solving the problem.
 
SOLVER_UTILS_EXPORT void DoSolve ()
 Solve the problem.
 
SOLVER_UTILS_EXPORT void TransCoeffToPhys ()
 Transform from coefficient to physical space.
 
SOLVER_UTILS_EXPORT void TransPhysToCoeff ()
 Transform from physical to coefficient space.
 
SOLVER_UTILS_EXPORT void Output ()
 Perform output operations after solve.
 
SOLVER_UTILS_EXPORT std::string GetSessionName ()
 Get Session name.
 
template<class T >
std::shared_ptr< T > as ()
 
SOLVER_UTILS_EXPORT void ResetSessionName (std::string newname)
 Reset Session name.
 
SOLVER_UTILS_EXPORT LibUtilities::SessionReaderSharedPtr GetSession ()
 Get Session name.
 
SOLVER_UTILS_EXPORT MultiRegions::ExpListSharedPtr GetPressure ()
 Get pressure field if available.
 
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.
 
SOLVER_UTILS_EXPORT void SetLambda (NekDouble lambda)
 Set parameter m_lambda.
 
SOLVER_UTILS_EXPORT SessionFunctionSharedPtr GetFunction (std::string name, const MultiRegions::ExpListSharedPtr &field=MultiRegions::NullExpListSharedPtr, bool cache=false)
 Get a SessionFunction by name.
 
SOLVER_UTILS_EXPORT void SetInitialConditions (NekDouble initialtime=0.0, bool dumpInitialConditions=true, const int domain=0)
 Initialise the data in the dependent fields.
 
SOLVER_UTILS_EXPORT void EvaluateExactSolution (int field, Array< OneD, NekDouble > &outfield, const NekDouble time)
 Evaluates an exact solution.
 
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.
 
SOLVER_UTILS_EXPORT NekDouble L2Error (unsigned int field, bool Normalised=false)
 Compute the L2 error of the fields.
 
SOLVER_UTILS_EXPORT NekDouble LinfError (unsigned int field, const Array< OneD, NekDouble > &exactsoln=NullNekDouble1DArray)
 Linf error computation.
 
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.
 
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].
 
SOLVER_UTILS_EXPORT void Checkpoint_Output (const int n)
 Write checkpoint file of m_fields.
 
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.
 
SOLVER_UTILS_EXPORT void Checkpoint_BaseFlow (const int n)
 Write base flow file of m_fields.
 
SOLVER_UTILS_EXPORT void WriteFld (const std::string &outname)
 Write field data to the given filename.
 
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.
 
SOLVER_UTILS_EXPORT void ImportFld (const std::string &infile, Array< OneD, MultiRegions::ExpListSharedPtr > &pFields)
 Input field data from the given file.
 
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.
 
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.
 
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.
 
SOLVER_UTILS_EXPORT void SessionSummary (SummaryList &vSummary)
 Write out a session summary.
 
SOLVER_UTILS_EXPORT Array< OneD, MultiRegions::ExpListSharedPtr > & UpdateFields ()
 
SOLVER_UTILS_EXPORT LibUtilities::FieldMetaDataMapUpdateFieldMetaDataMap ()
 Get hold of FieldInfoMap so it can be updated.
 
SOLVER_UTILS_EXPORT NekDouble GetTime ()
 Return final time.
 
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 LibUtilities::FieldMetaDataMapGetFieldMetaDataMap (void)
 
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.
 
SOLVER_UTILS_EXPORT bool NegatedOp ()
 Identify if operator is negated in DoSolve.
 
- 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.
 
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)
 
SOLVER_UTILS_EXPORT void ResetMatricesNormal (Array< OneD, Array< OneD, NekDouble > > &traceNormals)
 
SOLVER_UTILS_EXPORT void UpdateNormalsFlag ()
 
const Array< OneD, const Array< OneD, NekDouble > > & GetGridVelocity ()
 
bool & GetUpdateNormalsFlag ()
 
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)
 
SOLVER_UTILS_EXPORT void ExtraFldOutputGrid (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.
 
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.
 
SOLVER_UTILS_EXPORT void GetPressure (const Array< OneD, const Array< OneD, NekDouble > > &physfield, Array< OneD, NekDouble > &pressure)
 Extract array with pressure from physfield.
 
SOLVER_UTILS_EXPORT void SetMovingFrameVelocities (const Array< OneD, NekDouble > &vFrameVels)
 
SOLVER_UTILS_EXPORT bool GetMovingFrameVelocities (Array< OneD, NekDouble > &vFrameVels)
 
SOLVER_UTILS_EXPORT void SetMovingFrameDisp (const Array< OneD, NekDouble > &vFrameDisp)
 
SOLVER_UTILS_EXPORT bool GetMovingFrameDisp (Array< OneD, NekDouble > &vFrameDisp)
 
SOLVER_UTILS_EXPORT void SetMovingFramePivot (const Array< OneD, NekDouble > &vFramePivot)
 
SOLVER_UTILS_EXPORT void GetMovingFramePivot (Array< OneD, NekDouble > &vFramePivot)
 
SOLVER_UTILS_EXPORT void SetMovableDoFs (const std::set< int > &dirDoFs)
 
SOLVER_UTILS_EXPORT void GetMovableDoFs (std::set< int > &dirDoFs)
 
SOLVER_UTILS_EXPORT void SetAeroForce (Array< OneD, NekDouble > forces)
 Set aerodynamic force and moment.
 
SOLVER_UTILS_EXPORT void GetAeroForce (Array< OneD, NekDouble > forces)
 Get aerodynamic force and moment.
 

Protected Member Functions

 IncNavierStokes (const LibUtilities::SessionReaderSharedPtr &pSession, const SpatialDomains::MeshGraphSharedPtr &pGraph)
 Constructor.
 
 ~IncNavierStokes () override=default
 
void v_InitObject (bool DeclareField=true) override
 Initialisation object for EquationSystem.
 
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) override
 
bool v_GetMovingFrameVelocities (Array< OneD, NekDouble > &vFrameVels) override
 
void v_SetMovingFrameDisp (const Array< OneD, NekDouble > &vFrameDisp) override
 
void v_SetMovingFramePivot (const Array< OneD, NekDouble > &vFramePivot) override
 
void v_GetMovingFramePivot (Array< OneD, NekDouble > &vFramePivot) override
 
bool v_GetMovingFrameDisp (Array< OneD, NekDouble > &vFrameDisp) override
 
void v_SetAeroForce (Array< OneD, NekDouble > forces) override
 
void v_GetAeroForce (Array< OneD, NekDouble > forces) override
 
void v_SetMovableDoFs (const std::set< int > &dirDoFs) override
 
void v_GetMovableDoFs (std::set< int > &dirDoFs) 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
 
void SetRadiationBoundaryForcing (int fieldid)
 Set Radiation forcing term.
 
void SetZeroNormalVelocity ()
 Set Normal Velocity Component to Zero.
 
void SetWomersleyBoundary (const int fldid, const int bndid)
 Set Womersley Profile if specified.
 
void SetUpWomersley (const int fldid, const int bndid, std::string womstr)
 Set Up Womersley details.
 
MultiRegions::ExpListSharedPtr v_GetPressure () override
 
void v_TransCoeffToPhys (void) override
 Virtual function for transformation to physical space.
 
void v_TransPhysToCoeff (void) override
 Virtual function for transformation to coefficient space.
 
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 bool v_PostIntegrate (int step) override
 
- Protected Member Functions inherited from Nektar::SolverUtils::UnsteadySystem
SOLVER_UTILS_EXPORT UnsteadySystem (const LibUtilities::SessionReaderSharedPtr &pSession, const SpatialDomains::MeshGraphSharedPtr &pGraph)
 Initialises UnsteadySystem class members.
 
SOLVER_UTILS_EXPORT void v_InitObject (bool DeclareField=true) override
 Init object for UnsteadySystem class.
 
SOLVER_UTILS_EXPORT void v_DoSolve () override
 Solves an unsteady problem.
 
virtual SOLVER_UTILS_EXPORT void v_PrintStatusInformation (const int step, const NekDouble cpuTime)
 Print Status Information.
 
virtual SOLVER_UTILS_EXPORT void v_PrintSummaryStatistics (const NekDouble intTime)
 Print Summary Statistics.
 
SOLVER_UTILS_EXPORT void v_DoInitialise (bool dumpInitialConditions=true) override
 Sets up initial conditions.
 
SOLVER_UTILS_EXPORT void v_GenerateSummary (SummaryList &s) override
 Print a summary of time stepping parameters.
 
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.
 
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.
 
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.
 
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.
 
- Protected Member Functions inherited from Nektar::SolverUtils::EquationSystem
SOLVER_UTILS_EXPORT EquationSystem (const LibUtilities::SessionReaderSharedPtr &pSession, const SpatialDomains::MeshGraphSharedPtr &pGraph)
 Initialises EquationSystem class members.
 
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.
 
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.
 
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.
 
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 bool v_NegatedOp (void)
 Virtual function to identify if operator is negated in DoSolve.
 
virtual SOLVER_UTILS_EXPORT void v_ExtraFldOutput (std::vector< Array< OneD, NekDouble > > &fieldcoeffs, std::vector< std::string > &variables)
 

Protected Attributes

ExtrapolateSharedPtr m_extrapolation
 
IncBoundaryConditionsSharedPtr m_IncNavierStokesBCs
 
std::ofstream m_mdlFile
 modal energy file
 
bool m_SmoothAdvection
 bool to identify if advection term smoothing is requested
 
std::vector< SolverUtils::ForcingSharedPtrm_forcing
 Forcing terms.
 
int m_nConvectiveFields
 Number of fields to be convected;.
 
Array< OneD, int > m_velocity
 int which identifies which components of m_fields contains the velocity (u,v,w);
 
MultiRegions::ExpListSharedPtr m_pressure
 Pointer to field holding pressure field.
 
NekDouble m_kinvis
 Kinematic viscosity.
 
int m_energysteps
 dump energy to file at steps time
 
EquationType m_equationType
 equation type;
 
Array< OneD, Array< OneD, int > > m_fieldsBCToElmtID
 Mapping from BCs to Elmt IDs.
 
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.
 
int m_intSteps
 Number of time integration steps AND Order of extrapolation for pressure boundary conditions.
 
Array< OneD, NekDoublem_pivotPoint
 pivot point for moving reference frame
 
Array< OneD, NekDoublem_aeroForces
 
std::map< int, std::map< int, WomersleyParamsSharedPtr > > m_womersleyParams
 Womersley parameters if required.
 
- Protected Attributes inherited from Nektar::SolverUtils::AdvectionSystem
SolverUtils::AdvectionSharedPtr m_advObject
 Advection term.
 
- Protected Attributes inherited from Nektar::SolverUtils::UnsteadySystem
LibUtilities::TimeIntegrationSchemeSharedPtr m_intScheme
 Wrapper to the time integration scheme.
 
LibUtilities::TimeIntegrationSchemeOperators m_ode
 The time integration scheme operators to use.
 
Array< OneD, Array< OneD, NekDouble > > m_previousSolution
 Storage for previous solution for steady-state check.
 
std::vector< int > m_intVariables
 
NekDouble m_cflSafetyFactor
 CFL safety factor (comprise between 0 to 1).
 
NekDouble m_CFLGrowth
 CFL growth rate.
 
NekDouble m_CFLEnd
 Maximun cfl in cfl growth.
 
int m_abortSteps
 Number of steps between checks for abort conditions.
 
bool m_explicitDiffusion
 Indicates if explicit or implicit treatment of diffusion is used.
 
bool m_explicitAdvection
 Indicates if explicit or implicit treatment of advection is used.
 
bool m_explicitReaction
 Indicates if explicit or implicit treatment of reaction is used.
 
int m_steadyStateSteps
 Check for steady state at step interval.
 
NekDouble m_steadyStateTol
 Tolerance to which steady state should be evaluated at.
 
int m_filtersInfosteps
 Number of time steps between outputting filters information.
 
std::vector< std::pair< std::string, FilterSharedPtr > > m_filters
 
bool m_homoInitialFwd
 Flag to determine if simulation should start in homogeneous forward transformed state.
 
std::ofstream m_errFile
 
NekDouble m_epsilon
 Diffusion coefficient.
 
- Protected Attributes inherited from Nektar::SolverUtils::EquationSystem
LibUtilities::CommSharedPtr m_comm
 Communicator.
 
bool m_verbose
 
LibUtilities::SessionReaderSharedPtr m_session
 The session reader.
 
std::map< std::string, SolverUtils::SessionFunctionSharedPtrm_sessionFunctions
 Map of known SessionFunctions.
 
LibUtilities::FieldIOSharedPtr m_fld
 Field input/output.
 
Array< OneD, MultiRegions::ExpListSharedPtrm_fields
 Array holding all dependent variables.
 
SpatialDomains::BoundaryConditionsSharedPtr m_boundaryConditions
 Pointer to boundary conditions object.
 
SpatialDomains::MeshGraphSharedPtr m_graph
 Pointer to graph defining mesh.
 
std::string m_sessionName
 Name of the session.
 
NekDouble m_time
 Current time of simulation.
 
int m_initialStep
 Number of the step where the simulation should begin.
 
NekDouble m_fintime
 Finish time of the simulation.
 
NekDouble m_timestep
 Time step size.
 
NekDouble m_lambda
 Lambda constant in real system if one required.
 
NekDouble m_checktime
 Time between checkpoints.
 
NekDouble m_lastCheckTime
 
NekDouble m_TimeIncrementFactor
 
int m_nchk
 Number of checkpoints written so far.
 
int m_steps
 Number of steps to take.
 
int m_checksteps
 Number of steps between checkpoints.
 
int m_infosteps
 Number of time steps between outputting status information.
 
int m_iterPIT = 0
 Number of parallel-in-time time iteration.
 
int m_windowPIT = 0
 Index of windows for parallel-in-time time iteration.
 
int m_spacedim
 Spatial dimension (>= expansion dim).
 
int m_expdim
 Expansion dimension.
 
bool m_singleMode
 Flag to determine if single homogeneous mode is used.
 
bool m_halfMode
 Flag to determine if half homogeneous mode is used.
 
bool m_multipleModes
 Flag to determine if use multiple homogenenous modes are used.
 
bool m_useFFT
 Flag to determine if FFT is used for homogeneous transform.
 
bool m_homogen_dealiasing
 Flag to determine if dealiasing is used for homogeneous simulations.
 
bool m_specHP_dealiasing
 Flag to determine if dealisising is usde for the Spectral/hp element discretisation.
 
enum MultiRegions::ProjectionType m_projectionType
 Type of projection; e.g continuous or discontinuous.
 
Array< OneD, Array< OneD, NekDouble > > m_traceNormals
 Array holding trace normals for DG simulations in the forwards direction.
 
Array< OneD, bool > m_checkIfSystemSingular
 Flag to indicate if the fields should be checked for singularity.
 
LibUtilities::FieldMetaDataMap m_fieldMetaDataMap
 Map to identify relevant solver info to dump in output fields.
 
Array< OneD, NekDoublem_movingFrameData
 Moving reference frame status in the body frame X, Y, Z, Theta_x, Theta_y, Theta_z, [inertial] U, V, W, Omega_x, Omega_y, Omega_z, [body] A_x, A_y, A_z, DOmega_x, DOmega_y, DOmega_z, [body] pivot_x, pivot_y, pivot_z [body].
 
std::vector< std::string > m_strFrameData
 variable name in m_movingFrameData
 
std::vector< bool > m_movableDoFs
 
int m_NumQuadPointsError
 Number of Quadrature points used to work out the error.
 
enum HomogeneousType m_HomogeneousType
 
NekDouble m_LhomX
 physical length in X direction (if homogeneous)
 
NekDouble m_LhomY
 physical length in Y direction (if homogeneous)
 
NekDouble m_LhomZ
 physical length in Z direction (if homogeneous)
 
int m_npointsX
 number of points in X direction (if homogeneous)
 
int m_npointsY
 number of points in Y direction (if homogeneous)
 
int m_npointsZ
 number of points in Z direction (if homogeneous)
 
int m_HomoDirec
 number of homogenous directions
 
- 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_meshDistorted = false
 
bool m_implicitALESolver = false
 
bool m_updateNormals = 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 148 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 812 of file IncNavierStokes.cpp.

813{
814 m_forcing.push_back(pForce);
815}
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 1020 of file IncNavierStokes.cpp.

1021{
1022 std::vector<std::string> vForceList;
1023 bool hasForce{false};
1024
1025 if (!m_session->DefinesElement("Nektar/Forcing"))
1026 {
1027 return hasForce;
1028 }
1029
1030 TiXmlElement *vForcing = m_session->GetElement("Nektar/Forcing");
1031 if (vForcing)
1032 {
1033 TiXmlElement *vForce = vForcing->FirstChildElement("FORCE");
1034 while (vForce)
1035 {
1036 std::string vType = vForce->Attribute("TYPE");
1037
1038 vForceList.push_back(vType);
1039 vForce = vForce->NextSiblingElement("FORCE");
1040 }
1041 }
1042
1043 for (auto &f : vForceList)
1044 {
1045 if (boost::iequals(f, sForce))
1046 {
1047 hasForce = true;
1048 }
1049 }
1050
1051 return hasForce;
1052}
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 309 of file IncNavierStokes.cpp.

312{
313 size_t VelDim = m_velocity.size();
314 Array<OneD, Array<OneD, NekDouble>> velocity(VelDim);
315
316 size_t npoints = m_fields[0]->GetNpoints();
317 for (size_t i = 0; i < VelDim; ++i)
318 {
319 velocity[i] = Array<OneD, NekDouble>(npoints);
320 Vmath::Vcopy(npoints, inarray[m_velocity[i]], 1, velocity[i], 1);
321 }
322 for (auto &x : m_forcing)
323 {
324 x->PreApply(m_fields, velocity, velocity, time);
325 }
326
327 m_advObject->Advect(m_nConvectiveFields, m_fields, velocity, inarray,
328 outarray, time);
329}
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 152 of file IncNavierStokes.h.

153 {
154 return m_nConvectiveFields;
155 }

References m_nConvectiveFields.

◆ SetBoundaryConditions()

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

time dependent boundary conditions updating

Time dependent boundary conditions updating

Definition at line 334 of file IncNavierStokes.cpp.

335{
336 size_t i, n;
337 std::string varName;
338 size_t nvariables = m_fields.size();
339
340 for (i = 0; i < nvariables; ++i)
341 {
342 for (n = 0; n < m_fields[i]->GetBndConditions().size(); ++n)
343 {
344 if (m_fields[i]->GetBndConditions()[n]->IsTimeDependent())
345 {
346 varName = m_session->GetVariable(i);
347 m_fields[i]->EvaluateBoundaryConditions(time, varName);
348 }
349 else if (boost::istarts_with(
350 m_fields[i]->GetBndConditions()[n]->GetUserDefined(),
351 "Womersley"))
352 {
354 }
355 }
356
357 // Set Radiation conditions if required
359 }
360
361 // Enforcing the boundary conditions (Inlet and wall) for the
362 // Moving reference frame
364}
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 369 of file IncNavierStokes.cpp.

370{
371 size_t i, n;
372
373 Array<OneD, const SpatialDomains::BoundaryConditionShPtr> BndConds;
374 Array<OneD, MultiRegions::ExpListSharedPtr> BndExp;
375
376 BndConds = m_fields[fieldid]->GetBndConditions();
377 BndExp = m_fields[fieldid]->GetBndCondExpansions();
378
381
382 size_t cnt;
383 size_t elmtid, nq, offset, boundary;
384 Array<OneD, NekDouble> Bvals, U;
385 size_t cnt1 = 0;
386
387 for (cnt = n = 0; n < BndConds.size(); ++n)
388 {
389 std::string type = BndConds[n]->GetUserDefined();
390
391 if ((BndConds[n]->GetBoundaryConditionType() ==
393 (boost::iequals(type, "Radiation")))
394 {
395 size_t nExp = BndExp[n]->GetExpSize();
396 for (i = 0; i < nExp; ++i, cnt++)
397 {
398 elmtid = m_fieldsBCToElmtID[m_velocity[fieldid]][cnt];
399 elmt = m_fields[fieldid]->GetExp(elmtid);
400 offset = m_fields[fieldid]->GetPhys_Offset(elmtid);
401
402 U = m_fields[fieldid]->UpdatePhys() + offset;
403 Bc = BndExp[n]->GetExp(i);
404
405 boundary = m_fieldsBCToTraceID[fieldid][cnt];
406
407 // Get edge values and put into ubc
408 nq = Bc->GetTotPoints();
409 Array<OneD, NekDouble> ubc(nq);
410 elmt->GetTracePhysVals(boundary, Bc, U, ubc);
411
412 Vmath::Vmul(nq,
414 [fieldid][cnt1 + BndExp[n]->GetPhys_Offset(i)],
415 1, &ubc[0], 1, &ubc[0], 1);
416
417 Bvals =
418 BndExp[n]->UpdateCoeffs() + BndExp[n]->GetCoeff_Offset(i);
419
420 Bc->IProductWRTBase(ubc, Bvals);
421 }
422 cnt1 += BndExp[n]->GetTotPoints();
423 }
424 else
425 {
426 cnt += BndExp[n]->GetExpSize();
427 }
428 }
429}
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 588 of file IncNavierStokes.cpp.

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

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

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 519 of file IncNavierStokes.cpp.

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

432{
433 // use static trip since cannot use UserDefinedTag for zero
434 // velocity and have time dependent conditions
435 static bool Setup = false;
436
437 if (Setup == true)
438 {
439 return;
440 }
441 Setup = true;
442
443 size_t i, n;
444
445 Array<OneD, Array<OneD, const SpatialDomains::BoundaryConditionShPtr>>
446 BndConds(m_spacedim);
447 Array<OneD, Array<OneD, MultiRegions::ExpListSharedPtr>> BndExp(m_spacedim);
448
449 for (int i = 0; i < m_spacedim; ++i)
450 {
451 BndConds[i] = m_fields[m_velocity[i]]->GetBndConditions();
452 BndExp[i] = m_fields[m_velocity[i]]->GetBndCondExpansions();
453 }
454
456
457 size_t cnt;
458 size_t elmtid, nq, boundary;
459
460 Array<OneD, Array<OneD, NekDouble>> normals;
461 Array<OneD, NekDouble> Bphys, Bcoeffs;
462
463 size_t fldid = m_velocity[0];
464
465 for (cnt = n = 0; n < BndConds[0].size(); ++n)
466 {
467 if ((BndConds[0][n]->GetBoundaryConditionType() ==
469 (boost::iequals(BndConds[0][n]->GetUserDefined(),
470 "ZeroNormalComponent")))
471 {
472 size_t nExp = BndExp[0][n]->GetExpSize();
473 for (i = 0; i < nExp; ++i, cnt++)
474 {
475 elmtid = m_fieldsBCToElmtID[fldid][cnt];
476 elmt = m_fields[0]->GetExp(elmtid);
477 boundary = m_fieldsBCToTraceID[fldid][cnt];
478
479 normals = elmt->GetTraceNormal(boundary);
480
481 nq = BndExp[0][n]->GetExp(i)->GetTotPoints();
482 Array<OneD, NekDouble> normvel(nq, 0.0);
483
484 for (int k = 0; k < m_spacedim; ++k)
485 {
486 Bphys = BndExp[k][n]->UpdatePhys() +
487 BndExp[k][n]->GetPhys_Offset(i);
488 Bc = BndExp[k][n]->GetExp(i);
489 Vmath::Vvtvp(nq, normals[k], 1, Bphys, 1, normvel, 1,
490 normvel, 1);
491 }
492
493 // negate normvel for next step
494 Vmath::Neg(nq, normvel, 1);
495
496 for (int k = 0; k < m_spacedim; ++k)
497 {
498 Bphys = BndExp[k][n]->UpdatePhys() +
499 BndExp[k][n]->GetPhys_Offset(i);
500 Bcoeffs = BndExp[k][n]->UpdateCoeffs() +
501 BndExp[k][n]->GetCoeff_Offset(i);
502 Bc = BndExp[k][n]->GetExp(i);
503 Vmath::Vvtvp(nq, normvel, 1, normals[k], 1, Bphys, 1, Bphys,
504 1);
505 Bc->FwdTransBndConstrained(Bphys, Bcoeffs);
506 }
507 }
508 }
509 else
510 {
511 cnt += BndExp[0][n]->GetExpSize();
512 }
513 }
514}
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 1009 of file IncNavierStokes.cpp.

1010{
1011 if (m_aeroForces.size() >= 12)
1012 {
1013 Vmath::Vcopy(12, m_aeroForces, 1, forces, 1);
1014 }
1015}
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 869 of file IncNavierStokes.cpp.

872{
873 int nPts = physfield[0].size();
874 Vmath::Fill(nPts, 1.0, density, 1);
875}
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 820 of file IncNavierStokes.cpp.

822{
823 size_t nvel = m_velocity.size();
824 size_t nelmt = m_fields[0]->GetExpSize();
825
826 Array<OneD, NekDouble> stdVelocity(nelmt, 0.0);
827 Array<OneD, Array<OneD, NekDouble>> velfields;
828
829 if (m_HomogeneousType == eHomogeneous1D) // just do check on 2D info
830 {
831 velfields = Array<OneD, Array<OneD, NekDouble>>(2);
832
833 for (size_t i = 0; i < 2; ++i)
834 {
835 velfields[i] = m_fields[m_velocity[i]]->UpdatePhys();
836 }
837 }
838 else
839 {
840 velfields = Array<OneD, Array<OneD, NekDouble>>(nvel);
841
842 for (size_t i = 0; i < nvel; ++i)
843 {
844 velfields[i] = m_fields[m_velocity[i]]->UpdatePhys();
845 }
846 }
847
848 stdVelocity = m_extrapolation->GetMaxStdVelocity(velfields);
849
850 return stdVelocity;
851}
ExtrapolateSharedPtr m_extrapolation

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

◆ v_GetMovableDoFs()

void Nektar::IncNavierStokes::v_GetMovableDoFs ( std::set< int > &  dirDoFs)
overrideprotectedvirtual

Reimplemented from Nektar::SolverUtils::FluidInterface.

Definition at line 989 of file IncNavierStokes.cpp.

990{
991 dirDoFs.clear();
992 for (int i = 0; i < m_movableDoFs.size(); ++i)
993 {
994 if (m_movableDoFs[i])
995 {
996 dirDoFs.insert(i);
997 }
998 }
999}

References Nektar::SolverUtils::EquationSystem::m_movableDoFs.

◆ v_GetMovingFrameDisp()

bool Nektar::IncNavierStokes::v_GetMovingFrameDisp ( Array< OneD, NekDouble > &  vFrameDisp)
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 948 of file IncNavierStokes.cpp.

949{
950 if (m_movingFrameData.size())
951 {
952 ASSERTL0(
953 vFrameDisp.size() == 6,
954 "Arrays have different size, cannot get moving frame displacement");
955 Vmath::Vcopy(vFrameDisp.size(), m_movingFrameData, 1, vFrameDisp, 1);
956 return true;
957 }
958 else
959 {
960 return false;
961 }
962}
Array< OneD, NekDouble > m_movingFrameData
Moving reference frame status in the body frame X, Y, Z, Theta_x, Theta_y, Theta_z,...

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

◆ v_GetMovingFramePivot()

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

Reimplemented from Nektar::SolverUtils::FluidInterface.

Definition at line 973 of file IncNavierStokes.cpp.

974{
975 ASSERTL0(vFramePivot.size() == 3,
976 "Arrays have different size, cannot set moving frame pivot");
977 Array<OneD, NekDouble> temp = m_movingFrameData + 18;
978 Vmath::Vcopy(vFramePivot.size(), temp, 1, vFramePivot, 1);
979}

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

◆ v_GetMovingFrameVelocities()

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

Reimplemented from Nektar::SolverUtils::FluidInterface.

Definition at line 909 of file IncNavierStokes.cpp.

911{
912 if (m_movingFrameData.size())
913 {
914 ASSERTL0(vFrameVels.size() <= 12,
915 "Arrays have different dimensions, cannot get moving frame "
916 "velocities");
917 Vmath::Vcopy(vFrameVels.size(), m_movingFrameData + 6, 1, vFrameVels,
918 1);
919 return true;
920 }
921 else
922 {
923 return false;
924 }
925}

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 282 of file IncNavierStokes.h.

283 {
284 return m_pressure;
285 }
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 856 of file IncNavierStokes.cpp.

859{
860 if (physfield.size())
861 {
862 pressure = physfield[physfield.size() - 1];
863 }
864}

◆ 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 880 of file IncNavierStokes.cpp.

883{
884 for (int i = 0; i < m_spacedim; ++i)
885 {
886 velocity[i] = physfield[i];
887 }
888}

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

◆ v_HasConstantDensity()

bool Nektar::IncNavierStokes::v_HasConstantDensity ( )
inlineoverrideprotectedvirtual

Implements Nektar::SolverUtils::FluidInterface.

Definition at line 225 of file IncNavierStokes.h.

226 {
227 return true;
228 }

◆ 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::PressDecompVCSFSI, Nektar::SmoothedProfileMethod, Nektar::VCSFSI, 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 std::string vSolver = m_session->GetSolverInfo("SolverType");
167 const bool isVCS = boost::iequals(vSolver, "VelocityCorrectionScheme");
168 if (isVCS)
169 {
170 ASSERTL0(false, "The Forcing MovingRefenceFrame is no "
171 "longer supported for use in the "
172 "VelocityCorrectionScheme. Please replace the "
173 "SolverType with VCSFSI or PressDecompVCSFSI.");
174 }
175 // 0-5(inertial disp), 6-11(body vel), 12-17(body acce) current
176 // 18-21(body pivot)
178 "X", "Y", "Z", "Theta_x", "Theta_y", "Theta_z",
179 "U", "V", "W", "Omega_x", "Omega_y", "Omega_z",
180 "A_x", "A_y", "A_z", "DOmega_x", "DOmega_y", "DOmega_z",
181 "X0", "Y0", "Z0"};
182 m_movingFrameData = Array<OneD, NekDouble>(21, 0.0);
183 m_aeroForces = Array<OneD, NekDouble>(12, 0.0); // p; vis
184 m_movableDoFs.resize(6, false);
185 }
186 else
187 {
188 m_aeroForces = Array<OneD, NekDouble>(6, 0.0);
189 }
190 // Forcing terms
191 m_forcing = SolverUtils::Forcing::Load(m_session, shared_from_this(),
193
194 // check to see if any Robin boundary conditions and if so set
195 // up m_field to boundary condition maps;
196 m_fieldsBCToElmtID = Array<OneD, Array<OneD, int>>(numfields);
197 m_fieldsBCToTraceID = Array<OneD, Array<OneD, int>>(numfields);
198 m_fieldsRadiationFactor = Array<OneD, Array<OneD, NekDouble>>(numfields);
199
200 for (size_t i = 0; i < m_fields.size(); ++i)
201 {
202 bool Set = false;
203
204 Array<OneD, const SpatialDomains::BoundaryConditionShPtr> BndConds;
205 Array<OneD, MultiRegions::ExpListSharedPtr> BndExp;
206 int radpts = 0;
207
208 BndConds = m_fields[i]->GetBndConditions();
209 BndExp = m_fields[i]->GetBndCondExpansions();
210 for (size_t n = 0; n < BndConds.size(); ++n)
211 {
212 if (boost::iequals(BndConds[n]->GetUserDefined(), "Radiation"))
213 {
214 ASSERTL0(
215 BndConds[n]->GetBoundaryConditionType() ==
217 "Radiation boundary condition must be of type Robin <R>");
218
219 if (Set == false)
220 {
221 m_fields[i]->GetBoundaryToElmtMap(m_fieldsBCToElmtID[i],
223 Set = true;
224 }
225 radpts += BndExp[n]->GetTotPoints();
226 }
227 if (boost::iequals(BndConds[n]->GetUserDefined(),
228 "ZeroNormalComponent"))
229 {
230 ASSERTL0(BndConds[n]->GetBoundaryConditionType() ==
232 "Zero Normal Component boundary condition option must "
233 "be of type Dirichlet <D>");
234
235 if (Set == false)
236 {
237 m_fields[i]->GetBoundaryToElmtMap(m_fieldsBCToElmtID[i],
239 Set = true;
240 }
241 }
242 }
243
244 m_fieldsRadiationFactor[i] = Array<OneD, NekDouble>(radpts);
245
246 radpts = 0; // reset to use as a counter
247
248 for (size_t n = 0; n < BndConds.size(); ++n)
249 {
250 if (boost::iequals(BndConds[n]->GetUserDefined(), "Radiation"))
251 {
252
253 int npoints = BndExp[n]->GetNpoints();
254 Array<OneD, NekDouble> x0(npoints, 0.0);
255 Array<OneD, NekDouble> x1(npoints, 0.0);
256 Array<OneD, NekDouble> x2(npoints, 0.0);
257 Array<OneD, NekDouble> tmpArray;
258
259 BndExp[n]->GetCoords(x0, x1, x2);
260
262 std::static_pointer_cast<
263 SpatialDomains::RobinBoundaryCondition>(BndConds[n])
264 ->m_robinPrimitiveCoeff;
265
266 coeff->Evaluate(x0, x1, x2, m_time,
267 tmpArray = m_fieldsRadiationFactor[i] + radpts);
268 // Vmath::Neg(npoints,tmpArray = m_fieldsRadiationFactor[i]+
269 // radpts,1);
270 radpts += npoints;
271 }
272 }
273 }
274
275 // Set up maping for womersley BC - and load variables
276 for (size_t i = 0; i < m_fields.size(); ++i)
277 {
278 for (size_t n = 0; n < m_fields[i]->GetBndConditions().size(); ++n)
279 {
280 if (boost::istarts_with(
281 m_fields[i]->GetBndConditions()[n]->GetUserDefined(),
282 "Womersley"))
283 {
284 // assumes that boundary condition is applied in normal
285 // direction and is decomposed for each direction. There could
286 // be a unique file for each direction
287 m_womersleyParams[i][n] =
289 m_spacedim);
290 // Read in fourier coeffs and precompute coefficients
292 i, n, m_fields[i]->GetBndConditions()[n]->GetUserDefined());
293
294 m_fields[i]->GetBoundaryToElmtMap(m_fieldsBCToElmtID[i],
296 }
297 }
298 }
299
300 // Set up Field Meta Data for output files
301 m_fieldMetaDataMap["Kinvis"] = boost::lexical_cast<std::string>(m_kinvis);
302 m_fieldMetaDataMap["TimeStep"] =
303 boost::lexical_cast<std::string>(m_timestep);
304}
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
std::shared_ptr< Equation > EquationSharedPtr
Definition Equation.h:131
AdvectionFactory & GetAdvectionFactory()
Gets the factory for initialising advection objects.
Definition Advection.cpp:43
@ eSteadyNavierStokes
@ 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::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_movableDoFs, 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 1057 of file IncNavierStokes.cpp.

1058{
1059 m_extrapolation->SubStepSaveFields(step);
1060 m_extrapolation->SubStepAdvance(step, m_time);
1062 return false;
1063}
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 1001 of file IncNavierStokes.cpp.

1002{
1003 if (m_aeroForces.size() >= 12)
1004 {
1005 Vmath::Vcopy(12, forces, 1, m_aeroForces, 1);
1006 }
1007}

References m_aeroForces, and Vmath::Vcopy().

◆ v_SetMovableDoFs()

void Nektar::IncNavierStokes::v_SetMovableDoFs ( const std::set< int > &  dirDoFs)
overrideprotectedvirtual

Reimplemented from Nektar::SolverUtils::FluidInterface.

Definition at line 981 of file IncNavierStokes.cpp.

982{
983 for (int i = 0; i < m_movableDoFs.size(); ++i)
984 {
985 m_movableDoFs[i] = dirDoFs.find(i) != dirDoFs.end();
986 }
987}

References Nektar::SolverUtils::EquationSystem::m_movableDoFs.

◆ v_SetMovingFrameDisp()

void Nektar::IncNavierStokes::v_SetMovingFrameDisp ( const Array< OneD, NekDouble > &  vFrameDisp)
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 931 of file IncNavierStokes.cpp.

933{
934 if (m_movingFrameData.size())
935 {
936 ASSERTL0(
937 vFrameDisp.size() == 6,
938 "Arrays have different size, cannot set moving frame displacement");
939 Array<OneD, NekDouble> temp = m_movingFrameData;
940 Vmath::Vcopy(vFrameDisp.size(), vFrameDisp, 1, temp, 1);
941 }
942}

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 964 of file IncNavierStokes.cpp.

966{
967 ASSERTL0(vFramePivot.size() == 3,
968 "Arrays have different size, cannot set moving frame pivot");
969 Array<OneD, NekDouble> temp = m_movingFrameData + 18;
970 Vmath::Vcopy(vFramePivot.size(), vFramePivot, 1, temp, 1);
971}

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

◆ v_SetMovingFrameVelocities()

void Nektar::IncNavierStokes::v_SetMovingFrameVelocities ( const Array< OneD, NekDouble > &  vFrameVels)
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 896 of file IncNavierStokes.cpp.

898{
899 if (m_movingFrameData.size())
900 {
901 ASSERTL0(vFrameVels.size() <= 12,
902 "Arrays have different dimensions, cannot set moving frame "
903 "velocities");
904 Array<OneD, NekDouble> temp = m_movingFrameData + 6;
905 Vmath::Vcopy(vFrameVels.size(), vFrameVels, 1, temp, 1);
906 }
907}

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 287 of file IncNavierStokes.h.

288 {
289 ASSERTL0(false, "This method is not defined in this class");
290 }

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 292 of file IncNavierStokes.h.

293 {
294 ASSERTL0(false, "This method is not defined in this class");
295 }

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 207 of file IncNavierStokes.h.

◆ m_aeroForces

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

Definition at line 205 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 187 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 193 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 195 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 197 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 201 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 167 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 204 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 180 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::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 280 of file IncNavierStokes.h.

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