43 RegisterCreatorFunction(
"UnsteadyAdvection",
44 UnsteadyAdvection::create,
45 "Unsteady Advection equation.");
47 UnsteadyAdvection::UnsteadyAdvection(
67 std::vector<std::string> vel;
87 "AdvectionType", advName,
"NonConservative");
117 "AdvectionType", advName,
"WeakDG");
131 "UpwindType", riemName,
"Upwind");
144 ASSERTL0(
false,
"Unsupported projection type.");
158 ASSERTL0(
false,
"Implicit unsteady Advection not set up.");
184 for (i = 0; i <
m_velocity.num_elements(); ++i)
214 int nVariables = inarray.num_elements();
224 for (i = 0; i < nVariables; ++i)
246 int nVariables = inarray.num_elements();
261 for(i = 0; i < nVariables; ++i)
263 Vmath::Vcopy(nQuadraturePts, inarray[i], 1, outarray[i], 1);
273 for(i = 0; i < nVariables; ++i)
275 m_fields[i]->FwdTrans(inarray[i], coeffs);
276 m_fields[i]->BwdTrans_IterPerExp(coeffs, outarray[i]);
282 ASSERTL0(
false,
"Unknown projection scheme");
299 "Dimension of flux array and velocity array do not match");
302 int nq = physfield[0].num_elements();
304 for (i = 0; i < flux.num_elements(); ++i)
306 for (j = 0; j < flux[0].num_elements(); ++j)
327 "Dimension of flux array and velocity array do not match");
330 int nq = physfield[0].num_elements();
331 int nVariables = physfield.num_elements();
340 nq =
m_fields[0]->Get1DScaledTotPoints(OneDptscale);
348 for (i = 0; i < nVariables; ++i)
358 OneDptscale, physfield[i], physfieldInterp[i]);
367 OneDptscale,
m_velocity[j], velocityInterp[j]);
371 for (i = 0; i < flux.num_elements(); ++i)
373 for (j = 0; j < flux[0].num_elements(); ++j)
375 Vmath::Vmul(nq, physfieldInterp[i], 1, velocityInterp[j], 1,
376 fluxInterp[i][j], 1);
381 for (i = 0; i < nVariables; ++i)
385 m_fields[0]->PhysGalerkinProjection1DScaled(
386 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)
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
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)