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.");
169 int nq = physfield[0].num_elements();
174 "Dimension of flux array and velocity array do not match");
194 Vmath::Vadd(nq, flux[0][j], 1, tmp2, 1, flux[0][j], 1);
197 for (
int i = 1; i < flux.num_elements(); ++i)
199 ASSERTL1(flux[i].num_elements() == m_spacedim,
200 "Dimension of flux array and velocity array do not match");
220 Vmath::Vadd(nq, flux[i][j], 1, tmp1, 1, flux[i][j], 1);
234 int nVariables = inarray.num_elements();
242 for (
int i = 0; i < nVariables; ++i)
249 Vmath::Vmul(nq, tmp1, 1, outarray[i], 1, outarray[i], 1);
267 int nvariables = inarray.num_elements();
271 for (
int i = 0; i < nvariables; ++i)
287 int nvariables =
m_fields.num_elements();
291 for(
int n = 0; n <
m_fields[0]->GetBndConditions().num_elements(); ++n)
294 if (boost::iequals(
m_fields[0]->GetBndConditions()[n]->GetUserDefined(),
"Wall"))
300 if (
m_fields[0]->GetBndConditions()[n]->IsTimeDependent())
302 for (
int i = 0; i < nvariables; ++i)
305 m_fields[i]->EvaluateBoundaryConditions(time, varName);
308 cnt +=
m_fields[0]->GetBndCondExpansions()[n]->GetExpSize();
320 int nVariables = physarray.num_elements();
326 for (
int i = 0; i < nVariables; ++i)
329 m_fields[i]->ExtractTracePhys(physarray[i], Fwd[i]);
334 int id1, id2, nBCEdgePts;
335 int eMax =
m_fields[0]->GetBndCondExpansions()[bcRegion]->GetExpSize();
337 for (
int e = 0; e < eMax; ++e)
339 nBCEdgePts =
m_fields[0]->GetBndCondExpansions()[bcRegion]->
340 GetExp(e)->GetTotPoints();
341 id1 =
m_fields[0]->GetBndCondExpansions()[bcRegion]->GetPhys_Offset(e);
342 id2 =
m_fields[0]->GetTrace()->GetPhys_Offset(traceBndMap[cnt+e]);
358 Vmath::Smul(nBCEdgePts, -2.0, &tmp[0], 1, &tmp[0], 1);
371 for (
int i = 0; i < nVariables; ++i)
375 &(
m_fields[i]->GetBndCondExpansions()[bcRegion]->UpdatePhys())[id1], 1);
393 std::vector<std::string> &variables)
397 const int nCoeffs =
m_fields[0]->GetNcoeffs();
405 fieldcoeffs.push_back(tmpFwd);
472 m_fields[0]->MultiplyByElmtInvMass(sourceC, sourceC);
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.
virtual void v_DoInitialise()
Sets up initial conditions.
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 WallBC(int bcRegion, int cnt, Array< OneD, Array< OneD, NekDouble > > &physarray)
Wall boundary conditions for the APE equations.
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...
SOLVER_UTILS_EXPORT void SetInitialConditions(NekDouble initialtime=0.0, bool dumpInitialConditions=true, const int domain=0)
Initialise the data in the dependent fields.
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.