https://mooseframework.inl.gov
Loading...
Searching...
No Matches
ConvectiveFluxFunction.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
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");
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
42Real
44{
45 Real coef;
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
54Real
56{
58 {
59 Real coef = _coefficient.value(_t, _q_point[_qp]);
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}
registerMooseObject("HeatTransferApp", ConvectiveFluxFunction)
const Function & _coefficient
Heat transfer coefficient.
CoefFuncType
Enum used to define the type of function used for the heat transfer coefficient.
virtual Real computeQpJacobian() override
const Function & _T_infinity
Far-field temperature.
static InputParameters validParams()
ConvectiveFluxFunction(const InputParameters &parameters)
const CoefFuncType _coef_func_type
Type of function used for the heat transfer coefficient.
virtual Real computeQpResidual() override
virtual Real value(Real t, const Point &p) const
virtual Real timeDerivative(Real t, const Point &p) const
void addRequiredParam(const std::string &name, const std::string &doc_string)
void addParam(const std::string &name, const std::initializer_list< typename T::value_type > &value, const std::string &doc_string)
void addClassDescription(const std::string &doc_string)
unsigned int _qp
unsigned int _i
unsigned int _j
const MooseArray< Point > & _q_point
const VariableValue & _u
static InputParameters validParams()
const VariablePhiValue & _phi
const VariableTestValue & _test