37 #include <boost/core/ignore_unused.hpp>
46 string UnsteadyViscousBurgers::className =
48 "UnsteadyViscousBurgers", UnsteadyViscousBurgers::create);
50 UnsteadyViscousBurgers::UnsteadyViscousBurgers(
70 m_session->MatchSolverInfo(
"SpectralVanishingViscosity",
"True",
72 m_session->MatchSolverInfo(
"SpectralVanishingViscosity",
"VarDiff",
91 ASSERTL0(
false,
"Need to implement for DG");
98 m_session->LoadSolverInfo(
"AdvectionType", advName,
"WeakDG");
103 m_session->LoadSolverInfo(
"UpwindType", riemName,
"Upwind");
111 std::string diffName;
112 m_session->LoadSolverInfo(
"DiffusionType", diffName,
"LDG");
126 m_session->LoadSolverInfo(
"AdvectionType", advName,
136 for (
int i = 0; i <
m_fields.size(); ++i)
146 ASSERTL0(
false,
"Explicit Galerkin diffusion not set up.");
153 ASSERTL0(
false,
"Unsupported projection type.");
197 for (i = 0; i < inarray.size(); ++i)
199 m_fields[0]->ExtractTracePhys(inarray[i], tmp);
221 int nVariables = inarray.size();
228 for (
int i = 0; i < nVariables; ++i)
237 for (
int i = 0; i < nVariables; ++i)
247 for (
int i = 0; i < nVariables; ++i)
249 Vmath::Vadd(nSolutionPts, &outarray[i][0], 1, &outarrayDiff[i][0],
250 1, &outarray[i][0], 1);
258 x->Apply(
m_fields, inarray, outarray, time);
275 int nvariables = inarray.size();
284 for (i = 0; i < nvariables; ++i)
297 ASSERTL0(
false,
"Unknown projection scheme");
315 int nvariables = inarray.size();
330 for (
int n = 1; n < nvariables; ++n)
332 F[n] = F[n - 1] + nq;
339 for (
int i = 0; i < nvariables; ++i)
356 for (
int i = 0; i <
m_fields.size(); ++i)
358 m_fields[i]->ClearGlobalLinSysManager();
365 for (
int i = 0; i < nvariables; ++i)
386 const int nq =
m_fields[0]->GetNpoints();
388 for (
int i = 0; i < flux.size(); ++i)
390 for (
int j = 0; j < flux[0].size(); ++j)
392 Vmath::Vmul(nq, physfield[i], 1, physfield[j], 1, flux[i][j], 1);
411 boost::ignore_unused(inarray);
413 unsigned int nDim = qfield.size();
414 unsigned int nConvectiveFields = qfield[0].size();
415 unsigned int nPts = qfield[0][0].size();
417 for (
unsigned int j = 0; j < nDim; ++j)
419 for (
unsigned int i = 0; i < nConvectiveFields; ++i)
#define ASSERTL0(condition, msg)
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 DefineImplicitSolve(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(bool DeclareField=true) override
Init object for UnsteadySystem class.
SOLVER_UTILS_EXPORT int GetTraceNpoints()
Array< OneD, MultiRegions::ExpListSharedPtr > m_fields
Array holding all dependent variables.
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.
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_explicitDiffusion
Indicates if explicit or implicit treatment of diffusion is used.
SOLVER_UTILS_EXPORT void SVVVarDiffCoeff(const Array< OneD, Array< OneD, NekDouble >> vel, StdRegions::VarCoeffMap &varCoeffMap)
Evaluate the SVV diffusion coefficient according to Moura's paper where it should proportional to h t...
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.
Array< OneD, NekDouble > m_traceVn
bool m_useSpecVanViscVarDiff
virtual ~UnsteadyViscousBurgers()
Destructor.
virtual void v_GenerateSummary(SolverUtils::SummaryList &s) override
Print Summary.
void DoImplicitSolve(const Array< OneD, const Array< OneD, NekDouble >> &inarray, Array< OneD, Array< OneD, NekDouble >> &outarray, NekDouble time, NekDouble lambda)
Solve implicitly the diffusion term.
void DoOdeRhs(const Array< OneD, const Array< OneD, NekDouble >> &inarray, Array< OneD, Array< OneD, NekDouble >> &outarray, const NekDouble time)
Compute the RHS.
SolverUtils::DiffusionSharedPtr m_diffusion
std::vector< SolverUtils::ForcingSharedPtr > m_forcing
Forcing terms.
NekDouble m_sVVCutoffRatio
void DoOdeProjection(const Array< OneD, const Array< OneD, NekDouble >> &inarray, Array< OneD, Array< OneD, NekDouble >> &outarray, const NekDouble time)
Perform the projection.
void GetFluxVectorAdv(const Array< OneD, Array< OneD, NekDouble >> &physfield, Array< OneD, Array< OneD, Array< OneD, NekDouble >>> &flux)
Evaluate the flux at each solution point for the advection part.
virtual void v_InitObject(bool DeclareFields=true) override
Initialise the object.
Array< OneD, NekDouble > & GetNormalVelocity(Array< OneD, Array< OneD, NekDouble >> &inarray)
Get the normal velocity.
SolverUtils::RiemannSolverSharedPtr m_riemannSolver
void GetFluxVectorDiff(const Array< OneD, Array< OneD, NekDouble >> &inarray, const Array< OneD, Array< OneD, Array< OneD, NekDouble >>> &qfield, Array< OneD, Array< OneD, Array< OneD, NekDouble >>> &viscousTensor)
Evaluate the flux at each solution point for the diffusion part.
StdRegions::VarCoeffMap m_varCoeffLap
Variable Coefficient map for the Laplacian which can be activated as part of SVV or otherwise.
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
DiffusionFactory & GetDiffusionFactory()
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
static VarCoeffMap NullVarCoeffMap
The above copyright notice and this permission notice shall be included.
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 Vadd(int n, const T *x, const int incx, const T *y, const int incy, T *z, const int incz)
Add vector z = x+y.
void Smul(int n, const T alpha, const T *x, const int incx, T *y, const int incy)
Scalar multiply y = alpha*x.
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)