www.mooseframework.org
ConvectiveFluxFunction.C
Go to the documentation of this file.
1 //* This file is part of the MOOSE framework
2 //* https://www.mooseframework.org
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 "ConvectiveFluxFunction.h"
11 
12 #include "Function.h"
13 
15 
18 {
20  params.addRequiredParam<FunctionName>("T_infinity", "Function describing far-field temperature");
21  params.addRequiredParam<FunctionName>("coefficient",
22  "Function describing heat transfer coefficient");
23  MooseEnum coef_func_type("TIME_AND_POSITION TEMPERATURE", "TIME_AND_POSITION");
24  params.addParam<MooseEnum>(
25  "coefficient_function_type",
26  coef_func_type,
27  "Type of function for heat transfer coefficient provided in 'coefficient' parameter");
28  params.addClassDescription(
29  "Determines boundary value by fluid heat transfer coefficient and far-field temperature");
30 
31  return params;
32 }
33 
35  : IntegratedBC(parameters),
36  _T_infinity(getFunction("T_infinity")),
37  _coefficient(getFunction("coefficient")),
38  _coef_func_type(getParam<MooseEnum>("coefficient_function_type").getEnum<CoefFuncType>())
39 {
40 }
41 
42 Real
44 {
45  Real coef;
47  coef = _coefficient.value(_t, _q_point[_qp]);
48  else
49  coef = _coefficient.value(_u[_qp], Point());
50 
51  return _test[_i][_qp] * coef * (_u[_qp] - _T_infinity.value(_t, _q_point[_qp]));
52 }
53 
54 Real
56 {
58  {
60  return _test[_i][_qp] * coef * _phi[_j][_qp];
61  }
62  else
63  {
64  const Real coef = _coefficient.value(_u[_qp]);
65  const Real dcoef_dT = _coefficient.timeDerivative(_u[_qp]);
66  return _test[_i][_qp] * (coef + (_u[_qp] - _T_infinity.value(_t, _q_point[_qp])) * dcoef_dT) *
67  _phi[_j][_qp];
68  }
69 }
const VariableTestValue & _test
registerMooseObject("HeatTransferApp", ConvectiveFluxFunction)
unsigned int _j
virtual Real computeQpJacobian() override
void addParam(const std::string &name, const std::initializer_list< typename T::value_type > &value, const std::string &doc_string)
virtual Real timeDerivative(Real t, const Point &p) const
static InputParameters validParams()
unsigned int _i
const VariablePhiValue & _phi
void addRequiredParam(const std::string &name, const std::string &doc_string)
unsigned int _qp
const MooseArray< Point > & _q_point
static InputParameters validParams()
const Function & _T_infinity
Far-field temperature.
const Function & _coefficient
Heat transfer coefficient.
const CoefFuncType _coef_func_type
Type of function used for the heat transfer coefficient.
DIE A HORRIBLE DEATH HERE typedef LIBMESH_DEFAULT_SCALAR_TYPE Real
void addClassDescription(const std::string &doc_string)
virtual Real computeQpResidual() override
virtual Real value(Real t, const Point &p) const
CoefFuncType
Enum used to define the type of function used for the heat transfer coefficient.
const VariableValue & _u
ConvectiveFluxFunction(const InputParameters &parameters)