40 #include <boost/algorithm/string.hpp>
46 using namespace MultiRegions;
48 string VelocityCorrectionScheme::className =
50 "VelocityCorrectionScheme",
51 VelocityCorrectionScheme::create);
59 VelocityCorrectionScheme::VelocityCorrectionScheme(
83 ASSERTL0(
false,
"Need to set up pressure field definition");
90 std::string varName =
m_session->GetVariable(n);
91 if (
m_session->DefinesFunction(
"DiffusionCoefficient", varName))
94 =
m_session->GetFunction(
"DiffusionCoefficient", varName);
104 if (
m_session->DefinesSolverInfo(
"Extrapolation"))
107 m_session->GetSolverInfo(
"Extrapolation"));
126 m_session->MatchSolverInfo(
"SpectralVanishingViscosity",
"True",
131 m_session->MatchSolverInfo(
"SpectralVanishingViscositySpectralHP",
133 m_session->MatchSolverInfo(
"SpectralVanishingViscosityHomo1D",
139 m_session->MatchSolverInfo(
"SPECTRALHPDEALIASING",
"True",
144 ASSERTL0(m_nConvectiveFields > 2,
"Expect to have three velocity fields with homogenous expansion");
151 int num_planes = planes.num_elements();
154 int kmodes =
m_fields[0]->GetHomogeneousBasis()->GetNumModes();
159 for(n = 0; n < num_planes; ++n)
161 if(planes[n] > pstart)
163 fac = (
NekDouble)((planes[n] - kmodes)*(planes[n] - kmodes))/
164 ((
NekDouble)((planes[n] - pstart)*(planes[n] - pstart)));
169 for(
int i = 0; i <
m_velocity.num_elements(); ++i)
215 dealias += (dealias ==
"" ?
"" :
" + ") +
string(
"spectral/hp");
225 smoothing += (smoothing ==
"" ?
"" :
" + ") +
string(
"Homogeneous1D");
230 s,
"Smoothing",
"SVV (" + smoothing +
" SVV (cut-off = "
272 int nfields =
m_fields.num_elements() - 1;
273 for (
int k=0 ; k < nfields; ++k)
287 int nfields =
m_fields.num_elements() - 1;
288 for (
int k=0 ; k < nfields; ++k)
300 int vVar =
m_session->GetVariables().size();
302 vChecks[vVar-1] =
true;
311 return m_session->GetVariables().size() - 1;
334 std::vector<SolverUtils::ForcingSharedPtr>::const_iterator x;
337 (*x)->Apply(
m_fields, inarray, outarray, time);
378 int physTot =
m_fields[0]->GetTotPoints();
383 for(i = 1; i < nvel; ++i)
402 int phystot =
m_fields[0]->GetTotPoints();
422 Blas::Daxpy(phystot,-aii_dtinv,inarray[i],1,
Forcing[i],1);
EquationType m_equationType
equation type;
virtual Array< OneD, bool > v_GetSystemSingularChecks()
virtual void v_DoInitialise(void)
Sets up initial conditions.
#define ASSERTL0(condition, msg)
virtual ~VelocityCorrectionScheme()
void SetBoundaryConditions(NekDouble time)
time dependent boundary conditions updating
void EvaluateAdvection_SetPressureBCs(const Array< OneD, const Array< OneD, NekDouble > > &inarray, Array< OneD, Array< OneD, NekDouble > > &outarray, const NekDouble time)
SolverUtils::AdvectionSharedPtr m_advObject
Advection term.
tBaseSharedPtr CreateInstance(tKey idKey BOOST_PP_COMMA_IF(MAX_PARAM) BOOST_PP_ENUM_BINARY_PARAMS(MAX_PARAM, tParam, x))
Create an instance of the class referred to by idKey.
void SolveUnsteadyStokesSystem(const Array< OneD, const Array< OneD, NekDouble > > &inarray, Array< OneD, Array< OneD, NekDouble > > &outarray, const NekDouble time, const NekDouble a_iixDt)
NekDouble m_time
Current time of simulation.
bool m_explicitDiffusion
Indicates if explicit or implicit treatment of diffusion is used.
NekDouble m_kinvis
Kinematic viscosity.
void DefineImplicitSolve(FuncPointerT func, ObjectPointerT obj)
void SolvePressure(const Array< OneD, NekDouble > &Forcing)
ExtrapolateFactory & GetExtrapolateFactory()
LibUtilities::TimeIntegrationSchemeOperators m_ode
The time integration scheme operators to use.
NekDouble m_timestep
Time step size.
std::vector< std::pair< std::string, std::string > > SummaryList
virtual void v_GenerateSummary(SolverUtils::SummaryList &s)
Print a summary of time stepping parameters.
Array< OneD, int > m_velocity
int which identifies which components of m_fields contains the velocity (u,v,w);
bool m_useHomo1DSpecVanVisc
bool to identify if spectral vanishing viscosity is active.
NekDouble m_sVVDiffCoeff
Diffusion coefficient of SVV modes.
ExtrapolateSharedPtr m_extrapolation
virtual std::string v_GetSubSteppingExtrapolateStr(const std::string &instr)
virtual std::string v_GetExtrapolateStr(void)
void EvaluateAdvectionTerms(const Array< OneD, const Array< OneD, NekDouble > > &inarray, Array< OneD, Array< OneD, NekDouble > > &outarray)
bool m_specHP_dealiasing
Flag to determine if dealisising is usde for the Spectral/hp element discretisation.
std::map< ConstFactorType, NekDouble > ConstFactorMap
const char *const TimeIntegrationMethodMap[]
int m_nConvectiveFields
Number of fields to be convected;.
boost::shared_ptr< SessionReader > SessionReaderSharedPtr
virtual int v_GetForceDimension()
void SolveViscous(const Array< OneD, const Array< OneD, NekDouble > > &Forcing, Array< OneD, Array< OneD, NekDouble > > &outarray, const NekDouble aii_Dt)
void SetUpViscousForcing(const Array< OneD, const Array< OneD, NekDouble > > &inarray, Array< OneD, Array< OneD, NekDouble > > &Forcing, const NekDouble aii_Dt)
virtual SOLVER_UTILS_EXPORT void v_GenerateSummary(SummaryList &s)
Print a summary of time stepping parameters.
void Smul(int n, const T alpha, const T *x, const int incx, T *y, const int incy)
Scalar multiply y = alpha*y.
void DefineOdeRhs(FuncPointerT func, ObjectPointerT obj)
std::vector< SolverUtils::ForcingSharedPtr > m_forcing
Forcing terms.
Base class for unsteady solvers.
virtual void v_SetUpViscousForcing(const Array< OneD, const Array< OneD, NekDouble > > &inarray, Array< OneD, Array< OneD, NekDouble > > &Forcing, const NekDouble aii_Dt)
void SetUpPressureForcing(const Array< OneD, const Array< OneD, NekDouble > > &fields, Array< OneD, Array< OneD, NekDouble > > &Forcing, const NekDouble aii_Dt)
bool m_SmoothAdvection
bool to identify if advection term smoothing is requested
void AddSummaryItem(SummaryList &l, const std::string &name, const std::string &value)
Adds a summary item to the summary info list.
virtual void v_TransCoeffToPhys(void)
Virtual function for transformation to physical space.
LibUtilities::FieldMetaDataMap m_fieldMetaDataMap
Map to identify relevant solver info to dump in output fields.
virtual void v_SolvePressure(const Array< OneD, NekDouble > &Forcing)
boost::shared_ptr< Equation > EquationSharedPtr
bool m_homogen_dealiasing
Flag to determine if dealiasing is used for homogeneous simulations.
EquationSystemFactory & GetEquationSystemFactory()
Array< OneD, Array< OneD, NekDouble > > m_F
MultiRegions::Direction const DirCartesianMap[]
virtual void v_SolveViscous(const Array< OneD, const Array< OneD, NekDouble > > &Forcing, Array< OneD, Array< OneD, NekDouble > > &outarray, const NekDouble aii_Dt)
NekDouble m_sVVCutoffRatio
cutt off ratio from which to start decayhing modes
Array< OneD, MultiRegions::ExpListSharedPtr > m_fields
Array holding all dependent variables.
bool m_useSpecVanVisc
bool to identify if spectral vanishing viscosity is active.
LibUtilities::SessionReaderSharedPtr m_session
The session reader.
Array< OneD, NekDouble > m_diffCoeff
Diffusion coefficients (will be kinvis for velocities)
virtual void v_TransPhysToCoeff(void)
Virtual function for transformation to coefficient space.
LibUtilities::TimeIntegrationWrapperSharedPtr m_intScheme
Wrapper to the time integration scheme.
This class is the base class for Navier Stokes problems.
virtual void v_InitObject()
Init object for UnsteadySystem class.
MultiRegions::ExpListSharedPtr m_pressure
Pointer to field holding pressure field.
Defines a forcing term to be explicitly applied.
virtual void v_SetUpPressureForcing(const Array< OneD, const Array< OneD, NekDouble > > &fields, Array< OneD, Array< OneD, NekDouble > > &Forcing, const NekDouble aii_Dt)
virtual void v_InitObject()
Init object for UnsteadySystem class.
virtual void v_EvaluateAdvection_SetPressureBCs(const Array< OneD, const Array< OneD, NekDouble > > &inarray, Array< OneD, Array< OneD, NekDouble > > &outarray, const NekDouble time)
virtual SOLVER_UTILS_EXPORT void v_DoInitialise()
Sets up initial conditions.
enum HomogeneousType m_HomogeneousType
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.
static FlagList NullFlagList
An empty flag list.
std::vector< int > m_intVariables
static VarCoeffMap NullVarCoeffMap
tKey RegisterCreatorFunction(tKey idKey, CreatorFunction classCreator, tDescription pDesc="")
Register a class with the factory.