https://mooseframework.inl.gov
OneDEnergyWallHeating.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 "OneDEnergyWallHeating.h"
11 
12 registerMooseObject("ThermalHydraulicsApp", OneDEnergyWallHeating);
13 
16 {
18  params.addClassDescription("Adds a convective heat flux term from a wall temperature");
19  params.addRequiredCoupledVar("rhoA", "");
20  params.addRequiredCoupledVar("rhouA", "");
21  params.addRequiredCoupledVar("rhoEA", "Energy equation variable");
22  params.addRequiredCoupledVar("P_hf", "heat flux perimeter");
23  params.addCoupledVar("T_wall", "Wall temperature as a field variable");
24  params.addRequiredParam<MaterialPropertyName>("Hw",
25  "Convective heat transfer coefficient, W/m^2-K");
26  params.addRequiredParam<MaterialPropertyName>("T", "Temperature material property");
27 
28  return params;
29 }
30 
33  _temperature(getMaterialProperty<Real>("T")),
34  _dT_drhoA(getMaterialPropertyDerivativeTHM<Real>("T", "rhoA")),
35  _dT_drhouA(getMaterialPropertyDerivativeTHM<Real>("T", "rhouA")),
36  _dT_drhoEA(getMaterialPropertyDerivativeTHM<Real>("T", "rhoEA")),
37  _Hw(getMaterialProperty<Real>("Hw")),
38  _T_wall(coupledValue("T_wall")),
39  _P_hf(coupledValue("P_hf")),
40  _rhoA_var_number(coupled("rhoA")),
41  _rhouA_var_number(coupled("rhouA"))
42 {
43 }
44 
45 Real
47 {
48  return _Hw[_qp] * _P_hf[_qp] * (_temperature[_qp] - _T_wall[_qp]) * _test[_i][_qp];
49 }
50 
51 Real
53 {
54  return _Hw[_qp] * _P_hf[_qp] * _dT_drhoEA[_qp] * _phi[_j][_qp] * _test[_i][_qp];
55 }
56 
57 Real
59 {
60  if (jvar == _rhoA_var_number)
61  return _Hw[_qp] * _P_hf[_qp] * _dT_drhoA[_qp] * _phi[_j][_qp] * _test[_i][_qp];
62 
63  else if (jvar == _rhouA_var_number)
64  return _Hw[_qp] * _P_hf[_qp] * _dT_drhouA[_qp] * _phi[_j][_qp] * _test[_i][_qp];
65 
66  else
67  return 0.;
68 }
virtual Real computeQpJacobian()
const MaterialProperty< Real > & _dT_drhoA
static InputParameters validParams()
const MaterialProperty< Real > & _Hw
const VariableValue & _T_wall
static InputParameters validParams()
void addRequiredParam(const std::string &name, const std::string &doc_string)
virtual Real computeQpOffDiagJacobian(unsigned int jvar)
const VariableValue & _P_hf
OneDEnergyWallHeating(const InputParameters &parameters)
void addCoupledVar(const std::string &name, const std::string &doc_string)
const MaterialProperty< Real > & _temperature
void addRequiredCoupledVar(const std::string &name, const std::string &doc_string)
DIE A HORRIBLE DEATH HERE typedef LIBMESH_DEFAULT_SCALAR_TYPE Real
registerMooseObject("ThermalHydraulicsApp", OneDEnergyWallHeating)
void addClassDescription(const std::string &doc_string)
const MaterialProperty< Real > & _dT_drhoEA
const MaterialProperty< Real > & _dT_drhouA
virtual Real computeQpResidual()