heatTransferCoefficientModel.C
Go to the documentation of this file.
1 /*---------------------------------------------------------------------------*\
2  ========= |
3  \\ / F ield | OpenFOAM: The Open Source CFD Toolbox
4  \\ / O peration | Website: https://openfoam.org
5  \\ / A nd | Copyright (C) 2021-2023 OpenFOAM Foundation
6  \\/ M anipulation |
7 -------------------------------------------------------------------------------
8 License
9  This file is part of OpenFOAM.
10 
11  OpenFOAM is free software: you can redistribute it and/or modify it
12  under the terms of the GNU General Public License as published by
13  the Free Software Foundation, either version 3 of the License, or
14  (at your option) any later version.
15 
16  OpenFOAM is distributed in the hope that it will be useful, but WITHOUT
17  ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
18  FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
19  for more details.
20 
21  You should have received a copy of the GNU General Public License
22  along with OpenFOAM. If not, see <http://www.gnu.org/licenses/>.
23 
24 \*---------------------------------------------------------------------------*/
25 
27 
28 // * * * * * * * * * * * * * * Static Data Members * * * * * * * * * * * * * //
29 
30 namespace Foam
31 {
32 namespace fv
33 {
37 }
38 }
39 
40 
41 // * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * //
42 
44 (
45  const word& modelType,
46  const dictionary& dict,
47  const fvMesh& mesh
48 )
49 :
50  mesh_(mesh)
51 {}
52 
53 
55 (
56  const word& modelType,
57  const dictionary& dict,
58  const interRegionModel& model
59 )
60 :
61  heatTransferCoefficientModel(modelType, dict, model.mesh())
62 {}
63 
64 
65 // * * * * * * * * * * * * * * * * Selectors * * * * * * * * * * * * * * * * //
66 
69 (
70  const dictionary& dict,
71  const fvMesh& mesh
72 )
73 {
74  word heatTransferCoefficientModelType(dict.lookup(typeName));
75 
76  Info<< "Selecting " << typeName << " "
77  << heatTransferCoefficientModelType << endl;
78 
79  meshConstructorTable::iterator cstrIter =
80  meshConstructorTablePtr_->find(heatTransferCoefficientModelType);
81 
82  if (cstrIter == meshConstructorTablePtr_->end())
83  {
85  << "Unknown " << typeName << " type "
86  << heatTransferCoefficientModelType << endl << endl
87  << "Valid " << typeName << " types are : " << endl
88  << meshConstructorTablePtr_->sortedToc()
89  << exit(FatalError);
90  }
91 
92  return
93  cstrIter()
94  (
95  dict.optionalSubDict(heatTransferCoefficientModelType + "Coeffs"),
96  mesh
97  );
98 }
99 
100 
103 (
104  const dictionary& dict,
105  const interRegionModel& model
106 )
107 {
108  word heatTransferCoefficientModelType(dict.lookup(typeName));
109 
110  Info<< "Selecting " << typeName << " "
111  << heatTransferCoefficientModelType << endl;
112 
113  modelConstructorTable::iterator cstrIter =
114  modelConstructorTablePtr_->find(heatTransferCoefficientModelType);
115 
116  if (cstrIter == modelConstructorTablePtr_->end())
117  {
119  << "Unknown " << typeName << " type "
120  << heatTransferCoefficientModelType << endl << endl
121  << "Valid " << typeName << " types are : " << endl
122  << modelConstructorTablePtr_->sortedToc()
123  << exit(FatalError);
124  }
125 
126  return
127  cstrIter()
128  (
129  dict.optionalSubDict(heatTransferCoefficientModelType + "Coeffs"),
130  model
131  );
132 }
133 
134 
135 // * * * * * * * * * * * * * * * * Destructor * * * * * * * * * * * * * * * //
136 
138 {}
139 
140 
141 // * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * * //
142 
144 {
145  return true;
146 }
147 
148 
149 // ************************************************************************* //
A list of keyword definitions, which are a keyword followed by any number of values (e....
Definition: dictionary.H:160
Mesh data needed to do the Finite Volume discretisation.
Definition: fvMesh.H:101
Base class for heat transfer coefficient modelling used in heat transfer fvModels.
virtual bool read(const dictionary &dict)
Read dictionary.
static autoPtr< heatTransferCoefficientModel > New(const dictionary &dict, const fvMesh &mesh)
Select from dictionary and mesh.
heatTransferCoefficientModel(const word &modelType, const dictionary &dict, const fvMesh &mesh)
Construct from dictionary and mesh.
Base class for inter-region exchange.
A class for handling words, derived from string.
Definition: word.H:62
#define FatalErrorInFunction
Report an error message using Foam::FatalError.
Definition: error.H:306
defineTypeNameAndDebug(bound, 0)
defineRunTimeSelectionTable(heatTransferCoefficientModel, mesh)
Namespace for OpenFOAM.
errorManipArg< error, int > exit(error &err, const int errNo=1)
Definition: errorManip.H:124
Ostream & endl(Ostream &os)
Add newline and flush stream.
Definition: Ostream.H:251
messageStream Info
error FatalError
labelList fv(nPoints)
dictionary dict