https://mooseframework.inl.gov
Loading...
Searching...
No Matches
Typedefs | Functions | Variables
THM Namespace Reference

Typedefs

typedef unsigned int FlowModelID
 

Functions

FlowModelID registerFlowModelID ()
 Register a new flow mode type and return its ID.
 
template<bool is_ad>
std::string functorMaterialPropertyName (const std::string &base)
 
template<>
Component1DConnection::EEndType stringToEnum (const std::string &s)
 
template<>
Component2D::ExternalBoundaryType stringToEnum (const std::string &s)
 
template<>
FlowChannelBase::EConvHeatTransGeom stringToEnum (const std::string &s)
 
template<>
FlowChannelBase::EPipeType stringToEnum (const std::string &s)
 
template<>
FlowChannelBase::EPipeLocation stringToEnum (const std::string &s)
 
void associateSyntax (Syntax &syntax)
 
void registerActions (Syntax &syntax)
 
template<typename T >
int sgn (T val)
 The sign function.
 
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.
 
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.
 
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.
 
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.
 
DenseVector< Real > applyQuotientRule (const Real &num, const Real &den, const DenseVector< Real > &dnum_dy, const DenseVector< Real > &dden_dy)
 Computes a derivative of a fraction using quotient rule for a derivative w.r.t.
 
template<typename T1 , typename T2 , typename T3 , typename T4 , typename T5 >
auto Reynolds (const T1 &volume_fraction, const T2 &rho, const T3 &vel, const T4 &D_h, const T5 &mu)
 Compute Reynolds number.
 
template<typename T1 , typename T2 , typename T3 >
auto Prandtl (const T1 &cp, const T2 &mu, const T3 &k)
 Compute Prandtl number.
 
template<typename T1 , typename T2 , typename T3 , typename T4 , typename T5 , typename T6 >
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.
 
template<typename T1 , typename T2 , typename T3 , typename T4 , typename T5 >
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.
 
template<typename T1 , typename T2 >
auto Laplace (const T1 &surf_tension, const T2 &delta_rho, const Real &gravity_magnitude)
 Compute Laplace number (or coefficient)
 
template<typename T1 , typename T2 , typename T3 , typename T4 >
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)
 
template<typename T1 , typename T2 >
auto Dean (const T1 &Re, const T2 &doD)
 Compute Dean 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.
 
ADReal vel_from_arhoA_arhouA (ADReal arhoA, ADReal arhouA)
 Computes velocity from alpha*rho*A and alpha*rho*u*A.
 
Real dvel_darhoA (Real arhoA, Real arhouA)
 Derivative of velocity w.r.t.
 
Real dvel_darhouA (Real arhoA)
 Derivative of velocity 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.
 
ADReal rho_from_arhoA_alpha_A (ADReal arhoA, ADReal alpha, ADReal A)
 Computes density from alpha*rho*A, alpha, and area.
 
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.
 
ADReal v_from_rhoA_A (ADReal rhoA, ADReal A)
 Computes specific volume and its derivatives from rho*A, and area.
 
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.
 
ADReal v_from_arhoA_alpha_A (ADReal arhoA, ADReal alpha, ADReal A)
 Computes specific volume and its derivatives from alpha*rho*A, volume fraction, and area.
 
void v_from_rho (Real rho, Real &v, Real &dv_drho)
 Computes specific volume and its derivative with respect to density.
 
Real dv_dalpha_liquid (Real area, Real arhoA, bool is_liquid)
 Derivative of specific volume wrt alpha_liquid.
 
Real dv_darhoA (Real area, Real arhoA)
 Derivative of specific volume wrt density equation solution variable.
 
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.
 
ADReal e_from_arhoA_arhouA_arhoEA (ADReal arhoA, ADReal arhouA, ADReal arhoEA)
 
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.
 
ADReal e_from_E_vel (ADReal E, ADReal vel)
 Computes specific internal energy from specific total energy and velocity.
 
Real de_darhoA (Real arhoA, Real arhouA, Real arhoEA)
 Derivative of specific internal energy wrt density of the phase (rhoA or arhoA)
 
Real de_darhouA (Real arhoA, Real arhouA)
 Derivative of specific internal energy wrt momentum of the phase (rhouA or arhouA)
 
Real de_darhoEA (Real arhoA)
 Derivative of specific internal energy wrt total energy of the phase (rhoEA or arhoEA)
 
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.
 
ADReal E_from_arhoA_arhoEA (ADReal arhoA, ADReal arhoEA)
 Computes specific total energy from alpha*rho*A and alpha*rho*E*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.
 
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.
 
ADReal h_from_e_p_rho (ADReal e, ADReal p, ADReal rho)
 
bool isInlet (Real vel, Real normal)
 Determine if inlet boundary condition should be applied.
 
bool isInlet (ADReal vel, Real normal)
 
bool isOutlet (Real vel, Real normal)
 Determine if outlet boundary condition should be applied.
 
bool isOutlet (ADReal vel, Real normal)
 
template<typename T >
T stringToEnum (const std::string &s)
 Converts a string to an enum.
 
template<typename T >
T stringToEnum (const std::string &s, const std::map< std::string, T > &enum_map)
 Converts a string to an enum using a map of string to enum.
 
template<typename T >
MooseEnum getMooseEnum (const std::string &default_key, const std::map< std::string, T > &enum_map)
 Gets MooseEnum corresponding to an enum, using a map of string to enum.
 
void computeOrthogonalDirections (const RealVectorValue &n_unnormalized, RealVectorValue &t1, RealVectorValue &t2)
 Computes two unit vectors orthogonal to the given vector.
 
void allGatherADVectorMap (const Parallel::Communicator &comm, std::map< dof_id_type, std::vector< ADReal > > &this_map)
 Parallel gather of a map of DoF ID to AD vector.
 
void allGatherADVectorMapSum (const Parallel::Communicator &comm, std::map< dof_id_type, std::vector< ADReal > > &this_map)
 Parallel gather of a map of DoF ID to AD vector.
 
bool absoluteFuzzyEqualVectors (const RealVectorValue &a, const RealVectorValue &b, const Real &tol)
 
bool areParallelVectors (const RealVectorValue &a, const RealVectorValue &b, const Real &tol)
 
bool haveSameDirection (const RealVectorValue &a, const RealVectorValue &b, const Real &tol)
 
DenseVector< Real > applyQuotientRule (const Real &num, const Real &den, const DenseVector< Real > &dnum_dy, const DenseVector< Real > &dden_dy)
 

Variables

FlowModelID FM_INVALID = registerFlowModelID()
 
FlowModelID FM_SINGLE_PHASE = registerFlowModelID()
 
