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-2023 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, internal field and dictionary
106  (
107  const fvPatch&,
108  const DimensionedField<scalar, volMesh>&,
109  const dictionary&
110  );
111 
112  //- Construct by mapping given
113  // fixedPressureCompressibleDensityFvPatchScalarField
114  // onto a new patch
116  (
118  const fvPatch&,
120  const fvPatchFieldMapper&
121  );
122 
123  //- Disallow copy without setting internal field reference
125  (
127  ) = delete;
128 
129  //- Copy constructor setting internal field reference
131  (
134  );
135 
136  //- Construct and return a clone setting internal field reference
138  (
140  ) const
141  {
143  (
145  (
146  *this,
147  iF
148  )
149  );
150  }
151 
152 
153  // Member Functions
154 
155  //- Update the coefficients associated with the patch field
156  virtual void updateCoeffs();
157 
158  //- Write
159  virtual void write(Ostream&) const;
160 };
161 
162 
163 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
164 
165 } // End namespace Foam
166 
167 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
168 
169 #endif
170 
171 // ************************************************************************* //
Field with dimensions and associated with geometry type GeoMesh which is used to size the field and a...
An Ostream is an abstract base class for all output systems (streams, files, token lists,...
Definition: Ostream.H:57
This boundary condition calculates a (liquid) compressible density as a function of pressure and flui...
virtual tmp< fvPatchScalarField > clone(const DimensionedField< scalar, volMesh > &iF) const
Construct and return a clone setting internal field reference.
virtual void updateCoeffs()
Update the coefficients associated with the patch field.
fixedPressureCompressibleDensityFvPatchScalarField(const fvPatch &, const DimensionedField< scalar, volMesh > &, const dictionary &)
Construct from patch, internal field and dictionary.
TypeName("fixedPressureCompressibleDensity")
Runtime type information.
Foam::fvPatchFieldMapper.
A finiteVolume patch using a polyPatch and a fvBoundaryMesh.
Definition: fvPatch.H:64
A class for managing temporary objects.
Definition: tmp.H:55
Namespace for OpenFOAM.