46 "APE1/APE4 (Acoustic Perturbation Equations)");
61 UnsteadySystem::v_InitObject();
68 "Only Projection=DisContinuous supported by the APE class.");
106 m_vecLocs[0][i] = 1 + i;
110 m_session->LoadSolverInfo(
"UpwindType", riemName,
"APEUpwind");
120 m_session->LoadSolverInfo(
"AdvectionType", advName,
"WeakDG");
134 ASSERTL0(
false,
"Implicit APE not set up.");
160 int nq = physfield[0].num_elements();
165 "Dimension of flux array and velocity array do not match");
185 Vmath::Vadd(nq, flux[0][j], 1, tmp2, 1, flux[0][j], 1);
188 for (
int i = 1; i < flux.num_elements(); ++i)
190 ASSERTL1(flux[i].num_elements() == m_spacedim,
191 "Dimension of flux array and velocity array do not match");
211 Vmath::Vadd(nq, flux[i][j], 1, tmp1, 1, flux[i][j], 1);
225 int nVariables = inarray.num_elements();
233 for (
int i = 0; i < nVariables; ++i)
240 Vmath::Vmul(nq, tmp1, 1, outarray[i], 1, outarray[i], 1);
258 int nvariables = inarray.num_elements();
262 for (
int i = 0; i < nvariables; ++i)
278 int nvariables =
m_fields.num_elements();
285 for (
int i = 0; i < nvariables; ++i)
288 m_fields[i]->ExtractTracePhys(inarray[i], Fwd[i]);
292 for(
int n = 0; n <
m_fields[0]->GetBndConditions().num_elements(); ++n)
295 if (boost::iequals(
m_fields[0]->GetBndConditions()[n]->GetUserDefined(),
"Wall"))
297 WallBC(n, cnt, Fwd, inarray);
301 if (
m_fields[0]->GetBndConditions()[n]->IsTimeDependent())
303 for (
int i = 0; i < nvariables; ++i)
306 m_fields[i]->EvaluateBoundaryConditions(time, varName);
309 cnt +=
m_fields[0]->GetBndCondExpansions()[n]->GetExpSize();
321 int nVariables = physarray.num_elements();
327 int id1, id2, nBCEdgePts;
328 int eMax =
m_fields[0]->GetBndCondExpansions()[bcRegion]->GetExpSize();
330 for (
int e = 0; e < eMax; ++e)
332 nBCEdgePts =
m_fields[0]->GetBndCondExpansions()[bcRegion]->
333 GetExp(e)->GetTotPoints();
334 id1 =
m_fields[0]->GetBndCondExpansions()[bcRegion]->GetPhys_Offset(e);
335 id2 =
m_fields[0]->GetTrace()->GetPhys_Offset(traceBndMap[cnt+e]);
351 Vmath::Smul(nBCEdgePts, -2.0, &tmp[0], 1, &tmp[0], 1);
364 for (
int i = 0; i < nVariables; ++i)
368 &(
m_fields[i]->GetBndCondExpansions()[bcRegion]->UpdatePhys())[id1], 1);
386 std::vector<std::string> &variables)
390 const int nCoeffs =
m_fields[0]->GetNcoeffs();
398 fieldcoeffs.push_back(tmpFwd);
465 m_fields[0]->MultiplyByElmtInvMass(sourceC, sourceC);
void WallBC(int bcRegion, int cnt, Array< OneD, Array< OneD, NekDouble > > &Fwd, Array< OneD, Array< OneD, NekDouble > > &physarray)
Wall boundary conditions for the APE equations.
const Array< OneD, const Array< OneD, NekDouble > > & GetNormals()
Get the normal vectors.
#define ASSERTL0(condition, msg)
SolverUtils::AdvectionSharedPtr m_advection
void AddSource(Array< OneD, Array< OneD, NekDouble > > &outarray)
sourceterm for p' equation obtained from GetSource
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.
NekDouble m_time
Current time of simulation.
std::vector< std::string > m_basefield_names
LibUtilities::TimeIntegrationSchemeOperators m_ode
The time integration scheme operators to use.
Array< OneD, Array< OneD, NekDouble > > m_basefield
Array< OneD, Array< OneD, NekDouble > > m_vecLocs
static EquationSystemSharedPtr create(const LibUtilities::SessionReaderSharedPtr &pSession)
Creates an instance of this class.
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.
void Vdiv(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 GetFluxVector(const Array< OneD, Array< OneD, NekDouble > > &physfield, Array< OneD, Array< OneD, Array< OneD, NekDouble > > > &flux)
Return the flux vector for the APE equations.
boost::shared_ptr< SessionReader > SessionReaderSharedPtr
SOLVER_UTILS_EXPORT int GetTotPoints()
Array< OneD, NekDouble > m_sourceTerms
Array< OneD, Array< OneD, NekDouble > > m_traceNormals
Array holding trace normals for DG simulations in the forwards direction.
void DefineProjection(FuncPointerT func, ObjectPointerT obj)
NekDouble GetGamma()
Get the heat capacity ratio.
virtual void v_ExtraFldOutput(std::vector< Array< OneD, NekDouble > > &fieldcoeffs, std::vector< std::string > &variables)
void Smul(int n, const T alpha, const T *x, const int incx, T *y, const int incy)
Scalar multiply y = alpha*y.
bool m_explicitAdvection
Indicates if explicit or implicit treatment of advection is used.
const Array< OneD, const Array< OneD, NekDouble > > & GetVecLocs()
Get the locations of the components of the directed fields within the fields array.
Array< OneD, Array< OneD, NekDouble > > m_traceBasefield
void DefineOdeRhs(FuncPointerT func, ObjectPointerT obj)
APE(const LibUtilities::SessionReaderSharedPtr &pSession)
Initialises UnsteadySystem class members.
virtual ~APE()
Destructor.
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 right-hand side.
RiemannSolverFactory & GetRiemannSolverFactory()
int m_spacedim
Spatial dimension (>= expansion dim).
AdvectionFactory & GetAdvectionFactory()
Gets the factory for initialising advection objects.
void Neg(int n, T *x, const int incx)
Negate x = -x.
static std::string className
Name of class.
virtual void v_InitObject()
Initialization object for the APE class.
void SetBoundaryConditions(Array< OneD, Array< OneD, NekDouble > > &physarray, NekDouble time)
Apply the Boundary Conditions to the APE equations.
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.
NekDouble m_gamma
Isentropic coefficient, Ratio of specific heats (APE)
const Array< OneD, const Array< OneD, NekDouble > > & GetBasefield()
Get the baseflow field.
EquationSystemFactory & GetEquationSystemFactory()
SOLVER_UTILS_EXPORT int GetTraceTotPoints()
SolverUtils::RiemannSolverSharedPtr m_riemannSolver
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()
void DoOdeProjection(const Array< OneD, const Array< OneD, NekDouble > > &inarray, Array< OneD, Array< OneD, NekDouble > > &outarray, const NekDouble time)
Compute the projection and call the method for imposing the boundary conditions in case of discontinu...
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)
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 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.
tKey RegisterCreatorFunction(tKey idKey, CreatorFunction classCreator, tDescription pDesc="")
Register a class with the factory.