42 RegisterCreatorFunction(
"UnsteadyAdvection",
44 "Unsteady Advection equation.");
48 : UnsteadySystem(pSession),
49 AdvectionSystem(pSession)
60 AdvectionSystem::v_InitObject();
65 std::vector<std::string> vel;
85 "AdvectionType", advName,
"NonConservative");
115 "AdvectionType", advName,
"WeakDG");
129 "UpwindType", riemName,
"Upwind");
141 ASSERTL0(
false,
"Unsupported projection type.");
155 ASSERTL0(
false,
"Implicit unsteady Advection not set up.");
181 for (i = 0; i <
m_velocity.num_elements(); ++i)
211 int nVariables = inarray.num_elements();
221 for (i = 0; i < nVariables; ++i)
243 int nVariables = inarray.num_elements();
258 for(i = 0; i < nVariables; ++i)
260 Vmath::Vcopy(nQuadraturePts, inarray[i], 1, outarray[i], 1);
270 for(i = 0; i < nVariables; ++i)
272 m_fields[i]->FwdTrans(inarray[i], coeffs);
273 m_fields[i]->BwdTrans_IterPerExp(coeffs, outarray[i]);
279 ASSERTL0(
false,
"Unknown projection scheme");
296 "Dimension of flux array and velocity array do not match");
299 int nq = physfield[0].num_elements();
301 for (i = 0; i < flux.num_elements(); ++i)
303 for (j = 0; j < flux[0].num_elements(); ++j)
324 "Dimension of flux array and velocity array do not match");
327 int nq = physfield[0].num_elements();
328 int nVariables = physfield.num_elements();
337 nq =
m_fields[0]->Get1DScaledTotPoints(OneDptscale);
345 for (i = 0; i < nVariables; ++i)
355 OneDptscale, physfield[i], physfieldInterp[i]);
364 OneDptscale,
m_velocity[j], velocityInterp[j]);
368 for (i = 0; i < flux.num_elements(); ++i)
370 for (j = 0; j < flux[0].num_elements(); ++j)
372 Vmath::Vmul(nq, physfieldInterp[i], 1, velocityInterp[j], 1,
373 fluxInterp[i][j], 1);
378 for (i = 0; i < nVariables; ++i)
382 m_fields[0]->PhysGalerkinProjection1DScaled(
383 OneDptscale, fluxInterp[i][j], flux[i][j]);
390 AdvectionSystem::v_GenerateSummary(s);
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.
static SolverUtils::EquationSystemSharedPtr create(const LibUtilities::SessionReaderSharedPtr &pSession)
Creates an instance of this class.
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)
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.
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).
UnsteadyAdvection(const LibUtilities::SessionReaderSharedPtr &pSession)
Session reader.
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.
void Zero(int n, T *x, const int incx)
Zero vector.
#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)
static std::string className
Name of class.
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.