FlowModelID FM_TWO_PHASE = registerFlowModelID()
 
FlowModelID FM_TWO_PHASE_NCG = registerFlowModelID()
 
FlowModelID FM_GAS_MIX = registerFlowModelID()
 
static const size_t MAX_VARIABLE_LENGTH = 31
 
static const std::string AREA = "A"
 
static const std::string AREA_LINEAR = "A_linear"
 
static const std::string DENSITY = "rho"
 
static const std::string DIRECTION = "direction"
 
static const std::string DYNAMIC_VISCOSITY = "mu"
 
static const std::string FRICTION_FACTOR_DARCY = "f_D"
 
static const std::string HEAT_FLUX_WALL = "q_wall"
 
static const std::string HEAT_FLUX_PERIMETER = "P_hf"
 
static const std::string HEAT_TRANSFER_COEFFICIENT_WALL = "Hw"
 
static const std::string HYDRAULIC_DIAMETER = "D_h"
 
static const std::string MASS_DIFFUSION_COEFFICIENT = "mass_diffusion_coefficient"
 
static const std::string MASS_FRACTION = "mass_fraction"
 
static const std::string NUSSELT_NUMBER = "Nu"
 
static const std::string PRESSURE = "p"
 
static const std::string REYNOLDS_NUMBER = "Re"
 
static const std::string RHOA = "rhoA"
 
static const std::string RHOEA = "rhoEA"
 
static const std::string RHOUA = "rhouA"
 
static const std::string SOUND_SPEED = "c"
 
static const std::string SPECIFIC_ENTHALPY = "h"
 
static const std::string SPECIFIC_HEAT_CONSTANT_PRESSURE = "cp"
 
static const std::string SPECIFIC_HEAT_CONSTANT_VOLUME = "cv"
 
static const std::string SPECIFIC_INTERNAL_ENERGY = "e"
 
static const std::string SPECIFIC_TOTAL_ENTHALPY = "H"
 
static const std::string SPECIFIC_VOLUME = "v"
 
static const std::string TEMPERATURE = "T"
 
static const std::string TEMPERATURE_WALL = "T_wall"
 
static const std::string THERMAL_CONDUCTIVITY = "k"
 
static const std::string UNITY = "unity"
 
static const std::string VELOCITY = "vel"
 
static const std::string VELOCITY_X = "vel_x"
 
static const std::string VELOCITY_Y = "vel_y"
 
static const std::string VELOCITY_Z = "vel_z"
 
static const std::string XIRHOA = "xirhoA"
 
static const Real gravity_const = 9.81
 
static VectorValue< Real > default_gravity_vector = VectorValue<Real>(0.0, 0.0, -gravity_const)
 
static const Real Stefan_Boltzman_const = 5.670e-8
 

Typedef Documentation

◆ FlowModelID

typedef unsigned int THM::FlowModelID

Definition at line 29 of file ThermalHydraulicsApp.h.

Function Documentation

◆ absoluteFuzzyEqualVectors() [1/2]

bool THM::absoluteFuzzyEqualVectors ( const RealVectorValue &  a,
const RealVectorValue &  b,
const Real &  tol 
)

Definition at line 18 of file Numerics.C.

19{
20 return MooseUtils::absoluteFuzzyEqual(a(0), b(0), tol) &&
21 MooseUtils::absoluteFuzzyEqual(a(1), b(1), tol) &&
22 MooseUtils::absoluteFuzzyEqual(a(2), b(2), tol);
23}
const double tol

◆ absoluteFuzzyEqualVectors() [2/2]

bool THM::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.

Parameters
[in]aFirst vector
[in]bSecond vector
[in]tolAbsolute tolerance

Referenced by areParallelVectors(), TEST(), and TEST().

◆ allGatherADVectorMap()

void THM::allGatherADVectorMap ( const Parallel::Communicator &  comm,
std::map< dof_id_type, std::vector< ADReal > > &  this_map 
)

Parallel gather of a map of DoF ID to AD vector.

Parameters
[in]commParallel communicator
[in,out]this_mapData map

Definition at line 47 of file THMUtils.C.

49{
50 std::vector<std::map<dof_id_type, std::vector<ADReal>>> all_maps;
51 comm.allgather(this_map, all_maps);
52 for (auto & one_map : all_maps)
53 for (auto & it : one_map)
54 this_map[it.first] = it.second;
55}
for(PetscInt i=0;i< nvars;++i)

Referenced by ADHeatTransferFromHeatStructure3D1PhaseUserObject::finalize(), FlowChannelHeatStructureCouplerUserObject::finalize(), and StoreVariableByElemIDSideUserObject::finalize().

◆ allGatherADVectorMapSum()

void THM::allGatherADVectorMapSum ( const Parallel::Communicator &  comm,
std::map< dof_id_type, std::vector< ADReal > > &  this_map 
)

Parallel gather of a map of DoF ID to AD vector.

In contrast to allGatherADVectorMap, this function does not assume that each of the maps from the different processors have unique keys; it applies a sum if the key exists on multiple processors.

Parameters
[in]commParallel communicator
[in,out]this_mapData map

Definition at line 58 of file THMUtils.C.

60{
61 std::vector<std::map<dof_id_type, std::vector<ADReal>>> all_maps;
62 comm.allgather(this_map, all_maps);
63 this_map.clear();
64 for (auto & one_map : all_maps)
65 for (auto & it : one_map)
66 if (this_map.find(it.first) == this_map.end())
67 this_map[it.first] = it.second;
68 else
69 {
70 auto & existing = this_map[it.first];
71 for (const auto i : index_range(existing))
72 existing[i] += it.second[i];
73 }
74}

Referenced by HSCoupler2D2DRadiationUserObject::finalize(), and HSCoupler2D3DUserObject::finalize().

◆ applyQuotientRule() [1/3]

DenseVector< Real > THM::applyQuotientRule ( const Real &  num,
const Real &  den,
const DenseVector< Real > &  dnum_dy,
const DenseVector< Real > &  dden_dy 
)

Computes a derivative of a fraction using quotient rule for a derivative w.r.t.

a vector quantity

Parameters
[in]numnumerator value
[in]dendenominator value
[in]dnum_dyderivative of numerator value
[in]dden_dyderivative of denominator value

◆ applyQuotientRule() [2/3]

DenseVector< Real > THM::applyQuotientRule ( const Real &  num,
const Real &  den,
const DenseVector< Real > &  dnum_dy,
const DenseVector< Real > &  dden_dy 
)

Definition at line 45 of file Numerics.C.

49{
50 DenseVector<Real> d_dy = dnum_dy;
51 d_dy *= 1.0 / den;
52 d_dy.add(-num / std::pow(den, 2), dden_dy);
53
54 return d_dy;
55}

