https://mooseframework.inl.gov
LinearFVRobinCHTBC.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 
10 #include "LinearFVRobinCHTBC.h"
11 #include "NS.h"
12 
13 registerMooseObject("NavierStokesApp", LinearFVRobinCHTBC);
14 
17 {
19  params.addRequiredParam<MooseFunctorName>("h", "The convective heat transfer coefficient.");
20  params.addRequiredParam<MooseFunctorName>("incoming_flux",
21  "The incoming diffusive flux on the interface.");
22  params.addRequiredParam<MooseFunctorName>("surface_temperature",
23  "The prescribed temperature on the interface.");
24  params.addRequiredParam<MooseFunctorName>(
25  "thermal_conductivity",
26  "The thermal conductivity of the material. Only used to compute the pure normal gradient of "
27  "the variable on the boundary.");
28 
29  params.addClassDescription(
30  "Conjugate heat transfer BC for Robin boundary condition-based coupling.");
31  return params;
32 }
33 
35  : LinearFVAdvectionDiffusionBC(parameters),
37  _htc(getFunctor<Real>("h")),
38  _k(getFunctor<Real>("thermal_conductivity")),
39  _incoming_flux(getFunctor<Real>("incoming_flux")),
40  _surface_temperature(getFunctor<Real>("surface_temperature"))
41 {
42 }
43 
44 Real
46 {
47  const auto elem_info = (_current_face_type == FaceInfo::VarFaceNeighbors::ELEM)
50 
51  return _var.getElemValue(*elem_info, determineState());
52 }
53 
54 Real
56 {
57  const auto elem_info = (_current_face_type == FaceInfo::VarFaceNeighbors::ELEM)
60  const auto state = determineState();
61  const auto current_face = singleSidedFaceArg(_current_face_info);
62  const auto surface_temperature_face = functorFaceArg(_surface_temperature, _current_face_info);
63  const auto incoming_flux_face = functorFaceArg(_incoming_flux, _current_face_info);
64 
65  return (_htc(current_face, state) * (_var.getElemValue(*elem_info, determineState()) -
66  _surface_temperature(surface_temperature_face, state)) +
67  _incoming_flux(incoming_flux_face, state)) /
68  _k(current_face, state);
69 }
70 
71 Real
73 {
74  // We approximate the face value with the cell value here.
75  // TODO: we can extend this to a 2-term expansion at some point when the need arises.
76  return 1.0;
77 }
78 
79 Real
81 {
82  // We approximate the face value with the cell value, we
83  // don't need to add anything to the right hand side.
84  return 0.0;
85 }
86 
87 Real
89 {
90  const auto face = singleSidedFaceArg(_current_face_info);
91  const auto state = determineState();
92 
93  // We just put the heat transfer coefficient on the diagonal (multiplication with the
94  // surface area is taken care of in the kernel).
95  return _htc(face, state);
96 }
97 Real
99 {
100  const auto state = determineState();
101  const auto current_face = singleSidedFaceArg(_current_face_info);
102  const auto surface_temperature_face = functorFaceArg(_surface_temperature, _current_face_info);
103  const auto incoming_flux_face = functorFaceArg(_incoming_flux, _current_face_info);
104 
105  return _htc(current_face, state) * _surface_temperature(surface_temperature_face, state) +
106  _incoming_flux(incoming_flux_face, state);
107 }
virtual Real computeBoundaryValue() const override
Moose::FaceArg functorFaceArg(const FunctorType &functor, const FaceInfo *fi, Moose::FV::LimiterType limiter_type=Moose::FV::LimiterType::CentralDifference, bool correct_skewness=false) const
Base class that allows error checking for CHT applications.
registerMooseObject("NavierStokesApp", LinearFVRobinCHTBC)
Moose::StateArg determineState() const
const ElemInfo * neighborInfo() const
const ElemInfo * elemInfo() const
virtual Real computeBoundaryGradientRHSContribution() const override
const Moose::Functor< Real > & _surface_temperature
The prescribed temperature on the interface.
void addRequiredParam(const std::string &name, const std::string &doc_string)
static InputParameters validParams()
FaceInfo::VarFaceNeighbors _current_face_type
MooseLinearVariableFV< Real > & _var
const Moose::Functor< Real > & _k
The thermal conductivity of the material.
virtual Real computeBoundaryValueMatrixContribution() const override
DIE A HORRIBLE DEATH HERE typedef LIBMESH_DEFAULT_SCALAR_TYPE Real
LinearFVRobinCHTBC(const InputParameters &parameters)
Class constructor.
const FaceInfo * _current_face_info
const Moose::Functor< Real > & _incoming_flux
The incoming diffusive flux on the intervace.
virtual Real computeBoundaryValueRHSContribution() const override
Real getElemValue(const ElemInfo &elem_info, const StateArg &state) const
void addClassDescription(const std::string &doc_string)
const Moose::Functor< Real > & _htc
The virtual convective heat transfer coefficient.
virtual Real computeBoundaryGradientMatrixContribution() const override
Moose::FaceArg singleSidedFaceArg(const FaceInfo *fi, Moose::FV::LimiterType limiter_type=Moose::FV::LimiterType::CentralDifference, bool correct_skewness=false) const
Conjugate heat transfer BC for Robin boundary condition-based coupling.
static InputParameters validParams()
virtual Real computeBoundaryNormalGradient() const override