FreeFOAM The Cross-Platform CFD Toolkit
fixedPressureCompressibleDensityFvPatchScalarField.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 
30 #include <finiteVolume/volFields.H>
31 
32 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
33 
34 namespace Foam
35 {
36 
37 // * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * //
38 
41 (
42  const fvPatch& p,
44 )
45 :
47  pName_("pNameIsUndefined")
48 {}
49 
50 
53 (
55  const fvPatch& p,
57  const fvPatchFieldMapper& mapper
58 )
59 :
60  fixedValueFvPatchField<scalar>(ptf, p, iF, mapper),
61  pName_(ptf.pName_)
62 {}
63 
64 
67 (
68  const fvPatch& p,
70  const dictionary& dict
71 )
72 :
74  pName_(dict.lookup("p"))
75 {}
76 
77 
80 (
82 )
83 :
85  pName_(ptf.pName_)
86 {}
87 
88 
91 (
94 )
95 :
97  pName_(ptf.pName_)
98 {}
99 
100 
101 // * * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * //
102 
104 {
105  if (updated())
106  {
107  return;
108  }
109 
110  const fvPatchField<scalar>& pp =
111  patch().lookupPatchField<volScalarField, scalar>(pName_);
112 
113  const dictionary& thermoProps =
114  db().lookupObject<IOdictionary>("thermodynamicProperties");
115 
116  const scalar rholSat =
117  dimensionedScalar(thermoProps.lookup("rholSat")).value();
118 
119  const scalar pSat =
120  dimensionedScalar(thermoProps.lookup("pSat")).value();
121 
122  const scalar psil = dimensionedScalar(thermoProps.lookup("psil")).value();
123 
124  operator==(rholSat + psil*(pp - pSat));
125 
127 }
128 
129 
131 (
132  Ostream& os
133 ) const
134 {
136  os.writeKeyword("p") << pName_ << token::END_STATEMENT << nl;
137  writeEntry("value", os);
138 }
139 
140 
141 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
142 
144 (
147 );
148 
149 
150 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
151 
152 } // End namespace Foam
153 
154 // ************************ vim: set sw=4 sts=4 et: ************************ //