53#include <SolverCore/Advection/AdvectionWeakDG/AdvectionWeakDGOp.hpp>
54#include <SolverCore/TimeOps/TimeOp.hpp>
60using namespace MultiRegions;
65 "Euler equations in conservative variables.");
69 : UnsteadySystem(pSession, pGraph)
71 ASSERTL0(m_projectionType == MultiRegions::eDiscontinuous,
72 "The NavierStokesCFE is only implemented for projectionType "
80void EulerCFE::v_InitObject(
bool declareExpansionLists)
83 UnsteadySystem::v_InitObject(declareExpansionLists);
85 ASSERTL0(m_session->DefinesSolverInfo(
"UPWINDTYPE"),
86 "No UPWINDTYPE defined in session.");
92 v_InitialiseOperators();
97 UnsteadySystem::v_GenerateSummary(s);
102 std::stringstream ss;
106| \| | ___| | _| |_ __ _ _ __ _| |_ _| |_
107| . ` |/ _ \ |/ / __/ _` | '__|_ _|_ _|
108| |\ | __/ <| || (_| | | |_| |_|
109\_| \_/\___|_|\_\\__\__,_|_|
112 _ __ ___ __| | ___ ___ _ __ _ _ __ ___ __| |
113| '__/ _ \/ _` |/ _ \/ __| |/ _` | '_ \ / _ \/ _` |
114| | | __/ (_| | __/\__ \ | (_| | | | | __/ (_| |
115|_| \___|\__,_|\___||___/_|\__, |_| |_|\___|\__,_|
137 const double &time,
const double &dt)
140 m_advectionWeakDGOp->UpdateBndPhys(time);
141 m_advectionWeakDGOp->SetScale(-dt);
142 m_advectionWeakDGOp->Apply(in, out);
150 [[maybe_unused]]
const double &time)
154 m_math.copy(in, out);
161void EulerCFE::v_InitialiseOperators()
164 m_iProductWRTBaseOp =
167 m_expansionLists[0], m_variables[0]);
170 m_advectionWeakDGOp =
173 std::string execName =
175 std::string riemannMethod = m_session->GetSolverInfo(
"UpwindType");
180 m_advectionWeakDGOp->SetVolumeFluxOp(volumeFluxOp);
182 std::string EqnOfState =
183 StringUtils::ToUpperCopy(m_session->GetEquationOfState().type);
184 riemannMethod =
"AdvTraceFluxCFE" + riemannMethod + EqnOfState;
186 m_expansionLists[0], m_variables[0], riemannMethod, execName);
189 m_advectionWeakDGOp->SetTraceFlux(traceFluxOp);
193 m_advectionWeakDGOp->SetFusedElmtOp(
194 CreateAdvDiffFusedElmtCFEOp<SolverCore::AdvectionFusedElmtOp>(
195 m_expansionLists[0], m_variables[0],
true,
""));
198 m_timeOp = TimeOp<double>::Create(m_expansionLists[0], m_variables[0]);
199 m_timeOp->DefineProjection(&EulerCFE::DoProjection,
this);
200 m_timeOp->DefineExplicitRhs(&EulerCFE::DoAdvection,
this);
202 SetUpBoundaryConditions();
205CoefficientFieldViews EulerCFE::v_GetOutputFieldViews()
210 m_iProductWRTBaseOp->Apply(m_phys[0], m_wsp_coeff[0]);
211 m_multiplyByElmtInvMassOp->Apply(m_wsp_coeff[0], m_coeff[0]);
213 return UnsteadySystem::v_GetOutputFieldViews();
222void EulerCFE::SetUpBoundaryConditions()
230 m_expansionLists[0], m_variables[0]);
231 m_advectionWeakDGOp->AddBndCondUpdateOp(bndCondPressureOutflowOp);
234 auto bndCondEntropyVelocityOp =
237 m_advectionWeakDGOp->AddBndCondUpdateOp(bndCondEntropyVelocityOp);
241 auto bndCondEntropyPressureOp =
244 m_advectionWeakDGOp->AddBndCondUpdateOp(bndCondEntropyPressureOp);
246 auto bndCondEntropyTotalEnthalpyOp =
248 m_expansionLists[0], m_variables[0]);
249 m_advectionWeakDGOp->AddBndCondUpdateOp(bndCondEntropyTotalEnthalpyOp);
255 m_expansionLists[0], m_variables[0]);
256 m_advectionWeakDGOp->AddBndCondUpdateOp(bndCondSlipWallOp);
259 m_expansionLists[0], m_variables[0]);
260 m_advectionWeakDGOp->AddBndCondUpdateOp(bndCondExtrapOrder0Op);
264 auto bndCondRiemannInvariantOp =
267 m_advectionWeakDGOp->AddBndCondUpdateOp(bndCondRiemannInvariantOp);
271 auto bndCondStagnationInflowOp =
274 m_advectionWeakDGOp->AddBndCondUpdateOp(bndCondStagnationInflowOp);
284UnsteadySystem::CFLVelocity EulerCFE::v_GetCFLVelocity()
286 std::vector<std::string> components;
287 for (
unsigned int i = 0; i < m_coordim; ++i)
289 components.push_back(
"u" + std::to_string(i));
291 components.push_back(
"c");
293 if (!m_cflVelocityOp)
298 ASSERTL0(m_expansionLists[0]->GetExp(0)->GetShapeDimension() ==
300 "The Courant estimate expects the shape and coordinate "
301 "dimensions to agree.");
304 CFLVelocityCFEOp<double>::Create(m_expansionLists[0], components);
307 MultiRegions::GetBlockAttributes<double, FieldState::Phys>(
308 m_expansionLists[0]);
310 m_cflVelocity = LibUtilities::Field<double, FieldState::Phys>(
311 "cflVelocity", bAtr_phys, m_coordim + 1, m_npointsZ);
314 m_cflVelocityOp->Apply(m_phys[0], m_cflVelocity);
317 return {&m_cflVelocity, 0, components, 1.0};
#define ASSERTL0(condition, msg)
Whole-field interface of the IProductWRTBase element operator, which takes a physical-space field to ...
Whole-field interface of the MultiplyByElmtInvMass element operator, which multiplies a coefficient-s...
Subsonic Riemann boundary holding the entropy and the pressure.
Subsonic Riemann boundary holding the entropy and the total enthalpy.
Subsonic Riemann inflow holding the entropy and the velocity.
Subsonic pressure outflow, as a boundary state.
Characteristic farfield boundary from the Riemann invariants.
Inviscid slip wall and symmetry plane.
Subsonic inflow from a stagnation state and a flow direction.
static SolverUtils::EquationSystemSharedPtr create(const LibUtilities::SessionReaderSharedPtr &pSession, const SpatialDomains::MeshGraphSharedPtr &pGraph)
Creates an instance of this class.
static std::string className
Name of class.
EulerCFE(const LibUtilities::SessionReaderSharedPtr &pSession, const SpatialDomains::MeshGraphSharedPtr &pGraph)
A Field represents expansion data to be operated on.
tKey RegisterCreatorFunction(tKey idKey, CreatorFunction classCreator, std::string pDesc="")
Register a class with the factory.
Whole-field interface of the inner product with the basis: integrates a physical-space field against ...
Whole-field interface of the element-wise inverse mass operator: replaces every element's coefficient...
Common base class of the operator family interfaces: holds the expansion list, component names and da...
std::shared_ptr< SessionReader > SessionReaderSharedPtr
std::vector< std::pair< std::string, std::string > > SummaryList
EquationSystemFactory & GetEquationSystemFactory()
void AddSummaryItem(SummaryList &l, const std::string &name, const std::string &value)
Adds a summary item to the summary info list.
std::shared_ptr< MeshGraph > MeshGraphSharedPtr