radiationCoupledBase.H
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) 2011-2019 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 Class
25  Foam::radiationCoupledBase
26 
27 Description
28  Common functions to emissivity. It gets supplied from lookup into a
29  dictionary or calculated by the solidThermo:
30 
31  - 'lookup' : Read the patch emissivity field from the dictionary
32  - 'solidRadiation' : Use the emissivity field mapped from the adjacent solid
33 
34 SourceFiles
35  radiationCoupledBase.C
36 
37 \*---------------------------------------------------------------------------*/
38 
39 #ifndef radiationCoupledBase_H
40 #define radiationCoupledBase_H
41 
42 #include "scalarField.H"
43 #include "NamedEnum.H"
44 #include "fvPatch.H"
45 #include "fvPatchFieldMapper.H"
46 
47 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
48 
49 namespace Foam
50 {
51 
52 /*---------------------------------------------------------------------------*\
53  Class radiationCoupledBase Declaration
54 \*---------------------------------------------------------------------------*/
55 
57 {
58 public:
59 
60  //- Type of supplied emissivity
62  {
64  LOOKUP
65  };
66 
67 
68 private:
69 
70  // Private Data
71 
73  emissivityMethodTypeNames_;
74 
75  //- Underlying patch
76  const fvPatch& patch_;
77 
78 
79 protected:
80 
81  // Protected data
82 
83  //- How to get emissivity
85 
86  //- Emissivity
87  // Cached locally when is read from dictionary (lookup mode)
89 
90 
91 public:
92 
93  //- Runtime type information
94  TypeName("radiationCoupledBase");
95 
96 
97  // Constructors
98 
99  //- Construct from patch, emissivity mode and emissivity
101  (
102  const fvPatch& patch,
103  const word& calculationMethod,
104  const scalarField& emissivity
105  );
106 
107  //- Construct from patch, emissivity mode and emissivity and mapper
109  (
110  const fvPatch& patch,
111  const word& calculationMethod,
112  const scalarField& emissivity,
113  const fvPatchFieldMapper& mapper
114  );
115 
116  //- Construct from patch and dictionary
118  (
119  const fvPatch& patch,
120  const dictionary& dict
121  );
122 
123 
124  //- Destructor
125  virtual ~radiationCoupledBase();
126 
127 
128  // Member Functions
129 
130  // Access
131 
132  //- Method to obtain emissivity
133  word emissivityMethod() const
134  {
135  return emissivityMethodTypeNames_[method_];
136  }
137 
138 
139  //- Calculate corresponding emissivity field
140  scalarField emissivity() const;
141 
142 
143  // Mapping functions
144 
145  //- Map (and resize as needed) from self given a mapping object
146  // Used to update fields following mesh topology change
147  virtual void autoMap(const fvPatchFieldMapper&);
148 
149  //- Reverse map the given fvPatchField onto this fvPatchField
150  // Used to reconstruct fields
151  virtual void rmap(const fvPatchScalarField&, const labelList&);
152 
153 
154  //- Write
155  void write(Ostream&) const;
156 };
157 
158 
159 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
160 
161 } // End namespace Foam
162 
163 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
164 
165 #endif
166 
167 // ************************************************************************* //
dictionary dict
A list of keyword definitions, which are a keyword followed by any number of values (e...
Definition: dictionary.H:158
A finiteVolume patch using a polyPatch and a fvBoundaryMesh.
Definition: fvPatch.H:61
TypeName("radiationCoupledBase")
Runtime type information.
Abstract base class with a fat-interface to all derived classes covering all possible ways in which t...
Definition: fvPatchField.H:66
scalarField emissivity() const
Calculate corresponding emissivity field.
scalarField emissivity_
Emissivity.
emissivityMethodType
Type of supplied emissivity.
A class for handling words, derived from string.
Definition: word.H:59
void write(Ostream &) const
Write.
Foam::fvPatchFieldMapper.
Common functions to emissivity. It gets supplied from lookup into a dictionary or calculated by the s...
word emissivityMethod() const
Method to obtain emissivity.
An Ostream is an abstract base class for all output systems (streams, files, token lists...
Definition: Ostream.H:53
virtual void rmap(const fvPatchScalarField &, const labelList &)
Reverse map the given fvPatchField onto this fvPatchField.
const emissivityMethodType method_
How to get emissivity.
virtual ~radiationCoupledBase()
Destructor.
virtual void autoMap(const fvPatchFieldMapper &)
Map (and resize as needed) from self given a mapping object.
Namespace for OpenFOAM.
radiationCoupledBase(const fvPatch &patch, const word &calculationMethod, const scalarField &emissivity)
Construct from patch, emissivity mode and emissivity.