FreeFOAM The Cross-Platform CFD Toolkit
solidWallHeatFluxTemperatureFvPatchScalarField.C
Go to the documentation of this file.
1 /*---------------------------------------------------------------------------*\
2  ========= |
3  \\ / F ield | OpenFOAM: The Open Source CFD Toolbox
4  \\ / O peration |
5  \\ / A nd | Copyright (C) 1991-2010 OpenCFD Ltd.
6  \\/ M anipulation |
7 -------------------------------------------------------------------------------
8 License
9  This file is part of OpenFOAM.
10 
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.
15 
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.
20 
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/>.
23 
24 \*---------------------------------------------------------------------------*/
25 
29 #include <finiteVolume/volFields.H>
30 
31 // * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * //
32 
35 (
36  const fvPatch& p,
37  const DimensionedField<scalar, volMesh>& iF
38 )
39 :
40  fixedGradientFvPatchScalarField(p, iF),
41  q_(p.size(), 0.0),
42  KName_("undefined-Kcond")
43 {}
44 
45 
48 (
50  const fvPatch& p,
51  const DimensionedField<scalar, volMesh>& iF,
52  const fvPatchFieldMapper& mapper
53 )
54 :
55  fixedGradientFvPatchScalarField(ptf, p, iF, mapper),
56  q_(ptf.q_, mapper),
57  KName_(ptf.KName_)
58 {}
59 
60 
63 (
64  const fvPatch& p,
65  const DimensionedField<scalar, volMesh>& iF,
66  const dictionary& dict
67 )
68 :
69  fixedGradientFvPatchScalarField(p, iF, dict),
70  q_("q", dict, p.size()),
71  KName_(dict.lookup("Kcond"))
72 {}
73 
74 
77 (
79 )
80 :
81  fixedGradientFvPatchScalarField(tppsf),
82  q_(tppsf.q_),
83  KName_(tppsf.KName_)
84 {}
85 
86 
89 (
91  const DimensionedField<scalar, volMesh>& iF
92 )
93 :
94  fixedGradientFvPatchScalarField(tppsf, iF),
95  q_(tppsf.q_),
96  KName_(tppsf.KName_)
97 {}
98 
99 
100 // * * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * //
101 
103 (
104  const fvPatchFieldMapper& m
105 )
106 {
108  q_.autoMap(m);
109 }
110 
111 
113 (
114  const fvPatchScalarField& ptf,
115  const labelList& addr
116 )
117 {
118  fixedGradientFvPatchScalarField::rmap(ptf, addr);
119 
121  refCast<const solidWallHeatFluxTemperatureFvPatchScalarField>(ptf);
122 
123  q_.rmap(hfptf.q_, addr);
124 }
125 
126 
128 {
129  if (updated())
130  {
131  return;
132  }
133 
134  const scalarField& Kw = patch().lookupPatchField<volScalarField, scalar>
135  (
136  KName_
137  );
138 
139  gradient() = q_/Kw;
140 
141  fixedGradientFvPatchScalarField::updateCoeffs();
142 }
143 
144 
146 (
147  Ostream& os
148 ) const
149 {
150  fixedGradientFvPatchScalarField::write(os);
151  q_.writeEntry("q", os);
152  os.writeKeyword("Kcond") << KName_ << token::END_STATEMENT << nl;
153  this->writeEntry("value", os);
154 }
155 
156 
157 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
158 
159 namespace Foam
160 {
162  (
165  );
166 }
167 
168 // ************************ vim: set sw=4 sts=4 et: ************************ //