https://mooseframework.inl.gov
Loading...
Searching...
No Matches
ConstantViewFactorSurfaceRadiation.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
14 "08/30/2026 24:00");
15
18{
20 params.addRequiredParam<std::vector<std::vector<Real>>>(
21 "view_factors", "The view factors from sideset i to sideset j.");
23 "ConstantViewFactorSurfaceRadiation computes radiative heat transfer between side sets and "
24 "the view factors are provided in the input file");
25 return params;
26}
27
29 const InputParameters & parameters)
31{
32 mooseDeprecated("ConstantViewFactorSurfaceRadiation is deprecated. Please use "
33 "ViewFactorObjectSurfaceRadiation in conjunction with SpecifiedViewFactor to "
34 "achieve the same effect as this object.");
35}
36
37std::vector<std::vector<Real>>
39{
40 std::vector<std::vector<Real>> vf = getParam<std::vector<std::vector<Real>>>("view_factors");
41
42 // check that the input has the right format
43 if (vf.size() != _n_sides)
44 paramError("view_factors",
45 "Leading dimension of view_factors must be equal to number of side sets.");
46
47 for (unsigned int i = 0; i < _n_sides; ++i)
48 if (vf[i].size() != _n_sides)
49 paramError("view_factors",
50 "view_factors must be provided as square array. Row ",
51 i,
52 " has ",
53 vf[i].size(),
54 " entries.");
55 return vf;
56}
57
58void
60{
62
63 // check row-sum and normalize if necessary
64 for (unsigned int i = 0; i < _n_sides; ++i)
65 {
66 Real sum = 0;
67 for (auto & v : _view_factors[i])
68 sum += v;
69
70 // an error of 5% is acceptable, but more indicates an error in the
71 // problem setup
72 if (std::abs(sum - 1) > 0.05)
73 mooseError("view_factors row ", i, " sums to ", sum);
74
75 // correct view factors
76 for (auto & v : _view_factors[i])
77 v /= sum;
78 }
79}
registerMooseObjectDeprecated("HeatTransferApp", ConstantViewFactorSurfaceRadiation, "08/30/2026 24:00")
const double v
ConstantViewFactorSurfaceRadiation computes radiative heat transfer between side sets and the view fa...
ConstantViewFactorSurfaceRadiation(const InputParameters &parameters)
virtual std::vector< std::vector< Real > > setViewFactors() override
a purely virtual function that defines where view factors come from
GrayLambertSurfaceRadiationBase computes the heat flux on a set of surfaces in radiative heat transfe...
unsigned int _n_sides
number of active boundary ids
std::vector< std::vector< Real > > _view_factors
the view factors which are set by setViewFactors by derived classes
void addRequiredParam(const std::string &name, const std::string &doc_string)
void addClassDescription(const std::string &doc_string)
void mooseDeprecated(Args &&... args) const
void paramError(const std::string &param, Args... args) const
void mooseError(Args &&... args) const