Nektar++
|
#include <ForcingSyntheticEddy.h>
Static Public Member Functions | |
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. More... | |
Static Public Member Functions inherited from Nektar::SolverUtils::Forcing | |
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) |
Static Public Attributes | |
static SOLVER_UTILS_EXPORT std::string | className |
Name of the class. More... | |
Protected Attributes | |
std::map< int, LibUtilities::EquationSharedPtr > | m_R |
Array< OneD, Array< OneD, NekDouble > > | m_Cholesky |
Cholesky decomposition of the Reynolds Stresses for all points in the mesh. More... | |
NekDouble | m_Ub |
Bulk velocity. More... | |
NekDouble | m_sigma |
Standard deviation. More... | |
Array< OneD, NekDouble > | m_lyz |
Inlet length in the y-direction and z-direction. More... | |
Array< OneD, NekDouble > | m_rc |
Center of the inlet plane. More... | |
int | m_N |
Number of eddies in the box. More... | |
Array< OneD, NekDouble > | m_l |
Characteristic lenght scales. More... | |
Array< OneD, NekDouble > | m_lref |
Reference lenghts. More... | |
Array< OneD, NekDouble > | m_xiMax |
Xi max. More... | |
NekDouble | m_xiMaxMin = 0.4 |
int | m_spacedim |
Space dimension. More... | |
NekDouble | m_gamma |
Ration of specific heats. More... | |
Array< OneD, int > | m_mask |
Box of eddies mask. More... | |
Array< OneD, Array< OneD, NekDouble > > | m_eddyPos |
Eddy position. More... | |
bool | m_calcForcing {true} |
Check when the forcing should be applied. More... | |
std::vector< unsigned int > | m_eddiesIDForcing |
Eddies that add to the domain. More... | |
NekDouble | m_currTime |
Current time. More... | |
bool | m_tCase |
Check for test case. More... | |
Array< OneD, Array< OneD, Array< OneD, NekDouble > > > | m_ForcingEddy |
Forcing for each eddy. More... | |
Protected Attributes inherited from Nektar::SolverUtils::Forcing | |
LibUtilities::SessionReaderSharedPtr | m_session |
Session reader. More... | |
const std::weak_ptr< EquationSystem > | m_equ |
Weak pointer to equation system using this forcing. More... | |
Array< OneD, Array< OneD, NekDouble > > | m_Forcing |
Evaluated forcing function. More... | |
int | m_NumVariable |
Number of variables. More... | |
std::map< std::string, SolverUtils::SessionFunctionSharedPtr > | m_sessionFunctions |
Map of known SessionFunctions. More... | |
Friends | |
class | MemoryManager< ForcingSyntheticEddy > |
Additional Inherited Members | |
Public Member Functions inherited from Nektar::SolverUtils::Forcing | |
virtual SOLVER_UTILS_EXPORT | ~Forcing () |
SOLVER_UTILS_EXPORT void | InitObject (const Array< OneD, MultiRegions::ExpListSharedPtr > &pFields, const unsigned int &pNumForcingFields, const TiXmlElement *pForce) |
Initialise the forcing object. More... | |
SOLVER_UTILS_EXPORT void | Apply (const Array< OneD, MultiRegions::ExpListSharedPtr > &fields, const Array< OneD, Array< OneD, NekDouble > > &inarray, Array< OneD, Array< OneD, NekDouble > > &outarray, const NekDouble &time) |
Apply the forcing. More... | |
SOLVER_UTILS_EXPORT void | PreApply (const Array< OneD, MultiRegions::ExpListSharedPtr > &fields, const Array< OneD, Array< OneD, NekDouble > > &inarray, Array< OneD, Array< OneD, NekDouble > > &outarray, const NekDouble &time) |
Change the advection velocity before applying the forcing. For example, subtracting the frame velocity from the advection velocity in the MovingRefercenceFrame. More... | |
SOLVER_UTILS_EXPORT void | ApplyCoeff (const Array< OneD, MultiRegions::ExpListSharedPtr > &fields, const Array< OneD, Array< OneD, NekDouble > > &inarray, Array< OneD, Array< OneD, NekDouble > > &outarray, const NekDouble &time) |
Apply the forcing. More... | |
SOLVER_UTILS_EXPORT const Array< OneD, const Array< OneD, NekDouble > > & | GetForces () |
SOLVER_UTILS_EXPORT Array< OneD, Array< OneD, NekDouble > > & | UpdateForces () |
Definition at line 45 of file ForcingSyntheticEddy.h.
|
protected |
Definition at line 49 of file ForcingSyntheticEddy.cpp.
|
overrideprotecteddefault |
|
protected |
Compute Characteristic Convective Turbulent Time.
Compute characteristic convective turbulent time.
pFields | Pointer to fields. |
Definition at line 285 of file ForcingSyntheticEddy.cpp.
References m_l, m_lref, m_mask, m_spacedim, m_Ub, and m_xiMaxMin.
Referenced by Nektar::SolverUtils::ForcingCFSSyntheticEddy::CalculateForcing(), and Nektar::SolverUtils::ForcingIncNSSyntheticEddy::CalculateForcing().
|
protected |
Compute Constant C.
Compute constant C for the gaussian funcion.
row | index for the rows of the matrix. |
col | index for the columns of the matrix. |
Definition at line 614 of file ForcingSyntheticEddy.cpp.
References ComputeGaussian(), m_spacedim, and m_xiMax.
Referenced by ComputeStochasticSignal().
|
protected |
Compute Gaussian.
Compute standard Gaussian with zero mean.
coord | Coordianate. |
Definition at line 591 of file ForcingSyntheticEddy.cpp.
References tinysimd::abs(), m_sigma, and tinysimd::sqrt().
Referenced by ComputeConstantC(), and ComputeStochasticSignal().
|
protected |
Compute the initial location of the eddies for the test case.
Place eddies in specific locations in the test case geometry for consistency and comparison.
This function was design for a three-dimensional channel flow test case (ChanFlow3d_infTurb). It is only called for testing purposes (unit test).
Definition at line 900 of file ForcingSyntheticEddy.cpp.
References m_eddyPos, m_lref, m_lyz, m_N, m_rc, and m_spacedim.
Referenced by v_InitObject().
|
protected |
Compute the initial position of the eddies inside the box.
Calculate distribution of eddies in the box.
Definition at line 565 of file ForcingSyntheticEddy.cpp.
References m_eddyPos, m_lref, m_lyz, m_N, m_rc, and m_spacedim.
Referenced by v_InitObject().
|
protected |
Set reference lengths.
Calculates the reference lenghts.
Definition at line 768 of file ForcingSyntheticEddy.cpp.
References m_l, m_lref, and m_spacedim.
Referenced by v_InitObject().
|
protected |
Compute Smoothing Factor.
Compute smoothing factor to avoid strong variations of the source term across the domain.
pFields | Pointer to fields. |
convTurbTime | Convective turbulent time. |
Definition at line 320 of file ForcingSyntheticEddy.cpp.
References m_lref, m_mask, m_rc, m_spacedim, and m_Ub.
Referenced by Nektar::SolverUtils::ForcingCFSSyntheticEddy::CalculateForcing(), and Nektar::SolverUtils::ForcingIncNSSyntheticEddy::CalculateForcing().
|
protected |
Compute Stochastic Signal.
Compute stochastic signal.
pFields | Pointer to fields. |
Definition at line 429 of file ForcingSyntheticEddy.cpp.
References ComputeConstantC(), ComputeGaussian(), GenerateRandomOneOrMinusOne(), m_eddiesIDForcing, m_eddyPos, m_lref, m_mask, m_N, m_spacedim, and m_xiMax.
Referenced by Nektar::SolverUtils::ForcingCFSSyntheticEddy::CalculateForcing(), and Nektar::SolverUtils::ForcingIncNSSyntheticEddy::CalculateForcing().
|
protected |
Compute Velocity Fluctuation.
Calculate velocity fluctuation for the source term.
pFields | Pointer to fields. |
stochasticSignal | Stochastic signal. |
Definition at line 387 of file ForcingSyntheticEddy.cpp.
References m_Cholesky, m_eddiesIDForcing, m_mask, m_N, and m_spacedim.
Referenced by Nektar::SolverUtils::ForcingCFSSyntheticEddy::CalculateForcing(), and Nektar::SolverUtils::ForcingIncNSSyntheticEddy::CalculateForcing().
|
protected |
Set Xi max.
Calculates the \(\xi_{max}\).
Definition at line 793 of file ForcingSyntheticEddy.cpp.
References m_l, m_lref, m_spacedim, m_xiMax, and m_xiMaxMin.
Referenced by v_InitObject().
|
inlinestatic |
Creates an instance of this class.
Definition at line 51 of file ForcingSyntheticEddy.h.
References Nektar::MemoryManager< DataType >::AllocateSharedPtr(), Nektar::SolverUtils::ForcingSharedPtr, and CellMLToNektar.cellml_metadata::p.
|
protected |
Compute Random 1 or -1 value.
Generate random 1 or -1 values to be use to compute the stochastic signal.
Definition at line 640 of file ForcingSyntheticEddy.cpp.
References m_eddiesIDForcing, m_N, m_spacedim, and m_tCase.
Referenced by ComputeStochasticSignal().
|
protected |
Initialise forcing term for each eddy.
Initialise Forcing term for each eddy.
Definition at line 717 of file ForcingSyntheticEddy.cpp.
References m_ForcingEddy, and m_N.
Referenced by v_InitObject().
|
protected |
Check if point is inside the box of eddies.
Check it point is inside the box of eddies.
coord0 | coordinate in the x-direction. |
coord1 | coordinate in the y-direction. |
coord2 | coordinate in the z-direction. |
Definition at line 748 of file ForcingSyntheticEddy.cpp.
References m_lref, m_lyz, and m_rc.
Referenced by SetBoxOfEddiesMask().
|
protected |
Remove eddy from forcing term.
pFields | Pointer to fields. |
Definition at line 542 of file ForcingSyntheticEddy.cpp.
References m_eddiesIDForcing, Nektar::SolverUtils::Forcing::m_Forcing, and m_ForcingEddy.
Referenced by Nektar::SolverUtils::ForcingCFSSyntheticEddy::CalculateForcing(), and Nektar::SolverUtils::ForcingIncNSSyntheticEddy::CalculateForcing().
|
protected |
Set box of eddies mask.
Set box of eddies mask to be used to seprate the degrees of freedom (coordinates) inside and outside the box of eddies.
pFields | Pointer to fields. |
Definition at line 678 of file ForcingSyntheticEddy.cpp.
References InsideBoxOfEddies(), and m_mask.
Referenced by v_InitObject().
|
protected |
Calculates the Cholesky decomposition of the Reynolds Stresses in each degree of freedom of the mesh.
pFields | Pointer to fields. |
Definition at line 821 of file ForcingSyntheticEddy.cpp.
References Lapack::Dpptrf(), Nektar::ErrorUtil::efatal, m_Cholesky, m_R, m_spacedim, and NEKERROR.
Referenced by v_InitObject().
|
protected |
Set the Number of the Eddies in the box.
Calculate the number of eddies that are going to be injected in the synthetic eddy region (box).
Definition at line 885 of file ForcingSyntheticEddy.cpp.
References m_lref, m_lyz, m_N, and m_spacedim.
Referenced by v_InitObject().
|
protected |
Update positions of the eddies inside the box.
Update the position of the eddies for every time step.
Definition at line 500 of file ForcingSyntheticEddy.cpp.
References m_calcForcing, m_eddiesIDForcing, m_eddyPos, m_lref, m_lyz, m_N, m_rc, Nektar::SolverUtils::Forcing::m_session, m_tCase, and m_Ub.
Referenced by Nektar::SolverUtils::ForcingCFSSyntheticEddy::v_Apply(), Nektar::SolverUtils::ForcingIncNSSyntheticEddy::v_Apply(), and Nektar::SolverUtils::ForcingCFSSyntheticEddy::v_ApplyCoeff().
|
overrideprotectedvirtual |
Apply forcing term if an eddy left the box of eddies and update the eddies positions.
pFields | Pointer to fields. |
inarray | Given fields. The fields are in in physical space. |
outarray | Calculated solution after forcing term being applied in physical space. |
time | time. |
Implements Nektar::SolverUtils::Forcing.
Reimplemented in Nektar::SolverUtils::ForcingCFSSyntheticEddy, and Nektar::SolverUtils::ForcingIncNSSyntheticEddy.
Definition at line 254 of file ForcingSyntheticEddy.cpp.
|
overrideprotectedvirtual |
Apply forcing term if an eddy left the box of eddies and update the eddies positions.
pFields | Pointer to fields. |
inarray | Given fields. The fields are in in physical space. |
outarray | Calculated solution after forcing term being applied in coefficient space. |
time | time. |
Reimplemented from Nektar::SolverUtils::Forcing.
Reimplemented in Nektar::SolverUtils::ForcingCFSSyntheticEddy.
Definition at line 272 of file ForcingSyntheticEddy.cpp.
|
overrideprotectedvirtual |
Read input from xml file and initialise the class members. The main parameters are the characteristic lengths, Reynolds stresses and the synthetic eddy region (box of eddies).
pFields | Pointer to fields. |
pNumForcingField | Number of forcing fields. |
pForce | Xml element describing the mapping. |
Implements Nektar::SolverUtils::Forcing.
Definition at line 65 of file ForcingSyntheticEddy.cpp.
References ASSERTL0, ComputeInitialLocationTestCase(), ComputeInitialRandomLocationOfEddies(), ComputeRefLenghts(), ComputeXiMax(), Nektar::ErrorUtil::efatal, InitialiseForcingEddy(), m_eddiesIDForcing, Nektar::SolverUtils::Forcing::m_Forcing, m_gamma, m_l, m_lyz, m_N, m_R, m_rc, Nektar::SolverUtils::Forcing::m_session, m_sigma, m_spacedim, m_tCase, m_Ub, NEKERROR, SetBoxOfEddiesMask(), SetCholeskyReyStresses(), and SetNumberOfEddies().
|
friend |
Definition at line 1 of file ForcingSyntheticEddy.h.
|
static |
Name of the class.
Definition at line 65 of file ForcingSyntheticEddy.h.
|
protected |
Check when the forcing should be applied.
Definition at line 170 of file ForcingSyntheticEddy.h.
Referenced by UpdateEddiesPositions(), Nektar::SolverUtils::ForcingCFSSyntheticEddy::v_Apply(), Nektar::SolverUtils::ForcingIncNSSyntheticEddy::v_Apply(), and Nektar::SolverUtils::ForcingCFSSyntheticEddy::v_ApplyCoeff().
|
protected |
Cholesky decomposition of the Reynolds Stresses for all points in the mesh.
Definition at line 142 of file ForcingSyntheticEddy.h.
Referenced by ComputeVelocityFluctuation(), and SetCholeskyReyStresses().
|
protected |
Current time.
Definition at line 174 of file ForcingSyntheticEddy.h.
Referenced by Nektar::SolverUtils::ForcingCFSSyntheticEddy::v_ApplyCoeff().
|
protected |
Eddies that add to the domain.
Definition at line 172 of file ForcingSyntheticEddy.h.
Referenced by Nektar::SolverUtils::ForcingCFSSyntheticEddy::CalculateForcing(), Nektar::SolverUtils::ForcingIncNSSyntheticEddy::CalculateForcing(), Nektar::SolverUtils::ForcingCFSSyntheticEddy::ComputeDensityFluctuation(), ComputeStochasticSignal(), ComputeVelocityFluctuation(), GenerateRandomOneOrMinusOne(), RemoveEddiesFromForcing(), UpdateEddiesPositions(), and v_InitObject().
Eddy position.
Definition at line 168 of file ForcingSyntheticEddy.h.
Referenced by ComputeInitialLocationTestCase(), ComputeInitialRandomLocationOfEddies(), ComputeStochasticSignal(), and UpdateEddiesPositions().
|
protected |
Forcing for each eddy.
Definition at line 178 of file ForcingSyntheticEddy.h.
Referenced by Nektar::SolverUtils::ForcingCFSSyntheticEddy::CalculateForcing(), Nektar::SolverUtils::ForcingIncNSSyntheticEddy::CalculateForcing(), InitialiseForcingEddy(), and RemoveEddiesFromForcing().
|
protected |
Ration of specific heats.
Definition at line 164 of file ForcingSyntheticEddy.h.
Referenced by Nektar::SolverUtils::ForcingCFSSyntheticEddy::ComputeDensityFluctuation(), and v_InitObject().
Characteristic lenght scales.
Definition at line 154 of file ForcingSyntheticEddy.h.
Referenced by ComputeCharConvTurbTime(), ComputeRefLenghts(), ComputeXiMax(), and v_InitObject().
Reference lenghts.
Definition at line 156 of file ForcingSyntheticEddy.h.
Referenced by ComputeCharConvTurbTime(), ComputeInitialLocationTestCase(), ComputeInitialRandomLocationOfEddies(), ComputeRefLenghts(), ComputeSmoothingFactor(), ComputeStochasticSignal(), ComputeXiMax(), InsideBoxOfEddies(), SetNumberOfEddies(), and UpdateEddiesPositions().
Inlet length in the y-direction and z-direction.
Definition at line 148 of file ForcingSyntheticEddy.h.
Referenced by ComputeInitialLocationTestCase(), ComputeInitialRandomLocationOfEddies(), InsideBoxOfEddies(), SetNumberOfEddies(), UpdateEddiesPositions(), and v_InitObject().
Box of eddies mask.
Definition at line 166 of file ForcingSyntheticEddy.h.
Referenced by Nektar::SolverUtils::ForcingCFSSyntheticEddy::CalculateForcing(), Nektar::SolverUtils::ForcingIncNSSyntheticEddy::CalculateForcing(), ComputeCharConvTurbTime(), Nektar::SolverUtils::ForcingCFSSyntheticEddy::ComputeDensityFluctuation(), Nektar::SolverUtils::ForcingCFSSyntheticEddy::ComputeRhoMachMean(), ComputeSmoothingFactor(), ComputeStochasticSignal(), ComputeVelocityFluctuation(), and SetBoxOfEddiesMask().
|
protected |
Number of eddies in the box.
Definition at line 152 of file ForcingSyntheticEddy.h.
Referenced by Nektar::SolverUtils::ForcingCFSSyntheticEddy::ComputeDensityFluctuation(), ComputeInitialLocationTestCase(), ComputeInitialRandomLocationOfEddies(), ComputeStochasticSignal(), ComputeVelocityFluctuation(), GenerateRandomOneOrMinusOne(), InitialiseForcingEddy(), SetNumberOfEddies(), UpdateEddiesPositions(), and v_InitObject().
|
protected |
Definition at line 139 of file ForcingSyntheticEddy.h.
Referenced by SetCholeskyReyStresses(), and v_InitObject().
Center of the inlet plane.
Definition at line 150 of file ForcingSyntheticEddy.h.
Referenced by ComputeInitialLocationTestCase(), ComputeInitialRandomLocationOfEddies(), ComputeSmoothingFactor(), InsideBoxOfEddies(), UpdateEddiesPositions(), and v_InitObject().
|
protected |
Standard deviation.
Definition at line 146 of file ForcingSyntheticEddy.h.
Referenced by ComputeGaussian(), and v_InitObject().
|
protected |
Space dimension.
Definition at line 162 of file ForcingSyntheticEddy.h.
Referenced by Nektar::SolverUtils::ForcingCFSSyntheticEddy::CalculateForcing(), Nektar::SolverUtils::ForcingIncNSSyntheticEddy::CalculateForcing(), ComputeCharConvTurbTime(), ComputeConstantC(), ComputeInitialLocationTestCase(), ComputeInitialRandomLocationOfEddies(), ComputeRefLenghts(), ComputeSmoothingFactor(), ComputeStochasticSignal(), ComputeVelocityFluctuation(), ComputeXiMax(), GenerateRandomOneOrMinusOne(), SetCholeskyReyStresses(), SetNumberOfEddies(), and v_InitObject().
|
protected |
Check for test case.
Definition at line 176 of file ForcingSyntheticEddy.h.
Referenced by GenerateRandomOneOrMinusOne(), UpdateEddiesPositions(), and v_InitObject().
|
protected |
Bulk velocity.
Definition at line 144 of file ForcingSyntheticEddy.h.
Referenced by ComputeCharConvTurbTime(), Nektar::SolverUtils::ForcingCFSSyntheticEddy::ComputeDensityFluctuation(), ComputeSmoothingFactor(), UpdateEddiesPositions(), and v_InitObject().
Xi max.
Definition at line 158 of file ForcingSyntheticEddy.h.
Referenced by ComputeConstantC(), ComputeStochasticSignal(), and ComputeXiMax().
|
protected |
Definition at line 160 of file ForcingSyntheticEddy.h.
Referenced by ComputeCharConvTurbTime(), and ComputeXiMax().