fixedPressureCompressibleDensityFvPatchScalarField.H
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) 2011-2016 OpenFOAM Foundation
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 Class
25  Foam::fixedPressureCompressibleDensityFvPatchScalarField
26 
27 Group
28  grpInletBoundaryConditions
29 
30 Description
31  This boundary condition calculates a (liquid) compressible density as a
32  function of pressure and fluid properties:
33 
34  \f[
35  \rho = \rho_{l,sat} + \psi_l*(p - p_{sat})
36  \f]
37 
38  where
39 
40  \vartable
41  \rho | density [kg/m3]
42  \rho_{l,sat} | saturation liquid density [kg/m3]
43  \psi_l | liquid compressibility
44  p | pressure [Pa]
45  p_{sat} | saturation pressure [Pa]
46  \endvartable
47 
48  The variables \c rholSat, \c pSat and \c psil are retrieved from the
49  \c thermodynamicProperties dictionary.
50 
51 Usage
52  \table
53  Property | Description | Required | Default value
54  p | pressure field name | no | p
55  \endtable
56 
57  Example of the boundary condition specification:
58  \verbatim
59  <patchName>
60  {
61  type fixedPressureCompressibleDensity;
62  p p;
63  value uniform 1;
64  }
65  \endverbatim
66 
67 See also
68  Foam::fixedValueFvPatchField
69 
70 SourceFiles
71  fixedPressureCompressibleDensityFvPatchScalarField.C
72 
73 \*---------------------------------------------------------------------------*/
74 
75 #ifndef fixedPressureCompressibleDensityFvPatchScalarField_H
76 #define fixedPressureCompressibleDensityFvPatchScalarField_H
77 
79 
80 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
81 
82 namespace Foam
83 {
84 
85 /*---------------------------------------------------------------------------*\
86  Class fixedPressureCompressibleDensityFvPatchScalarField Declaration
87 \*---------------------------------------------------------------------------*/
88 
89 class fixedPressureCompressibleDensityFvPatchScalarField
90 :
91  public fixedValueFvPatchScalarField
92 {
93  // Private data
94 
95  //- Name of static pressure field
96  word pName_;
97 
98 
99 public:
100 
101  //- Runtime type information
102  TypeName("fixedPressureCompressibleDensity");
103 
104 
105  // Constructors
106 
107  //- Construct from patch and internal field
109  (
110  const fvPatch&,
111  const DimensionedField<scalar, volMesh>&
112  );
113 
114  //- Construct from patch, internal field and dictionary
116  (
117  const fvPatch&,
119  const dictionary&
120  );
121 
122  //- Construct by mapping given
123  // fixedPressureCompressibleDensityFvPatchScalarField
124  // onto a new patch
126  (
128  const fvPatch&,
130  const fvPatchFieldMapper&
131  );
132 
133  //- Construct as copy
135  (
137  );
138 
139  //- Construct and return a clone
140  virtual tmp<fvPatchScalarField> clone() const
141  {
143  (
145  );
146  }
147 
148  //- Construct as copy setting internal field reference
150  (
153  );
154 
155  //- Construct and return a clone setting internal field reference
157  (
159  ) const
160  {
162  (
164  (
165  *this,
166  iF
167  )
168  );
169  }
170 
171 
172  // Member functions
173 
174  //- Update the coefficients associated with the patch field
175  virtual void updateCoeffs();
176 
177  //- Write
178  virtual void write(Ostream&) const;
179 };
180 
181 
182 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
183 
184 } // End namespace Foam
185 
186 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
187 
188 #endif
189 
190 // ************************************************************************* //
virtual tmp< fvPatchScalarField > clone() const
Construct and return a clone.
virtual void updateCoeffs()
Update the coefficients associated with the patch field.
A list of keyword definitions, which are a keyword followed by any number of values (e...
Definition: dictionary.H:137
fixedPressureCompressibleDensityFvPatchScalarField(const fvPatch &, const DimensionedField< scalar, volMesh > &)
Construct from patch and internal field.
A finiteVolume patch using a polyPatch and a fvBoundaryMesh.
Definition: fvPatch.H:61
Foam::fvPatchFieldMapper.
An Ostream is an abstract base class for all output systems (streams, files, token lists...
Definition: Ostream.H:53
Field with dimensions and associated with geometry type GeoMesh which is used to size the field and a...
This boundary condition calculates a (liquid) compressible density as a function of pressure and flui...
A class for managing temporary objects.
Definition: PtrList.H:54
TypeName("fixedPressureCompressibleDensity")
Runtime type information.
Namespace for OpenFOAM.