1 /*---------------------------------------------------------------------------*\
3 \\ / F ield | OpenFOAM: The Open Source CFD Toolbox
5 \\ / A nd | Copyright (C) 1991-2009 OpenCFD Ltd.
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 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
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
38 const DimensionedField<scalar, volMesh>& iF
41 fixedValueFvPatchScalarField(p, iF),
47 Foam::solidWallHeatFluxTemperatureFvPatchScalarField::
48 solidWallHeatFluxTemperatureFvPatchScalarField
50 const solidWallHeatFluxTemperatureFvPatchScalarField& ptf,
52 const DimensionedField<scalar, volMesh>& iF,
53 const fvPatchFieldMapper& mapper
56 fixedValueFvPatchScalarField(ptf, p, iF, mapper),
62 Foam::solidWallHeatFluxTemperatureFvPatchScalarField::
63 solidWallHeatFluxTemperatureFvPatchScalarField
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),
88 Foam::solidWallHeatFluxTemperatureFvPatchScalarField::
89 solidWallHeatFluxTemperatureFvPatchScalarField
91 const solidWallHeatFluxTemperatureFvPatchScalarField& tppsf,
92 const DimensionedField<scalar, volMesh>& iF
95 fixedValueFvPatchScalarField(tppsf, iF),
101 // * * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * //
103 void Foam::solidWallHeatFluxTemperatureFvPatchScalarField::autoMap
105 const fvPatchFieldMapper& m
108 fixedValueFvPatchScalarField::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()
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
151 fixedValueFvPatchScalarField::write(os);
152 q_.writeEntry("q", os);
153 os.writeKeyword("K") << KName_ << token::END_STATEMENT << nl;
157 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
164 solidWallHeatFluxTemperatureFvPatchScalarField
168 // ************************************************************************* //