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/>.
24 \*---------------------------------------------------------------------------*/
26 #include "temperatureThermoBaffleFvPatchScalarField.H"
27 #include "addToRunTimeSelectionTable.H"
29 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
33 namespace compressible
37 // * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * //
39 temperatureThermoBaffleFvPatchScalarField::
40 temperatureThermoBaffleFvPatchScalarField
43 const DimensionedField<scalar, volMesh>& iF
46 turbulentTemperatureCoupledBaffleMixedFvPatchScalarField(p, iF),
49 solidThermoType_("undefined")
53 temperatureThermoBaffleFvPatchScalarField::
54 temperatureThermoBaffleFvPatchScalarField
56 const temperatureThermoBaffleFvPatchScalarField& ptf,
58 const DimensionedField<scalar, volMesh>& iF,
59 const fvPatchFieldMapper& mapper
62 turbulentTemperatureCoupledBaffleMixedFvPatchScalarField
71 solidThermoType_(ptf.solidThermoType_)
75 temperatureThermoBaffleFvPatchScalarField::
76 temperatureThermoBaffleFvPatchScalarField
79 const DimensionedField<scalar, volMesh>& iF,
80 const dictionary& dict
83 turbulentTemperatureCoupledBaffleMixedFvPatchScalarField(p, iF, dict),
88 if (!isA<directMappedPatchBase>(patch().patch()))
92 "temperatureThermoBaffleFvPatchScalarField::"
93 "temperatureThermoBaffleFvPatchScalarField\n"
95 " const fvPatch& p,\n"
96 " const DimensionedField<scalar, volMesh>& iF,\n"
97 " const dictionary& dict\n"
99 ) << "\n patch type '" << patch().type()
100 << "' not type '" << directMappedPatchBase::typeName << "'"
101 << "\n for patch " << patch().name()
102 << " of field " << dimensionedInternalField().name()
103 << " in file " << dimensionedInternalField().objectPath()
107 const fvMesh& thisMesh = patch().boundaryMesh().mesh();
109 typedef regionModels::thermoBaffleModels::thermoBaffleModel baffle;
113 thisMesh.name() == polyMesh::defaultRegion
114 && !thisMesh.foundObject<baffle>("thermoBaffle")
118 Info << "Creating thermal baffle..." << endl;
119 baffle_.reset(baffle::New(thisMesh, dict).ptr());
121 dict.lookup("thermoType") >> solidThermoType_;
126 temperatureThermoBaffleFvPatchScalarField::
127 temperatureThermoBaffleFvPatchScalarField
129 const temperatureThermoBaffleFvPatchScalarField& ptf,
130 const DimensionedField<scalar, volMesh>& iF
133 turbulentTemperatureCoupledBaffleMixedFvPatchScalarField(ptf, iF),
135 baffle_(ptf.baffle_),
136 solidThermoType_(ptf.solidThermoType_)
139 // * * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * //
142 void temperatureThermoBaffleFvPatchScalarField::autoMap
144 const fvPatchFieldMapper& m
147 mixedFvPatchScalarField::autoMap(m);
151 void temperatureThermoBaffleFvPatchScalarField::rmap
153 const fvPatchScalarField& ptf,
154 const labelList& addr
157 mixedFvPatchScalarField::rmap(ptf, addr);
161 void temperatureThermoBaffleFvPatchScalarField::updateCoeffs()
168 const fvMesh& thisMesh = patch().boundaryMesh().mesh();
172 thisMesh.name() == polyMesh::defaultRegion
179 turbulentTemperatureCoupledBaffleMixedFvPatchScalarField::updateCoeffs();
183 void temperatureThermoBaffleFvPatchScalarField::write(Ostream& os) const
185 turbulentTemperatureCoupledBaffleMixedFvPatchScalarField::write(os);
187 const fvMesh& thisMesh = patch().boundaryMesh().mesh();
189 if (thisMesh.name() == polyMesh::defaultRegion && owner_)
191 os.writeKeyword("thermoBaffleModel") << baffle_->modelName()
192 << token::END_STATEMENT << nl;
194 os.writeKeyword("regionName") << baffle_->regionMesh().name()
195 << token::END_STATEMENT << nl;
197 os.writeKeyword("infoOutput") << baffle_->infoOutput()
198 << token::END_STATEMENT << nl;
200 os.writeKeyword("active") << baffle_->active()
201 << token::END_STATEMENT << nl;
203 os.writeKeyword(word(baffle_->modelName() + "coeffs"));
205 os << baffle_->coeffs() << nl;
207 os.writeKeyword("thermoType") << solidThermoType_
208 << token::END_STATEMENT << nl;
210 os.writeKeyword(word(solidThermoType_ + "Coeffs")) << nl;
212 os << indent << '{' << nl
213 << indent << baffle_->thermo() << nl
214 << indent << '}' << nl;
218 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
223 temperatureThermoBaffleFvPatchScalarField
227 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
229 } // End namespace compressible
230 } // End namespace Foam
232 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
235 // ************************************************************************* //