◆ applyQuotientRule() [3/3]

Real THM::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.

a scalar quantity

Parameters
[in]numnumerator value
[in]dendenominator value
[in]dnum_dyderivative of numerator value
[in]dden_dyderivative of denominator value

Definition at line 39 of file Numerics.C.

40{
41 return (dnum_dy * den - num * dden_dy) / (den * den);
42}

◆ areParallelVectors() [1/2]

bool THM::areParallelVectors ( const RealVectorValue &  a,
const RealVectorValue &  b,
const Real &  tol 
)

Definition at line 26 of file Numerics.C.

27{
28 const RealVectorValue c = a.cross(b);
29 return absoluteFuzzyEqualVectors(c, RealVectorValue(0, 0, 0), tol);
30}
TypeVector< typename CompareTypes< T, T2 >::supertype > cross(const TypeVector< T2 > &v) const
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.

◆ areParallelVectors() [2/2]

bool THM::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.

Parameters
[in]aFirst vector
[in]bSecond vector
[in]tolAbsolute tolerance

Referenced by ADJunctionParallelChannels1PhaseUserObject::computeFluxesAndResiduals(), ADGateValve1PhaseUserObject::finalize(), DiscreteLineSegmentInterface::getAlignmentAxis(), haveSameDirection(), TEST(), and TEST().

◆ associateSyntax()

void THM::associateSyntax ( Syntax syntax)

Definition at line 18 of file THMSyntax.C.

19{
20 syntax.registerActionSyntax("THMCreateMeshAction", "Components");
21 syntax.registerActionSyntax("AddComponentAction", "Components/*", "THM:add_component");
22 syntax.registerActionSyntax("AddComponentAction", "Components/*/*", "THM:add_component");
23 syntax.registerActionSyntax("AddClosuresAction", "Closures/*", "THM:add_closures");
24 syntax.registerActionSyntax("THMAddControlAction", "ControlLogic/*", "THM:add_control_logic");
25 syntax.registerTaskName("THM:add_control_logic", "THMControl", false);
26 syntax.registerActionSyntax("AddIterationCountPostprocessorsAction", "Debug");
27 syntax.registerActionSyntax("PostprocessorAsControlAction", "Postprocessors/*");
28 syntax.registerActionSyntax("THMDebugAction", "Debug");
29 syntax.registerActionSyntax("THMPrintComponentLoopsAction", "Debug");
30 syntax.registerActionSyntax("THMOutputVectorVelocityAction", "Outputs");
31 syntax.registerActionSyntax("THMSetupOutputAction", "Outputs");
32 syntax.registerActionSyntax("CoupledHeatTransferAction", "CoupledHeatTransfers/*", "add_bc");
34 "CoupledHeatTransferAction", "CoupledHeatTransfers/*", "add_user_object");
36 "CoupledHeatTransferAction", "CoupledHeatTransfers/*", "add_transfer");
37}
void registerActionSyntax(const std::string &action, const std::string &syntax, const std::string &task="", const std::string &file="", int line=-1)
void registerTaskName(const std::string &task, bool should_auto_build=false)

Referenced by ThermalHydraulicsApp::registerAll().

◆ computeOrthogonalDirections()

void THM::computeOrthogonalDirections ( const RealVectorValue &  n_unnormalized,
RealVectorValue &  t1,
RealVectorValue &  t2 
)

Computes two unit vectors orthogonal to the given vector.

The input vector need not be normalized; it will be normalized within this function.

Parameters
[in]n_unnormalizedVector for which to find orthogonal directions
[out]t1First orthogonal unit vector
[out]t2Second orthogonal unit vector

Definition at line 22 of file THMUtils.C.

25{
26 const RealVectorValue n = n_unnormalized.unit();
27
28 if (MooseUtils::absoluteFuzzyEqual(std::abs(n(0)), 1.0))
29 {
30 t1 = RealVectorValue(0, 1, 0);
31 t2 = RealVectorValue(0, 0, 1);
32 }
33 else
34 {
35 // Gram-Schmidt process to get first
36 RealVectorValue ex(1, 0, 0);
37 t1 = ex - (ex * n) * n;
38 t1 = t1.unit();
39
40 // use cross-product to get second
41 t2 = n.cross(t1);
42 t2 = t2.unit();
43 }
44}
TypeVector< T > unit() const

Referenced by ADVolumeJunction1PhaseUserObject::compute3DFlux(), ADVolumeJunction1PhaseUserObject::computeResidual(), NumericalFlux1D::getFlux(), TEST(), and TEST().

◆ de_darhoA()

Real THM::de_darhoA ( Real  arhoA,
Real  arhouA,
Real  arhoEA 
)

Derivative of specific internal energy wrt density of the phase (rhoA or arhoA)

Parameters
arhoA- density equation solution variable: alpha*rho*A
arhouA- momentum equation solution variable: alpha*rho*u*A
arhoEA- energy equation solution variable: alpha*rho*E*A

Definition at line 181 of file Numerics.C.

182{
183 return (-arhoEA / arhoA / arhoA + arhouA * arhouA / arhoA / arhoA / arhoA);
184}

Referenced by FluidProperties3EqnMaterial::computeQpProperties(), e_from_arhoA_arhouA_arhoEA(), and TEST().

◆ de_darhoEA()

Real THM::de_darhoEA ( Real  arhoA)

Derivative of specific internal energy wrt total energy of the phase (rhoEA or arhoEA)

Parameters
arhoA- density equation solution variable: alpha*rho*A

Definition at line 193 of file Numerics.C.

194{
195 return (1 / arhoA);
196}

Referenced by FluidProperties3EqnMaterial::computeQpProperties(), e_from_arhoA_arhouA_arhoEA(), and TEST().

◆ de_darhouA()

Real THM::de_darhouA ( Real  arhoA,
Real  arhouA 
)

Derivative of specific internal energy wrt momentum of the phase (rhouA or arhouA)

Parameters
arhoA- density equation solution variable: alpha*rho*A
arhouA- momentum equation solution variable: alpha*rho*u*A

Definition at line 187 of file Numerics.C.

188{
189 return (-arhouA / arhoA / arhoA);
190}

Referenced by FluidProperties3EqnMaterial::computeQpProperties(), e_from_arhoA_arhouA_arhoEA(), and TEST().

◆ Dean()

template<typename T1 , typename T2 >
auto THM::Dean ( const T1 &  Re,
const T2 &  doD 
)

Compute Dean number.

Parameters
ReReynolds number
doDtube diameter to coil diameter ratio
Returns
Dean number

Definition at line 242 of file Numerics.h.

