40#include <boost/algorithm/string.hpp>
46using namespace MultiRegions;
84 "Implicit velocity correction");
95 dealias += (dealias ==
"" ?
"" :
" + ") +
string(
"spectral/hp");
108 s,
"Smoothing-SpecHP",
109 "SVV (" + smoothing +
" Exp Kernel(cut-off = " +
119 s,
"Smoothing-SpecHP",
120 "SVV (" + smoothing +
" Power Kernel (Power ratio =" +
129 s,
"Smoothing-SpecHP",
130 "SVV (" + smoothing +
" DG Kernel (diff coeff = " +
140 s,
"Smoothing-Homo1D",
141 "SVV (Homogeneous1D - Exp Kernel(cut-off = " +
150 s,
"GJP Stab. Impl. ",
151 m_session->GetSolverInfo(
"GJPStabilisation"));
154 if (boost::iequals(
m_session->GetSolverInfo(
"GJPStabilisation"),
158 s,
"GJP Normal Velocity",
159 m_session->GetSolverInfo(
"GJPNormalVelocity"));
191 m_session->MatchSolverInfo(
"AdvectionVelocity",
"Extrapolated",
219 m_session->MatchSolverInfo(
"AdvectionOperator",
"SkewSymmetric",
241 int phystot =
m_fields[0]->GetTotPoints();
245 for (
int i = 0; i < nvel; i++)
287 int phystot =
m_fields[0]->GetTotPoints();
306 for (
int i = 0; i < nvel; ++i)
324 for (
int i = 0; i < nvel; ++i)
337 for (
int i = 0; i < nvel; i++)
342 m_fields[0]->CurlCurl(velocity, velocity);
360 for (
int i = 0; i < nvel; ++i)
438 varcoeffs[varcoefftypes[i]] =
m_AdvVel[i];
453 auto gkey =
m_fields[i]->LinearAdvectionDiffusionReactionSolve(
464 (gkey.GetMatrixType() ==
466 gkey.GetMatrixType() ==
469 m_fields[i]->UnsetGlobalLinSys(gkey,
true);
531 int phystot =
m_fields[0]->GetTotPoints();
538 for (
int i = 1; i < nvel; ++i)
541 Vmath::Vadd(phystot, divAdvVel, 1, tmpstore, 1, divAdvVel, 1);
545 Vmath::Smul(phystot, 1.0 / 2.0 / lambda, divAdvVel, 1, divAdvVel, 1);
548 Vmath::Vadd(phystot, ones, 1, divAdvVel, 1, divAdvVel, 1);
562 unsetGlobalLinSys[i] = 1;
567 std::dynamic_pointer_cast<MultiRegions::ContField>(
m_fields[i]);
574 if (std::dynamic_pointer_cast<MultiRegions::ContField>(
m_fields[j])
575 ->SameTypeOfBoundaryConditions(*contField))
577 unsetGlobalLinSys[i] = 0;
583 unsetGlobalLinSys[i] = 1;
MultiRegions::ExpListSharedPtr m_pressure
Pointer to field holding pressure field.
NekDouble m_kinvis
Kinematic viscosity.
ExtrapolateSharedPtr m_extrapolation
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;.
std::vector< SolverUtils::ForcingSharedPtr > m_forcing
Forcing terms.
void EvaluateAdvectionTerms(const Array< OneD, const Array< OneD, NekDouble > > &inarray, Array< OneD, Array< OneD, NekDouble > > &outarray, const NekDouble time)
tKey RegisterCreatorFunction(tKey idKey, CreatorFunction classCreator, std::string pDesc="")
Register a class with the factory.
static std::string RegisterEnumValue(std::string pEnum, std::string pString, int pEnumValue)
Registers an enumeration value.
void AccumulateRegion(std::string, int iolevel=0)
Accumulate elapsed time for a region.
NekDouble m_timestep
Time step size.
NekDouble m_time
Current time of simulation.
Array< OneD, MultiRegions::ExpListSharedPtr > m_fields
Array holding all dependent variables.
bool m_specHP_dealiasing
Flag to determine if dealisising is usde for the Spectral/hp element discretisation.
LibUtilities::SessionReaderSharedPtr m_session
The session reader.
enum HomogeneousType m_HomogeneousType
bool m_homogen_dealiasing
Flag to determine if dealiasing is used for homogeneous simulations.
SOLVER_UTILS_EXPORT int GetTotPoints()
Defines a forcing term to be explicitly applied.
Base class for unsteady solvers.
LibUtilities::TimeIntegrationSchemeSharedPtr m_intScheme
Wrapper to the time integration scheme.
SOLVER_UTILS_EXPORT void v_GenerateSummary(SummaryList &s) override
Print a summary of time stepping parameters.
Array< OneD, NekInt > m_unsetGlobalLinSys
Array checking whether GlobalLinSys needs to be unset.
Array< OneD, Array< OneD, Array< OneD, NekDouble > > > m_extVel
3D Array for extrapolated Advection Velocities [dir][time-levle][dof]
void v_SolveViscous(const Array< OneD, const Array< OneD, NekDouble > > &Forcing, const Array< OneD, const Array< OneD, NekDouble > > &inarray, Array< OneD, Array< OneD, NekDouble > > &outarray, const NekDouble aii_Dt) override
void v_EvaluateAdvection_SetPressureBCs(const Array< OneD, const Array< OneD, NekDouble > > &inarray, Array< OneD, Array< OneD, NekDouble > > &outarray, const NekDouble time) override
void v_SetUpPressureForcing(const Array< OneD, const Array< OneD, NekDouble > > &fields, Array< OneD, Array< OneD, NekDouble > > &Forcing, const NekDouble aii_Dt) override
void v_GenerateSummary(SolverUtils::SummaryList &s) override
Print a summary of time stepping parameters.
Array< OneD, Array< OneD, NekDouble > > m_AdvVel
void v_DoInitialise(bool dumpInitialConditions) override
Sets up initial conditions.
Array< OneD, Array< OneD, NekDouble > > m_advection
2D Array for Advection Velocities [dir][dof]
bool m_advectionVelocity
bool to identify implicit scheme ie advection velocity
void AddImplicitSkewSymAdvection(StdRegions::VarCoeffMap varcoeffs, NekDouble aii_Dt)
bool m_implicitSkewSymAdvection
bool to identify advection operator
VCSImplicit(const LibUtilities::SessionReaderSharedPtr &pSession, const SpatialDomains::MeshGraphSharedPtr &pGraph)
Constructor.
static std::string solverTypeLookupId
int m_intOrder
integer for advection velocity
static std::string className
Name of class.
void v_SetUpViscousForcing(const Array< OneD, const Array< OneD, NekDouble > > &inarray, Array< OneD, Array< OneD, NekDouble > > &Forcing, const NekDouble aii_Dt) override
void CheckUnsetGlobalLinSys(Array< OneD, NekInt > &unsetGlobalLinSys)
static SolverUtils::EquationSystemSharedPtr create(const LibUtilities::SessionReaderSharedPtr &pSession, const SpatialDomains::MeshGraphSharedPtr &pGraph)
Creates an instance of this class.
void v_SolvePressure(const Array< OneD, NekDouble > &Forcing) override
NekDouble m_sVVCutoffRatioHomo1D
Array< OneD, NekDouble > m_svvVarDiffCoeff
Array of coefficient if power kernel is used in SVV.
NekDouble m_sVVDiffCoeffHomo1D
Diffusion coefficient of SVV modes in homogeneous 1D Direction.
bool m_IsSVVPowerKernel
Identifier for Power Kernel otherwise DG kernel.
NekDouble m_sVVCutoffRatio
cutt off ratio from which to start decayhing modes
NekDouble m_sVVDiffCoeff
Diffusion coefficient of SVV modes.
bool m_useGJPStabilisation
bool to identify if GJP semi-implicit is active.
bool m_useSpecVanVisc
bool to identify if spectral vanishing viscosity is active.
Array< OneD, NekDouble > m_diffCoeff
Diffusion coefficients (will be kinvis for velocities)
void AppendSVVFactors(StdRegions::ConstFactorMap &factors, MultiRegions::VarFactorsMap &varFactorsMap)
void v_DoInitialise(bool dumpInitialConditions=true) override
Sets up initial conditions.
bool m_useHomo1DSpecVanVisc
bool to identify if spectral vanishing viscosity is active.
void ComputeGJPNormalVelocity(const Array< OneD, const Array< OneD, NekDouble > > &inarray, StdRegions::VarCoeffMap &varcoeffs)
std::shared_ptr< SessionReader > SessionReaderSharedPtr
MultiRegions::Direction const DirCartesianMap[]
static VarFactorsMap NullVarFactorsMap
std::map< StdRegions::ConstFactorType, Array< OneD, NekDouble > > VarFactorsMap
std::vector< std::pair< std::string, std::string > > SummaryList
EquationSystemFactory & GetEquationSystemFactory()
void AddSummaryItem(SummaryList &l, const std::string &name, const std::string &value)
Adds a summary item to the summary info list.
std::shared_ptr< MeshGraph > MeshGraphSharedPtr
@ eLinearAdvectionDiffusionReaction
@ eLinearAdvectionDiffusionReactionGJP
std::map< ConstFactorType, NekDouble > ConstFactorMap
static VarCoeffMap NullVarCoeffMap
std::map< StdRegions::VarCoeffType, VarCoeffEntry > VarCoeffMap
StdRegions::ConstFactorMap factors
static Array< OneD, NekDouble > NullNekDouble1DArray
void Svtvp(int n, const T alpha, const T *x, const int incx, const T *y, const int incy, T *z, const int incz)
Svtvp (scalar times vector plus vector): z = alpha*x + y.
void Neg(int n, T *x, const int incx)
Negate x = -x.
void Vadd(int n, const T *x, const int incx, const T *y, const int incy, T *z, const int incz)
Add vector z = x+y.
void Smul(int n, const T alpha, const T *x, const int incx, T *y, const int incy)
Scalar multiply y = alpha*x.
void Zero(int n, T *x, const int incx)
Zero vector.
void Vcopy(int n, const T *x, const int incx, T *y, const int incy)