23 params.
addRequiredParam<UserObjectName>(
"fp",
"Single-phase fluid properties");
25 "bisection_tolerance", 1e-4,
"Tolerance for bisection to find h(entropy_in, p_out)");
29 "Maximum number of iterations for bisection to find h(entropy_in, p_out)");
32 "If specific impulse is accumulated over timesteps. If false, then " 33 "instantaneous value is computed");
34 params.
addCoupledVar(
"variables",
"Single-phase flow variables");
35 params.
set<std::vector<VariableName>>(
"variables") = {
"rhoA",
"rhouA",
"rhoEA",
"A"};
43 _boundary_name(getParam<
std::vector<BoundaryName>>(
"boundary")[0]),
44 _boundary_uo_name(_boundary_name +
":boundary_uo"),
46 _p_exit(getParam<
Real>(
"p_exit")),
47 _H(getADMaterialPropertyByName<
Real>(
"H")),
48 _v(getADMaterialPropertyByName<
Real>(
"v")),
49 _e(getADMaterialPropertyByName<
Real>(
"e")),
50 _T(getADMaterialPropertyByName<
Real>(
"T")),
52 _tol(getParam<
Real>(
"bisection_tolerance")),
53 _max_nit(getParam<unsigned
int>(
"bisection_max_it")),
54 _cumulative(getParam<bool>(
"cumulative")),
55 _accumulated_mass_flow_rate(declareRestartableData<
Real>(
"accumulated_mass_flow_rate", 0)),
56 _accumulated_thrust(declareRestartableData<
Real>(
"accumulated_thrust", 0)),
60 paramError(
"cumulative",
"Must be false unless problem is transient");
106 for (
unsigned int qp = 0; qp <
_qrule->n_points(); qp++)
137 Real T_mid = 0.5 * (T_up + T_low);
143 unsigned int nit = 0;
144 while (std::abs(1 - entropy_mid / entropy_in) >
_tol)
147 if ((entropy_mid - entropy_in > 0) == (entropy_up - entropy_low > 0))
150 entropy_up = entropy_mid;
155 entropy_low = entropy_mid;
159 T_mid = 0.5 * (T_up + T_low);
168 mooseDoOnce(
mooseWarning(
"Bisection in ADSpecificImpulse1Phase did not converge"));
virtual const std::vector< ADReal > & getFlux(unsigned int iside, dof_id_type ielem, const std::vector< ADReal > &uvec1, const RealVectorValue &dwave) const
Get the boundary flux vector.
const Real _tol
bisection tolerance
Real _value
The value of this post-processor.
virtual Real getValue() const override
const unsigned int & _current_side
ADSpecificImpulse1Phase(const InputParameters ¶meters)
const ADBoundaryFluxBase & _boundary_uo
Boundary user object.
const unsigned int _max_nit
maximum number of iterations for bisection
const ADVariableValue & adCoupledValue(const std::string &var_name, unsigned int comp=0) const
virtual void threadJoin(const UserObject &y) override
const ADMaterialProperty< Real > & _H
the total enthalpy including mechanical energy
const std::vector< double > y
static InputParameters validParams()
const ADMaterialProperty< Real > & _e
internal energy
static const unsigned int N_FLUX_INPUTS
Number of numerical flux function inputs for 3D.
void mooseWarning(Args &&... args) const
Real _mass_flow_rate
total mass flow rate
Real & _accumulated_mass_flow_rate
accumulated mass flow rate over time
const unsigned int _n_components
Number of components in the solution vector used to compute the flux.
std::vector< const ADVariableValue * > _U
Variables to pass to boundary flux user object, in the correct order.
const SinglePhaseFluidProperties & _fp
fluid property user object
const ADMaterialProperty< Real > & _v
specific volume
Common class for single phase fluid properties.
Real & _accumulated_thrust
accumulated thrust over time
const Real _p_exit
the outlet pressure, user supplied value
void paramError(const std::string ¶m, Args... args) const
virtual void execute() override
A base class for computing/caching fluxes at boundaries.
const bool _cumulative
if the specific impulse is accumulated over timesteps
DIE A HORRIBLE DEATH HERE typedef LIBMESH_DEFAULT_SCALAR_TYPE Real
FEProblemBase & _fe_problem
registerMooseObject("ThermalHydraulicsApp", ADSpecificImpulse1Phase)
Estimates specific impulse from fluid state at the boundary.
static InputParameters validParams()
const QBase *const & _qrule
const MooseArray< Point > & _normals
static const Real gravity_const
virtual void initialize() override
virtual void finalize() override
const Elem *const & _current_elem
virtual bool isTransient() const override
void ErrorVector unsigned int
const ADMaterialProperty< Real > & _T
fluid temperature