38 #include <boost/algorithm/string.hpp>
44 string EulerADCFE::className =
46 "EulerADCFE", EulerADCFE::create,
47 "Euler equations in conservative variables with "
48 "artificial diffusion.");
50 EulerADCFE::EulerADCFE(
63 "Not enough variables for smooth shock capturing; "
64 "make sure you have added eps to variable list.");
71 if(
m_session->DefinesSolverInfo(
"PROBLEMTYPE"))
73 std::string ProblemTypeStr =
m_session->GetSolverInfo(
"PROBLEMTYPE");
98 ASSERTL0(
false,
"Implicit CFE not set up.");
116 bool dumpInitialConditions,
122 if(dumpInitialConditions)
135 int nvariables = inarray.num_elements();
142 for (i = 0; i < nvariables; ++i)
151 for (i = 0; i < nvariables; ++i)
160 for (i = 0; i < nvariables; ++i)
183 Vmath::Vadd(npoints, a_vel, 1, u_abs, 1, wave_sp, 1);
189 outarrayDiff[nvariables-1], 1,
190 outarrayDiff[nvariables-1], 1);
194 outarrayDiff[nvariables-1], 1,
195 outarrayDiff[nvariables-1], 1);
199 outarrayDiff[nvariables-1], 1,
200 outarrayDiff[nvariables-1], 1);
202 for (i = 0; i < nvariables; ++i)
212 for (i = 0; i < nvariables; ++i)
219 for (i = 0; i < nvariables; ++i)
224 outarrayForcing[i], 1,
230 std::vector<SolverUtils::ForcingSharedPtr>::const_iterator x;
233 (*x)->Apply(
m_fields, inarray, outarray, time);
243 int nvariables = inarray.num_elements();
252 for(i = 0; i < nvariables; ++i)
262 ASSERTL0(
false,
"No Continuous Galerkin for Euler equations");
266 ASSERTL0(
false,
"Unknown projection scheme");
278 int nvariables = inarray.num_elements();
281 for (
int i = 0; i < nvariables; ++i)
284 m_fields[i]->ExtractTracePhys(inarray[i], Fwd[i]);
288 for (
int n = 0; n <
m_fields[0]->GetBndConditions().num_elements(); ++n)
290 std::string type =
m_fields[0]->GetBndConditions()[n]->GetUserDefined();
293 if (boost::iequals(type,
"WallViscous"))
296 ASSERTL0(
false,
"WallViscous is a wrong bc for the "
306 cnt +=
m_fields[0]->GetBndCondExpansions()[n]->GetExpSize();
void SetBoundaryConditions(Array< OneD, Array< OneD, NekDouble > > &physarray, NekDouble time)
#define ASSERTL0(condition, msg)
virtual void v_InitObject()
Initialization object for CompressibleFlowSystem class.
virtual void v_SetInitialConditions(NekDouble initialtime=0.0, bool dumpInitialConditions=true, const int domain=0)
void GetSoundSpeed(const Array< OneD, Array< OneD, NekDouble > > &physfield, Array< OneD, NekDouble > &pressure, Array< OneD, NekDouble > &soundspeed)
NekDouble m_time
Current time of simulation.
T Vmax(int n, const T *x, const int incx)
Return the maximum element in x – called vmax to avoid conflict with max.
LibUtilities::TimeIntegrationSchemeOperators m_ode
The time integration scheme operators to use.
std::vector< std::pair< std::string, std::string > > SummaryList
SOLVER_UTILS_EXPORT const Array< OneD, int > GetNumExpModesPerExp()
SOLVER_UTILS_EXPORT void Checkpoint_Output(const int n)
Write checkpoint file of m_fields.
virtual ~EulerADCFE()
problem type selector
enum MultiRegions::ProjectionType m_projectionType
Type of projection; e.g continuous or discontinuous.
void GetArtificialDynamicViscosity(const Array< OneD, Array< OneD, NekDouble > > &physfield, Array< OneD, NekDouble > &mu_var)
boost::shared_ptr< SessionReader > SessionReaderSharedPtr
ProblemType m_problemType
void DoOdeRhs(const Array< OneD, const Array< OneD, NekDouble > > &inarray, Array< OneD, Array< OneD, NekDouble > > &outarray, const NekDouble time)
virtual void v_GenerateSummary(SolverUtils::SummaryList &s)
Print a summary of time stepping parameters.
void DoOdeProjection(const Array< OneD, const Array< OneD, NekDouble > > &inarray, Array< OneD, Array< OneD, NekDouble > > &outarray, const NekDouble time)
virtual void v_InitObject()
Initialization object for CompressibleFlowSystem class.
void DefineProjection(FuncPointerT func, ObjectPointerT obj)
void Smul(int n, const T alpha, const T *x, const int incx, T *y, const int incy)
Scalar multiply y = alpha*y.
bool m_explicitAdvection
Indicates if explicit or implicit treatment of advection is used.
void DefineOdeRhs(FuncPointerT func, ObjectPointerT obj)
virtual void v_GenerateSummary(SolverUtils::SummaryList &s)
Print a summary of time stepping parameters.
void AddSummaryItem(SummaryList &l, const std::string &name, const std::string &value)
Adds a summary item to the summary info list.
int m_spacedim
Spatial dimension (>= expansion dim).
void Neg(int n, T *x, const int incx)
Negate x = -x.
virtual SOLVER_UTILS_EXPORT void v_SetInitialConditions(NekDouble initialtime=0.0, bool dumpInitialConditions=true, const int domain=0)
EquationSystemFactory & GetEquationSystemFactory()
void GetAbsoluteVelocity(const Array< OneD, const Array< OneD, NekDouble > > &inarray, Array< OneD, NekDouble > &Vtot)
SolverUtils::AdvectionSharedPtr m_advection
SolverUtils::DiffusionSharedPtr m_diffusion
SOLVER_UTILS_EXPORT int GetTraceTotPoints()
std::string m_shockCaptureType
SOLVER_UTILS_EXPORT int GetNpoints()
Array< OneD, MultiRegions::ExpListSharedPtr > m_fields
Array holding all dependent variables.
virtual void v_SetInitialConditions(NekDouble initialtime=0.0, bool dumpInitialConditions=true, const int domain=0)
LibUtilities::SessionReaderSharedPtr m_session
The session reader.
void SetCommonBC(const std::string &userDefStr, const int n, const NekDouble time, int &cnt, Array< OneD, Array< OneD, NekDouble > > &Fwd, Array< OneD, Array< OneD, NekDouble > > &inarray)
Set boundary conditions which can be: a) Wall and Symmerty BCs implemented at CompressibleFlowSystem ...
void GetForcingTerm(const Array< OneD, const Array< OneD, NekDouble > > &inarray, Array< OneD, Array< OneD, NekDouble > > outarrayForcing)
SOLVER_UTILS_EXPORT MultiRegions::ExpListSharedPtr GetPressure()
Get pressure field if available.
void Vcopy(int n, const T *x, const int incx, T *y, const int incy)
std::vector< SolverUtils::ForcingSharedPtr > m_forcing
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.
tKey RegisterCreatorFunction(tKey idKey, CreatorFunction classCreator, tDescription pDesc="")
Register a class with the factory.
const char *const ProblemTypeMap[]