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();
163 for (
int j = 0; j < nvariables; ++j)
174 for (
int j = 0; j < nvariables; ++j)
176 m_fields[j]->FwdTrans(inarray[j], coeffs);
177 m_fields[j]->BwdTrans_IterPerExp(coeffs, outarray[j]);
182 ASSERTL0(
false,
"Unknown projection scheme");
217 "Dimension of flux array and velocity array do not match");
219 int nq = physfield[0].size();
221 for (
int i = 0; i < flux.size(); ++i)
223 for (
int j = 0; j < flux[0].size(); ++j)
240 int n_element =
m_fields[0]->GetExpSize();
250 for (
int el = 0; el < n_element; ++el)
252 int npoints =
m_fields[0]->GetExp(el)->GetTotPoints();
255 if (std::dynamic_pointer_cast<LocalRegions::TriExp>(
262 tstep[el] = CFL[el] / (stdVelocity[el]);
264 else if (std::dynamic_pointer_cast<LocalRegions::QuadExp>(
271 tstep[el] = CFL[el] / (stdVelocity[el]);
292 int n_elements =
m_fields[0]->GetExpSize();
299 int P = ExpOrder - 1;
309 if (TimeStability == 1.0)
313 else if (TimeStability == 2.0)
317 else if (TimeStability == 2.784)
323 ASSERTL0(
false,
"Dominant eigenvalues database not present for this "
324 "time-stepping scheme")
329 TimeStep = (TimeStability / SpatialStability) * CFL;
343 int n_element =
m_fields[0]->GetExpSize();
344 int nvel = inarray.size();
352 for (
int i = 0; i < nvel; ++i)
359 for (
int el = 0; el < n_element; ++el)
366 el2D->GetGeom2D()->GetMetricInfo()->GetJac();
368 el2D->GetGeom2D()->GetMetricInfo()->GetDerivFactors();
370 if (el2D->GetGeom2D()->GetMetricInfo()->GetGtype() ==
373 for (
int i = 0; i < n_points; i++)
376 gmat[0][i] * inarray[0][i] + gmat[2][i] * inarray[1][i];
379 gmat[1][i] * inarray[0][i] + gmat[3][i] * inarray[1][i];
384 for (
int i = 0; i < n_points; i++)
387 gmat[0][0] * inarray[0][i] + gmat[2][0] * inarray[1][i];
390 gmat[1][0] * inarray[0][i] + gmat[3][0] * inarray[1][i];
394 for (
int i = 0; i < n_points; i++)
396 pntVelocity =
sqrt(stdVelocity[0][i] * stdVelocity[0][i] +
397 stdVelocity[1][i] * stdVelocity[1][i]);
399 if (pntVelocity > stdV[el])
401 stdV[el] = pntVelocity;
408 for (
int el = 0; el < n_element; ++el)
416 el3D->GetGeom3D()->GetMetricInfo()->GetJac();
418 el3D->GetGeom3D()->GetMetricInfo()->GetDerivFactors();
420 if (el3D->GetGeom3D()->GetMetricInfo()->GetGtype() ==
423 for (
int i = 0; i < n_points; i++)
425 stdVelocity[0][i] = gmat[0][i] * inarray[0][i] +
426 gmat[3][i] * inarray[1][i] +
427 gmat[6][i] * inarray[2][i];
429 stdVelocity[1][i] = gmat[1][i] * inarray[0][i] +
430 gmat[4][i] * inarray[1][i] +
431 gmat[7][i] * inarray[2][i];
433 stdVelocity[2][i] = gmat[2][i] * inarray[0][i] +
434 gmat[5][i] * inarray[1][i] +
435 gmat[8][i] * inarray[2][i];
441 el3D->GetGeom3D()->GetMetricInfo()->GetJac();
443 el3D->GetGeom3D()->GetMetricInfo()->GetDerivFactors();
445 for (
int i = 0; i < n_points; i++)
447 stdVelocity[0][i] = gmat[0][0] * inarray[0][i] +
448 gmat[3][0] * inarray[1][i] +
449 gmat[6][0] * inarray[2][i];
451 stdVelocity[1][i] = gmat[1][0] * inarray[0][i] +
452 gmat[4][0] * inarray[1][i] +
453 gmat[7][0] * inarray[2][i];
455 stdVelocity[2][i] = gmat[2][0] * inarray[0][i] +
456 gmat[5][0] * inarray[1][i] +
457 gmat[8][0] * inarray[2][i];
461 for (
int i = 0; i < n_points; i++)
463 pntVelocity =
sqrt(stdVelocity[0][i] * stdVelocity[0][i] +
464 stdVelocity[1][i] * stdVelocity[1][i] +
465 stdVelocity[2][i] * stdVelocity[2][i]);
467 if (pntVelocity > stdV[el])
469 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
SolverUtils::RiemannSolverSharedPtr m_riemannSolver
CFLtester(const LibUtilities::SessionReaderSharedPtr &pSession, const SpatialDomains::MeshGraphSharedPtr &pGraph)
void DoOdeRhs(const Array< OneD, const Array< OneD, NekDouble >> &inarray, Array< OneD, Array< OneD, NekDouble >> &outarray, const NekDouble time)
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.
Array< OneD, NekDouble > GetStdVelocity(const Array< OneD, Array< OneD, NekDouble >> inarray)
static std::string className
void GetFluxVector(const Array< OneD, Array< OneD, NekDouble >> &physfield, Array< OneD, Array< OneD, Array< OneD, NekDouble >>> &flux)
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
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)