243{
244 using std::sqrt;
245 return Re * sqrt(doD);
246}
const double Re

Referenced by TEST().

◆ dv_dalpha_liquid()

Real THM::dv_dalpha_liquid ( Real  area,
Real  arhoA,
bool  is_liquid 
)

Derivative of specific volume wrt alpha_liquid.

Makes sense only when using 7-equation model

Parameters
area- The cross-sectional area
arhoA- density equation solution variable: alpha*rho*A
is_liquid- True if the specific volume corresponds to liquid phase

Definition at line 134 of file Numerics.C.

135{
136 const Real sign = is_liquid ? 1.0 : -1.0;
137 return sign * (area / arhoA);
138}

Referenced by TEST().

◆ dv_darhoA()

Real THM::dv_darhoA ( Real  area,
Real  arhoA 
)

Derivative of specific volume wrt density equation solution variable.

Parameters
area- Cross-sectional area
arhoA- density equation solution variable: alpha*rho*A

Definition at line 141 of file Numerics.C.

142{
143 return -area / arhoA / arhoA;
144}

Referenced by FluidProperties3EqnMaterial::computeQpProperties(), TEST(), and v_from_arhoA_alpha_A().

◆ dvel_darhoA()

Real THM::dvel_darhoA ( Real  arhoA,
Real  arhouA 
)

Derivative of velocity w.r.t.

alpha*rho*A

Parameters
[in]arhoAalpha*rho*A
[in]arhouAalpha*rho*u*A
Returns
derivative of velocity w.r.t. alpha*rho*A

Definition at line 72 of file Numerics.C.

73{
74 return -arhouA / (arhoA * arhoA);
75}

Referenced by TEST(), and vel_from_arhoA_arhouA().

◆ dvel_darhouA()

Real THM::dvel_darhouA ( Real  arhoA)

Derivative of velocity w.r.t.

alpha*rho*u*A

Parameters
[in]arhoAalpha*rho*A
Returns
derivative of velocity w.r.t. alpha*rho*u*A

Definition at line 78 of file Numerics.C.

79{
80 return 1.0 / arhoA;
81}

Referenced by TEST(), and vel_from_arhoA_arhouA().

◆ E_from_arhoA_arhoEA() [1/2]

ADReal THM::E_from_arhoA_arhoEA ( ADReal  arhoA,
ADReal  arhoEA 
)

Computes specific total energy from alpha*rho*A and alpha*rho*E*A.

Parameters
[in]arhoAalpha*rho*A
[in]arhoEAalpha*rho*E*A
Returns
specific total energy

Definition at line 206 of file Numerics.C.

207{
208 return arhoEA / arhoA;
209}

◆ E_from_arhoA_arhoEA() [2/2]

void THM::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.

Parameters
[in]arhoAalpha*rho*A
[in]arhoEAalpha*rho*E*A
[out]Especific total energy
[out]dE_darhoAderivative of specific total energy w.r.t. alpha*rho*A
[out]dE_darhoEAderivative of specific total energy w.r.t. alpha*rho*E*A

Definition at line 199 of file Numerics.C.

200{
201 E = arhoEA / arhoA;
202 dE_darhoA = -arhoEA / (arhoA * arhoA);
203 dE_darhoEA = 1.0 / arhoA;
204}

Referenced by TEST().

◆ e_from_arhoA_arhouA_arhoEA() [1/2]

ADReal THM::e_from_arhoA_arhouA_arhoEA ( ADReal  arhoA,
ADReal  arhouA,
ADReal  arhoEA 
)

Definition at line 162 of file Numerics.C.

163{
164 return arhoEA / arhoA - 0.5 * arhouA * arhouA / (arhoA * arhoA);
165}

◆ e_from_arhoA_arhouA_arhoEA() [2/2]

void THM::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.

Parameters
[in]arhoAalpha*rho*A
[in]arhouAalpha*rho*u*A
[in]arhoEAalpha*rho*E*A
[out]especific internal energy
[out]de_darhoAderivative of specific internal energy w.r.t. alpha*rho*A
[out]de_darhouAderivative of specific internal energy w.r.t. alpha*rho*u*A
[out]de_darhoEAderivative of specific internal energy w.r.t. alpha*rho*E*A

Definition at line 147 of file Numerics.C.

154{
155 e = arhoEA / arhoA - 0.5 * arhouA * arhouA / (arhoA * arhoA);
156 de_darhoA_val = de_darhoA(arhoA, arhouA, arhoEA);
157 de_darhouA_val = de_darhouA(arhoA, arhouA);
158 de_darhoEA_val = de_darhoEA(arhoA);
159}
Real de_darhouA(Real arhoA, Real arhouA)
Derivative of specific internal energy wrt momentum of the phase (rhouA or arhouA)
Definition Numerics.C:187
Real de_darhoEA(Real arhoA)
Derivative of specific internal energy wrt total energy of the phase (rhoEA or arhoEA)
Definition Numerics.C:193
Real de_darhoA(Real arhoA, Real arhouA, Real arhoEA)
Derivative of specific internal energy wrt density of the phase (rhoA or arhoA)
Definition Numerics.C:181

Referenced by ADShaftConnectedCompressor1PhaseUserObject::computeFluxesAndResiduals(), and TEST().

◆ e_from_E_vel() [1/2]

ADReal THM::e_from_E_vel ( ADReal  E,
ADReal  vel 
)

Computes specific internal energy from specific total energy and velocity.

Parameters
[in]Especific total energy
[in]velvelocity
Returns
specific internal energy

Definition at line 175 of file Numerics.C.

176{
177 return E - 0.5 * vel * vel;
178}

◆ e_from_E_vel() [2/2]

void THM::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.

Parameters
[in]Especific total energy
[in]velvelocity
[out]especific internal energy
[out]de_dEderivative of specific internal energy w.r.t. specific total energy
[out]de_dvelderivative of specific internal energy w.r.t. velocity

Definition at line 168 of file Numerics.C.

169{
170 e = E - 0.5 * vel * vel;
171 de_dE = 1;
172 de_dvel = -vel;
173}

Referenced by TEST().

◆ E_from_e_vel()

void THM::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.

Parameters
[in]especific internal energy
[in]velvelocity
[out]Especific total energy
[out]dE_dederivative of specific total energy w.r.t. specific internal energy
[out]dE_dvelderivative of specific total energy w.r.t. velocity

Definition at line 212 of file Numerics.C.

213{
214 E = e + 0.5 * vel * vel;
215 dE_de = 1.0;
216 dE_dvel = vel;
217}

Referenced by TEST().

◆ functorMaterialPropertyName()

template<bool is_ad>
std::string THM::functorMaterialPropertyName ( const std::string &  base)

