22 MooseEnum wave_speed_formulation(
"einfeldt davis",
"einfeldt");
24 "wave_speed_formulation", wave_speed_formulation,
"Method for computing wave speeds");
27 "Name for fluid properties user object");
29 params.
addClassDescription(
"Computes internal side flux for the 1-D, 1-phase, variable-area " 30 "Euler equations using the HLLC approximate Riemann solver.");
39 _wave_speed_formulation(
46 const std::vector<ADReal> & UR,
50 std::vector<ADReal> & FL,
51 std::vector<ADReal> & FR)
const 71 const ADReal rhoL = rhoAL / AL;
73 const ADReal unL = uvecL * nLR;
74 const ADReal ut1L = uvecL * t1;
75 const ADReal ut2L = uvecL * t2;
76 const ADReal rhoEL = rhoEAL / AL;
77 const ADReal vL = 1.0 / rhoL;
78 const ADReal EL = rhoEAL / rhoAL;
79 const ADReal eL = EL - 0.5 * uvecL * uvecL;
83 const ADReal rhoR = rhoAR / AR;
85 const ADReal unR = uvecR * nLR;
86 const ADReal ut1R = uvecR * t1;
87 const ADReal ut2R = uvecR * t2;
88 const ADReal rhoER = rhoEAR / AR;
89 const ADReal vR = 1.0 / rhoR;
90 const ADReal ER = rhoEAR / rhoAR;
91 const ADReal eR = ER - 0.5 * uvecR * uvecR;
100 const ADReal sqrt_rhoL = std::sqrt(rhoL);
101 const ADReal sqrt_rhoR = std::sqrt(rhoR);
102 const ADReal un_roe = (sqrt_rhoL * unL + sqrt_rhoR * unR) / (sqrt_rhoL + sqrt_rhoR);
103 const ADReal ut1_roe = (sqrt_rhoL * ut1L + sqrt_rhoR * ut1R) / (sqrt_rhoL + sqrt_rhoR);
104 const ADReal ut2_roe = (sqrt_rhoL * ut2L + sqrt_rhoR * ut2R) / (sqrt_rhoL + sqrt_rhoR);
105 const ADReal HL = EL + pL / rhoL;
106 const ADReal HR = ER + pR / rhoR;
107 const ADReal H_roe = (sqrt_rhoL * HL + sqrt_rhoR * HR) / (sqrt_rhoL + sqrt_rhoR);
109 const ADReal h_roe = H_roe - 0.5 * uvec_roe * uvec_roe;
110 const ADReal rho_roe = std::sqrt(rhoL * rhoR);
111 const ADReal v_roe = 1.0 / rho_roe;
112 const ADReal e_roe =
_fp.e_from_v_h(v_roe, h_roe);
113 const ADReal c_roe =
_fp.c_from_v_e(v_roe, e_roe);
115 sL = std::min(unL -
cL, un_roe - c_roe);
116 sR = std::max(unR + cR, un_roe + c_roe);
120 sL = std::min(unL -
cL, unR - cR);
121 sR = std::max(unL +
cL, unR + cR);
125 mooseAssert(
false,
"Invalid 'wave_speed_formulation'.");
129 const ADReal sm = (rhoR * unR * (sR - unR) - rhoL * unL * (sL - unL) + pL - pR) /
130 (rhoR * (sR - unR) - rhoL * (sL - unL));
133 const ADReal omegL = 1.0 / (sL - sm);
134 const ADReal omegR = 1.0 / (sR - sm);
137 const ADReal ps = rhoL * (sL - unL) * (sm - unL) + pL;
141 const ADReal rhoLs = omegL * (sL - unL) * rhoL;
142 const ADReal rhounLs = omegL * ((sL - unL) * rhoL * unL + ps - pL);
143 const ADReal rhoELs = omegL * ((sL - unL) * rhoEL - pL * unL + ps * sm);
145 const ADReal rhoRs = omegR * (sR - unR) * rhoR;
146 const ADReal rhounRs = omegR * ((sR - unR) * rhoR * unR + ps - pR);
147 const ADReal rhoERs = omegR * ((sR - unR) * rhoER - pR * unR + ps * sm);
175 else if (sL <= 0.0 && sm > 0.0)
185 else if (sm <= 0.0 && sR >= 0.0)
206 std::fill(FL.begin(), FL.end(),
getNaN());
210 const ADReal A_wall_L = AL - A_flow;
213 const ADReal A_wall_R = AR - A_flow;
219 const std::vector<ADReal> & UR)
const
static const unsigned int N_FLUX_OUTPUTS
Number of numerical flux function outputs for 3D.
Real getNaN() const
Throws an error or returns a NaN with or without a warning, with a default message.
static InputParameters validParams()
WaveSpeedFormulation
Type for how to compute left and right wave speeds.
DualNumber< Real, DNDerivativeType, true > ADReal
unsigned int _last_region_index
Index describing the region last entered, which is useful for testing and debugging.
const SinglePhaseFluidProperties & _fp
fluid properties user object
Computes internal side flux for the 1-D, 1-phase, variable-area Euler equations using the HLLC approx...
static InputParameters validParams()
virtual ADReal computeFlowArea(const std::vector< ADReal > &UL, const std::vector< ADReal > &UR) const
Computes the flow area that is used in the numerical flux.
const WaveSpeedFormulation _wave_speed_formulation
How to compute left and right wave speeds.
Common class for single phase fluid properties.
Base class for computing numerical fluxes for FlowModelSinglePhase.
static const unsigned int N_FLUX_INPUTS
Number of numerical flux function inputs for 1D.
ADNumericalFlux3EqnHLLC(const InputParameters ¶meters)
registerMooseObject("ThermalHydraulicsApp", ADNumericalFlux3EqnHLLC)
virtual void calcFlux(const std::vector< ADReal > &UL, const std::vector< ADReal > &UR, const RealVectorValue &nLR, const RealVectorValue &t1, const RealVectorValue &t2, std::vector< ADReal > &FL, std::vector< ADReal > &FR) const override
Calculates the 3D flux vectors given "left" and "right" states.
static InputParameters validParams()
Interface class for producing errors, warnings, or just quiet NaNs.
static const std::string cL