https://mooseframework.inl.gov
Typedefs | Functions | Variables
THM Namespace Reference

Typedefs

typedef unsigned int FlowModelID
 

Functions

FlowModelID registerFlowModelID ()
 Register a new flow mode type and return its ID. More...
 
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. More...
 
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. More...
 
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. More...
 
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. More...
 
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. More...
 
DenseVector< RealapplyQuotientRule (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. More...
 
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. More...
 
template<typename T1 , typename T2 , typename T3 >
auto Prandtl (const T1 &cp, const T2 &mu, const T3 &k)
 Compute Prandtl number. More...
 
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. More...
 
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. More...
 
template<typename T1 , typename T2 >
auto Laplace (const T1 &surf_tension, const T2 &delta_rho, const Real &gravity_magnitude)
 Compute Laplace number (or coefficient) More...
 
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) More...
 
template<typename T1 , typename T2 >
auto Dean (const T1 &Re, const T2 &doD)
 Compute Dean number. More...
 
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. More...
 
ADReal vel_from_arhoA_arhouA (ADReal arhoA, ADReal arhouA)
 Computes velocity from alpha*rho*A and alpha*rho*u*A. More...
 
Real dvel_darhoA (Real arhoA, Real arhouA)
 Derivative of velocity w.r.t. More...
 
Real dvel_darhouA (Real arhoA)
 Derivative of velocity w.r.t. More...
 
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. More...
 
ADReal rho_from_arhoA_alpha_A (ADReal arhoA, ADReal alpha, ADReal A)
 Computes density from alpha*rho*A, alpha, and area. More...
 
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. More...
 
ADReal v_from_rhoA_A (ADReal rhoA, ADReal A)
 Computes specific volume and its derivatives from rho*A, and area. More...
 
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. More...
 
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. More...
 
void v_from_rho (Real rho, Real &v, Real &dv_drho)
 Computes specific volume and its derivative with respect to density. More...
 
Real dv_dalpha_liquid (Real area, Real arhoA, bool is_liquid)
 Derivative of specific volume wrt alpha_liquid. More...
 
Real dv_darhoA (Real area, Real arhoA)
 Derivative of specific volume wrt density equation solution variable. More...
 
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. More...
 
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. More...
 
ADReal e_from_E_vel (ADReal E, ADReal vel)
 Computes specific internal energy from specific total energy and velocity. More...
 
Real de_darhoA (Real arhoA, Real arhouA, Real arhoEA)
 Derivative of specific internal energy wrt density of the phase (rhoA or arhoA) More...
 
Real de_darhouA (Real arhoA, Real arhouA)
 Derivative of specific internal energy wrt momentum of the phase (rhouA or arhouA) More...
 
Real de_darhoEA (Real arhoA)
 Derivative of specific internal energy wrt total energy of the phase (rhoEA or arhoEA) More...
 
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. More...
 
ADReal E_from_arhoA_arhoEA (ADReal arhoA, ADReal arhoEA)
 Computes specific total energy from alpha*rho*A and alpha*rho*E*A. More...
 
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. More...
 
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. More...
 
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. More...
 
bool isInlet (ADReal vel, Real normal)
 
bool isOutlet (Real vel, Real normal)
 Determine if outlet boundary condition should be applied. More...
 
bool isOutlet (ADReal vel, Real normal)
 
template<typename T >
stringToEnum (const std::string &s)
 Converts a string to an enum. More...
 
template<typename 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. More...
 
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. More...
 
void computeOrthogonalDirections (const RealVectorValue &n_unnormalized, RealVectorValue &t1, RealVectorValue &t2)
 Computes two unit vectors orthogonal to the given vector. More...
 
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. More...
 
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. More...
 
DenseVector< RealapplyQuotientRule (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< Realdefault_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()

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

Definition at line 18 of file Numerics.C.

Referenced by areParallelVectors(), and TEST().

19 {
20  return MooseUtils::absoluteFuzzyEqual(a(0), b(0), tol) &&
23 }
bool absoluteFuzzyEqual(const T &var1, const T2 &var2, const T3 &tol=libMesh::TOLERANCE *libMesh::TOLERANCE)
const double tol

◆ 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.

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

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 }

