37 #include <boost/core/ignore_unused.hpp>
46 string UnsteadyViscousBurgers::className
48 "UnsteadyViscousBurgers",
49 UnsteadyViscousBurgers::create);
51 UnsteadyViscousBurgers::UnsteadyViscousBurgers(
93 ASSERTL0(
false,
"Need to implement for DG");
100 m_session->LoadSolverInfo(
"AdvectionType", advName,
"WeakDG");
102 CreateInstance(advName, advName);
105 m_session->LoadSolverInfo(
"UpwindType", riemName,
"Upwind");
112 std::string diffName;
113 m_session->LoadSolverInfo(
"DiffusionType", diffName,
"LDG");
115 CreateInstance(diffName, diffName);
127 m_session->LoadSolverInfo(
"AdvectionType", advName,
130 CreateInstance(advName, advName);
137 for(
int i = 0; i <
m_fields.size(); ++i)
147 ASSERTL0(
false,
"Explicit Galerkin diffusion not set up.");
154 ASSERTL0(
false,
"Unsupported projection type.");
198 for (i = 0; i < inarray.size(); ++i)
200 m_fields[0]->ExtractTracePhys(inarray[i], tmp);
226 int nVariables = inarray.size();
233 for (
int i = 0; i < nVariables; ++i)
240 inarray, outarray, time);
243 for (
int i = 0; i < nVariables; ++i)
253 for (
int i = 0; i < nVariables; ++i)
256 &outarrayDiff[i][0], 1, &outarray[i][0], 1);
264 x->Apply(
m_fields, inarray, outarray, time);
282 int nvariables = inarray.size();
291 for(i = 0; i < nvariables; ++i)
304 ASSERTL0(
false,
"Unknown projection scheme");
324 int nvariables = inarray.size();
339 for (
int n = 1; n < nvariables; ++n)
348 for (
int i = 0; i < nvariables; ++i)
352 inarray[i], 1, F[i], 1);
365 for(
int i = 0; i <
m_fields.size(); ++i)
367 m_fields[i]->ClearGlobalLinSysManager();
374 for (
int i = 0; i < nvariables; ++i)
395 const int nq =
m_fields[0]->GetNpoints();
397 for (
int i = 0; i < flux.size(); ++i)
399 for (
int j = 0; j < flux[0].size(); ++j)
421 boost::ignore_unused(inarray);
423 unsigned int nDim = qfield.size();
424 unsigned int nConvectiveFields = qfield[0].size();
425 unsigned int nPts = qfield[0][0].size();
427 for (
unsigned int j = 0; j < nDim; ++j)
429 for (
unsigned int i = 0; i < nConvectiveFields; ++i)
432 viscousTensor[j][i], 1 );
#define ASSERTL0(condition, msg)
tKey RegisterCreatorFunction(tKey idKey, CreatorFunction classCreator, std::string pDesc="")
Register a class with the factory.
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()
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)
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
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 ~UnsteadyViscousBurgers()
Destructor.
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.
Array< OneD, NekDouble > & GetNormalVelocity(Array< OneD, Array< OneD, NekDouble > > &inarray)
Get the normal velocity.
virtual 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.
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.
virtual void v_InitObject()
Initialise the object.
SolverUtils::RiemannSolverSharedPtr m_riemannSolver
virtual void DoOdeRhs(const Array< OneD, const Array< OneD, NekDouble > > &inarray, Array< OneD, Array< OneD, NekDouble > > &outarray, const NekDouble time)
Compute the RHS.
virtual void v_GenerateSummary(SolverUtils::SummaryList &s)
Print Summary.
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)