FreeFOAM The Cross-Platform CFD Toolkit
mixedInternalEnergyFvPatchScalarField.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 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
33 
34 namespace Foam
35 {
36 
37 // * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * //
38 
40 (
41  const fvPatch& p,
43 )
44 :
45  mixedFvPatchScalarField(p, iF)
46 {
47  valueFraction() = 0.0;
48  refValue() = 0.0;
49  refGrad() = 0.0;
50 }
51 
52 
54 (
56  const fvPatch& p,
58  const fvPatchFieldMapper& mapper
59 )
60 :
61  mixedFvPatchScalarField(ptf, p, iF, mapper)
62 {}
63 
64 
66 (
67  const fvPatch& p,
69  const dictionary& dict
70 )
71 :
72  mixedFvPatchScalarField(p, iF, dict)
73 {}
74 
75 
77 (
79 )
80 :
81  mixedFvPatchScalarField(tppsf)
82 {}
83 
84 
86 (
89 )
90 :
91  mixedFvPatchScalarField(tppsf, iF)
92 {}
93 
94 
95 // * * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * //
96 
98 {
99  if (updated())
100  {
101  return;
102  }
103 
104  const basicThermo& thermo = db().lookupObject<basicThermo>
105  (
106  "thermophysicalProperties"
107  );
108 
109  const label patchi = patch().index();
110 
111  mixedFvPatchScalarField& Tw = refCast<mixedFvPatchScalarField>
112  (
113  const_cast<fvPatchScalarField&>(thermo.T().boundaryField()[patchi])
114  );
115 
116  Tw.evaluate();
117 
118  valueFraction() = Tw.valueFraction();
119  refValue() = thermo.e(Tw.refValue(), patchi);
120  refGrad() = thermo.Cv(Tw, patchi)*Tw.refGrad()
121  + patch().deltaCoeffs()*
122  (
123  thermo.e(Tw, patchi)
124  - thermo.e(Tw, patch().faceCells())
125  );
126 
128 }
129 
130 
131 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
132 
134 
135 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
136 
137 } // End namespace Foam
138 
139 // ************************ vim: set sw=4 sts=4 et: ************************ //