60 std::vector<std::string> vel;
85 m_session->LoadSolverInfo(
"AdvectionType", advName,
"WeakDG");
89 m_session->LoadSolverInfo(
"UpwindType", riemName,
"Upwind");
105 m_session->LoadSolverInfo(
"AdvectionType", advName,
114 ASSERTL0(
false,
"Unsupported projection type.");
126 ASSERTL0(
false,
"Implicit unsteady Advection not set up.");
138 int nvariables = inarray.size();
143 for (
int j = 0; j < nvariables; ++j)
153 int nvariables = inarray.size();
161 if (inarray != outarray)
165 for (
int j = 0; j < nvariables; ++j)
177 for (
int j = 0; j < nvariables; ++j)
179 m_fields[j]->FwdTrans(inarray[j], coeffs);
180 m_fields[j]->BwdTrans_IterPerExp(coeffs, outarray[j]);
185 ASSERTL0(
false,
"Unknown projection scheme");
220 "Dimension of flux array and velocity array do not match");
222 int nq = physfield[0].size();
224 for (
int i = 0; i < flux.size(); ++i)
226 for (
int j = 0; j < flux[0].size(); ++j)
243 int n_element =
m_fields[0]->GetExpSize();
249 for (
int el = 0; el < n_element; ++el)
251 int npoints =
m_fields[0]->GetExp(el)->GetTotPoints();
253 if (std::dynamic_pointer_cast<LocalRegions::TriExp>(
256 tstep[el] = CFL[el] / (stdVelocity[el]);
258 else if (std::dynamic_pointer_cast<LocalRegions::QuadExp>(
261 tstep[el] = CFL[el] / (stdVelocity[el]);
282 int n_elements =
m_fields[0]->GetExpSize();
289 int P = ExpOrder - 1;
299 if (TimeStability == 1.0)
303 else if (TimeStability == 2.0)
307 else if (TimeStability == 2.784)
313 ASSERTL0(
false,
"Dominant eigenvalues database not present for this "
314 "time-stepping scheme")
319 TimeStep = (TimeStability / SpatialStability) * CFL;
333 int n_element =
m_fields[0]->GetExpSize();
334 int nvel = inarray.size();
342 for (
int i = 0; i < nvel; ++i)
349 for (
int el = 0; el < n_element; ++el)
356 el2D->GetGeom2D()->GetMetricInfo()->GetJac();
358 el2D->GetGeom2D()->GetMetricInfo()->GetDerivFactors();
360 if (el2D->GetGeom2D()->GetMetricInfo()->GetGtype() ==
363 for (
int i = 0; i < n_points; i++)
366 gmat[0][i] * inarray[0][i] + gmat[2][i] * inarray[1][i];
369 gmat[1][i] * inarray[0][i] + gmat[3][i] * inarray[1][i];
374 for (
int i = 0; i < n_points; i++)
377 gmat[0][0] * inarray[0][i] + gmat[2][0] * inarray[1][i];
380 gmat[1][0] * inarray[0][i] + gmat[3][0] * inarray[1][i];
384 for (
int i = 0; i < n_points; i++)
386 pntVelocity =
sqrt(stdVelocity[0][i] * stdVelocity[0][i] +
387 stdVelocity[1][i] * stdVelocity[1][i]);
389 if (pntVelocity > stdV[el])
391 stdV[el] = pntVelocity;
398 for (
int el = 0; el < n_element; ++el)
406 el3D->GetGeom3D()->GetMetricInfo()->GetJac();
408 el3D->GetGeom3D()->GetMetricInfo()->GetDerivFactors();
410 if (el3D->GetGeom3D()->GetMetricInfo()->GetGtype() ==
413 for (
int i = 0; i < n_points; i++)
415 stdVelocity[0][i] = gmat[0][i] * inarray[0][i] +
416 gmat[3][i] * inarray[1][i] +
417 gmat[6][i] * inarray[2][i];
419 stdVelocity[1][i] = gmat[1][i] * inarray[0][i] +
420 gmat[4][i] * inarray[1][i] +
421 gmat[7][i] * inarray[2][i];
423 stdVelocity[2][i] = gmat[2][i] * inarray[0][i] +
424 gmat[5][i] * inarray[1][i] +
425 gmat[8][i] * inarray[2][i];
431 el3D->GetGeom3D()->GetMetricInfo()->GetJac();
433 el3D->GetGeom3D()->GetMetricInfo()->GetDerivFactors();
435 for (
int i = 0; i < n_points; i++)
437 stdVelocity[0][i] = gmat[0][0] * inarray[0][i] +
438 gmat[3][0] * inarray[1][i] +
439 gmat[6][0] * inarray[2][i];
441 stdVelocity[1][i] = gmat[1][0] * inarray[0][i] +
442 gmat[4][0] * inarray[1][i] +
443 gmat[7][0] * inarray[2][i];
445 stdVelocity[2][i] = gmat[2][0] * inarray[0][i] +
446 gmat[5][0] * inarray[1][i] +
447 gmat[8][0] * inarray[2][i];
451 for (
int i = 0; i < n_points; i++)
453 pntVelocity =
sqrt(stdVelocity[0][i] * stdVelocity[0][i] +
454 stdVelocity[1][i] * stdVelocity[1][i] +
455 stdVelocity[2][i] * stdVelocity[2][i]);
457 if (pntVelocity > stdV[el])
459 stdV[el] = pntVelocity;
#define ASSERTL0(condition, msg)
#define ASSERTL1(condition, msg)
Assert Level 1 – Debugging which is used whether in FULLDEBUG or DEBUG compilation mode....
Array< OneD, Array< OneD, NekDouble > > m_velocity
Array< OneD, NekDouble > GetStdVelocity(const Array< OneD, Array< OneD, NekDouble > > inarray)
SolverUtils::RiemannSolverSharedPtr m_riemannSolver
CFLtester(const LibUtilities::SessionReaderSharedPtr &pSession, const SpatialDomains::MeshGraphSharedPtr &pGraph)
virtual NekDouble v_GetTimeStep(const Array< OneD, int > ExpOrder, const Array< OneD, NekDouble > CFL, NekDouble timeCFL) override
static EquationSystemSharedPtr create(const LibUtilities::SessionReaderSharedPtr &pSession, const SpatialDomains::MeshGraphSharedPtr &pGraph)
virtual void v_GenerateSummary(SummaryList &s) override
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(bool DeclareFields=true) override
Init object for UnsteadySystem class.
Array< OneD, NekDouble > m_traceVn
Array< OneD, NekDouble > & GetNormalVelocity()
Get the normal velocity.
void GetFluxVector(const Array< OneD, Array< OneD, NekDouble > > &physfield, Array< OneD, Array< OneD, Array< OneD, NekDouble > > > &flux)
static std::string className
void DoOdeRhs(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.
tBaseSharedPtr CreateInstance(tKey idKey, tParam... args)
Create an instance of the class referred to by idKey.
void DefineProjection(FuncPointerT func, ObjectPointerT obj)
void DefineOdeRhs(FuncPointerT func, ObjectPointerT obj)
A base class for PDEs which include an advection component.
SolverUtils::AdvectionSharedPtr m_advObject
Advection term.
virtual SOLVER_UTILS_EXPORT void v_InitObject(bool DeclareField=true) override
Init object for UnsteadySystem class.
int m_spacedim
Spatial dimension (>= expansion dim).
SOLVER_UTILS_EXPORT int GetTraceNpoints()
int m_expdim
Expansion dimension.
Array< OneD, MultiRegions::ExpListSharedPtr > m_fields
Array holding all dependent variables.
LibUtilities::SessionReaderSharedPtr m_session
The session reader.
Array< OneD, Array< OneD, NekDouble > > m_traceNormals
Array holding trace normals for DG simulations in the forwards direction.
SOLVER_UTILS_EXPORT int GetNpoints()
SOLVER_UTILS_EXPORT int GetNcoeffs()
enum MultiRegions::ProjectionType m_projectionType
Type of projection; e.g continuous or discontinuous.
SOLVER_UTILS_EXPORT void SetBoundaryConditions(NekDouble time)
Evaluates the boundary conditions at the given time.
SOLVER_UTILS_EXPORT SessionFunctionSharedPtr GetFunction(std::string name, const MultiRegions::ExpListSharedPtr &field=MultiRegions::NullExpListSharedPtr, bool cache=false)
Get a SessionFunction by name.
SOLVER_UTILS_EXPORT int GetTotPoints()
Base class for unsteady solvers.
LibUtilities::TimeIntegrationSchemeOperators m_ode
The time integration scheme operators to use.
bool m_explicitAdvection
Indicates if explicit or implicit treatment of advection is used.
virtual SOLVER_UTILS_EXPORT void v_GenerateSummary(SummaryList &s) override
Print a summary of time stepping parameters.
bool m_homoInitialFwd
Flag to determine if simulation should start in homogeneous forward transformed state.
int GetTotPoints() const
This function returns the total number of quadrature points used in the element.
std::shared_ptr< SessionReader > SessionReaderSharedPtr
@ P
Monomial polynomials .
std::shared_ptr< Expansion2D > Expansion2DSharedPtr
std::shared_ptr< Expansion3D > Expansion3DSharedPtr
@ eMixed_CG_Discontinuous
AdvectionFactory & GetAdvectionFactory()
Gets the factory for initialising advection objects.
std::vector< std::pair< std::string, std::string > > SummaryList
EquationSystemFactory & GetEquationSystemFactory()
RiemannSolverFactory & GetRiemannSolverFactory()
@ eDeformed
Geometry is curved or has non-constant factors.
std::shared_ptr< MeshGraph > MeshGraphSharedPtr
The above copyright notice and this permission notice shall be included.
static NekDouble EigenvaluesAnaMeshesRK2[6][14]
static NekDouble EigenvaluesAnaMeshesRK4[6][14]
static NekDouble EigenvaluesAnaMeshesAB2[6][14]
void Vmul(int n, const T *x, const int incx, const T *y, const int incy, T *z, const int incz)
Multiply vector z = x*y.
void Neg(int n, T *x, const int incx)
Negate x = -x.
T Vmin(int n, const T *x, const int incx)
Return the minimum element in x - called vmin to avoid conflict with min.
void Vvtvp(int n, const T *w, const int incw, const T *x, const int incx, const T *y, const int incy, T *z, const int incz)
vvtvp (vector times vector plus vector): z = w*x + y
void Zero(int n, T *x, const int incx)
Zero vector.
void Vcopy(int n, const T *x, const int incx, T *y, const int incy)
scalarT< T > sqrt(scalarT< T > in)