44 RegisterCreatorFunction(
"UnsteadyAdvection",
45 UnsteadyAdvection::create,
46 "Unsteady Advection equation.");
48 UnsteadyAdvection::UnsteadyAdvection(
68 std::vector<std::string> vel;
88 "AdvectionType", advName,
"NonConservative");
118 "AdvectionType", advName,
"WeakDG");
132 "UpwindType", riemName,
"Upwind");
145 ASSERTL0(
false,
"Unsupported projection type.");
159 ASSERTL0(
false,
"Implicit unsteady Advection not set up.");
215 int nVariables = inarray.size();
230 for (i = 0; i < nVariables; ++i)
252 int nVariables = inarray.size();
267 for(i = 0; i < nVariables; ++i)
269 Vmath::Vcopy(nQuadraturePts, inarray[i], 1, outarray[i], 1);
279 for(i = 0; i < nVariables; ++i)
281 m_fields[i]->FwdTrans(inarray[i], coeffs);
282 m_fields[i]->BwdTrans_IterPerExp(coeffs, outarray[i]);
288 ASSERTL0(
false,
"Unknown projection scheme");
305 "Dimension of flux array and velocity array do not match");
308 int nq = physfield[0].size();
310 for (i = 0; i < flux.size(); ++i)
312 for (j = 0; j < flux[0].size(); ++j)
333 "Dimension of flux array and velocity array do not match");
336 int nq = physfield[0].size();
337 int nVariables = physfield.size();
346 nq =
m_fields[0]->Get1DScaledTotPoints(OneDptscale);
354 for (i = 0; i < nVariables; ++i)
364 OneDptscale, physfield[i], physfieldInterp[i]);
373 OneDptscale,
m_velocity[j], velocityInterp[j]);
377 for (i = 0; i < flux.size(); ++i)
379 for (j = 0; j < flux[0].size(); ++j)
381 Vmath::Vmul(nq, physfieldInterp[i], 1, velocityInterp[j], 1,
382 fluxInterp[i][j], 1);
387 for (i = 0; i < nVariables; ++i)
391 m_fields[0]->PhysGalerkinProjection1DScaled(
392 OneDptscale, fluxInterp[i][j], flux[i][j]);
#define ASSERTL0(condition, msg)
#define ASSERTL1(condition, msg)
Assert Level 1 – Debugging which is used whether in FULLDEBUG or DEBUG compilation mode....
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)
void AccumulateRegion(std::string, int iolevel=0)
Accumulate elapsed time for a region.
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.
bool m_specHP_dealiasing
Flag to determine if dealisising is usde for the Spectral/hp element discretisation.
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.
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.
virtual void v_InitObject()
Initialise the object.
Array< OneD, NekDouble > m_traceVn
virtual void v_GenerateSummary(SolverUtils::SummaryList &s)
Print Summary.
virtual ~UnsteadyAdvection()
Destructor.
Array< OneD, NekDouble > & GetNormalVelocity()
Get the normal velocity.
Array< OneD, Array< OneD, NekDouble > > m_velocity
Advection velocity.
void DoOdeRhs(const Array< OneD, const Array< OneD, NekDouble > > &inarray, Array< OneD, Array< OneD, NekDouble > > &outarray, const NekDouble time)
Compute the RHS.
void DoOdeProjection(const Array< OneD, const Array< OneD, NekDouble > > &inarray, Array< OneD, Array< OneD, NekDouble > > &outarray, const NekDouble time)
Compute the projection.
void GetFluxVectorDeAlias(const Array< OneD, Array< OneD, NekDouble > > &physfield, Array< OneD, Array< OneD, Array< OneD, NekDouble > > > &flux)
Evaluate the flux at each solution point using dealiasing.
void GetFluxVector(const Array< OneD, Array< OneD, NekDouble > > &physfield, Array< OneD, Array< OneD, Array< OneD, NekDouble > > > &flux)
Evaluate the flux at each solution point.
SolverUtils::RiemannSolverSharedPtr m_riemannSolver
std::shared_ptr< SessionReader > SessionReaderSharedPtr
@ 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()
std::shared_ptr< MeshGraph > MeshGraphSharedPtr
The above copyright notice and this permission notice shall be included.
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.
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)