https://mooseframework.inl.gov
HeatStructureEnergyBase.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 "HeatConductionModel.h"
12 
15 {
17 
18  params.addClassDescription("Computes the total energy for a heat structure.");
19 
20  params.addParam<Real>("n_units", 1., "Number of units of heat structure represents");
21  params.addParam<Real>("T_ref", 0, "Reference temperature");
22 
23  return params;
24 }
25 
27  : ElementIntegralPostprocessor(parameters),
28  _n_units(getParam<Real>("n_units")),
29  _T_ref(getParam<Real>("T_ref")),
30  _rho(getMaterialPropertyByName<Real>(HeatConductionModel::DENSITY)),
31  _cp(getMaterialPropertyByName<Real>(HeatConductionModel::SPECIFIC_HEAT_CONSTANT_PRESSURE)),
32  _T_var(&_fe_problem.getStandardVariable(_tid, HeatConductionModel::TEMPERATURE)),
33  _T(_T_var->sln())
34 {
36 }
37 
38 Real
40 {
41  return _rho[_qp] * _cp[_qp] * (_T[_qp] - _T_ref) * _n_units;
42 }
virtual Real computeQpIntegral() override
static const std::string SPECIFIC_HEAT_CONSTANT_PRESSURE
Definition: THMNames.h:34
static InputParameters validParams()
void addParam(const std::string &name, const std::initializer_list< typename T::value_type > &value, const std::string &doc_string)
HeatStructureEnergyBase(const InputParameters &parameters)
const Real _n_units
Number of units that heat structure is multiplied by.
static InputParameters validParams()
const Real & _T_ref
Reference temperature.
const VariableValue & _T
Temperature variable value.
void addMooseVariableDependency(MooseVariableFieldBase *var)
MooseVariable * _T_var
Temperature variable.
DIE A HORRIBLE DEATH HERE typedef LIBMESH_DEFAULT_SCALAR_TYPE Real
void addClassDescription(const std::string &doc_string)
Provides functions to setup the heat conduction model.
const MaterialProperty< Real > & _cp
Isobaric specific heat capacity.
const MaterialProperty< Real > & _rho
Density of the heat structure.
static const std::string DENSITY
Definition: THMNames.h:16