fixedPressureCompressibleDensityFvPatchScalarField.H
Go to the documentation of this file.
1 /*---------------------------------------------------------------------------*\
2  ========= |
3  \\ / F ield | OpenFOAM: The Open Source CFD Toolbox
4  \\ / O peration | Website: https://openfoam.org
5  \\ / A nd | Copyright (C) 2011-2020 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 Description
28  This boundary condition calculates a (liquid) compressible density as a
29  function of pressure and fluid properties:
30 
31  \f[
32  \rho = \rho_{l,sat} + \psi_l*(p - p_{sat})
33  \f]
34 
35  where
36 
37  \vartable
38  \rho | density [kg/m^3]
39  \rho_{l,sat} | saturation liquid density [kg/m^3]
40  \psi_l | liquid compressibility
41  p | pressure [Pa]
42  p_{sat} | saturation pressure [Pa]
43  \endvartable
44 
45  The variables \c rholSat, \c pSat and \c psil are retrieved from the
46  \c thermodynamicProperties dictionary.
47 
48 Usage
49  \table
50  Property | Description | Required | Default value
51  p | pressure field name | no | p
52  \endtable
53 
54  Example of the boundary condition specification:
55  \verbatim
56  <patchName>
57  {
58  type fixedPressureCompressibleDensity;
59  p p;
60  value uniform 1;
61  }
62  \endverbatim
63 
64 See also
65  Foam::fixedValueFvPatchField
66 
67 SourceFiles
68  fixedPressureCompressibleDensityFvPatchScalarField.C
69 
70 \*---------------------------------------------------------------------------*/
71 
72 #ifndef fixedPressureCompressibleDensityFvPatchScalarField_H
73 #define fixedPressureCompressibleDensityFvPatchScalarField_H
74 
76 
77 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
78 
79 namespace Foam
80 {
81 
82 /*---------------------------------------------------------------------------*\
83  Class fixedPressureCompressibleDensityFvPatchScalarField Declaration
84 \*---------------------------------------------------------------------------*/
85 
86 class fixedPressureCompressibleDensityFvPatchScalarField
87 :
88  public fixedValueFvPatchScalarField
89 {
90  // Private Data
91 
92  //- Name of static pressure field
93  word pName_;
94 
95 
96 public:
97 
98  //- Runtime type information
99  TypeName("fixedPressureCompressibleDensity");
100 
101 
102  // Constructors
103 
104  //- Construct from patch and internal field
106  (
107  const fvPatch&,
108  const DimensionedField<scalar, volMesh>&
109  );
110 
111  //- Construct from patch, internal field and dictionary
113  (
114  const fvPatch&,
116  const dictionary&
117  );
118 
119  //- Construct by mapping given
120  // fixedPressureCompressibleDensityFvPatchScalarField
121  // onto a new patch
123  (
125  const fvPatch&,
127  const fvPatchFieldMapper&
128  );
129 
130  //- Disallow copy without setting internal field reference
132  (
134  ) = delete;
135 
136  //- Copy constructor setting internal field reference
138  (
141  );
142 
143  //- Construct and return a clone setting internal field reference
145  (
147  ) const
148  {
150  (
152  (
153  *this,
154  iF
155  )
156  );
157  }
158 
159 
160  // Member Functions
161 
162  //- Update the coefficients associated with the patch field
163  virtual void updateCoeffs();
164 
165  //- Write
166  virtual void write(Ostream&) const;
167 };
168 
169 
170 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
171 
172 } // End namespace Foam
173 
174 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
175 
176 #endif
177 
178 // ************************************************************************* //
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:156
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:62
Foam::fvPatchFieldMapper.
An Ostream is an abstract base class for all output systems (streams, files, token lists...
Definition: Ostream.H:54
virtual tmp< fvPatchScalarField > clone(const DimensionedField< scalar, volMesh > &iF) const
Construct and return a clone setting internal field reference.
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:53
TypeName("fixedPressureCompressibleDensity")
Runtime type information.
Namespace for OpenFOAM.