39 applyQuotientRule(
const Real & num,
const Real & den,
const Real & dnum_dy,
const Real & dden_dy)
41 return (dnum_dy * den - num * dden_dy) / (den * den);
47 const DenseVector<Real> & dnum_dy,
48 const DenseVector<Real> & dden_dy)
50 DenseVector<Real> d_dy = dnum_dy;
52 d_dy.add(-num /
std::pow(den, 2), dden_dy);
68 return arhouA / arhoA;
74 return -arhouA / (arhoA * arhoA);
85 Real arhoA, Real
alpha, Real
A, Real & rho, Real & drho_darhoA, Real & drho_dalpha)
89 drho_darhoA = 1.0 / (
alpha *
A);
96 return arhoA / (
alpha *
A);
103 dv_drhoA = -
A / (rhoA * rhoA);
117 dv_dalpha =
A / arhoA;
123 return (
alpha *
A) / arhoA;
130 dv_drho = -1.0 / (rho * rho);
136 const Real sign = is_liquid ? 1.0 : -1.0;
137 return sign * (area / arhoA);
143 return -area / arhoA / arhoA;
151 Real & de_darhoA_val,
152 Real & de_darhouA_val,
153 Real & de_darhoEA_val)
155 e = arhoEA / arhoA - 0.5 * arhouA * arhouA / (arhoA * arhoA);
156 de_darhoA_val =
de_darhoA(arhoA, arhouA, arhoEA);
164 return arhoEA / arhoA - 0.5 * arhouA * arhouA / (arhoA * arhoA);
170 e = E - 0.5 * vel * vel;
177 return E - 0.5 * vel * vel;
183 return (-arhoEA / arhoA / arhoA + arhouA * arhouA / arhoA / arhoA / arhoA);
189 return (-arhouA / arhoA / arhoA);
202 dE_darhoA = -arhoEA / (arhoA * arhoA);
203 dE_darhoEA = 1.0 / arhoA;
208 return arhoEA / arhoA;
214 E = e + 0.5 * vel * vel;
220 h_from_e_p_rho(Real e, Real p, Real rho, Real & h, Real & dh_de, Real & dh_dp, Real & dh_drho)
225 dh_drho = -p / (rho * rho);
237 return (vel * normal) < 0;
249 return (vel * normal) >= 0;
void e_from_arhoA_arhouA_arhoEA(Real arhoA, Real arhouA, Real arhoEA, Real &e, Real &de_darhoA, Real &de_darhouA, Real &de_darhoEA)
Computes specific internal energy and its derivatives from alpha*rho*A, alpha*rho*u*A, and alpha*rho*E*A.
Real de_darhoA(Real arhoA, Real arhouA, Real arhoEA)
Derivative of specific internal energy wrt density of the phase (rhoA or arhoA)
bool absoluteFuzzyEqual(const T &var1, const T2 &var2, const T3 &tol=libMesh::TOLERANCE *libMesh::TOLERANCE)
Real de_darhoEA(Real arhoA)
Derivative of specific internal energy wrt total energy of the phase (rhoEA or arhoEA) ...
void v_from_rhoA_A(Real rhoA, Real A, Real &v, Real &dv_drhoA)
Computes specific volume and its derivatives from rho*A, and area.
void rho_from_arhoA_alpha_A(Real arhoA, Real alpha, Real A, Real &rho, Real &drho_darhoA, Real &drho_dalpha)
Computes density and its derivatives from alpha*rho*A, alpha, and area.
void e_from_E_vel(Real E, Real vel, Real &e, Real &de_dE, Real &de_dvel)
Computes specific internal energy and its derivatives from specific total energy and velocity...
Real dv_darhoA(Real area, Real arhoA)
Derivative of specific volume wrt density equation solution variable.
bool isOutlet(Real vel, Real normal)
Determine if outlet boundary condition should be applied.
void vel_from_arhoA_arhouA(Real arhoA, Real arhouA, Real &vel, Real &dvel_darhoA, Real &dvel_darhouA)
Computes velocity and its derivatives from alpha*rho*A and alpha*rho*u*A.
bool areParallelVectors(const RealVectorValue &a, const RealVectorValue &b, const Real &tol=libMesh::TOLERANCE *libMesh::TOLERANCE)
Tests if two real-valued vectors are parallel within some absolute tolerance.
DualNumber< Real, DNDerivativeType, true > ADReal
Real de_darhouA(Real arhoA, Real arhouA)
Derivative of specific internal energy wrt momentum of the phase (rhouA or arhouA) ...
void E_from_arhoA_arhoEA(Real arhoA, Real arhoEA, Real &E, Real &dE_darhoA, Real &dE_darhoEA)
Computes specific total energy and its derivatives from alpha*rho*A and alpha*rho*E*A.
Real dvel_darhouA(Real arhoA)
Derivative of velocity w.r.t.
bool haveSameDirection(const RealVectorValue &a, const RealVectorValue &b, const Real &tol=libMesh::TOLERANCE *libMesh::TOLERANCE)
Tests if two real-valued vectors are in the same direction.
DIE A HORRIBLE DEATH HERE typedef LIBMESH_DEFAULT_SCALAR_TYPE Real
static const std::string v
bool isInlet(Real vel, Real normal)
Determine if inlet boundary condition should be applied.
static const std::string alpha
void v_from_rho(Real rho, Real &v, Real &dv_drho)
Computes specific volume and its derivative with respect to density.
void E_from_e_vel(Real e, Real vel, Real &E, Real &dE_de, Real &dE_dvel)
Computes specific total energy and its derivatives from specific internal energy and velocity...
Real dv_dalpha_liquid(Real area, Real arhoA, bool is_liquid)
Derivative of specific volume wrt alpha_liquid.
Real dvel_darhoA(Real arhoA, Real arhouA)
Derivative of velocity w.r.t.
void h_from_e_p_rho(Real e, Real p, Real rho, Real &h, Real &dh_de, Real &dh_dp, Real &dh_drho)
Computes specific enthalpy and its derivatives from specific internal energy, pressure, and density.
MooseUnits pow(const MooseUnits &, int)
void v_from_arhoA_alpha_A(Real arhoA, Real alpha, Real A, Real &v, Real &dv_darhoA, Real &dv_dalpha)
Computes specific volume and its derivatives from alpha*rho*A, volume fraction, and area...
bool absoluteFuzzyEqualVectors(const RealVectorValue &a, const RealVectorValue &b, const Real &tol=libMesh::TOLERANCE *libMesh::TOLERANCE)
Tests if two real-valued vectors are equal within some absolute tolerance.
Real applyQuotientRule(const Real &num, const Real &den, const Real &dnum_dy, const Real &dden_dy)
Computes a derivative of a fraction using quotient rule for a derivative w.r.t.