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(getMaterialPropertyByName<
Real>(
"H")),
48 _v(getMaterialPropertyByName<
Real>(
"v")),
49 _e(getMaterialPropertyByName<
Real>(
"e")),
50 _T(getMaterialPropertyByName<
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++)
136 Real T_mid = 0.5 * (T_up + T_low);
142 unsigned int nit = 0;
143 while (std::abs(1 - entropy_mid / entropy_in) >
_tol)
146 if ((entropy_mid - entropy_in > 0) == (entropy_up - entropy_low > 0))
149 entropy_up = entropy_mid;
154 entropy_low = entropy_mid;
158 T_mid = 0.5 * (T_up + T_low);
167 mooseDoOnce(
mooseWarning(
"Bisection in SpecificImpulse1Phase did not converge"));
176 Real vel_exit = std::sqrt(2.0 * (
_H[qp] - h_exit));
177 _thrust += std::abs(vel_exit * flux[0]);
registerMooseObject("ThermalHydraulicsApp", SpecificImpulse1Phase)
const Real _p_exit
the outlet pressure, user supplied value
virtual const std::vector< Real > & getFlux(unsigned int iside, dof_id_type ielem, const std::vector< Real > &uvec1, const RealVectorValue &dwave) const
Get the boundary flux vector.
virtual void initialize() override
static InputParameters validParams()
SpecificImpulse1Phase(const InputParameters ¶meters)
const unsigned int & _current_side
const MaterialProperty< Real > & _e
internal energy
const unsigned int _max_nit
maximum number of iterations for bisection
const unsigned int _n_components
Number of components in the solution vector used to compute the flux.
Estimates specific impulse from fluid state at the boundary.
virtual Real getValue() const override
const std::vector< double > y
const MaterialProperty< Real > & _T
fluid temperature
static const unsigned int N_FLUX_INPUTS
Number of numerical flux function inputs for 3D.
void mooseWarning(Args &&... args) const
Real & _accumulated_mass_flow_rate
accumulated mass flow rate over time
A base class for computing/caching fluxes at boundaries.
Real _value
The value of this post-processor.
const MaterialProperty< Real > & _v
specific volume
virtual void threadJoin(const UserObject &y) override
virtual const VariableValue & coupledValue(const std::string &var_name, unsigned int comp=0) const
const Real _tol
bisection tolerance
Common class for single phase fluid properties.
void paramError(const std::string ¶m, Args... args) const
const MaterialProperty< Real > & _H
the total enthalpy including mechanical energy
Real _mass_flow_rate
total mass flow rate
DIE A HORRIBLE DEATH HERE typedef LIBMESH_DEFAULT_SCALAR_TYPE Real
std::vector< const VariableValue * > _U
Variables to pass to boundary flux user object, in the correct order.
FEProblemBase & _fe_problem
virtual void finalize() override
static InputParameters validParams()
const QBase *const & _qrule
virtual void execute() override
const MooseArray< Point > & _normals
const BoundaryFluxBase & _boundary_uo
Boundary user object.
static const Real gravity_const
const SinglePhaseFluidProperties & _fp
fluid property user object
Real & _accumulated_thrust
accumulated thrust over time
const Elem *const & _current_elem
virtual bool isTransient() const override
const bool _cumulative
if the specific impulse is accumulated over timesteps
void ErrorVector unsigned int