initial commit for version 1.6.x patch release
[OpenFOAM-1.6.x.git] / src / turbulenceModels / incompressible / RAS / derivedFvPatchFields / turbulentHeatFluxTemperature / turbulentHeatFluxTemperatureFvPatchScalarField.C
blob3ca461698afff2844b2c481b9fb99dce7789b9fc
1 /*---------------------------------------------------------------------------*\
2   =========                 |
3   \\      /  F ield         | OpenFOAM: The Open Source CFD Toolbox
4    \\    /   O peration     |
5     \\  /    A nd           | Copyright (C) 1991-2009 OpenCFD Ltd.
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 the
13     Free Software Foundation; either version 2 of the License, or (at your
14     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, write to the Free Software Foundation,
23     Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
25 \*---------------------------------------------------------------------------*/
27 #include "turbulentHeatFluxTemperatureFvPatchScalarField.H"
28 #include "addToRunTimeSelectionTable.H"
29 #include "fvPatchFieldMapper.H"
30 #include "volFields.H"
32 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
34 namespace Foam
36 namespace incompressible
39 // * * * * * * * * * * * * * * * * Constructors  * * * * * * * * * * * * * * //
41 turbulentHeatFluxTemperatureFvPatchScalarField::
42 turbulentHeatFluxTemperatureFvPatchScalarField
44     const fvPatch& p,
45     const DimensionedField<scalar, volMesh>& iF
48     fixedGradientFvPatchScalarField(p, iF),
49     q_(p.size(), 0.0),
50     alphaEffName_("undefinedAlphaEff"),
51     CpName_("undefinedCp")
55 turbulentHeatFluxTemperatureFvPatchScalarField::
56 turbulentHeatFluxTemperatureFvPatchScalarField
58     const turbulentHeatFluxTemperatureFvPatchScalarField& ptf,
59     const fvPatch& p,
60     const DimensionedField<scalar, volMesh>& iF,
61     const fvPatchFieldMapper& mapper
64     fixedGradientFvPatchScalarField(ptf, p, iF, mapper),
65     q_(ptf.q_, mapper),
66     alphaEffName_(ptf.alphaEffName_),
67     CpName_(ptf.CpName_)
71 turbulentHeatFluxTemperatureFvPatchScalarField::
72 turbulentHeatFluxTemperatureFvPatchScalarField
74     const fvPatch& p,
75     const DimensionedField<scalar, volMesh>& iF,
76     const dictionary& dict
79     fixedGradientFvPatchScalarField(p, iF),
80     q_("q", dict, p.size()),
81     alphaEffName_(dict.lookup("alphaEff")),
82     CpName_(dict.lookup("Cp"))
84     fvPatchField<scalar>::operator=(patchInternalField());
85     gradient() = 0.0;
89 turbulentHeatFluxTemperatureFvPatchScalarField::
90 turbulentHeatFluxTemperatureFvPatchScalarField
92     const turbulentHeatFluxTemperatureFvPatchScalarField& thftpsf
95     fixedGradientFvPatchScalarField(thftpsf),
96     q_(thftpsf.q_),
97     alphaEffName_(thftpsf.alphaEffName_),
98     CpName_(thftpsf.CpName_)
102 turbulentHeatFluxTemperatureFvPatchScalarField::
103 turbulentHeatFluxTemperatureFvPatchScalarField
105     const turbulentHeatFluxTemperatureFvPatchScalarField& thftpsf,
106     const DimensionedField<scalar, volMesh>& iF
109     fixedGradientFvPatchScalarField(thftpsf, iF),
110     q_(thftpsf.q_),
111     alphaEffName_(thftpsf.alphaEffName_),
112     CpName_(thftpsf.CpName_)
116 // * * * * * * * * * * * * * * * Member Functions  * * * * * * * * * * * * * //
118 void turbulentHeatFluxTemperatureFvPatchScalarField::autoMap
120     const fvPatchFieldMapper& m
123     scalarField::autoMap(m);
124     q_.autoMap(m);
128 void turbulentHeatFluxTemperatureFvPatchScalarField::rmap
130     const fvPatchScalarField& ptf,
131     const labelList& addr
134     fixedGradientFvPatchScalarField::rmap(ptf, addr);
136     const turbulentHeatFluxTemperatureFvPatchScalarField& thftptf =
137         refCast<const turbulentHeatFluxTemperatureFvPatchScalarField>
138         (
139             ptf
140         );
142     q_.rmap(thftptf.q_, addr);
146 void turbulentHeatFluxTemperatureFvPatchScalarField::updateCoeffs()
148     if (updated())
149     {
150         return;
151     }
153     const scalarField& alphaEffp =
154         patch().lookupPatchField<volScalarField, scalar>(alphaEffName_);
156     const scalarField& Cpp =
157         patch().lookupPatchField<volScalarField, scalar>(CpName_);
159     gradient() = q_/(Cpp*alphaEffp);
161     fixedGradientFvPatchScalarField::updateCoeffs();
165 void turbulentHeatFluxTemperatureFvPatchScalarField::write(Ostream& os) const
167     fixedGradientFvPatchScalarField::write(os);
168     q_.writeEntry("q", os);
169     os.writeKeyword("alphaEff") << alphaEffName_ << token::END_STATEMENT << nl;
170     os.writeKeyword("Cp") << CpName_ << token::END_STATEMENT << nl;
171     writeEntry("value", os);
175 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
177 makePatchTypeField
179     fvPatchScalarField,
180     turbulentHeatFluxTemperatureFvPatchScalarField
184 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
186 } // End namespace incompressible
187 } // End namespace Foam
190 // ************************************************************************* //