https://mooseframework.inl.gov
FVFunctorConvectiveHeatFluxBC.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 #include "Function.h"
12 
14 
17 {
19  params.addClassDescription(
20  "Convective heat transfer boundary condition with temperature and heat "
21  "transfer coefficient given by functors.");
22  params.addRequiredParam<MooseFunctorName>("T_solid", "Functor for wall temperature");
23  params.addRequiredParam<MooseFunctorName>("T_bulk", "Functor for far-field temperature");
24  params.addRequiredParam<MooseFunctorName>("heat_transfer_coefficient",
25  "Functor for heat transfer coefficient");
26  params.addRequiredParam<bool>("is_solid", "Whether this kernel acts on the solid temperature");
27 
28  return params;
29 }
30 
32  : FVFluxBC(parameters),
33  _T_solid(getFunctor<ADReal>("T_solid")),
34  _T_bulk(getFunctor<ADReal>("T_bulk")),
35  _htc(getFunctor<ADReal>("heat_transfer_coefficient")),
36  _is_solid(getParam<bool>("is_solid"))
37 {
38 }
39 
40 ADReal
42 {
43  // Allow the functors to pick their side evaluation since either T_bulk or T_solid is likely not
44  // defined on this boundary condition's side
45  const Moose::FaceArg face{
46  _face_info, Moose::FV::LimiterType::CentralDifference, true, false, nullptr, nullptr};
47  const auto flux = _htc(face, determineState()) *
48  (_T_bulk(face, determineState()) - _T_solid(face, determineState()));
49  if (_is_solid)
50  return -flux;
51  else
52  return flux;
53 }
const FaceInfo * _face_info
static InputParameters validParams()
registerMooseObject("HeatTransferApp", FVFunctorConvectiveHeatFluxBC)
Moose::StateArg determineState() const
const bool _is_solid
Boolean specifying if domain is solid or fluid.
DualNumber< Real, DNDerivativeType, true > ADReal
void addRequiredParam(const std::string &name, const std::string &doc_string)
Robin boundary condition (temperatures) for finite volume scheme between a solid and fluid where the ...
FVFunctorConvectiveHeatFluxBC(const InputParameters &parameters)
const Moose::Functor< ADReal > & _T_bulk
Far-field temperature functor.
virtual ADReal computeQpResidual() override
void addClassDescription(const std::string &doc_string)
const Moose::Functor< ADReal > & _T_solid
Wall temperature functor.
const Moose::Functor< ADReal > & _htc
Convective heat transfer coefficient functor.