60 std::vector<std::string> vel;
86 "AdvectionType", advName,
"WeakDG");
92 "UpwindType", riemName,
"Upwind");
109 "AdvectionType", advName,
"NonConservative");
118 ASSERTL0(
false,
"Unsupported projection type.");
130 ASSERTL0(
false,
"Implicit unsteady Advection not set up.");
143 int nvariables = inarray.size();
148 for(
int j = 0; j < nvariables; ++j)
159 int nvariables = inarray.size();
169 for(
int j = 0; j < nvariables; ++j)
180 for(
int j = 0; j < nvariables; ++j)
182 m_fields[j]->FwdTrans(inarray[j],coeffs);
183 m_fields[j]->BwdTrans_IterPerExp(coeffs,outarray[j]);
188 ASSERTL0(
false,
"Unknown projection scheme");
226 "Dimension of flux array and velocity array do not match");
228 int nq = physfield[0].size();
230 for (
int i = 0; i < flux.size(); ++i)
232 for (
int j = 0; j < flux[0].size(); ++j)
253 int n_element =
m_fields[0]->GetExpSize();
263 for (
int el = 0; el < n_element; ++el)
265 int npoints =
m_fields[0]->GetExp(el)->GetTotPoints();
268 if(std::dynamic_pointer_cast<LocalRegions::TriExp>(
m_fields[0]->GetExp(el)))
272 tstep[el] = CFL[el]/(stdVelocity[el]);
274 else if(std::dynamic_pointer_cast<LocalRegions::QuadExp>(
m_fields[0]->GetExp(el)))
278 tstep[el] = CFL[el]/(stdVelocity[el]);
302 int n_elements =
m_fields[0]->GetExpSize();
319 if (TimeStability == 1.0)
323 else if (TimeStability == 2.0)
327 else if (TimeStability == 2.784)
333 ASSERTL0(
false,
"Dominant eigenvalues database not present for this time-stepping scheme")
338 TimeStep = (TimeStability/SpatialStability)*CFL;
354 int n_element =
m_fields[0]->GetExpSize();
355 int nvel = inarray.size();
363 for (
int i = 0; i < nvel; ++i)
370 for (
int el = 0; el < n_element; ++el)
377 el2D->GetGeom2D()->GetMetricInfo()->GetJac();
379 el2D->GetGeom2D()->GetMetricInfo()->GetDerivFactors();
381 if (el2D->GetGeom2D()->GetMetricInfo()->GetGtype()
384 for (
int i = 0; i < n_points; i++)
386 stdVelocity[0][i] = gmat[0][i]*inarray[0][i]
387 + gmat[2][i]*inarray[1][i];
389 stdVelocity[1][i] = gmat[1][i]*inarray[0][i]
390 + gmat[3][i]*inarray[1][i];
395 for (
int i = 0; i < n_points; i++)
397 stdVelocity[0][i] = gmat[0][0]*inarray[0][i]
398 + gmat[2][0]*inarray[1][i];
400 stdVelocity[1][i] = gmat[1][0]*inarray[0][i]
401 + gmat[3][0]*inarray[1][i];
406 for (
int i = 0; i < n_points; i++)
408 pntVelocity =
sqrt(stdVelocity[0][i]*stdVelocity[0][i]
409 + stdVelocity[1][i]*stdVelocity[1][i]);
411 if (pntVelocity>stdV[el])
413 stdV[el] = pntVelocity;
420 for (
int el = 0; el < n_element; ++el)
428 el3D->GetGeom3D()->GetMetricInfo()->GetJac();
430 el3D->GetGeom3D()->GetMetricInfo()->GetDerivFactors();
432 if (el3D->GetGeom3D()->GetMetricInfo()->GetGtype()
435 for (
int i = 0; i < n_points; i++)
437 stdVelocity[0][i] = gmat[0][i]*inarray[0][i]
438 + gmat[3][i]*inarray[1][i]
439 + gmat[6][i]*inarray[2][i];
441 stdVelocity[1][i] = gmat[1][i]*inarray[0][i]
442 + gmat[4][i]*inarray[1][i]
443 + gmat[7][i]*inarray[2][i];
445 stdVelocity[2][i] = gmat[2][i]*inarray[0][i]
446 + gmat[5][i]*inarray[1][i]
447 + gmat[8][i]*inarray[2][i];
453 el3D->GetGeom3D()->GetMetricInfo()->GetJac();
455 el3D->GetGeom3D()->GetMetricInfo()->GetDerivFactors();
457 for (
int i = 0; i < n_points; i++)
459 stdVelocity[0][i] = gmat[0][0]*inarray[0][i]
460 + gmat[3][0]*inarray[1][i]
461 + gmat[6][0]*inarray[2][i];
463 stdVelocity[1][i] = gmat[1][0]*inarray[0][i]
464 + gmat[4][0]*inarray[1][i]
465 + gmat[7][0]*inarray[2][i];
467 stdVelocity[2][i] = gmat[2][0]*inarray[0][i]
468 + gmat[5][0]*inarray[1][i]
469 + gmat[8][0]*inarray[2][i];
473 for (
int i = 0; i < n_points; i++)
475 pntVelocity =
sqrt(stdVelocity[0][i]*stdVelocity[0][i]
476 + stdVelocity[1][i]*stdVelocity[1][i]
477 + stdVelocity[2][i]*stdVelocity[2][i]);
479 if (pntVelocity > stdV[el])
481 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
virtual void v_InitObject()
Init object for UnsteadySystem class.
Array< OneD, NekDouble > GetStdVelocity(const Array< OneD, Array< OneD, NekDouble > > inarray)
SolverUtils::RiemannSolverSharedPtr m_riemannSolver
CFLtester(const LibUtilities::SessionReaderSharedPtr &pSession, const SpatialDomains::MeshGraphSharedPtr &pGraph)
static EquationSystemSharedPtr create(const LibUtilities::SessionReaderSharedPtr &pSession, const SpatialDomains::MeshGraphSharedPtr &pGraph)
virtual void v_GenerateSummary(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)
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)
virtual NekDouble v_GetTimeStep(const Array< OneD, int > ExpOrder, const Array< OneD, NekDouble > CFL, NekDouble timeCFL)
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()
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)
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)