◆ 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.

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

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 }
for(PetscInt i=0;i< nvars;++i)
auto index_range(const T &sizable)

◆ applyQuotientRule() [1/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 }
MooseUnits pow(const MooseUnits &, int)

◆ applyQuotientRule() [2/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 }

◆ applyQuotientRule() [3/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

◆ areParallelVectors()

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

Definition at line 26 of file Numerics.C.

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

27 {
28  const RealVectorValue c = a.cross(b);
30 }
const double tol
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.
Definition: Numerics.C:18

◆ associateSyntax()

void THM::associateSyntax ( Syntax syntax)

Definition at line 18 of file THMSyntax.C.

Referenced by ThermalHydraulicsApp::registerAll().

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

◆ 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.

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

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 }
bool absoluteFuzzyEqual(const T &var1, const T2 &var2, const T3 &tol=libMesh::TOLERANCE *libMesh::TOLERANCE)
TypeVector< Real > unit() const
TypeVector< typename CompareTypes< Real, T2 >::supertype > cross(const TypeVector< T2 > &v) const

◆ 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.

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

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

◆ 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.

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

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

◆ 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.

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

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

◆ 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 239 of file Numerics.h.

Referenced by TEST().

240 {
241  return Re * std::sqrt(doD);
242 }

◆ 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.

Referenced by TEST().

135 {
136  const Real sign = is_liquid ? 1.0 : -1.0;
137  return sign * (area / arhoA);
138 }
T sign(T x)
DIE A HORRIBLE DEATH HERE typedef LIBMESH_DEFAULT_SCALAR_TYPE Real

◆ 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.

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

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

◆ 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.

Referenced by TEST(), and vel_from_arhoA_arhouA().

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

◆ 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.

Referenced by TEST(), and vel_from_arhoA_arhouA().

79 {
80  return 1.0 / arhoA;
81 }

