https://mooseframework.inl.gov
Loading...
Searching...
No Matches
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
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
38void
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
52Real
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
63Real
registerMooseObject("ThermalHydraulicsApp", NormalizedHeatStructureResidualNorm)
static InputParameters validParams()
virtual PostprocessorValue getValue() const override
virtual void initialize() override
void addRequiredParam(const std::string &name, const std::string &doc_string)
void addClassDescription(const std::string &doc_string)
Computes a normalized residual norm for a heat structure.
const PostprocessorValue & _ref_elem_size
Reference element size.
NormalizedHeatStructureResidualNorm(const InputParameters &parameters)
Real computeNormalization() const
Computes (but does not update) the normalization constant.