https://mooseframework.inl.gov
GapFluxModelRadiationBase.C
Go to the documentation of this file.
1 //* This file is part of the MOOSE framework
2 //* https://mooseframework.inl.gov
3 //*
4 //* All rights reserved, see COPYRIGHT for full restrictions
5 //* https://github.com/idaholab/moose/blob/master/COPYRIGHT
6 //*
7 //* Licensed under LGPL 2.1, please see LICENSE for details
8 //* https://www.gnu.org/licenses/lgpl-2.1.html
9 
11 
14 {
16  params.addParam<Real>("stefan_boltzmann", 5.670373e-8, "Stefan-Boltzmann constant");
17  params.addRangeCheckedParam<Real>("primary_emissivity",
18  1,
19  "primary_emissivity>=0 & primary_emissivity<=1",
20  "The emissivity of the primary surface");
21  params.addRangeCheckedParam<Real>("secondary_emissivity",
22  1,
23  "secondary_emissivity>=0 & secondary_emissivity<=1",
24  "The emissivity of the secondary surface");
25  params.addParamNamesToGroup("stefan_boltzmann primary_emissivity secondary_emissivity",
26  "Gap Radiative Flux");
27  return params;
28 }
29 
31  : GapFluxModelBase(parameters),
32  _stefan_boltzmann(getParam<Real>("stefan_boltzmann")),
33  _radial_coord(),
34  _eps_primary(getParam<Real>("primary_emissivity")),
35  _eps_secondary(getParam<Real>("secondary_emissivity")),
36  _has_zero_emissivity(_eps_primary == 0 && _eps_secondary == 0),
37  _parallel_plate_emissivity(
38  _has_zero_emissivity ? 0 : 1 / (1.0 / _eps_primary + 1.0 / _eps_secondary - 1))
39 {
40  const auto & coord_systems = _mesh.getCoordSystem();
41  mooseAssert(coord_systems.size(), "This better not be empty");
42  _coord_system = coord_systems.begin()->second;
43  for (const auto [sub_id, coord_system_type] : coord_systems)
44  {
45  libmesh_ignore(sub_id);
46  if (coord_system_type != _coord_system)
47  mooseError(
48  "Multiple coordinate system types detected. If you need this object to work with "
49  "multiple coordinate system types in the same mesh, please contact a MOOSE developer");
50  }
51 
54 }
55 
56 Real
58 {
60  return 0;
61 
62  switch (_coord_system)
63  {
64  case Moose::COORD_XYZ:
66 
67  case Moose::COORD_RZ:
68  {
69  const auto primary_r = _primary_point.point(_radial_coord);
70  const auto secondary_r = _secondary_point.point(_radial_coord);
71  const bool primary_is_inner = primary_r < secondary_r;
72  const auto inner_r = primary_is_inner ? primary_r : secondary_r;
73  const auto outer_r = primary_is_inner ? secondary_r : primary_r;
74  const auto inner_eps = primary_is_inner ? _eps_primary : _eps_secondary;
75  const auto outer_eps = primary_is_inner ? _eps_secondary : _eps_primary;
76 
77  // Taken from our documentation of FVInfiniteCylinderRadiativeBC
78  return inner_eps * outer_eps * outer_r /
79  (outer_eps * outer_r + inner_eps * inner_r * (1 - outer_eps));
80  }
81 
82  default:
83  mooseError("spherical coordinates not yet supported for this object");
84  }
85 }
86 
87 ADReal
89  const ADReal & primary_T) const
90 {
91  // We add 'surface_integration_factor' to account for the surface integration of the conductance
92  // due to radiation.
93  const ADReal temp_func =
94  (primary_T * primary_T + secondary_T * secondary_T) * (primary_T + secondary_T);
95 
96  return (primary_T - secondary_T) * _stefan_boltzmann * temp_func * emissivity() *
98 }
libMesh::Point point
Moose::ElemPointArg _primary_point
The primary quadrature point location.
void addParam(const std::string &name, const std::initializer_list< typename T::value_type > &value, const std::string &doc_string)
unsigned int _radial_coord
The index for the radial coordinate when performing RZ simulations.
const Real _parallel_plate_emissivity
The theoretical infinite parallel-plate geometry surface emissivity, which is a function of both the ...
GapFluxModelRadiationBase(const InputParameters &parameters)
DualNumber< Real, DNDerivativeType, true > ADReal
Base class for gap flux models used by ModularGapConductanceConstraint.
void libmesh_ignore(const Args &...)
unsigned int getAxisymmetricRadialCoord() const
Real emissivity() const
computes a single emissivity coefficient based on the coordinate system and the individual secondary ...
const Real _stefan_boltzmann
Stefan-Boltzmann constant.
Moose::CoordinateSystemType getCoordSystem(SubdomainID sid) const
DIE A HORRIBLE DEATH HERE typedef LIBMESH_DEFAULT_SCALAR_TYPE Real
const Moose::CoordinateSystemType & _coord_sys
const Real _eps_secondary
The emissivity of the secondary surface.
static InputParameters validParams()
void mooseError(Args &&... args) const
const bool _has_zero_emissivity
Whether both primary and secondary emissivities are zero.
void addRangeCheckedParam(const std::string &name, const T &value, const std::string &parsed_function, const std::string &doc_string)
const Real _eps_primary
The emissivity of the primary surface.
Moose::CoordinateSystemType _coord_system
The coordinate system type, e.g. XYZ or RZ.
static InputParameters validParams()
ADReal _surface_integration_factor
Moose::ElemPointArg _secondary_point
The secondary quadrature point location.
ADReal computeRadiationFlux(const ADReal &secondary_T, const ADReal &primary_T) const
computes the radiation flux based on the input secondary and primary temperatures ...
void addParamNamesToGroup(const std::string &space_delim_names, const std::string group_name)