Definition at line 51 of file THMNames.h.

52{
53 if constexpr (is_ad)
54 return base + "_ad";
55 else
56 return base + "_nonad";
57}

◆ getMooseEnum()

template<typename T >
MooseEnum THM::getMooseEnum ( const std::string &  default_key,
const std::map< std::string, T > &  enum_map 
)

Gets MooseEnum corresponding to an enum, using a map of string to enum.

Template Parameters
Tenum type
Parameters
[in]default_keykey corresponding to default value
[in]enum_mapmap of string to enum

Definition at line 66 of file THMEnums.h.

67{
68 std::string keys_string;
69 for (typename std::map<std::string, T>::const_iterator it = enum_map.begin();
70 it != enum_map.end();
71 it++)
72 if (it == enum_map.begin())
73 keys_string += it->first;
74 else
75 keys_string += " " + it->first;
76
77 return MooseEnum(keys_string, default_key, true);
78}

◆ Grashof()

template<typename T1 , typename T2 , typename T3 , typename T4 , typename T5 >
auto THM::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.

Parameters
betaThermal expansion coefficient
dT|T_w - T|
D_hHydraulic diameter
rho_liquidDensity of liquid
mu_liquidViscosity of liquid
gravity_magnitudeGravitational acceleration magnitude
Returns
Grashof number

Definition at line 178 of file Numerics.h.

184{
185 using std::pow;
186 return gravity_magnitude * beta * dT * pow(D_h, 3) * (rho_liquid * rho_liquid) /
187 (mu_liquid * mu_liquid);
188}
ExpressionBuilder::EBTerm pow(const ExpressionBuilder::EBTerm &left, T exponent)

Referenced by TEST().

◆ h_from_e_p_rho() [1/2]

ADReal THM::h_from_e_p_rho ( ADReal  e,
ADReal  p,
ADReal  rho 
)

Definition at line 229 of file Numerics.C.

230{
231 return e + p / rho;
232}
const Real p
const double rho

◆ h_from_e_p_rho() [2/2]

void THM::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.

Parameters
[in]especific internal energy
[in]ppressure
[in]rhodensity
[out]hspecific enthalpy
[out]dh_dederivative of specific enthalpy w.r.t. specific internal energy
[out]dh_dpderivative of specific enthalpy w.r.t. pressure
[out]dh_drhoderivative of specific enthalpy w.r.t. density

Definition at line 220 of file Numerics.C.

221{
222 h = e + p / rho;
223 dh_de = 1.0;
224 dh_dp = 1.0 / rho;
225 dh_drho = -p / (rho * rho);
226}

Referenced by ADShaftConnectedCompressor1PhaseUserObject::computeFluxesAndResiduals(), and TEST().

◆ haveSameDirection() [1/2]

bool THM::haveSameDirection ( const RealVectorValue &  a,
const RealVectorValue &  b,
const Real &  tol 
)

Definition at line 33 of file Numerics.C.

34{
35 return areParallelVectors(a, b, tol) && a * b > 0;
36}
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.

◆ haveSameDirection() [2/2]

bool THM::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.

Parameters
[in]aFirst vector
[in]bSecond vector
[in]tolAbsolute tolerance

Referenced by TEST(), and TEST().

◆ isInlet() [1/2]

bool THM::isInlet ( ADReal  vel,
Real  normal 
)

Definition at line 241 of file Numerics.C.

242{
243 return (MetaPhysicL::raw_value(vel) * normal) < 0;
244}
auto raw_value(const Eigen::Map< T > &in)

◆ isInlet() [2/2]

bool THM::isInlet ( Real  vel,
Real  normal 
)

Determine if inlet boundary condition should be applied.

Returns
true if the flow conditions are inlet, false otherwise
Parameters
velVelocity of the phase
normalOutward normal vector

Definition at line 235 of file Numerics.C.

236{
237 return (vel * normal) < 0;
238}

Referenced by ADBoundaryFlux3EqnGhostMassFlowRateTemperature::getGhostCellSolution(), ADBoundaryFlux3EqnGhostVelocityTemperature::getGhostCellSolution(), ADBoundaryFlux3EqnGhostStagnationPressureTemperature::getGhostCellSolution(), ADBoundaryFlux3EqnGhostDensityVelocity::getGhostCellSolution(), and TEST().

◆ isOutlet() [1/2]

bool THM::isOutlet ( ADReal  vel,
Real  normal 
)

Definition at line 253 of file Numerics.C.

254{
255 return (MetaPhysicL::raw_value(vel) * normal) >= 0;
256}

◆ isOutlet() [2/2]

bool THM::isOutlet ( Real  vel,
Real  normal 
)

Determine if outlet boundary condition should be applied.

Returns
true if the flow conditions are outlet, false otherwise
Parameters
velVelocity of the phase
normalOutward normal vector

Definition at line 247 of file Numerics.C.

248{
249 return (vel * normal) >= 0;
250}

Referenced by ADJunctionParallelChannels1PhaseUserObject::computeFluxesAndResiduals(), and TEST().

◆ Laplace()

template<typename T1 , typename T2 >
auto THM::Laplace ( const T1 &  surf_tension,
const T2 &  delta_rho,
const Real &  gravity_magnitude 
)

Compute Laplace number (or coefficient)

Parameters
surf_tensionSurface tension
delta_rhoDifference in density of phases
gravity_magnitudeGravitational acceleration magnitude
Returns
Laplace number

Definition at line 201 of file Numerics.h.

202{
203 using std::sqrt;
204 return sqrt(surf_tension / (gravity_magnitude * delta_rho));
205}

Referenced by TEST().

◆ Peclet()

template<typename T1 , typename T2 , typename T3 , typename T4 , typename T5 , typename T6 >
auto THM::Peclet ( const T1 &  volume_fraction,
const T2 &  cp,
const T3 &  rho,
const T4 &  vel,
const T5 &  D_h,
const T6 &  k 
)

Compute Peclet number.

Parameters
volume_fractionThe volume fraction of the phase
rhoThe density of the phase
velThe velocity of the phase
D_hThe hydraulic diameter
kThermal conductivity
cpSpecific heat
kThermal conductivity
Returns
Peclet number

Definition at line 153 of file Numerics.h.

159{
160 const auto diffusivity = HeatTransferUtils::thermalDiffusivity(k, rho, cp);
161 return volume_fraction * HeatTransferUtils::peclet(vel, D_h, diffusivity);
162}
auto peclet(const T1 &vel, const T2 &L, const T3 &diffusivity)
Compute Peclet number.
auto thermalDiffusivity(const T1 &k, const T2 &rho, const T3 &cp)
Compute thermal diffusivity.

