44 RegisterCreatorFunction(
"UnsteadyAdvection",
45 UnsteadyAdvection::create,
46 "Unsteady Advection equation.");
48 UnsteadyAdvection::UnsteadyAdvection(
67 std::vector<std::string> vel;
87 "AdvectionType", advName,
"NonConservative");
117 "AdvectionType", advName,
"WeakDG");
131 "UpwindType", riemName,
"Upwind");
143 ASSERTL0(
false,
"Unsupported projection type.");
157 ASSERTL0(
false,
"Implicit unsteady Advection not set up.");
183 for (i = 0; i <
m_velocity.num_elements(); ++i)
213 int nVariables = inarray.num_elements();
223 for (i = 0; i < nVariables; ++i)
245 int nVariables = inarray.num_elements();
260 for(i = 0; i < nVariables; ++i)
262 Vmath::Vcopy(nQuadraturePts, inarray[i], 1, outarray[i], 1);
272 for(i = 0; i < nVariables; ++i)
274 m_fields[i]->FwdTrans(inarray[i], coeffs);
275 m_fields[i]->BwdTrans_IterPerExp(coeffs, outarray[i]);
281 ASSERTL0(
false,
"Unknown projection scheme");
298 "Dimension of flux array and velocity array do not match");
301 int nq = physfield[0].num_elements();
303 for (i = 0; i < flux.num_elements(); ++i)
305 for (j = 0; j < flux[0].num_elements(); ++j)
326 "Dimension of flux array and velocity array do not match");
329 int nq = physfield[0].num_elements();
330 int nVariables = physfield.num_elements();
339 nq =
m_fields[0]->Get1DScaledTotPoints(OneDptscale);
347 for (i = 0; i < nVariables; ++i)
357 OneDptscale, physfield[i], physfieldInterp[i]);
366 OneDptscale,
m_velocity[j], velocityInterp[j]);
370 for (i = 0; i < flux.num_elements(); ++i)
372 for (j = 0; j < flux[0].num_elements(); ++j)
374 Vmath::Vmul(nq, physfieldInterp[i], 1, velocityInterp[j], 1,
375 fluxInterp[i][j], 1);
380 for (i = 0; i < nVariables; ++i)
384 m_fields[0]->PhysGalerkinProjection1DScaled(
385 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)
bool m_homoInitialFwd
Flag to determine if simulation should start in homogeneous forward transformed state.
tBaseSharedPtr CreateInstance(tKey idKey BOOST_PP_COMMA_IF(MAX_PARAM) BOOST_PP_ENUM_BINARY_PARAMS(MAX_PARAM, tParam, x))
Create an instance of the class referred to by idKey.
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.
boost::shared_ptr< SessionReader > SessionReaderSharedPtr
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.
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.
SOLVER_UTILS_EXPORT void EvaluateFunction(Array< OneD, Array< OneD, NekDouble > > &pArray, std::string pFunctionName, const NekDouble pTime=0.0, const int domain=0)
Evaluates a function as specified in the session file.
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 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)
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.