FreeFOAM The Cross-Platform CFD Toolkit
mixedEnthalpyFvPatchScalarField.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>
31 
32 // * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * //
33 
35 (
36  const fvPatch& p,
38 )
39 :
40  mixedFvPatchScalarField(p, iF)
41 {
42  valueFraction() = 0.0;
43  refValue() = 0.0;
44  refGrad() = 0.0;
45 }
46 
47 
49 (
51  const fvPatch& p,
53  const fvPatchFieldMapper& mapper
54 )
55 :
56  mixedFvPatchScalarField(ptf, p, iF, mapper)
57 {}
58 
59 
61 (
62  const fvPatch& p,
64  const dictionary& dict
65 )
66 :
67  mixedFvPatchScalarField(p, iF, dict)
68 {}
69 
70 
72 (
74 )
75 :
76  mixedFvPatchScalarField(tppsf)
77 {}
78 
79 
81 (
84 )
85 :
86  mixedFvPatchScalarField(tppsf, iF)
87 {}
88 
89 
90 // * * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * //
91 
93 {
94  if (updated())
95  {
96  return;
97  }
98 
99  const basicThermo& thermo = db().lookupObject<basicThermo>
100  (
101  "thermophysicalProperties"
102  );
103 
104  const label patchi = patch().index();
105 
106  mixedFvPatchScalarField& Tw = refCast<mixedFvPatchScalarField>
107  (
108  const_cast<fvPatchScalarField&>(thermo.T().boundaryField()[patchi])
109  );
110 
111  Tw.evaluate();
112 
113  valueFraction() = Tw.valueFraction();
114 
115  if (dimensionedInternalField().name() == "h")
116  {
117  refValue() = thermo.h(Tw.refValue(), patchi);
118  refGrad() = thermo.Cp(Tw, patchi)*Tw.refGrad()
119  + patch().deltaCoeffs()*
120  (
121  thermo.h(Tw, patchi)
122  - thermo.h(Tw, patch().faceCells())
123  );
124  }
125  else
126  {
127  refValue() = thermo.hs(Tw.refValue(), patchi);
128  refGrad() = thermo.Cp(Tw, patchi)*Tw.refGrad()
129  + patch().deltaCoeffs()*
130  (
131  thermo.hs(Tw, patchi)
132  - thermo.hs(Tw, patch().faceCells())
133  );
134  }
135 
137 }
138 
139 
140 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
141 
142 namespace Foam
143 {
145  (
148  );
149 }
150 
151 
152 // ************************ vim: set sw=4 sts=4 et: ************************ //