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, SystemBase * fluid_energy_system);
39 
43 
46 
49 
52 
54  bool converged() const;
55 
57  void resetCHTConvergence();
58 
60  void incrementCHTIterators();
61 
63  void sumIntegratedFluxes();
64 
66  void printIntegratedFluxes() const;
67 
69  void resetIntegratedFluxes();
70 
72  virtual bool enabled() const override final;
73 
74 protected:
77 
80 
83 
86 
88  std::vector<BoundaryName> _cht_boundary_names;
89 
91  std::vector<BoundaryID> _cht_boundary_ids;
92 
94  const unsigned int _max_cht_fpi;
95 
98 
101  std::vector<std::vector<Real>> _cht_flux_relaxation_factor;
102 
105  std::vector<std::vector<Real>> _cht_temperature_relaxation_factor;
106 
108  std::vector<unsigned int> _cht_system_numbers;
109 
111  std::vector<std::vector<const FaceInfo *>> _cht_face_info;
112 
114  std::vector<LinearFVFluxKernel *> _cht_conduction_kernels;
115 
117  std::vector<std::vector<LinearFVBoundaryCondition *>> _cht_boundary_conditions;
118 
121  std::vector<std::vector<FaceCenteredMapFunctor<Real, std::unordered_map<dof_id_type, Real>>>>
123 
125  std::vector<std::vector<Real>> _integrated_boundary_heat_flux;
126 
129  std::vector<std::vector<FaceCenteredMapFunctor<Real, std::unordered_map<dof_id_type, Real>>>>
131 
132 private:
134  unsigned int _fpi_it;
135 };
136 
137 inline bool
139 {
140  return !_cht_boundary_names.empty();
141 }
142 
143 inline void
145 {
146  _fpi_it = 0;
147 }
148 
149 inline void
151 {
152  _fpi_it++;
153 }
154 
155 } // End FV namespace
156 } // End Moose namespace
std::vector< unsigned int > _cht_system_numbers
The solid (0) and fluid (1) system numbers.
Definition: CHTHandler.h:108
void updateCHTBoundaryCouplingFields(const NS::CHTSide side)
Update the coupling fields for.
Definition: CHTHandler.C:327
This class provides an interface for managing conjugate heat transfer (CHT) between fluid and solid d...
Definition: CHTHandler.h:29
std::vector< BoundaryID > _cht_boundary_ids
The IDs of the CHT boundaries.
Definition: CHTHandler.h:91
FEProblemBase & _problem
Reference to FEProblem.
Definition: CHTHandler.h:76
void resetIntegratedFluxes()
Reset the heat fluxes to 0.
Definition: CHTHandler.C:408
const InputParameters & parameters() const
void printIntegratedFluxes() const
Print the integrated heat fluxes.
Definition: CHTHandler.C:396
void initializeCHTCouplingFields()
Initialize the coupling fields for the conjugate heat transfer routines.
Definition: CHTHandler.C:306
SystemBase * _energy_system
The energy system.
Definition: CHTHandler.h:82
void setupConjugateHeatTransferContainers()
Set up the boundary condition pairs, functor maps, and every other necessary structure for the conjug...
Definition: CHTHandler.C:226
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:130
void resetCHTConvergence()
Reset the convergence data.
Definition: CHTHandler.h:144
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:125
void incrementCHTIterators()
Increment CHT iterators in the loop.
Definition: CHTHandler.h:150
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:194
unsigned int _fpi_it
CHT fixed point iteration counter.
Definition: CHTHandler.h:134
void linkEnergySystems(SystemBase *solid_energy_system, SystemBase *fluid_energy_system)
Link energy systems.
Definition: CHTHandler.C:91
bool converged() const
Check if CHT iteration converged.
Definition: CHTHandler.C:415
std::vector< std::vector< const FaceInfo * > > _cht_face_info
The subset of the FaceInfo objects that belong to the given boundaries.
Definition: CHTHandler.h:111
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:105
const Real _cht_heat_flux_tolerance
Tolerance for heat flux at the CHT interfaces.
Definition: CHTHandler.h:97
void sumIntegratedFluxes()
Sum the integrated fluxes over all processors.
Definition: CHTHandler.C:385
SystemBase * _solid_energy_system
The solid energy system.
Definition: CHTHandler.h:85
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:122
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:88
void deduceCHTBoundaryCoupling()
Run error checks and make sure everything works.
Definition: CHTHandler.C:103
virtual bool enabled() const override final
Check if CHT treatment is needed.
Definition: CHTHandler.h:138
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:117
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:101
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:114
const unsigned int _max_cht_fpi
Maximum number of CHT fixed point iterations.
Definition: CHTHandler.h:94
CHTHandler(const InputParameters &parameters)
Constructor with initialization parameters.
Definition: CHTHandler.C:76
MooseMesh & _mesh
Mesh.
Definition: CHTHandler.h:79