38 #include <boost/algorithm/string.hpp>
45 "Euler equations in conservative variables with "
46 "artificial diffusion.");
61 "Not enough variables for smooth shock capturing; "
62 "make sure you have added eps to variable list.");
69 if(
m_session->DefinesSolverInfo(
"PROBLEMTYPE"))
71 std::string ProblemTypeStr =
m_session->GetSolverInfo(
"PROBLEMTYPE");
96 ASSERTL0(
false,
"Implicit CFE not set up.");
114 bool dumpInitialConditions,
117 EquationSystem::v_SetInitialConditions(initialtime,
false);
120 if(dumpInitialConditions)
133 int nvariables = inarray.num_elements();
140 for (i = 0; i < nvariables; ++i)
149 for (i = 0; i < nvariables; ++i)
158 for (i = 0; i < nvariables; ++i)
181 Vmath::Vadd(npoints, a_vel, 1, u_abs, 1, wave_sp, 1);
187 outarrayDiff[nvariables-1], 1,
188 outarrayDiff[nvariables-1], 1);
192 outarrayDiff[nvariables-1], 1,
193 outarrayDiff[nvariables-1], 1);
197 outarrayDiff[nvariables-1], 1,
198 outarrayDiff[nvariables-1], 1);
200 for (i = 0; i < nvariables; ++i)
210 for (i = 0; i < nvariables; ++i)
217 for (i = 0; i < nvariables; ++i)
222 outarrayForcing[i], 1,
228 std::vector<SolverUtils::ForcingSharedPtr>::const_iterator x;
231 (*x)->Apply(
m_fields, inarray, outarray, time);
241 int nvariables = inarray.num_elements();
250 for(i = 0; i < nvariables; ++i)
260 ASSERTL0(
false,
"No Continuous Galerkin for Euler equations");
264 ASSERTL0(
false,
"Unknown projection scheme");
277 for (
int n = 0; n <
m_fields[0]->GetBndConditions().num_elements(); ++n)
279 std::string type =
m_fields[0]->GetBndConditions()[n]->GetUserDefined();
282 if (boost::iequals(type,
"WallViscous"))
285 ASSERTL0(
false,
"WallViscous is a wrong bc for the "
295 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 SetCommonBC(const std::string &userDefStr, const int n, const NekDouble time, int &cnt, Array< OneD, Array< OneD, NekDouble > > &inarray)
Set boundary conditions which can be: a) Wall and Symmerty BCs implemented at CompressibleFlowSystem ...
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.
static SolverUtils::EquationSystemSharedPtr create(const LibUtilities::SessionReaderSharedPtr &pSession)
Creates an instance of this class.
EquationSystemFactory & GetEquationSystemFactory()
void GetAbsoluteVelocity(const Array< OneD, const Array< OneD, NekDouble > > &inarray, Array< OneD, NekDouble > &Vtot)
SolverUtils::AdvectionSharedPtr m_advection
SolverUtils::DiffusionSharedPtr m_diffusion
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)
static std::string className
Name of class.
LibUtilities::SessionReaderSharedPtr m_session
The session reader.
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.
EulerADCFE(const LibUtilities::SessionReaderSharedPtr &pSession)
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[]