◆ E_from_arhoA_arhoEA() [1/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.

Referenced by TEST().

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

◆ E_from_arhoA_arhoEA() [2/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_arhouA_arhoEA() [1/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.

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

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_darhoA(Real arhoA, Real arhouA, Real arhoEA)
Derivative of specific internal energy wrt density of the phase (rhoA or arhoA)
Definition: Numerics.C:181
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_darhouA(Real arhoA, Real arhouA)
Derivative of specific internal energy wrt momentum of the phase (rhouA or arhouA) ...
Definition: Numerics.C:187

◆ e_from_arhoA_arhouA_arhoEA() [2/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_E_vel() [1/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.

Referenced by TEST().

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

◆ e_from_E_vel() [2/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()

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.

Referenced by TEST().

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

◆ 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.

Referenced by TEST().

184 {
185  return gravity_magnitude * beta * dT * std::pow(D_h, 3) * (rho_liquid * rho_liquid) /
186  (mu_liquid * mu_liquid);
187 }
MooseUnits pow(const MooseUnits &, int)

◆ h_from_e_p_rho() [1/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.

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

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

◆ h_from_e_p_rho() [2/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 }

◆ haveSameDirection()

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

Definition at line 33 of file Numerics.C.

Referenced by TEST().

34 {
35  return areParallelVectors(a, b, tol) && a * b > 0;
36 }
const double tol
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.
Definition: Numerics.C:26

◆ isInlet() [1/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.

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

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

◆ isInlet() [2/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)

◆ isOutlet() [1/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.

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

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

◆ isOutlet() [2/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 }
auto raw_value(const Eigen::Map< T > &in)

◆ 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 200 of file Numerics.h.

Referenced by Laplace(), and TEST().

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

◆ 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.

Referenced by InterWrapper1PhaseProblem::computeInterpolatedValue(), SubChannel1PhaseProblem::computeInterpolatedValue(), InterWrapper1PhaseProblem::computeInterpolationCoefficients(), SubChannel1PhaseProblem::computeInterpolationCoefficients(), ADWallHeatTransferCoefficientLyonMaterial::computeQpProperties(), ADWallHeatTransferCoefficientKazimiMaterial::computeQpProperties(), ADWallHeatTransferCoefficientSchadMaterial::computeQpProperties(), ADWallHeatTransferCoefficientMikityukMaterial::computeQpProperties(), and TEST().

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.
static const std::string cp
Definition: NS.h:121
static const std::string k
Definition: NS.h:130

◆ 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 43 of file THMSyntax.C.

Referenced by ThermalHydraulicsApp::registerAll().

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

◆ 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]

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.

Referenced by TEST().

86 {
87  rho = arhoA / (alpha * A);
88 
89  drho_darhoA = 1.0 / (alpha * A);
90  drho_dalpha = -arhoA / (alpha * alpha * A);
91 }
static const std::string alpha
Definition: NS.h:134

◆ rho_from_arhoA_alpha_A() [2/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 }
static const std::string alpha
Definition: NS.h:134

◆ sgn()

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

◆ stringToEnum() [1/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

Definition at line 18 of file Component1DConnection.C.

Referenced by SlopeReconstruction1DInterface< true >::SlopeReconstruction1DInterface(), and ViewFactorRayStudy::ViewFactorRayStudy().

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<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 }

◆ stringToEnum() [3/7]

template<>
Component1DConnection::EEndType 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() [4/7]

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

Definition at line 28 of file Component2D.C.

29 {
30  return stringToEnum<Component2D::ExternalBoundaryType>(
32 }
static const std::map< std::string, ExternalBoundaryType > _external_boundary_type_to_enum
map of external boundary type string to enum
Definition: Component2D.h:234

◆ stringToEnum() [5/7]

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

Definition at line 49 of file FlowChannelBase.C.

50 {
51  return stringToEnum<FlowChannelBase::EConvHeatTransGeom>(
53 }
static const std::map< std::string, EConvHeatTransGeom > _heat_transfer_geom_to_enum
Map of convective heat transfer geometry type to enum.

◆ stringToEnum() [6/7]

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

Definition at line 57 of file FlowChannelBase.C.

58 {
59  return stringToEnum<FlowChannelBase::EPipeType>(s, FlowChannelBase::_pipe_type_to_enum);
60 }
static const std::map< std::string, EPipeType > _pipe_type_to_enum
Map of pipe type to enum.

◆ stringToEnum() [7/7]

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

Definition at line 64 of file FlowChannelBase.C.

65 {
66  return stringToEnum<FlowChannelBase::EPipeLocation>(s, FlowChannelBase::_pipe_location_to_enum);
67 }
static const std::map< std::string, EPipeLocation > _pipe_location_to_enum
Map of pipe location to enum.

◆ v_from_arhoA_alpha_A() [1/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.

Referenced by TEST().

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

◆ v_from_arhoA_alpha_A() [2/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 }
static const std::string alpha
Definition: NS.h:134

◆ 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.

Referenced by TEST().

128 {
129  v = 1.0 / rho;
130  dv_drho = -1.0 / (rho * rho);
131 }
static const std::string v
Definition: NS.h:84

◆ v_from_rhoA_A() [1/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.

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

101 {
102  v = A / rhoA;
103  dv_drhoA = -A / (rhoA * rhoA);
104 }
static const std::string v
Definition: NS.h:84

◆ v_from_rhoA_A() [2/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 }

◆ vel_from_arhoA_arhouA() [1/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.

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

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

◆ vel_from_arhoA_arhouA() [2/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 }

◆ 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 218 of file Numerics.h.

Referenced by TEST().

223 {
224  return viscosity /
225  std::sqrt(rho_k * surf_tension * std::sqrt(surf_tension / gravity_magnitude / delta_rho));
226 }

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.

◆ 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