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 54 using std::sqrt, std::min, std::max;
72 const ADReal rhoL = rhoAL / AL;
74 const ADReal unL = uvecL * nLR;
75 const ADReal ut1L = uvecL * t1;
76 const ADReal ut2L = uvecL * t2;
77 const ADReal rhoEL = rhoEAL / AL;
78 const ADReal vL = 1.0 / rhoL;
79 const ADReal EL = rhoEAL / rhoAL;
80 const ADReal eL = EL - 0.5 * uvecL * uvecL;
84 const ADReal rhoR = rhoAR / AR;
86 const ADReal unR = uvecR * nLR;
87 const ADReal ut1R = uvecR * t1;
88 const ADReal ut2R = uvecR * t2;
89 const ADReal rhoER = rhoEAR / AR;
90 const ADReal vR = 1.0 / rhoR;
91 const ADReal ER = rhoEAR / rhoAR;
92 const ADReal eR = ER - 0.5 * uvecR * uvecR;
103 const ADReal un_roe = (sqrt_rhoL * unL + sqrt_rhoR * unR) / (sqrt_rhoL + sqrt_rhoR);
104 const ADReal ut1_roe = (sqrt_rhoL * ut1L + sqrt_rhoR * ut1R) / (sqrt_rhoL + sqrt_rhoR);
105 const ADReal ut2_roe = (sqrt_rhoL * ut2L + sqrt_rhoR * ut2R) / (sqrt_rhoL + sqrt_rhoR);
106 const ADReal HL = EL + pL / rhoL;
107 const ADReal HR = ER + pR / rhoR;
108 const ADReal H_roe = (sqrt_rhoL * HL + sqrt_rhoR * HR) / (sqrt_rhoL + sqrt_rhoR);
110 const ADReal h_roe = H_roe - 0.5 * uvec_roe * uvec_roe;
112 const ADReal v_roe = 1.0 / rho_roe;
113 const ADReal e_roe =
_fp.e_from_v_h(v_roe, h_roe);
114 const ADReal c_roe =
_fp.c_from_v_e(v_roe, e_roe);
116 sL =
min(unL -
cL, un_roe - c_roe);
117 sR =
max(unR + cR, un_roe + c_roe);
121 sL =
min(unL -
cL, unR - cR);
122 sR =
max(unL +
cL, unR + cR);
126 mooseAssert(
false,
"Invalid 'wave_speed_formulation'.");
130 const ADReal sm = (rhoR * unR * (sR - unR) - rhoL * unL * (sL - unL) + pL - pR) /
131 (rhoR * (sR - unR) - rhoL * (sL - unL));
134 const ADReal omegL = 1.0 / (sL - sm);
135 const ADReal omegR = 1.0 / (sR - sm);
138 const ADReal ps = rhoL * (sL - unL) * (sm - unL) + pL;
142 const ADReal rhoLs = omegL * (sL - unL) * rhoL;
143 const ADReal rhounLs = omegL * ((sL - unL) * rhoL * unL + ps - pL);
144 const ADReal rhoELs = omegL * ((sL - unL) * rhoEL - pL * unL + ps * sm);
146 const ADReal rhoRs = omegR * (sR - unR) * rhoR;
147 const ADReal rhounRs = omegR * ((sR - unR) * rhoR * unR + ps - pR);
148 const ADReal rhoERs = omegR * ((sR - unR) * rhoER - pR * unR + ps * sm);
176 else if (sL <= 0.0 && sm > 0.0)
186 else if (sm <= 0.0 && sR >= 0.0)
207 std::fill(FL.begin(), FL.end(),
getNaN());
211 const ADReal A_wall_L = AL - A_flow;
214 const ADReal A_wall_R = AR - A_flow;
220 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.
auto max(const L &left, const R &right)
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)
CTSub CT_OPERATOR_BINARY CTMul CTCompareLess CTCompareGreater CTCompareEqual _arg template * sqrt(_arg)) *_arg.template D< dtag >()) CT_SIMPLE_UNARY_FUNCTION(tanh
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.
auto min(const L &left, const R &right)
static const std::string cL