https://mooseframework.inl.gov
NormalizedHeatStructureResidualNorm.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 "ThermalSolidProperties.h"
12 
14 
17 {
19 
20  params.addClassDescription("Computes a normalized residual norm for a heat structure.");
21 
22  params.addRequiredParam<Real>("T_ref", "Reference temperature [K]");
23  params.addRequiredParam<UserObjectName>("solid_properties", "Solid properties object");
24  params.addRequiredParam<PostprocessorName>("ref_elem_size",
25  "Reference element size [units vary]");
26 
27  return params;
28 }
29 
31  const InputParameters & parameters)
32  : DiscreteVariableResidualNorm(parameters),
33  _ref_elem_size(getPostprocessorValue("ref_elem_size")),
34  _initialized(false)
35 {
36 }
37 
38 void
40 {
42 
43  // This cannot be done in constructor or initialSetup() due to some solid
44  // properties not being initialized yet.
45  if (!_initialized)
46  {
48  _initialized = true;
49  }
50 }
51 
52 Real
54 {
55  const auto & sp = getUserObject<ThermalSolidProperties>("solid_properties");
56  const auto T_ref = getParam<Real>("T_ref");
57  const auto rho_ref = sp.rho_from_T(T_ref);
58  const auto cp_ref = sp.cp_from_T(T_ref);
59 
60  return rho_ref * cp_ref * T_ref * _ref_elem_size;
61 }
62 
63 Real
65 {
67 }
virtual PostprocessorValue getValue() const override
const PostprocessorValue & _ref_elem_size
Reference element size.
static InputParameters validParams()
void addRequiredParam(const std::string &name, const std::string &doc_string)
NormalizedHeatStructureResidualNorm(const InputParameters &parameters)
DIE A HORRIBLE DEATH HERE typedef LIBMESH_DEFAULT_SCALAR_TYPE Real
void addClassDescription(const std::string &doc_string)
virtual void initialize() override
Computes a normalized residual norm for a heat structure.
registerMooseObject("ThermalHydraulicsApp", NormalizedHeatStructureResidualNorm)
Real computeNormalization() const
Computes (but does not update) the normalization constant.