10 #include "gtest/gtest.h" 14 TEST(NumericsTest, test_absoluteFuzzyEqualVectors_True)
21 TEST(NumericsTest, test_absoluteFuzzyEqualVectors_False)
28 TEST(NumericsTest, test_areParallelVectors_True)
35 TEST(NumericsTest, test_areParallelVectors_False)
42 TEST(NumericsTest, test_haveSameDirection_True)
49 TEST(NumericsTest, test_haveSameDirection_False)
58 ABS_TEST(
THM::Reynolds(0.1, 999., 0.5, 2.0e-2, 0.9), 1.11, 1e-13);
59 ABS_TEST(
THM::Reynolds(0.1, 999., -0.5, 2.0e-2, 0.9), 1.11, 1e-13);
66 ABS_TEST(
THM::Peclet(0.1, 999., 999., 0.5, 2.0e-2, 0.9), 1108.89, 1e-13);
71 ABS_TEST(
THM::Grashof(0.1, 1., 2.0e-2, 999., 0.05, 9.81), 3.1329247392e3, 1e-13);
91 const Real arhouA = 2;
95 ABS_TEST(vel, 2., 1e-15);
105 const Real arhoA = 2;
109 Real rho, drho_darhoA, drho_dalpha;
111 ABS_TEST(rho, 20., 1e-15);
112 ABS_TEST(drho_darhoA, 10., 1e-15);
113 ABS_TEST(drho_dalpha, -200., 1e-13);
118 const Real arhoA = 2;
123 ABS_TEST(
v, 0.5, 1e-15);
124 ABS_TEST(dv_drhoA, -0.25, 1e-15);
129 ABS_TEST(
v, 0.05, 1e-15);
131 ABS_TEST(dv_dalpha, 0.5, 1e-13);
136 ABS_TEST(
v, 0.05, 1e-15);
147 const Real arhoA = 2;
148 const Real arhouA = 4;
149 const Real arhoEA = 8;
153 ABS_TEST(e, 2., 1e-15);
162 ABS_TEST(e, 8., 1e-15);
163 ABS_TEST(de_dE, 1., 1e-15);
164 ABS_TEST(de_dvel, -2., 1e-15);
171 TEST(NumericsTest, total_energy)
173 const Real arhoA = 2.;
174 const Real arhoEA = 8.;
176 Real E, dE_darhoA, dE_darhoEA;
178 ABS_TEST(E, 4., 1e-15);
179 ABS_TEST(dE_darhoA, -2., 1e-15);
180 ABS_TEST(dE_darhoEA, 0.5, 1e-15);
188 ABS_TEST(E, 6., 1e-15);
189 ABS_TEST(dE_de, 1., 1e-15);
190 ABS_TEST(dE_dvel, 2., 1e-15);
199 Real h, dh_de, dh_dp, dh_drho;
201 ABS_TEST(h, 8., 1e-15);
202 ABS_TEST(dh_de, 1., 1e-15);
203 ABS_TEST(dh_dp, 0.5, 1e-15);
204 ABS_TEST(dh_drho, -1., 1e-15);
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)
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.
static const std::string Reynolds
auto Prandtl(const T1 &cp, const T2 &mu, const T3 &k)
Compute Prandtl number.
auto Reynolds(const T1 &volume_fraction, const T2 &rho, const T3 &vel, const T4 &D_h, const T5 &mu)
Compute Reynolds number.
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.
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.
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.
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)
static const std::string Prandtl
TEST(NumericsTest, test_absoluteFuzzyEqualVectors_True)
auto Laplace(const T1 &surf_tension, const T2 &delta_rho, const Real &gravity_magnitude)
Compute Laplace number (or coefficient)
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.
static const std::string specific_volume
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.
Real dvel_darhouA(Real arhoA)
Derivative of velocity w.r.t.
auto wallHeatTransferCoefficient(const T1 &Nu, const T2 &k, const T3 &D_h)
Compute wall heat transfer coefficient.
auto Dean(const T1 &Re, const T2 &doD)
Compute Dean number.
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.
static const std::string internal_energy
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.
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.
static const std::string specific_enthalpy