Referenced by ADWallHeatTransferCoefficientKazimiMaterial::computeQpProperties(), ADWallHeatTransferCoefficientLyonMaterial::computeQpProperties(), ADWallHeatTransferCoefficientMikityukMaterial::computeQpProperties(), ADWallHeatTransferCoefficientSchadMaterial::computeQpProperties(), and TEST().

◆ Prandtl()

template<typename T1 , typename T2 , typename T3 >
auto THM::Prandtl ( const T1 &  cp,
const T2 &  mu,
const T3 &  k 
)

◆ registerActions()

void THM::registerActions ( Syntax syntax)

Definition at line 40 of file THMSyntax.C.

41{
42 registerTask("THM:init_simulation", true);
43 registerTask("THM:setup_mesh", true);
44 registerTask("THM:build_mesh", true);
45 registerTask("THM:init_components", true);
46 registerTask("THM:identify_loops", true);
47 registerTask("THM:add_variables", true);
48 registerTask("THM:add_control_logic", true);
49 registerTask("THM:setup_output", true);
50 registerTask("THM:add_component_moose_objects", true);
51 registerTask("THM:integrity_check", true);
52 registerTask("THM:control_data_integrity_check", true);
53 registerTask("THM:preconditioning_integrity_check", true);
54 registerTask("THM:setup_quadrature", true);
55 registerTask("THM:debug_action", false);
56 registerTask("THM:print_component_loops", false);
57 registerTask("THM:output_vector_velocity", true);
58 registerTask("THM:add_relationship_managers", true);
59
60 registerMooseObjectTask("THM:add_component", Component, false);
61 registerMooseObjectTask("THM:add_closures", Closures, false);
62
63 try
64 {
65 syntax.addDependency("THM:output_vector_velocity", "setup_mesh");
66 syntax.addDependency("THM:add_closures", "setup_mesh");
67 syntax.addDependency("THM:init_components", "THM:output_vector_velocity");
68 syntax.addDependency("THM:debug_action", "setup_mesh");
69 syntax.addDependency("THM:init_simulation", "THM:add_component");
70 syntax.addDependency("add_mesh_generator", "THM:add_component");
71 syntax.addDependency("THM:identify_loops", "THM:add_component");
72 // Components must specify their blocks to the Physics before it gets initialized
73 syntax.addDependency("init_physics", "THM:init_components");
74 // Fluid properties are retrieved during component initialization
75 syntax.addDependency("THM:init_components", "add_fluid_properties");
76 // Solid material property used in a component needs a function
77 syntax.addDependency("THM:init_components", "add_function");
78 syntax.addDependency("THM:identify_loops", "add_fluid_properties");
79 syntax.addDependency("THM:integrity_check", "THM:init_components");
80 syntax.addDependency("THM:integrity_check", "THM:identify_loops");
81 syntax.addDependency("THM:integrity_check", "THM:debug_action");
82 syntax.addDependency("THM:build_mesh", "THM:init_simulation");
83 syntax.addDependency("add_mesh_generator", "THM:build_mesh");
84 syntax.addDependency("THM:setup_mesh", "create_problem_complete");
85 syntax.addDependency("add_fluid_properties", "THM:setup_mesh");
86 syntax.addDependency("add_elemental_field_variable", "add_fluid_properties");
87 syntax.addDependency("add_aux_variable", "add_fluid_properties");
88 syntax.addDependency("add_variable", "add_fluid_properties");
89 syntax.addDependency("THM:init_components", "THM:add_closures");
90 syntax.addDependency("add_variable", "THM:init_components");
91 syntax.addDependency("THM:setup_output", "add_output");
92 syntax.addDependency("THM:add_component_moose_objects", "add_material");
93 syntax.addDependency("check_output", "THM:add_component_moose_objects");
94 syntax.addDependency("THM:add_control_logic", "add_control");
95 syntax.addDependency("THM:control_data_integrity_check", "check_integrity");
96 syntax.addDependency("add_user_object", "THM:add_variables");
97 syntax.addDependency("add_output_aux_variables", "THM:add_component_moose_objects");
98 syntax.addDependency("add_periodic_bc", "THM:add_variables");
99 syntax.addDependency("THM:print_component_loops", "THM:control_data_integrity_check");
100 syntax.addDependency("THM:preconditioning_integrity_check", "check_integrity");
101 syntax.addDependency("THM:add_relationship_managers", "add_geometric_rm");
102 syntax.addDependency("THM:add_relationship_managers", "THM:add_component");
103 syntax.addDependency("THM:init_simulation", "THM:add_relationship_managers");
104 syntax.addDependency("THM:output_vector_velocity", "THM:add_relationship_managers");
105 syntax.addDependency("THM:add_variables", "THM:integrity_check");
106 }
108 {
109 mooseError("Cyclic Dependency Detected during addDependency() calls");
110 }
111}
void mooseError(Args &&... args)
Base class for THM components.
Definition Component.h:32
void addDependency(const std::string &task, const std::string &pre_req)

Referenced by ThermalHydraulicsApp::registerAll().

◆ registerFlowModelID()

FlowModelID THM::registerFlowModelID ( )

Register a new flow mode type and return its ID.

Returns
ID of the newly registered

Definition at line 34 of file ThermalHydraulicsApp.C.

35{
36 static FlowModelID flow_model_id = 0;
37 flow_model_id++;
38 return flow_model_id;
39}
unsigned int FlowModelID

◆ Reynolds()

template<typename T1 , typename T2 , typename T3 , typename T4 , typename T5 >
auto THM::Reynolds ( const T1 &  volume_fraction,
const T2 &  rho,
const T3 &  vel,
const T4 &  D_h,
const T5 &  mu 
)

◆ rho_from_arhoA_alpha_A() [1/2]

ADReal THM::rho_from_arhoA_alpha_A ( ADReal  arhoA,
ADReal  alpha,
ADReal  A 
)

Computes density from alpha*rho*A, alpha, and area.

Parameters
[in]arhoAalpha*rho*A
[in]alphavolume fraction
[in]Aarea
Returns
density

Definition at line 94 of file Numerics.C.

95{
96 return arhoA / (alpha * A);
97}

◆ rho_from_arhoA_alpha_A() [2/2]

void THM::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.

Parameters
[in]arhoAalpha*rho*A
[in]alphavolume fraction
[in]Aarea
[out]rhodensity
[out]drho_darhoAderivative of density w.r.t. alpha*rho*A
[out]drho_dalphaderivative of density w.r.t. alpha

Definition at line 84 of file Numerics.C.

86{
87 rho = arhoA / (alpha * A);
88
89 drho_darhoA = 1.0 / (alpha * A);
90 drho_dalpha = -arhoA / (alpha * alpha * A);
91}

