https://mooseframework.inl.gov
CHTHandler.h
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 
10 #pragma once
11 
12 #include "MooseObject.h"
13 #include "FaceCenteredMapFunctor.h"
14 #include "SystemBase.h"
15 #include "NS.h"
16 
17 class LinearFVFluxKernel;
19 
20 namespace NS
21 {
22 namespace FV
23 {
24 
29 class CHTHandler : public MooseObject
30 {
31 public:
34 
36 
38  void linkEnergySystems(SystemBase * solid_energy_system,
39  SystemBase * fluid_energy_system,
40  std::vector<SystemBase *> pm_radiation_systems);
41 
45 
48 
51 
54 
56  bool converged() const;
57 
59  void resetCHTConvergence();
60 
62  void incrementCHTIterators();
63 
65  void sumIntegratedFluxes();
66 
68  void printIntegratedFluxes() const;
69 
71  void resetIntegratedFluxes();
72 
74  virtual bool enabled() const override final;
75 
76 protected:
79 
82 
85 
88 
90  std::vector<SystemBase *> _pm_radiation_systems;
91 
93  std::vector<BoundaryName> _cht_boundary_names;
94 
96  std::vector<BoundaryID> _cht_boundary_ids;
97 
99  const unsigned int _max_cht_fpi;
100 
103 
106  std::vector<std::vector<Real>> _cht_flux_relaxation_factor;
107 
110  std::vector<std::vector<Real>> _cht_temperature_relaxation_factor;
111 
113  std::vector<unsigned int> _cht_system_numbers;
114 
116  std::vector<unsigned int> _cht_pm_radiation_system_numbers;
117 
119  std::vector<std::vector<const FaceInfo *>> _cht_face_info;
120 
122  std::vector<LinearFVFluxKernel *> _cht_conduction_kernels;
123 
125  std::vector<LinearFVFluxKernel *> _cht_pm_radiation_kernels;
126 
128  std::vector<std::vector<LinearFVBoundaryCondition *>> _cht_boundary_conditions;
129 
131  std::vector<std::vector<LinearFVBoundaryCondition *>> _cht_pm_radiation_boundary_conditions;
132 
135  std::vector<std::vector<FaceCenteredMapFunctor<Real, std::unordered_map<dof_id_type, Real>>>>
137 
139  std::vector<std::vector<Real>> _integrated_boundary_heat_flux;
140 
143  std::vector<std::vector<FaceCenteredMapFunctor<Real, std::unordered_map<dof_id_type, Real>>>>
145 
146 private:
148  unsigned int _fpi_it;
149 };
150 
151 inline bool
153 {
154  return !_cht_boundary_names.empty();
155 }
156 
157 inline void
159 {
160  _fpi_it = 0;
161 }
162 
163 inline void
165 {
166  _fpi_it++;
167 }
168 
169 } // End FV namespace
170 } // End Moose namespace
std::vector< unsigned int > _cht_system_numbers
The solid (0) and fluid (1) system numbers.
Definition: CHTHandler.h:113
void updateCHTBoundaryCouplingFields(const NS::CHTSide side)
Update the coupling fields for.
Definition: CHTHandler.C:392
This class provides an interface for managing conjugate heat transfer (CHT) between fluid and solid d...
Definition: CHTHandler.h:29
std::vector< LinearFVFluxKernel * > _cht_pm_radiation_kernels
The conduction radiation kernels from the fluid domains.
Definition: CHTHandler.h:125
std::vector< BoundaryID > _cht_boundary_ids
The IDs of the CHT boundaries.
Definition: CHTHandler.h:96
FEProblemBase & _problem
Reference to FEProblem.
Definition: CHTHandler.h:78
void resetIntegratedFluxes()
Reset the heat fluxes to 0.
Definition: CHTHandler.C:488
const InputParameters & parameters() const
void printIntegratedFluxes() const
Print the integrated heat fluxes.
Definition: CHTHandler.C:476
void initializeCHTCouplingFields()
Initialize the coupling fields for the conjugate heat transfer routines.
Definition: CHTHandler.C:371
SystemBase * _energy_system
The energy system.
Definition: CHTHandler.h:84
void setupConjugateHeatTransferContainers()
Set up the boundary condition pairs, functor maps, and every other necessary structure for the conjug...
Definition: CHTHandler.C:291
std::vector< std::vector< FaceCenteredMapFunctor< Real, std::unordered_map< dof_id_type, Real > > > > _boundary_temperature
Functors describing the heat flux on the conjugate heat transfer interfaces.
Definition: CHTHandler.h:144
void resetCHTConvergence()
Reset the convergence data.
Definition: CHTHandler.h:158
std::vector< std::vector< Real > > _integrated_boundary_heat_flux
Integrated flux for the boundaries, first index is the boundary second is solid/fluid.
Definition: CHTHandler.h:139
void linkEnergySystems(SystemBase *solid_energy_system, SystemBase *fluid_energy_system, std::vector< SystemBase *> pm_radiation_systems)
Link energy systems.
Definition: CHTHandler.C:91
void incrementCHTIterators()
Increment CHT iterators in the loop.
Definition: CHTHandler.h:164
CHTSide
CHT side options, we want to make sure these can be used as integers so we are avoiding the enum clas...
Definition: NS.h:198
unsigned int _fpi_it
CHT fixed point iteration counter.
Definition: CHTHandler.h:148
bool converged() const
Check if CHT iteration converged.
Definition: CHTHandler.C:495
std::vector< std::vector< const FaceInfo * > > _cht_face_info
The subset of the FaceInfo objects that belong to the given boundaries.
Definition: CHTHandler.h:119
std::vector< std::vector< Real > > _cht_temperature_relaxation_factor
The relaxation factors for temperature fields for the CHT boundaries first index is solid/fluid secon...
Definition: CHTHandler.h:110
const Real _cht_heat_flux_tolerance
Tolerance for heat flux at the CHT interfaces.
Definition: CHTHandler.h:102
std::vector< SystemBase * > _pm_radiation_systems
The solid energy system.
Definition: CHTHandler.h:90
void sumIntegratedFluxes()
Sum the integrated fluxes over all processors.
Definition: CHTHandler.C:465
SystemBase * _solid_energy_system
The solid energy system.
Definition: CHTHandler.h:87
std::vector< std::vector< LinearFVBoundaryCondition * > > _cht_pm_radiation_boundary_conditions
Vector of boundary conditions that describe the radiation pm bcs from each side.
Definition: CHTHandler.h:131
std::vector< unsigned int > _cht_pm_radiation_system_numbers
The participating media radiation system numbers.
Definition: CHTHandler.h:116
std::vector< std::vector< FaceCenteredMapFunctor< Real, std::unordered_map< dof_id_type, Real > > > > _boundary_heat_flux
Functors describing the heat flux on the conjugate heat transfer interfaces.
Definition: CHTHandler.h:136
DIE A HORRIBLE DEATH HERE typedef LIBMESH_DEFAULT_SCALAR_TYPE Real
std::vector< BoundaryName > _cht_boundary_names
The names of the CHT boundaries.
Definition: CHTHandler.h:93
void deduceCHTBoundaryCoupling()
Run error checks and make sure everything works.
Definition: CHTHandler.C:106
virtual bool enabled() const override final
Check if CHT treatment is needed.
Definition: CHTHandler.h:152
static InputParameters validParams()
Definition: CHTHandler.C:25
std::vector< std::vector< LinearFVBoundaryCondition * > > _cht_boundary_conditions
Vector of boundary conditions that describe the conjugate heat transfer from each side...
Definition: CHTHandler.h:128
std::vector< std::vector< Real > > _cht_flux_relaxation_factor
The relaxation factors for flux fields for the CHT boundaries first index is solid/fluid second is th...
Definition: CHTHandler.h:106
std::vector< LinearFVFluxKernel * > _cht_conduction_kernels
The conduction kernels from the solid/fluid domains. Can&#39;t be const, considering we are updating the ...
Definition: CHTHandler.h:122
const unsigned int _max_cht_fpi
Maximum number of CHT fixed point iterations.
Definition: CHTHandler.h:99
CHTHandler(const InputParameters &parameters)
Constructor with initialization parameters.
Definition: CHTHandler.C:76
MooseMesh & _mesh
Mesh.
Definition: CHTHandler.h:81