44 string UnsteadyAdvection::className =
46 "UnsteadyAdvection", UnsteadyAdvection::create,
47 "Unsteady Advection equation.");
49 UnsteadyAdvection::UnsteadyAdvection(
69 m_session->MatchSolverInfo(
"GJPStabilisation",
"False",
78 std::vector<std::string> vel;
98 m_session->LoadSolverInfo(
"AdvectionType", advName,
128 m_session->LoadSolverInfo(
"AdvectionType", advName,
"WeakDG");
141 m_session->LoadSolverInfo(
"UpwindType", riemName,
"Upwind");
154 ASSERTL0(
false,
"Unsupported projection type.");
172 ASSERTL0(
false,
"Implicit unsteady Advection not set up.");
224 int nVariables = inarray.size();
239 for (i = 0; i < nVariables; ++i)
247 x->Apply(
m_fields, inarray, outarray, time);
266 int nVariables = inarray.size();
281 for (i = 0; i < nVariables; ++i)
283 Vmath::Vcopy(nQuadraturePts, inarray[i], 1, outarray[i], 1);
292 int ncoeffs =
m_fields[0]->GetNcoeffs();
296 for(i = 0; i < nVariables; ++i)
298 m_fields[i]->FwdTrans(inarray[i], coeffs);
299 m_fields[i]->BwdTrans_IterPerExp(coeffs, outarray[i]);
307 for (i = 0; i < nVariables; ++i)
310 std::dynamic_pointer_cast<MultiRegions::ContField>(
316 m_fields[i]->IProductWRTBase(in, wsp);
321 cfield->GetGJPForcing();
326 if (GJPData->IsSemiImplicit())
341 mtype, cfield->GetLocalToGlobalMap(), factors);
345 m_fields[i]->BwdTrans(coeffs, outarray[i]);
351 ASSERTL0(
false,
"Unknown projection scheme");
368 "Dimension of flux array and velocity array do not match");
371 int nq = physfield[0].size();
373 for (i = 0; i < flux.size(); ++i)
375 for (j = 0; j < flux[0].size(); ++j)
395 "Dimension of flux array and velocity array do not match");
398 int nq = physfield[0].size();
399 int nVariables = physfield.size();
407 nq =
m_fields[0]->Get1DScaledTotPoints(OneDptscale);
415 for (i = 0; i < nVariables; ++i)
424 m_fields[0]->PhysInterp1DScaled(OneDptscale, physfield[i],
438 for (i = 0; i < flux.size(); ++i)
440 for (j = 0; j < flux[0].size(); ++j)
442 Vmath::Vmul(nq, physfieldInterp[i], 1, velocityInterp[j], 1,
443 fluxInterp[i][j], 1);
448 for (i = 0; i < nVariables; ++i)
452 m_fields[0]->PhysGalerkinProjection1DScaled(
453 OneDptscale, fluxInterp[i][j], flux[i][j]);
464 s,
"GJP Stab. Impl. ",
465 m_session->GetSolverInfo(
"GJPStabilisation"));
#define ASSERTL0(condition, msg)
#define ASSERTL1(condition, msg)
Assert Level 1 – Debugging which is used whether in FULLDEBUG or DEBUG compilation mode....
tKey RegisterCreatorFunction(tKey idKey, CreatorFunction classCreator, std::string pDesc="")
Register a class with the factory.
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.
Describe a linear system.
A base class for PDEs which include an advection component.
SolverUtils::AdvectionSharedPtr m_advObject
Advection term.
virtual SOLVER_UTILS_EXPORT void v_InitObject(bool DeclareField=true) override
Init object for UnsteadySystem class.
int m_spacedim
Spatial dimension (>= expansion dim).
SOLVER_UTILS_EXPORT int GetTraceNpoints()
int m_expdim
Expansion dimension.
NekDouble m_timestep
Time step size.
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()
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.
static SOLVER_UTILS_EXPORT std::vector< ForcingSharedPtr > Load(const LibUtilities::SessionReaderSharedPtr &pSession, const std::weak_ptr< EquationSystem > &pEquation, const Array< OneD, MultiRegions::ExpListSharedPtr > &pFields, const unsigned int &pNumForcingFields=0)
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) override
Print a summary of time stepping parameters.
bool m_homoInitialFwd
Flag to determine if simulation should start in homogeneous forward transformed state.
std::vector< SolverUtils::ForcingSharedPtr > m_forcing
Forcing terms.
void DoOdeRhs(const Array< OneD, const Array< OneD, NekDouble >> &inarray, Array< OneD, Array< OneD, NekDouble >> &outarray, const NekDouble time)
Compute the RHS.
Array< OneD, NekDouble > m_traceVn
void DoOdeProjection(const Array< OneD, const Array< OneD, NekDouble >> &inarray, Array< OneD, Array< OneD, NekDouble >> &outarray, const NekDouble time)
Compute the projection.
void GetFluxVector(const Array< OneD, Array< OneD, NekDouble >> &physfield, Array< OneD, Array< OneD, Array< OneD, NekDouble >>> &flux)
Evaluate the flux at each solution point.
virtual ~UnsteadyAdvection()
Destructor.
Array< OneD, NekDouble > & GetNormalVelocity()
Get the normal velocity.
virtual void v_GenerateSummary(SolverUtils::SummaryList &s) override
Print Summary.
Array< OneD, Array< OneD, NekDouble > > m_velocity
Advection velocity.
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.
virtual void v_InitObject(bool DeclareFields=true) override
Initialise the object.
bool m_useGJPStabilisation
SolverUtils::RiemannSolverSharedPtr m_riemannSolver
std::shared_ptr< SessionReader > SessionReaderSharedPtr
@ eMixed_CG_Discontinuous
std::shared_ptr< GJPStabilisation > GJPStabilisationSharedPtr
std::shared_ptr< ContField > ContFieldSharedPtr
AdvectionFactory & GetAdvectionFactory()
Gets the factory for initialising advection objects.
std::vector< std::pair< std::string, std::string > > SummaryList
EquationSystemFactory & GetEquationSystemFactory()
void AddSummaryItem(SummaryList &l, const std::string &name, const std::string &value)
Adds a summary item to the summary info list.
RiemannSolverFactory & GetRiemannSolverFactory()
std::shared_ptr< MeshGraph > MeshGraphSharedPtr
std::map< ConstFactorType, NekDouble > ConstFactorMap
The above copyright notice and this permission notice shall be included.
static Array< OneD, NekDouble > NullNekDouble1DArray
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)