Referenced by TEST().

◆ sgn()

template<typename T >
int THM::sgn ( T  val)

The sign function.

Parameters
valThe argument of the sign function
Returns
-1 for negative values, 0 for zero and 1 for positive values

Definition at line 41 of file Numerics.h.

42{
43 return (T(0) < val) - (val < T(0));
44}
const double T

◆ stringToEnum() [1/7]

template<>
SlopeReconstruction1DInterface< false >::ESlopeReconstructionType THM::stringToEnum ( const std::string &  s)

Definition at line 18 of file Component1DConnection.C.

19{
20 return stringToEnum<Component1DConnection::EEndType>(s, Component1DConnection::_end_type_to_enum);
21}
static const std::map< std::string, EEndType > _end_type_to_enum
Map of end type string to enum.

◆ stringToEnum() [2/7]

template<>
Component2D::ExternalBoundaryType THM::stringToEnum ( const std::string &  s)

◆ stringToEnum() [3/7]

template<>
FlowChannelBase::EConvHeatTransGeom THM::stringToEnum ( const std::string &  s)

◆ stringToEnum() [4/7]

template<>
FlowChannelBase::EPipeType THM::stringToEnum ( const std::string &  s)

◆ stringToEnum() [5/7]

template<>
FlowChannelBase::EPipeLocation THM::stringToEnum ( const std::string &  s)

◆ stringToEnum() [6/7]

template<typename T >
T THM::stringToEnum ( const std::string &  s)

Converts a string to an enum.

This template is designed to be specialized and use the other version of this function in conjunction with the correct map.

Template Parameters
Tenum type
Parameters
[in]sstring to convert

◆ stringToEnum() [7/7]

template<typename T >
T THM::stringToEnum ( const std::string &  s,
const std::map< std::string, T > &  enum_map 
)

Converts a string to an enum using a map of string to enum.

Template Parameters
Tenum type
Parameters
[in]sstring to convert
[in]enum_mapmap of string to enum

Definition at line 53 of file THMEnums.h.

54{
55 std::string upper(s);
56 std::transform(upper.begin(), upper.end(), upper.begin(), ::toupper);
57
58 if (!enum_map.count(upper))
59 return static_cast<T>(-100);
60 else
61 return enum_map.at(upper);
62}

◆ v_from_arhoA_alpha_A() [1/2]

ADReal THM::v_from_arhoA_alpha_A ( ADReal  arhoA,
ADReal  alpha,
ADReal  A 
)

Computes specific volume and its derivatives from alpha*rho*A, volume fraction, and area.

Parameters
[in]arhoAalpha*rho*A
[in]alphavolume fraction
[in]Aarea
Returns
specific volume

Definition at line 121 of file Numerics.C.

122{
123 return (alpha * A) / arhoA;
124}

◆ v_from_arhoA_alpha_A() [2/2]

void THM::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.

Parameters
[in]arhoAalpha*rho*A
[in]alphavolume fraction
[in]Aarea
[out]dv_darhoAderivative of specific volume w.r.t. alpha*rho*A
[out]dv_dalphaderivative of specific volume w.r.t. volume fraction

Definition at line 113 of file Numerics.C.

114{
115 v = (alpha * A) / arhoA;
116 dv_darhoA = -(alpha * A) / (arhoA * arhoA);
117 dv_dalpha = A / arhoA;
118}
const double v
Real dv_darhoA(Real area, Real arhoA)
Derivative of specific volume wrt density equation solution variable.
Definition Numerics.C:141

Referenced by TEST().

◆ v_from_rho()

void THM::v_from_rho ( Real  rho,
Real &  v,
Real &  dv_drho 
)

Computes specific volume and its derivative with respect to density.

Parameters
[in]rhodensity
[in]vspecific volume
[in]dv_drhoderivative of specific volume w.r.t. density

Definition at line 127 of file Numerics.C.

128{
129 v = 1.0 / rho;
130 dv_drho = -1.0 / (rho * rho);
131}

Referenced by TEST().

◆ v_from_rhoA_A() [1/2]

ADReal THM::v_from_rhoA_A ( ADReal  rhoA,
ADReal  A 
)

Computes specific volume and its derivatives from rho*A, and area.

Parameters
[in]rhoArho*A
[in]Aarea
Returns
specific volume

Definition at line 107 of file Numerics.C.

108{
109 return A / rhoA;
110}

◆ v_from_rhoA_A() [2/2]

void THM::v_from_rhoA_A ( Real  rhoA,
Real  A,
Real &  v,
Real &  dv_drhoA 
)

Computes specific volume and its derivatives from rho*A, and area.

Parameters
[in]rhoArho*A
[in]Aarea
[out]dv_drhoAderivative of specific volume w.r.t. rho*A

Definition at line 100 of file Numerics.C.

101{
102 v = A / rhoA;
103 dv_drhoA = -A / (rhoA * rhoA);
104}

Referenced by ADJunctionParallelChannels1PhaseUserObject::computeFluxesAndResiduals(), ADSimpleTurbine1PhaseUserObject::computeFluxesAndResiduals(), ADVolumeJunction1PhaseUserObject::computeResidual(), VolumeJunction1PhaseAux::computeValue(), and TEST().

◆ vel_from_arhoA_arhouA() [1/2]

ADReal THM::vel_from_arhoA_arhouA ( ADReal  arhoA,
ADReal  arhouA 
)

Computes velocity from alpha*rho*A and alpha*rho*u*A.

Parameters
arhoAalpha*rho*A
arhouAalpha*rho*u*A
Returns
velocity

Definition at line 66 of file Numerics.C.

67{
68 return arhouA / arhoA;
69}

◆ vel_from_arhoA_arhouA() [2/2]

void THM::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.

Parameters
[in]arhoAalpha*rho*A
[in]arhouAalpha*rho*u*A
[out]velvelocity
[out]dvel_darhoAderivative of velocity w.r.t. alpha*rho*A
[out]dvel_darhouAderivative of velocity w.r.t. alpha*rho*u*A

Definition at line 58 of file Numerics.C.

59{
60 vel = arhouA / arhoA;
61 dvel_darhoA = -arhouA / (arhoA * arhoA);
62 dvel_darhouA = 1.0 / arhoA;
63}
Real dvel_darhoA(Real arhoA, Real arhouA)
Derivative of velocity w.r.t.
Definition Numerics.C:72
Real dvel_darhouA(Real arhoA)
Derivative of velocity w.r.t.
Definition Numerics.C:78

Referenced by FluidProperties3EqnMaterial::computeQpProperties(), and TEST().

◆ viscosityNumber()

