48 "APE1/APE4 (Acoustic Perturbation Equations)");
70 "Only Projection=DisContinuous supported by the APE class.");
108 m_vecLocs[0][i] = 1 + i;
112 m_session->LoadSolverInfo(
"UpwindType", riemName,
"APEUpwind");
122 m_session->LoadSolverInfo(
"AdvectionType", advName,
"WeakDG");
136 ASSERTL0(
false,
"Implicit APE not set up.");
162 int nq = physfield[0].num_elements();
167 "Dimension of flux array and velocity array do not match");
187 Vmath::Vadd(nq, flux[0][j], 1, tmp2, 1, flux[0][j], 1);
190 for (
int i = 1; i < flux.num_elements(); ++i)
192 ASSERTL1(flux[i].num_elements() == m_spacedim,
193 "Dimension of flux array and velocity array do not match");
213 Vmath::Vadd(nq, flux[i][j], 1, tmp1, 1, flux[i][j], 1);
227 int nVariables = inarray.num_elements();
235 for (
int i = 0; i < nVariables; ++i)
242 Vmath::Vmul(nq, tmp1, 1, outarray[i], 1, outarray[i], 1);
260 int nvariables = inarray.num_elements();
264 for (
int i = 0; i < nvariables; ++i)
280 int nvariables =
m_fields.num_elements();
287 for (
int i = 0; i < nvariables; ++i)
290 m_fields[i]->ExtractTracePhys(inarray[i], Fwd[i]);
294 for(
int n = 0; n <
m_fields[0]->GetBndConditions().num_elements(); ++n)
297 if (boost::iequals(
m_fields[0]->GetBndConditions()[n]->GetUserDefined(),
"Wall"))
299 WallBC(n, cnt, Fwd, inarray);
303 if (
m_fields[0]->GetBndConditions()[n]->IsTimeDependent())
305 for (
int i = 0; i < nvariables; ++i)
308 m_fields[i]->EvaluateBoundaryConditions(time, varName);
311 cnt +=
m_fields[0]->GetBndCondExpansions()[n]->GetExpSize();
323 int nVariables = physarray.num_elements();
329 int id1, id2, nBCEdgePts;
330 int eMax =
m_fields[0]->GetBndCondExpansions()[bcRegion]->GetExpSize();
332 for (
int e = 0; e < eMax; ++e)
334 nBCEdgePts =
m_fields[0]->GetBndCondExpansions()[bcRegion]->
335 GetExp(e)->GetTotPoints();
336 id1 =
m_fields[0]->GetBndCondExpansions()[bcRegion]->GetPhys_Offset(e);
337 id2 =
m_fields[0]->GetTrace()->GetPhys_Offset(traceBndMap[cnt+e]);
353 Vmath::Smul(nBCEdgePts, -2.0, &tmp[0], 1, &tmp[0], 1);
366 for (
int i = 0; i < nVariables; ++i)
370 &(
m_fields[i]->GetBndCondExpansions()[bcRegion]->UpdatePhys())[id1], 1);
388 std::vector<std::string> &variables)
392 const int nCoeffs =
m_fields[0]->GetNcoeffs();
400 fieldcoeffs.push_back(tmpFwd);
467 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
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)
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.
virtual void v_InitObject()
Initialization object for the APE class.
virtual SOLVER_UTILS_EXPORT void v_InitObject()
Init object for UnsteadySystem 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.