39#include <boost/algorithm/string.hpp>
45using namespace MultiRegions;
83 "Implicit velocity correction");
94 dealias += (dealias ==
"" ?
"" :
" + ") +
string(
"spectral/hp");
107 s,
"Smoothing-SpecHP",
108 "SVV (" + smoothing +
" Exp Kernel(cut-off = " +
118 s,
"Smoothing-SpecHP",
119 "SVV (" + smoothing +
" Power Kernel (Power ratio =" +
128 s,
"Smoothing-SpecHP",
129 "SVV (" + smoothing +
" DG Kernel (diff coeff = " +
139 s,
"Smoothing-Homo1D",
140 "SVV (Homogeneous1D - Exp Kernel(cut-off = " +
149 s,
"GJP Stab. Impl. ",
150 m_session->GetSolverInfo(
"GJPStabilisation"));
153 if (boost::iequals(
m_session->GetSolverInfo(
"GJPStabilisation"),
157 s,
"GJP Normal Velocity",
158 m_session->GetSolverInfo(
"GJPNormalVelocity"));
198 int phystot =
m_fields[0]->GetTotPoints();
201 for (
int i = 0; i < nvel; i++)
208 for (
int i = 0; i < nvel; i++)
210 velocity[i] =
m_fields[i]->GetPhys();
217 for (
int i = 0; i < nvel; i++)
219 Vmath::Svtvp(phystot, 1.0 / aii_Dt, fields[i], 1, advection[i], 1,
259 int phystot =
m_fields[0]->GetTotPoints();
285 for (
int i = 0; i < nvel; i++)
292 for (
int i = 0; i < nvel; i++)
294 velocity[i] =
m_fields[i]->GetPhys();
301 m_fields[0]->CurlCurl(velocity, velocity);
304 for (
int i = 0; i < nvel; ++i)
316 for (
int i = 0; i < nvel; ++i)
403 varcoeffs[varcoefftypes[i]] =
m_AdvVel[i];
418 auto gkey =
m_fields[i]->LinearAdvectionDiffusionReactionSolve(
428 (gkey.GetMatrixType() ==
430 gkey.GetMatrixType() ==
434 m_fields[i]->UnsetGlobalLinSys(gkey,
true);
458 boost::ignore_unused(time);
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_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.
virtual SOLVER_UTILS_EXPORT void v_GenerateSummary(SummaryList &s) override
Print a summary of time stepping parameters.
virtual 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
virtual void v_EvaluateAdvection_SetPressureBCs(const Array< OneD, const Array< OneD, NekDouble > > &inarray, Array< OneD, Array< OneD, NekDouble > > &outarray, const NekDouble time) override
virtual void v_SetUpPressureForcing(const Array< OneD, const Array< OneD, NekDouble > > &fields, Array< OneD, Array< OneD, NekDouble > > &Forcing, const NekDouble aii_Dt) override
virtual void v_GenerateSummary(SolverUtils::SummaryList &s) override
Print a summary of time stepping parameters.
Array< OneD, Array< OneD, NekDouble > > m_AdvVel
virtual void v_DoInitialise(bool dumpInitialConditions) override
Sets up initial conditions.
VCSImplicit(const LibUtilities::SessionReaderSharedPtr &pSession, const SpatialDomains::MeshGraphSharedPtr &pGraph)
Constructor.
static std::string solverTypeLookupId
static std::string className
Name of class.
virtual void v_SetUpViscousForcing(const Array< OneD, const Array< OneD, NekDouble > > &inarray, Array< OneD, Array< OneD, NekDouble > > &Forcing, const NekDouble aii_Dt) override
static SolverUtils::EquationSystemSharedPtr create(const LibUtilities::SessionReaderSharedPtr &pSession, const SpatialDomains::MeshGraphSharedPtr &pGraph)
Creates an instance of this class.
virtual 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)
virtual 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
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
The above copyright notice and this permission notice shall be included.
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 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.