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]);
void DoOdeProjection(const Array< OneD, const Array< OneD, NekDouble > > &inarray, Array< OneD, Array< OneD, NekDouble > > &outarray, const NekDouble time)
Compute the projection.
virtual void v_InitObject()
Initialise the object.
#define ASSERTL0(condition, msg)
std::shared_ptr< MeshGraph > MeshGraphSharedPtr
bool m_homoInitialFwd
Flag to determine if simulation should start in homogeneous forward transformed state.
SolverUtils::AdvectionSharedPtr m_advObject
Advection term.
LibUtilities::TimeIntegrationSchemeOperators m_ode
The time integration scheme operators to use.
std::vector< std::pair< std::string, std::string > > SummaryList
void GetFluxVector(const Array< OneD, Array< OneD, NekDouble > > &physfield, Array< OneD, Array< OneD, Array< OneD, NekDouble > > > &flux)
Evaluate the flux at each solution point.
int m_expdim
Expansion dimension.
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
enum MultiRegions::ProjectionType m_projectionType
Type of projection; e.g continuous or discontinuous.
bool m_specHP_dealiasing
Flag to determine if dealisising is usde for the Spectral/hp element discretisation.
virtual void v_GenerateSummary(SolverUtils::SummaryList &s)
Print Summary.
Array< OneD, Array< OneD, NekDouble > > m_traceNormals
Array holding trace normals for DG simulations in the forwards direction.
void DefineProjection(FuncPointerT func, ObjectPointerT obj)
virtual SOLVER_UTILS_EXPORT void v_GenerateSummary(SummaryList &s)
Print a summary of time stepping parameters.
tBaseSharedPtr CreateInstance(tKey idKey, tParam... args)
Create an instance of the class referred to by idKey.
bool m_explicitAdvection
Indicates if explicit or implicit treatment of advection is used.
void DefineOdeRhs(FuncPointerT func, ObjectPointerT obj)
Array< OneD, Array< OneD, NekDouble > > m_velocity
Advection velocity.
Base class for unsteady solvers.
void DoOdeRhs(const Array< OneD, const Array< OneD, NekDouble > > &inarray, Array< OneD, Array< OneD, NekDouble > > &outarray, const NekDouble time)
Compute the RHS.
RiemannSolverFactory & GetRiemannSolverFactory()
int m_spacedim
Spatial dimension (>= expansion dim).
AdvectionFactory & GetAdvectionFactory()
Gets the factory for initialising advection objects.
SolverUtils::RiemannSolverSharedPtr m_riemannSolver
void Neg(int n, T *x, const int incx)
Negate x = -x.
EquationSystemFactory & GetEquationSystemFactory()
SOLVER_UTILS_EXPORT void SetBoundaryConditions(NekDouble time)
Evaluates the boundary conditions at the given time.
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.
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 GetNpoints()
Array< OneD, NekDouble > m_traceVn
Array< OneD, MultiRegions::ExpListSharedPtr > m_fields
Array holding all dependent variables.
LibUtilities::SessionReaderSharedPtr m_session
The session reader.
SOLVER_UTILS_EXPORT int GetTraceNpoints()
SOLVER_UTILS_EXPORT int GetNcoeffs()
Array< OneD, NekDouble > & GetNormalVelocity()
Get the normal velocity.
virtual ~UnsteadyAdvection()
Destructor.
virtual SOLVER_UTILS_EXPORT void v_InitObject()
Init object for UnsteadySystem class.
void Zero(int n, T *x, const int incx)
Zero vector.
A base class for PDEs which include an advection component.
#define ASSERTL1(condition, msg)
Assert Level 1 – Debugging which is used whether in FULLDEBUG or DEBUG compilation mode...
void Vcopy(int n, const T *x, const int incx, T *y, const int incy)
std::shared_ptr< SessionReader > SessionReaderSharedPtr
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.