https://mooseframework.inl.gov
Loading...
Searching...
No Matches
CoupledConvectiveHeatFluxBC.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
13
16{
19 "Convective heat transfer boundary condition with temperature and heat "
20 "transfer coefficent given by auxiliary variables.");
21 params.addCoupledVar("scale_factor", 1., "Scale factor to multiply the heat flux with");
22 params.addCoupledVar("alpha", 1., "Volume fraction of components");
23 params.addRequiredCoupledVar("T_infinity", "Field holding far-field temperature");
24 params.addRequiredCoupledVar("htc", "Heat transfer coefficient");
25
26 return params;
27}
28
30 : IntegratedBC(parameters),
31 _n_components(coupledComponents("T_infinity")),
32 _T_infinity(coupledValues("T_infinity")),
33 _htc(coupledValues("htc")),
34 _alpha(coupledValues("alpha")),
35 _scale_factor(coupledValue("scale_factor"))
36{
37 if (coupledComponents("alpha") != _n_components)
39 "alpha",
40 "The number of coupled components does not match the number of `T_infinity` components.");
41 if (coupledComponents("htc") != _n_components)
43 "htc",
44 "The number of coupled components does not match the number of `T_infinity` components.");
45}
46
47Real
49{
50 Real q = 0;
51 for (std::size_t c = 0; c < _n_components; c++)
52 q += (*_alpha[c])[_qp] * (*_htc[c])[_qp] * (_u[_qp] - (*_T_infinity[c])[_qp]);
53 return _test[_i][_qp] * q * _scale_factor[_qp];
54}
55
56Real
58{
59 Real dq = 0;
60 for (std::size_t c = 0; c < _n_components; c++)
61 dq += (*_alpha[c])[_qp] * (*_htc[c])[_qp] * _phi[_j][_qp];
62 return _test[_i][_qp] * dq * _scale_factor[_qp];
63}
registerMooseObject("HeatTransferApp", CoupledConvectiveHeatFluxBC)
unsigned int coupledComponents(const std::string &var_name) const
Boundary condition for convective heat flux where temperature and heat transfer coefficient are given...
CoupledConvectiveHeatFluxBC(const InputParameters &parameters)
const std::vector< const VariableValue * > _htc
Convective heat transfer coefficient.
const std::vector< const VariableValue * > _alpha
Volume fraction of individual phase.
const std::vector< const VariableValue * > _T_infinity
Far-field temperature fields for each component.
const VariableValue & _scale_factor
Scale factor.
const unsigned int _n_components
The number of components.
void addRequiredCoupledVar(const std::string &name, const std::string &doc_string)
void addClassDescription(const std::string &doc_string)
void addCoupledVar(const std::string &name, const std::string &doc_string)
unsigned int _qp
unsigned int _i
unsigned int _j
const VariableValue & _u
static InputParameters validParams()
const VariablePhiValue & _phi
const VariableTestValue & _test
void paramError(const std::string &param, Args... args) const