45 "APE", APE::create,
"APE1/APE4 (Acoustic Perturbation Equations)");
67 for (
int i = 0; i <
m_bf.num_elements(); ++i)
76 for (
int i = 0; i <
m_bfFwdBwd.num_elements(); i++)
82 m_session->LoadSolverInfo(
"UpwindType", riemName,
"Upwind");
83 if (boost::to_lower_copy(riemName) ==
"characteristics" ||
84 boost::to_lower_copy(riemName) ==
"apeupwind" ||
85 boost::to_lower_copy(riemName) ==
"upwind")
87 riemName =
"APEUpwind";
89 if (boost::to_lower_copy(riemName) ==
"laxfriedrichs")
91 riemName =
"APELaxFriedrichs";
102 m_session->LoadSolverInfo(
"AdvectionType", advName,
"WeakDG");
116 ASSERTL0(
false,
"Implicit APE not set up.");
137 int nq = physfield[0].num_elements();
142 "Dimension of flux array and velocity array do not match");
151 Vmath::Vmul(nq, tmp1, 1, physfield[j + 1], 1, tmp1, 1);
160 for (
int i = 1; i < flux.num_elements(); ++i)
162 ASSERTL1(flux[i].num_elements() == m_spacedim,
163 "Dimension of flux array and velocity array do not match");
184 Vmath::Vadd(nq, flux[i][j], 1, tmp1, 1, flux[i][j], 1);
199 int id1, id2, nBCEdgePts;
200 int nVariables = physarray.num_elements();
204 int eMax =
m_fields[0]->GetBndCondExpansions()[bcRegion]->GetExpSize();
206 for (
int e = 0; e < eMax; ++e)
209 ->GetBndCondExpansions()[bcRegion]
212 id1 =
m_fields[0]->GetBndCondExpansions()[bcRegion]->GetPhys_Offset(e);
213 id2 =
m_fields[0]->GetTrace()->GetPhys_Offset(traceBndMap[cnt + e]);
231 for (
int i = 0; i < nBCEdgePts; ++i)
243 Fwd[
m_ip][id2 + i] / (2 * BfFwd[1][id2 + i] * c);
256 Fwd[
m_ip][id2 + i] / (2 * BfFwd[1][id2 + i] * c);
266 Fwd[
m_ip][id2 + i] = BfFwd[1][id2 + i] * c * (h2 - h1);
273 Fwd[
m_iu + j][id2 + i] =
274 Fwd[
m_iu + j][id2 + i] +
280 for (
int i = 0; i < nVariables; ++i)
284 ->GetBndCondExpansions()[bcRegion]
285 ->UpdatePhys())[id1],
Array< OneD, Array< OneD, NekDouble > > m_bf
#define ASSERTL0(condition, msg)
SolverUtils::RiemannSolverSharedPtr m_riemannSolver
std::shared_ptr< MeshGraph > MeshGraphSharedPtr
std::vector< std::string > m_bfNames
NekDouble m_time
Current time of simulation.
LibUtilities::TimeIntegrationSchemeOperators m_ode
The time integration scheme operators to use.
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
bool m_conservative
we are dealing with a conservative formualtion
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.
const Array< OneD, const Array< OneD, NekDouble > > & GetVecLocs()
Get the locations of the components of the directed fields within the fields array.
virtual void v_GetFluxVector(const Array< OneD, Array< OneD, NekDouble >> &physfield, Array< OneD, Array< OneD, Array< OneD, NekDouble >>> &flux)
Return the flux vector for the APE equations.
SOLVER_UTILS_EXPORT int GetTotPoints()
Array< OneD, Array< OneD, NekDouble > > m_traceNormals
Array holding trace normals for DG simulations in the forwards direction.
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 DefineProjection(FuncPointerT func, ObjectPointerT obj)
tBaseSharedPtr CreateInstance(tKey idKey, tParam... args)
Create an instance of the class referred to by idKey.
const Array< OneD, const Array< OneD, NekDouble > > & GetBasefieldFwdBwd()
Get the baseflow field.
bool m_explicitAdvection
Indicates if explicit or implicit treatment of advection is used.
void DefineOdeRhs(FuncPointerT func, ObjectPointerT obj)
virtual ~APE()
Destructor.
Base class for unsteady solvers.
RiemannSolverFactory & GetRiemannSolverFactory()
int m_spacedim
Spatial dimension (>= expansion dim).
AdvectionFactory & GetAdvectionFactory()
Gets the factory for initialising advection objects.
virtual void v_InitObject()
Initialization object for the AcousticSystem class.
virtual void v_InitObject()
Initialization object for the APE class.
EquationSystemFactory & GetEquationSystemFactory()
SOLVER_UTILS_EXPORT SessionFunctionSharedPtr GetFunction(std::string name, const MultiRegions::ExpListSharedPtr &field=MultiRegions::NullExpListSharedPtr, bool cache=false)
Get a SessionFunction by name.
int m_ip
indices of the fields
Array< OneD, Array< OneD, NekDouble > > m_bfFwdBwd
Array< OneD, MultiRegions::ExpListSharedPtr > m_fields
Array holding all dependent variables.
LibUtilities::SessionReaderSharedPtr m_session
The session reader.
const Array< OneD, const Array< OneD, NekDouble > > & GetNormals()
Get the normal vectors.
SOLVER_UTILS_EXPORT int GetTraceNpoints()
virtual void v_RiemannInvariantBC(int bcRegion, int cnt, Array< OneD, Array< OneD, NekDouble >> &Fwd, Array< OneD, Array< OneD, NekDouble >> &BfFwd, Array< OneD, Array< OneD, NekDouble >> &physarray)
Outflow characteristic boundary conditions for compressible flow problems.
tKey RegisterCreatorFunction(tKey idKey, CreatorFunction classCreator, std::string pDesc="")
Register a class with the factory.
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)
std::shared_ptr< SessionReader > SessionReaderSharedPtr
void DoOdeRhs(const Array< OneD, const Array< OneD, NekDouble >> &inarray, Array< OneD, Array< OneD, NekDouble >> &outarray, const NekDouble time)
Compute the right-hand side.
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.
SolverUtils::AdvectionSharedPtr m_advection