12#include "libmesh/libmesh_common.h"
13#include "libmesh/vector_value.h"
14#include "libmesh/dense_vector.h"
43 return (
T(0) < val) - (val <
T(0));
116template <
typename T1,
typename T2,
typename T3,
typename T4,
typename T5>
118Reynolds(
const T1 & volume_fraction,
const T2 &
rho,
const T3 & vel,
const T4 & D_h,
const T5 &
mu)
131template <
typename T1,
typename T2,
typename T3>
151template <
typename T1,
typename T2,
typename T3,
typename T4,
typename T5,
typename T6>
176template <
typename T1,
typename T2,
typename T3,
typename T4,
typename T5>
181 const T4 & rho_liquid,
182 const T5 & mu_liquid,
183 const Real & gravity_magnitude)
186 return gravity_magnitude * beta * dT *
pow(D_h, 3) * (rho_liquid * rho_liquid) /
187 (mu_liquid * mu_liquid);
199template <
typename T1,
typename T2>
201Laplace(
const T1 & surf_tension,
const T2 & delta_rho,
const Real & gravity_magnitude)
204 return sqrt(surf_tension / (gravity_magnitude * delta_rho));
218template <
typename T1,
typename T2,
typename T3,
typename T4>
221 const T2 & surf_tension,
223 const T4 & delta_rho,
224 const Real & gravity_magnitude)
228 sqrt(rho_k * surf_tension * sqrt(surf_tension / gravity_magnitude / delta_rho));
240template <
typename T1,
typename T2>
245 return Re * sqrt(doD);
DualNumber< Real, DNDerivativeType, true > ADReal
ExpressionBuilder::EBTerm pow(const ExpressionBuilder::EBTerm &left, T exponent)
auto peclet(const T1 &vel, const T2 &L, const T3 &diffusivity)
Compute Peclet number.
auto reynolds(const T1 &rho, const T2 &vel, const T3 &L, const T4 &mu)
Compute Reynolds number.
auto prandtl(const T1 &cp, const T2 &mu, const T3 &k)
Compute Prandtl number.
auto thermalDiffusivity(const T1 &k, const T2 &rho, const T3 &cp)
Compute thermal diffusivity.
auto wallHeatTransferCoefficient(const T1 &Nu, const T2 &k, const T3 &D_h)
Compute wall heat transfer coefficient.
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.
int sgn(T val)
The sign function.
Real dv_dalpha_liquid(Real area, Real arhoA, bool is_liquid)
Derivative of specific volume wrt alpha_liquid.
auto viscosityNumber(const T1 &viscosity, const T2 &surf_tension, const T3 &rho_k, const T4 &delta_rho, const Real &gravity_magnitude)
Compute viscosity number (or coefficient)
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.
bool isOutlet(Real vel, Real normal)
Determine if outlet boundary condition should be applied.
auto Prandtl(const T1 &cp, const T2 &mu, const T3 &k)
Compute Prandtl number.
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.
void v_from_rho(Real rho, Real &v, Real &dv_drho)
Computes specific volume and its derivative with respect to density.
Real dv_darhoA(Real area, Real arhoA)
Derivative of specific volume wrt density equation solution variable.
static const Real Stefan_Boltzman_const
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,...
auto Laplace(const T1 &surf_tension, const T2 &delta_rho, const Real &gravity_magnitude)
Compute Laplace number (or coefficient)
auto Reynolds(const T1 &volume_fraction, const T2 &rho, const T3 &vel, const T4 &D_h, const T5 &mu)
Compute Reynolds number.
Real dvel_darhoA(Real arhoA, Real arhouA)
Derivative of velocity w.r.t.
bool isInlet(Real vel, Real normal)
Determine if inlet boundary condition should be applied.
Real de_darhouA(Real arhoA, Real arhouA)
Derivative of specific internal energy wrt momentum of the phase (rhouA or arhouA)
Real dvel_darhouA(Real arhoA)
Derivative of velocity w.r.t.
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.
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.
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_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 de_darhoEA(Real arhoA)
Derivative of specific internal energy wrt total energy of the phase (rhoEA or arhoEA)
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,...
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.
auto Grashof(const T1 &beta, const T2 &dT, const T3 &D_h, const T4 &rho_liquid, const T5 &mu_liquid, const Real &gravity_magnitude)
Compute Grashof number.
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.
Real de_darhoA(Real arhoA, Real arhouA, Real arhoEA)
Derivative of specific internal energy wrt density of the phase (rhoA or arhoA)
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.
auto Peclet(const T1 &volume_fraction, const T2 &cp, const T3 &rho, const T4 &vel, const T5 &D_h, const T6 &k)
Compute Peclet number.
auto Dean(const T1 &Re, const T2 &doD)
Compute Dean number.
static VectorValue< Real > default_gravity_vector
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.
static const Real gravity_const
The following methods are specializations for using the Parallel::packed_range_* routines for a vecto...
static constexpr Real TOLERANCE
DIE A HORRIBLE DEATH HERE typedef LIBMESH_DEFAULT_SCALAR_TYPE Real