BUG: UListIO: byteSize overflowing on really big faceLists
[OpenFOAM-2.0.x.git] / src / turbulenceModels / compressible / turbulenceModel / derivedFvPatchFields / temperatureThermoBaffle1D / temperatureThermoBaffle1DFvPatchScalarField.H
blob8ee1b01b9cfa8c69d9e004271b6c23e9294de6a1
1 /*---------------------------------------------------------------------------*\
2   =========                 |
3   \\      /  F ield         | OpenFOAM: The Open Source CFD Toolbox
4    \\    /   O peration     |
5     \\  /    A nd           | Copyright (C) 2011 OpenFOAM Foundation
6      \\/     M anipulation  |
7 -------------------------------------------------------------------------------
8 License
9     This file is part of OpenFOAM.
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.
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.
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/>.
24 Class
25     Foam::temperatureThermoBaffle1DFvPatchScalarField
27 Description
28     Boundary which solves the 1D steady state heat transfer equation
29     through a baffle.
31 SourceFiles
32     temperatureThermoBaffle1DFvPatchScalarField.C
34 \*---------------------------------------------------------------------------*/
36 #ifndef temperatureThermoBaffle1DFvPatchScalarField_H
37 #define temperatureThermoBaffle1DFvPatchScalarField_H
39 #include "mixedFvPatchFields.H"
40 #include "autoPtr.H"
43 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
45 namespace Foam
47 namespace compressible
50 /*---------------------------------------------------------------------------*\
51         Class temperatureThermoBaffle1DFvPatchScalarField Declaration
52 \*---------------------------------------------------------------------------*/
54 template<class solidType>
55 class temperatureThermoBaffle1DFvPatchScalarField
57     public mixedFvPatchScalarField
59     // Private data
61     class solidThermoData
62     {
63             // Solid thermo
64             autoPtr<solidType> solidPtr_;
66             // Solid dictionaries
67             dictionary  transportDict_;
68             dictionary  radiationDict_;
69             dictionary  thermoDict_;
70             dictionary  densityDict_;
73     public:
75         // Constructor from components
76         solidThermoData(const dictionary& dict)
77         :
78             solidPtr_(new solidType(dict)),
79             transportDict_(dict.subDict("transport")),
80             radiationDict_(dict.subDict("radiation")),
81             thermoDict_(dict.subDict("thermodynamics")),
82             densityDict_(dict.subDict("density"))
83         {}
86         // Null constructor
87         solidThermoData()
88         :
89             solidPtr_(),
90             transportDict_(),
91             radiationDict_(),
92             thermoDict_(),
93             densityDict_()
94         {}
97         // Destructor
98         virtual ~solidThermoData()
99         {}
102         // Member Functions
104             void write(Ostream& os) const
105             {
106                 os.writeKeyword("transport");
107                 os << transportDict_  << nl;
108                 os.writeKeyword("radiation");
109                 os << radiationDict_ <<  nl;
110                 os.writeKeyword("thermodynamics");
111                 os << thermoDict_ << nl;
112                 os.writeKeyword("density");
113                 os << densityDict_ << nl;
114             }
117             scalar K(const scalar T) const
118             {
119                 return solidPtr_().K(T);
120             }
121     };
124         //- Name of the temperature field
125         word TName_;
127         //- Baffle is activated
128         bool baffleActivated_;
130         //- Baffle thickness [m]
131         scalarField thickness_;
133         //- Superficial heat source [W/m2]
134         scalarField Qs_;
136         //- Solid thermo
137         autoPtr<solidThermoData> solid_;
140 public:
142     //- Runtime type information
143     TypeName("compressible::temperatureThermoBaffle1D");
146     // Constructors
148         //- Construct from patch and internal field
149         temperatureThermoBaffle1DFvPatchScalarField
150         (
151             const fvPatch&,
152             const DimensionedField<scalar, volMesh>&
153         );
155         //- Construct from patch, internal field and dictionary
156         temperatureThermoBaffle1DFvPatchScalarField
157         (
158             const fvPatch&,
159             const DimensionedField<scalar, volMesh>&,
160             const dictionary&
161         );
163         //- Construct by mapping given
164         //  temperatureThermoBaffle1DFvPatchScalarField onto a new patch
165         temperatureThermoBaffle1DFvPatchScalarField
166         (
167             const temperatureThermoBaffle1DFvPatchScalarField&,
168             const fvPatch&,
169             const DimensionedField<scalar, volMesh>&,
170             const fvPatchFieldMapper&
171         );
173         //- Construct as copy
174         temperatureThermoBaffle1DFvPatchScalarField
175         (
176             const temperatureThermoBaffle1DFvPatchScalarField&
177         );
179         //- Construct and return a clone
180         virtual tmp<fvPatchScalarField> clone() const
181         {
182             return tmp<fvPatchScalarField>
183             (
184                 new temperatureThermoBaffle1DFvPatchScalarField(*this)
185             );
186         }
188         //- Construct as copy setting internal field reference
189         temperatureThermoBaffle1DFvPatchScalarField
190         (
191             const temperatureThermoBaffle1DFvPatchScalarField&,
192             const DimensionedField<scalar, volMesh>&
193         );
195         //- Construct and return a clone setting internal field reference
196         virtual tmp<fvPatchScalarField> clone
197         (
198             const DimensionedField<scalar, volMesh>& iF
199         ) const
200         {
201             return tmp<fvPatchScalarField>
202             (
203                 new temperatureThermoBaffle1DFvPatchScalarField(*this, iF)
204             );
205         }
208     // Member functions
210         // Mapping functions
212             //- Map (and resize as needed) from self given a mapping object
213             virtual void autoMap
214             (
215                 const fvPatchFieldMapper&
216             );
218             //- Reverse map the given fvPatchField onto this fvPatchField
219             virtual void rmap
220             (
221                 const fvPatchScalarField&,
222                 const labelList&
223             );
226         //- Update the coefficients associated with the patch field
227         virtual void updateCoeffs();
229         //- Write
230         virtual void write(Ostream&) const;
234 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
236 } // End namespace compressible
237 } // End namespace Foam
239 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
241 #ifdef NoRepository
242 #   include "temperatureThermoBaffle1DFvPatchScalarField.C"
243 #endif
245 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
247 #endif
249 // ************************************************************************* //