36#ifndef NEKTAR_SOLVERUTILS_FORCINGSYNTHETICEDDY
37#define NEKTAR_SOLVERUTILS_FORCINGSYNTHETICEDDY
53 const std::weak_ptr<EquationSystem> &pEquation,
55 const unsigned int &pNumForcingFields,
const TiXmlElement *pForce)
60 p->InitObject(pFields, pNumForcingFields, pForce);
71 const unsigned int &pNumForcingFields,
72 const TiXmlElement *pForce)
override;
139 std::map<int, LibUtilities::EquationSharedPtr>
m_R;
182 const std::weak_ptr<EquationSystem> &pEquation);
#define SOLVER_UTILS_EXPORT
General purpose memory allocation routines with the ability to allocate from thread specific memory p...
static std::shared_ptr< DataType > AllocateSharedPtr(const Args &...args)
Allocate a shared pointer from the memory pool.
Defines a forcing term to be explicitly applied.
SOLVER_UTILS_EXPORT void SetBoxOfEddiesMask(const Array< OneD, MultiRegions::ExpListSharedPtr > &pFields)
Set box of eddies mask.
NekDouble m_Ub
Bulk velocity.
std::map< int, LibUtilities::EquationSharedPtr > m_R
Array< OneD, NekDouble > m_lyz
Inlet length in the y-direction and z-direction.
Array< OneD, NekDouble > m_lref
Reference lenghts.
SOLVER_UTILS_EXPORT Array< OneD, Array< OneD, NekDouble > > ComputeSmoothingFactor(const Array< OneD, MultiRegions::ExpListSharedPtr > &pFields, Array< OneD, Array< OneD, NekDouble > > convTurb)
Compute Smoothing Factor.
SOLVER_UTILS_EXPORT ~ForcingSyntheticEddy(void) override=default
SOLVER_UTILS_EXPORT void v_ApplyCoeff(const Array< OneD, MultiRegions::ExpListSharedPtr > &pFields, const Array< OneD, Array< OneD, NekDouble > > &inarray, Array< OneD, Array< OneD, NekDouble > > &outarray, const NekDouble &time) override
Apply forcing term if an eddy left the box of eddies and update the eddies positions.
Array< OneD, Array< OneD, Array< OneD, NekDouble > > > m_ForcingEddy
Forcing for each eddy.
SOLVER_UTILS_EXPORT ForcingSyntheticEddy(const LibUtilities::SessionReaderSharedPtr &pSession, const std::weak_ptr< EquationSystem > &pEquation)
int m_N
Number of eddies in the box.
SOLVER_UTILS_EXPORT NekDouble ComputeConstantC(int row, int col)
Compute Constant C.
int m_spacedim
Space dimension.
Array< OneD, NekDouble > m_l
Characteristic lenght scales.
bool m_tCase
Check for test case.
static SOLVER_UTILS_EXPORT std::string className
Name of the class.
SOLVER_UTILS_EXPORT Array< OneD, Array< OneD, NekDouble > > ComputeStochasticSignal(const Array< OneD, MultiRegions::ExpListSharedPtr > &pFields)
Compute Stochastic Signal.
SOLVER_UTILS_EXPORT Array< OneD, Array< OneD, int > > GenerateRandomOneOrMinusOne()
Compute Random 1 or -1 value.
NekDouble m_currTime
Current time.
SOLVER_UTILS_EXPORT Array< OneD, Array< OneD, NekDouble > > ComputeVelocityFluctuation(const Array< OneD, MultiRegions::ExpListSharedPtr > &pFields, Array< OneD, Array< OneD, NekDouble > > stochasticSignal)
Compute Velocity Fluctuation.
SOLVER_UTILS_EXPORT void UpdateEddiesPositions()
Update positions of the eddies inside the box.
SOLVER_UTILS_EXPORT NekDouble ComputeGaussian(NekDouble coord, NekDouble xiMaxVal, NekDouble constC=1.0)
Compute Gaussian.
std::vector< unsigned int > m_eddiesIDForcing
Eddies that add to the domain.
SOLVER_UTILS_EXPORT void SetNumberOfEddies()
Set the Number of the Eddies in the box.
SOLVER_UTILS_EXPORT void InitialiseForcingEddy(const Array< OneD, MultiRegions::ExpListSharedPtr > &pFields)
Initialise forcing term for each eddy.
Array< OneD, NekDouble > m_rc
Center of the inlet plane.
SOLVER_UTILS_EXPORT void v_Apply(const Array< OneD, MultiRegions::ExpListSharedPtr > &pFields, const Array< OneD, Array< OneD, NekDouble > > &inarray, Array< OneD, Array< OneD, NekDouble > > &outarray, const NekDouble &time) override
Apply forcing term if an eddy left the box of eddies and update the eddies positions.
SOLVER_UTILS_EXPORT void ComputeInitialLocationTestCase()
Compute the initial location of the eddies for the test case.
bool m_calcForcing
Check when the forcing should be applied.
SOLVER_UTILS_EXPORT void v_InitObject(const Array< OneD, MultiRegions::ExpListSharedPtr > &pFields, const unsigned int &pNumForcingFields, const TiXmlElement *pForce) override
Read input from xml file and initialise the class members. The main parameters are the characteristic...
static SOLVER_UTILS_EXPORT ForcingSharedPtr create(const LibUtilities::SessionReaderSharedPtr &pSession, const std::weak_ptr< EquationSystem > &pEquation, const Array< OneD, MultiRegions::ExpListSharedPtr > &pFields, const unsigned int &pNumForcingFields, const TiXmlElement *pForce)
Creates an instance of this class.
NekDouble m_sigma
Standard deviation.
SOLVER_UTILS_EXPORT void ComputeInitialRandomLocationOfEddies()
Compute the initial position of the eddies inside the box.
SOLVER_UTILS_EXPORT void ComputeXiMax()
Set Xi max.
Array< OneD, NekDouble > m_xiMax
Xi max.
SOLVER_UTILS_EXPORT void RemoveEddiesFromForcing(const Array< OneD, MultiRegions::ExpListSharedPtr > &pFields)
Remove eddy from forcing term.
Array< OneD, Array< OneD, NekDouble > > m_Cholesky
Cholesky decomposition of the Reynolds Stresses for all points in the mesh.
SOLVER_UTILS_EXPORT Array< OneD, Array< OneD, NekDouble > > ComputeCharConvTurbTime(const Array< OneD, MultiRegions::ExpListSharedPtr > &pFields)
Compute Characteristic Convective Turbulent Time.
SOLVER_UTILS_EXPORT void ComputeRefLenghts()
Set reference lengths.
Array< OneD, int > m_mask
Box of eddies mask.
SOLVER_UTILS_EXPORT bool InsideBoxOfEddies(NekDouble coord0, NekDouble coord1, NekDouble coord2)
Check if point is inside the box of eddies.
SOLVER_UTILS_EXPORT void SetCholeskyReyStresses(const Array< OneD, MultiRegions::ExpListSharedPtr > &pFields)
Calculates the Cholesky decomposition of the Reynolds Stresses in each degree of freedom of the mesh.
Array< OneD, Array< OneD, NekDouble > > m_eddyPos
Eddy position.
NekDouble m_gamma
Ration of specific heats.
std::shared_ptr< SessionReader > SessionReaderSharedPtr
SOLVER_UTILS_EXPORT typedef std::shared_ptr< Forcing > ForcingSharedPtr
A shared pointer to an EquationSystem object.