40 #include <boost/algorithm/string.hpp>
46 string VelocityCorrectionScheme::className =
48 "VelocityCorrectionScheme",
49 VelocityCorrectionScheme::create);
57 VelocityCorrectionScheme::VelocityCorrectionScheme(
81 ASSERTL0(
false,
"Need to set up pressure field definition");
87 std::string vExtrapolation =
"Standard";
89 if (
m_session->DefinesSolverInfo(
"Extrapolation"))
91 vExtrapolation =
m_session->GetSolverInfo(
"Extrapolation");
113 m_session->MatchSolverInfo(
"SpectralVanishingViscosity",
"True",
118 m_session->MatchSolverInfo(
"SpectralVanishingViscosityHomo1D",
"True",
122 m_session->MatchSolverInfo(
"SPECTRALHPDEALIASING",
"True",
128 ASSERTL0(m_nConvectiveFields > 2,
"Expect to have three velocity fields with homogenous expansion");
140 int num_planes = planes.num_elements();
143 int kmodes =
m_fields[0]->GetHomogeneousBasis()->GetNumModes();
148 for(n = 0; n < num_planes; ++n)
150 if(planes[n] > pstart)
152 fac = (
NekDouble)((planes[n] - kmodes)*(planes[n] - kmodes))/
153 ((
NekDouble)((planes[n] - pstart)*(planes[n] - pstart)));
158 for(
int i = 0; i <
m_velocity.num_elements(); ++i)
203 dealias += (dealias ==
"" ?
"" :
" + ") +
string(
"spectral/hp");
213 smoothing += (smoothing ==
"" ?
"" :
" + ") +
string(
"Homogeneous1D");
218 s,
"Smoothing",
"SVV (" + smoothing +
" SVV (cut-off = "
258 int nfields =
m_fields.num_elements() - 1;
259 for (
int k=0 ; k < nfields; ++k)
273 int nfields =
m_fields.num_elements() - 1;
274 for (
int k=0 ; k < nfields; ++k)
286 int vVar =
m_session->GetVariables().size();
288 vChecks[vVar-1] =
true;
297 return m_session->GetVariables().size() - 1;
320 std::vector<SolverUtils::ForcingSharedPtr>::const_iterator x;
323 (*x)->Apply(
m_fields, inarray, outarray, time);
340 int phystot =
m_fields[0]->GetTotPoints();
376 int physTot =
m_fields[0]->GetTotPoints();
382 for(i = 0; i < nvel; ++i)
400 int phystot =
m_fields[0]->GetTotPoints();
418 for(
int i = 0; i < nvel; ++i)
420 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
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)
static const NekDouble kNekUnsetDouble
bool m_homogen_dealiasing
Flag to determine if dealiasing is used for homogeneous simulations.
EquationSystemFactory & GetEquationSystemFactory()
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)
void EvaluateAdvectionTerms(const Array< OneD, const Array< OneD, NekDouble > > &inarray, Array< OneD, Array< OneD, NekDouble > > &outarray, Array< OneD, NekDouble > &wk=NullNekDouble1DArray)
NekDouble m_sVVCutoffRatio
cutt off ratio from which to start decayhing modes
Array< OneD, MultiRegions::ExpListSharedPtr > m_fields
Array holding all dependent variables.
Array< OneD, NekDouble > m_saved_aii_Dt
Save aiiDt value to use as a trip to reset global matrix setup.
bool m_useSpecVanVisc
bool to identify if spectral vanishing viscosity is active.
LibUtilities::SessionReaderSharedPtr m_session
The session reader.
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.
void Zero(int n, T *x, const int incx)
Zero vector.
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.