https://mooseframework.inl.gov
Loading...
Searching...
No Matches
ViewFactorVectorPostprocessor.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 "ViewFactorBase.h"
13
16 ViewfactorVectorPostprocessor,
17 "08/30/2026 24:00",
19
22{
25 "VectorPostprocessor for accessing view factors from GrayLambertSurfaceRadiationBase UO");
26 params.addParam<UserObjectName>("view_factor_object_name", "Name of the ViewFactorBase UO");
27 // TODO: after deleting this parameter, make 'view_factor_object_name' required
28 // and delete the associated error checks
29 params.addDeprecatedParam<UserObjectName>("surface_radiation_object_name",
30 "Name of the GrayLambertSurfaceRadiationBase UO",
31 "Please use 'view_factor_object_name' instead.");
32 return params;
33}
34
36 : GeneralVectorPostprocessor(parameters),
37 _view_factor_uo(isParamValid("view_factor_object_name")
38 ? &getUserObject<ViewFactorBase>("view_factor_object_name")
39 : nullptr),
40 _glsr_uo(isParamValid("surface_radiation_object_name")
41 ? &getUserObject<GrayLambertSurfaceRadiationBase>("surface_radiation_object_name")
42 : nullptr),
43 _surface_ids(declareVector("subdomain_id"))
44{
45 if (!isParamValid("surface_radiation_object_name") && !isParamValid("view_factor_object_name"))
46 mooseError("The parameter 'view_factor_object_name' must be provided.");
47 if (isParamValid("surface_radiation_object_name") && isParamValid("view_factor_object_name"))
48 mooseError("The parameters 'surface_radiation_object_name' and 'view_factor_object_name' "
49 "cannot both be provided. Please delete 'surface_radiation_object_name'.");
50}
51
52void
54{
55 // setup of surface_id arrays
56 std::set<BoundaryID> bids;
57 if (_glsr_uo)
58 bids = _glsr_uo->getSurfaceIDs();
61
62 unsigned int ns = bids.size();
63 _surface_ids.resize(ns);
64 unsigned int j = 0;
65 for (auto & bid : bids)
66 {
67 _surface_ids[j] = bid;
68 ++j;
69 }
70
71 // setup of view factors
72 j = _vf.size();
73 _vf.resize(ns);
74 for (; j < ns; ++j)
75 {
76 std::stringstream ss;
77 ss << "vf_to_" << _surface_ids[j];
78 _vf[j] = &declareVector(ss.str());
79 _vf[j]->resize(ns);
80 }
81}
82
83void
85{
87 {
88 for (unsigned int i = 0; i < _surface_ids.size(); ++i)
89 for (unsigned int j = 0; j < _surface_ids.size(); ++j)
91 }
92
93 if (_glsr_uo)
94 {
95 for (unsigned int i = 0; i < _surface_ids.size(); ++i)
96 for (unsigned int j = 0; j < _surface_ids.size(); ++j)
98 }
99}
registerMooseObject("HeatTransferApp", ViewFactorVectorPostprocessor)
registerMooseObjectRenamed("HeatTransferApp", ViewfactorVectorPostprocessor, "08/30/2026 24:00", ViewFactorVectorPostprocessor)
virtual const std::set< BoundaryID > & boundaryIDs() const
static InputParameters validParams()
GrayLambertSurfaceRadiationBase computes the heat flux on a set of surfaces in radiative heat transfe...
Real getViewFactor(BoundaryID from_id, BoundaryID to_id) const
void addDeprecatedParam(const std::string &name, const T &value, const std::string &doc_string, const std::string &deprecation_message)
void addParam(const std::string &name, const std::initializer_list< typename T::value_type > &value, const std::string &doc_string)
void addClassDescription(const std::string &doc_string)
void mooseError(Args &&... args) const
bool isParamValid(const std::string &name) const
VectorPostprocessorValue & declareVector(const std::string &vector_name)
A base class for automatic computation of view factors between sidesets.
Real getViewFactor(BoundaryID from_id, BoundaryID to_id) const
public interface for obtaining view factors
VectorPostprocessorValue & _surface_ids
The surface ids of the data.
std::vector< VectorPostprocessorValue * > _vf
The data that this VPP harvests off the surface radiation userobject.
const ViewFactorBase *const _view_factor_uo
The view factor user object.
ViewFactorVectorPostprocessor(const InputParameters &parameters)
const GrayLambertSurfaceRadiationBase *const _glsr_uo
the surface radiation user object