initial commit for version 1.6.x patch release
[OpenFOAM-1.6.x.git] / applications / solvers / heatTransfer / chtMultiRegionFoam / derivedFvPatchFields / solidWallHeatFluxTemperature / solidWallHeatFluxTemperatureFvPatchScalarField.C
blobb1f8c3bed2f58850226ca1b1701f0afa359d8550
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 "solidWallHeatFluxTemperatureFvPatchScalarField.H"
28 #include "addToRunTimeSelectionTable.H"
29 #include "fvPatchFieldMapper.H"
30 #include "volFields.H"
32 // * * * * * * * * * * * * * * * * Constructors  * * * * * * * * * * * * * * //
34 Foam::solidWallHeatFluxTemperatureFvPatchScalarField::
35 solidWallHeatFluxTemperatureFvPatchScalarField
37     const fvPatch& p,
38     const DimensionedField<scalar, volMesh>& iF
41     fixedValueFvPatchScalarField(p, iF),
42     q_(p.size(), 0.0),
43     KName_("undefined-K")
47 Foam::solidWallHeatFluxTemperatureFvPatchScalarField::
48 solidWallHeatFluxTemperatureFvPatchScalarField
50     const solidWallHeatFluxTemperatureFvPatchScalarField& ptf,
51     const fvPatch& p,
52     const DimensionedField<scalar, volMesh>& iF,
53     const fvPatchFieldMapper& mapper
56     fixedValueFvPatchScalarField(ptf, p, iF, mapper),
57     q_(ptf.q_, mapper),
58     KName_(ptf.KName_)
62 Foam::solidWallHeatFluxTemperatureFvPatchScalarField::
63 solidWallHeatFluxTemperatureFvPatchScalarField
65     const fvPatch& p,
66     const DimensionedField<scalar, volMesh>& iF,
67     const dictionary& dict
70     fixedValueFvPatchScalarField(p, iF, dict),
71     q_("q", dict, p.size()),
72     KName_(dict.lookup("K"))
76 Foam::solidWallHeatFluxTemperatureFvPatchScalarField::
77 solidWallHeatFluxTemperatureFvPatchScalarField
79     const solidWallHeatFluxTemperatureFvPatchScalarField& tppsf
82     fixedValueFvPatchScalarField(tppsf),
83     q_(tppsf.q_),
84     KName_(tppsf.KName_)
88 Foam::solidWallHeatFluxTemperatureFvPatchScalarField::
89 solidWallHeatFluxTemperatureFvPatchScalarField
91     const solidWallHeatFluxTemperatureFvPatchScalarField& tppsf,
92     const DimensionedField<scalar, volMesh>& iF
95     fixedValueFvPatchScalarField(tppsf, iF),
96     q_(tppsf.q_),
97     KName_(tppsf.KName_)
101 // * * * * * * * * * * * * * * * Member Functions  * * * * * * * * * * * * * //
103 void Foam::solidWallHeatFluxTemperatureFvPatchScalarField::autoMap
105     const fvPatchFieldMapper& m
108     fixedValueFvPatchScalarField::autoMap(m);
109     q_.autoMap(m);
113 void Foam::solidWallHeatFluxTemperatureFvPatchScalarField::rmap
115     const fvPatchScalarField& ptf,
116     const labelList& addr
119     fixedValueFvPatchScalarField::rmap(ptf, addr);
121     const solidWallHeatFluxTemperatureFvPatchScalarField& hfptf =
122         refCast<const solidWallHeatFluxTemperatureFvPatchScalarField>(ptf);
124     q_.rmap(hfptf.q_, addr);
128 void Foam::solidWallHeatFluxTemperatureFvPatchScalarField::updateCoeffs()
130     if (updated())
131     {
132         return;
133     }
135     const scalarField& Kw =
136         patch().lookupPatchField<volScalarField, scalar>(KName_);
138     const fvPatchScalarField& Tw = *this;
140     operator==(q_/(patch().deltaCoeffs()*Kw) + Tw.patchInternalField());
142     fixedValueFvPatchScalarField::updateCoeffs();
146 void Foam::solidWallHeatFluxTemperatureFvPatchScalarField::write
148     Ostream& os
149 ) const
151     fixedValueFvPatchScalarField::write(os);
152     q_.writeEntry("q", os);
153     os.writeKeyword("K") << KName_ << token::END_STATEMENT << nl;
157 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
159 namespace Foam
161     makePatchTypeField
162     (
163         fvPatchScalarField,
164         solidWallHeatFluxTemperatureFvPatchScalarField
165     );
168 // ************************************************************************* //