1 /*---------------------------------------------------------------------------*\
3 \\ / F ield | OpenFOAM: The Open Source CFD Toolbox
5 \\ / A nd | Copyright (C) 2011 OpenFOAM Foundation
7 -------------------------------------------------------------------------------
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
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/>.
25 Foam::temperatureThermoBaffle1DFvPatchScalarField
28 Boundary which solves the 1D steady state heat transfer equation
32 temperatureThermoBaffle1DFvPatchScalarField.C
34 \*---------------------------------------------------------------------------*/
36 #ifndef temperatureThermoBaffle1DFvPatchScalarField_H
37 #define temperatureThermoBaffle1DFvPatchScalarField_H
39 #include "mixedFvPatchFields.H"
43 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
47 namespace compressible
50 /*---------------------------------------------------------------------------*\
51 Class temperatureThermoBaffle1DFvPatchScalarField Declaration
52 \*---------------------------------------------------------------------------*/
54 template<class solidType>
55 class temperatureThermoBaffle1DFvPatchScalarField
57 public mixedFvPatchScalarField
64 autoPtr<solidType> solidPtr_;
67 dictionary transportDict_;
68 dictionary radiationDict_;
69 dictionary thermoDict_;
70 dictionary densityDict_;
75 // Constructor from components
76 solidThermoData(const dictionary& dict)
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"))
98 virtual ~solidThermoData()
104 void write(Ostream& os) const
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;
117 scalar K(const scalar T) const
119 return solidPtr_().K(T);
124 //- Name of the temperature field
127 //- Baffle is activated
128 bool baffleActivated_;
130 //- Baffle thickness [m]
131 scalarField thickness_;
133 //- Superficial heat source [W/m2]
137 autoPtr<solidThermoData> solid_;
142 //- Runtime type information
143 TypeName("compressible::temperatureThermoBaffle1D");
148 //- Construct from patch and internal field
149 temperatureThermoBaffle1DFvPatchScalarField
152 const DimensionedField<scalar, volMesh>&
155 //- Construct from patch, internal field and dictionary
156 temperatureThermoBaffle1DFvPatchScalarField
159 const DimensionedField<scalar, volMesh>&,
163 //- Construct by mapping given
164 // temperatureThermoBaffle1DFvPatchScalarField onto a new patch
165 temperatureThermoBaffle1DFvPatchScalarField
167 const temperatureThermoBaffle1DFvPatchScalarField&,
169 const DimensionedField<scalar, volMesh>&,
170 const fvPatchFieldMapper&
173 //- Construct as copy
174 temperatureThermoBaffle1DFvPatchScalarField
176 const temperatureThermoBaffle1DFvPatchScalarField&
179 //- Construct and return a clone
180 virtual tmp<fvPatchScalarField> clone() const
182 return tmp<fvPatchScalarField>
184 new temperatureThermoBaffle1DFvPatchScalarField(*this)
188 //- Construct as copy setting internal field reference
189 temperatureThermoBaffle1DFvPatchScalarField
191 const temperatureThermoBaffle1DFvPatchScalarField&,
192 const DimensionedField<scalar, volMesh>&
195 //- Construct and return a clone setting internal field reference
196 virtual tmp<fvPatchScalarField> clone
198 const DimensionedField<scalar, volMesh>& iF
201 return tmp<fvPatchScalarField>
203 new temperatureThermoBaffle1DFvPatchScalarField(*this, iF)
212 //- Map (and resize as needed) from self given a mapping object
215 const fvPatchFieldMapper&
218 //- Reverse map the given fvPatchField onto this fvPatchField
221 const fvPatchScalarField&,
226 //- Update the coefficients associated with the patch field
227 virtual void updateCoeffs();
230 virtual void write(Ostream&) const;
234 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
236 } // End namespace compressible
237 } // End namespace Foam
239 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
242 # include "temperatureThermoBaffle1DFvPatchScalarField.C"
245 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
249 // ************************************************************************* //