template<typename T1 , typename T2 , typename T3 , typename T4 >
auto THM::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)

Parameters
viscosityViscosity
surf_tensionSurface tension
rho_kDensity of k-th phase of interest
delta_rhoDensity difference
gravity_magnitudeGravitational acceleration magnitude
Returns
viscosity number

Definition at line 220 of file Numerics.h.

225{
226 using std::sqrt;
227 return viscosity /
228 sqrt(rho_k * surf_tension * sqrt(surf_tension / gravity_magnitude / delta_rho));
229}

Referenced by TEST().

Variable Documentation

◆ AREA

const std::string THM::AREA = "A"
static

◆ AREA_LINEAR

const std::string THM::AREA_LINEAR = "A_linear"
static

◆ default_gravity_vector

VectorValue<Real> THM::default_gravity_vector = VectorValue<Real>(0.0, 0.0, -gravity_const)
static

Definition at line 29 of file Numerics.h.

Referenced by GravityInterface::validParams().

◆ DENSITY

const std::string THM::DENSITY = "rho"
static

◆ DIRECTION

const std::string THM::DIRECTION = "direction"
static

◆ DYNAMIC_VISCOSITY

const std::string THM::DYNAMIC_VISCOSITY = "mu"
static

Definition at line 18 of file THMNames.h.

◆ FM_GAS_MIX

FlowModelID THM::FM_GAS_MIX = registerFlowModelID()

Definition at line 45 of file ThermalHydraulicsApp.C.

Referenced by FlowChannelGasMix::getFlowModelID().

◆ FM_INVALID

FlowModelID THM::FM_INVALID = registerFlowModelID()

Definition at line 41 of file ThermalHydraulicsApp.C.

◆ FM_SINGLE_PHASE

FlowModelID THM::FM_SINGLE_PHASE = registerFlowModelID()

◆ FM_TWO_PHASE

FlowModelID THM::FM_TWO_PHASE = registerFlowModelID()

Definition at line 43 of file ThermalHydraulicsApp.C.

◆ FM_TWO_PHASE_NCG

FlowModelID THM::FM_TWO_PHASE_NCG = registerFlowModelID()

Definition at line 44 of file ThermalHydraulicsApp.C.

◆ FRICTION_FACTOR_DARCY

const std::string THM::FRICTION_FACTOR_DARCY = "f_D"
static

Definition at line 19 of file THMNames.h.

Referenced by FlowModel1PhaseBase::addMomentumFrictionKernel().

◆ gravity_const

const Real THM::gravity_const = 9.81
static

◆ HEAT_FLUX_PERIMETER

const std::string THM::HEAT_FLUX_PERIMETER = "P_hf"
static

Definition at line 21 of file THMNames.h.

◆ HEAT_FLUX_WALL

const std::string THM::HEAT_FLUX_WALL = "q_wall"
static

Definition at line 20 of file THMNames.h.

◆ HEAT_TRANSFER_COEFFICIENT_WALL

const std::string THM::HEAT_TRANSFER_COEFFICIENT_WALL = "Hw"
static

Definition at line 22 of file THMNames.h.

◆ HYDRAULIC_DIAMETER

const std::string THM::HYDRAULIC_DIAMETER = "D_h"
static

◆ MASS_DIFFUSION_COEFFICIENT

const std::string THM::MASS_DIFFUSION_COEFFICIENT = "mass_diffusion_coefficient"
static

◆ MASS_FRACTION

const std::string THM::MASS_FRACTION = "mass_fraction"
static

◆ MAX_VARIABLE_LENGTH

const size_t THM::MAX_VARIABLE_LENGTH = 31
static

Definition at line 45 of file ThermalHydraulicsApp.h.

Referenced by Simulation::checkVariableNameLength().

◆ NUSSELT_NUMBER

const std::string THM::NUSSELT_NUMBER = "Nu"
static

Definition at line 26 of file THMNames.h.

◆ PRESSURE

const std::string THM::PRESSURE = "p"
static

◆ REYNOLDS_NUMBER

const std::string THM::REYNOLDS_NUMBER = "Re"
static

Definition at line 28 of file THMNames.h.

◆ RHOA

const std::string THM::RHOA = "rhoA"
static

◆ RHOEA

const std::string THM::RHOEA = "rhoEA"
static

◆ RHOUA

const std::string THM::RHOUA = "rhouA"
static

◆ SOUND_SPEED

const std::string THM::SOUND_SPEED = "c"
static

Definition at line 32 of file THMNames.h.

◆ SPECIFIC_ENTHALPY

const std::string THM::SPECIFIC_ENTHALPY = "h"
static

Definition at line 33 of file THMNames.h.

◆ SPECIFIC_HEAT_CONSTANT_PRESSURE

const std::string THM::SPECIFIC_HEAT_CONSTANT_PRESSURE = "cp"
static

Definition at line 34 of file THMNames.h.

◆ SPECIFIC_HEAT_CONSTANT_VOLUME

const std::string THM::SPECIFIC_HEAT_CONSTANT_VOLUME = "cv"
static

Definition at line 35 of file THMNames.h.

◆ SPECIFIC_INTERNAL_ENERGY

const std::string THM::SPECIFIC_INTERNAL_ENERGY = "e"
static

◆ SPECIFIC_TOTAL_ENTHALPY

const std::string THM::SPECIFIC_TOTAL_ENTHALPY = "H"
static

◆ SPECIFIC_VOLUME

const std::string THM::SPECIFIC_VOLUME = "v"
static

◆ Stefan_Boltzman_const

const Real THM::Stefan_Boltzman_const = 5.670e-8
static

Definition at line 32 of file Numerics.h.

◆ TEMPERATURE

const std::string THM::TEMPERATURE = "T"
static

◆ TEMPERATURE_WALL

const std::string THM::TEMPERATURE_WALL = "T_wall"
static

Definition at line 40 of file THMNames.h.

◆ THERMAL_CONDUCTIVITY

const std::string THM::THERMAL_CONDUCTIVITY = "k"
static

Definition at line 41 of file THMNames.h.

Referenced by FlowModel1PhaseBase::addHeatConductionDGKernel().

◆ UNITY

const std::string THM::UNITY = "unity"
static

Definition at line 42 of file THMNames.h.

◆ VELOCITY

const std::string THM::VELOCITY = "vel"
static

◆ VELOCITY_X

const std::string THM::VELOCITY_X = "vel_x"
static

◆ VELOCITY_Y

const std::string THM::VELOCITY_Y = "vel_y"
static

◆ VELOCITY_Z

const std::string THM::VELOCITY_Z = "vel_z"
static

◆ XIRHOA

const std::string THM::XIRHOA = "xirhoA"
static