https://mooseframework.inl.gov
Loading...
Searching...
No Matches
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
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
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
44Real
46{
47 const auto elem_info = (_current_face_type == FaceInfo::VarFaceNeighbors::ELEM)
50
51 return _var.getElemValue(*elem_info, determineState());
52}
53
54Real
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
71Real
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
79Real
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
87Real
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}
97Real
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}
registerMooseObject("NavierStokesApp", LinearFVRobinCHTBC)
const ElemInfo * elemInfo() const
const ElemInfo * neighborInfo() const
void addRequiredParam(const std::string &name, const std::string &doc_string)
void addClassDescription(const std::string &doc_string)
static InputParameters validParams()
const FaceInfo * _current_face_info
Moose::FaceArg singleSidedFaceArg(const FaceInfo *fi, Moose::FV::LimiterType limiter_type=Moose::FV::LimiterType::CentralDifference, bool correct_skewness=false) const
Moose::FaceArg functorFaceArg(const FunctorType &functor, const FaceInfo *fi, Moose::FV::LimiterType limiter_type=Moose::FV::LimiterType::CentralDifference, bool correct_skewness=false) const
FaceInfo::VarFaceNeighbors _current_face_type
MooseLinearVariableFV< Real > & _var
Base class that allows error checking for CHT applications.
Conjugate heat transfer BC for Robin boundary condition-based coupling.
const Moose::Functor< Real > & _htc
The virtual convective heat transfer coefficient.
const Moose::Functor< Real > & _incoming_flux
The incoming diffusive flux on the intervace.
virtual Real computeBoundaryGradientRHSContribution() const override
virtual Real computeBoundaryGradientMatrixContribution() const override
virtual Real computeBoundaryValue() const override
static InputParameters validParams()
LinearFVRobinCHTBC(const InputParameters &parameters)
Class constructor.
const Moose::Functor< Real > & _k
The thermal conductivity of the material.
virtual Real computeBoundaryNormalGradient() const override
virtual Real computeBoundaryValueRHSContribution() const override
virtual Real computeBoundaryValueMatrixContribution() const override
const Moose::Functor< Real > & _surface_temperature
The prescribed temperature on the interface.
Real getElemValue(const ElemInfo &elem_info, const StateArg &state) const
Moose::StateArg determineState() const