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-2012 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  \heading Patch usage
52 
53  \table
54  Property | Description | Required | Default value
55  p | pressure field name | no | p
56  \endtable
57 
58  Example of the boundary condition specification:
59  \verbatim
60  myPatch
61  {
62  type fixedPressureCompressibleDensity;
63  p p;
64  value uniform 1;
65  }
66  \endverbatim
67 
68 SeeAlso
69  Foam::fixedValueFvPatchField
70 
71 SourceFiles
72  fixedPressureCompressibleDensityFvPatchScalarField.C
73 
74 \*---------------------------------------------------------------------------*/
75 
76 #ifndef fixedPressureCompressibleDensityFvPatchScalarField_H
77 #define fixedPressureCompressibleDensityFvPatchScalarField_H
78 
80 
81 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
82 
83 namespace Foam
84 {
85 
86 /*---------------------------------------------------------------------------*\
87  Class fixedPressureCompressibleDensityFvPatchScalarField Declaration
88 \*---------------------------------------------------------------------------*/
89 
90 class fixedPressureCompressibleDensityFvPatchScalarField
91 :
92  public fixedValueFvPatchScalarField
93 {
94  // Private data
95 
96  //- Name of static pressure field
97  word pName_;
98 
99 
100 public:
101 
102  //- Runtime type information
103  TypeName("fixedPressureCompressibleDensity");
104 
105 
106  // Constructors
107 
108  //- Construct from patch and internal field
110  (
111  const fvPatch&,
112  const DimensionedField<scalar, volMesh>&
113  );
114 
115  //- Construct from patch, internal field and dictionary
117  (
118  const fvPatch&,
120  const dictionary&
121  );
122 
123  //- Construct by mapping given
124  // fixedPressureCompressibleDensityFvPatchScalarField
125  // onto a new patch
127  (
129  const fvPatch&,
131  const fvPatchFieldMapper&
132  );
133 
134  //- Construct as copy
136  (
138  );
139 
140  //- Construct and return a clone
141  virtual tmp<fvPatchScalarField> clone() const
142  {
144  (
146  );
147  }
148 
149  //- Construct as copy setting internal field reference
151  (
154  );
155 
156  //- Construct and return a clone setting internal field reference
158  (
160  ) const
161  {
163  (
165  (
166  *this,
167  iF
168  )
169  );
170  }
171 
172 
173  // Member functions
174 
175  //- Update the coefficients associated with the patch field
176  virtual void updateCoeffs();
177 
178  //- Write
179  virtual void write(Ostream&) const;
180 };
181 
182 
183 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
184 
185 } // End namespace Foam
186 
187 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
188 
189 #endif
190 
191 // ************************************************************************* //
Foam::fixedPressureCompressibleDensityFvPatchScalarField::updateCoeffs
virtual void updateCoeffs()
Update the coefficients associated with the patch field.
Definition: fixedPressureCompressibleDensityFvPatchScalarField.C:98
Foam::word
A class for handling words, derived from string.
Definition: word.H:59
Foam::tmp
A class for managing temporary objects.
Definition: PtrList.H:118
Foam::fixedPressureCompressibleDensityFvPatchScalarField::clone
virtual tmp< fvPatchScalarField > clone() const
Construct and return a clone.
Definition: fixedPressureCompressibleDensityFvPatchScalarField.H:170
Foam::fixedPressureCompressibleDensityFvPatchScalarField::fixedPressureCompressibleDensityFvPatchScalarField
fixedPressureCompressibleDensityFvPatchScalarField(const fvPatch &, const DimensionedField< scalar, volMesh > &)
Construct from patch and internal field.
Definition: fixedPressureCompressibleDensityFvPatchScalarField.C:36
Foam::fixedPressureCompressibleDensityFvPatchScalarField
This boundary condition calculates a (liquid) compressible density as a function of pressure and flui...
Definition: fixedPressureCompressibleDensityFvPatchScalarField.H:119
Foam::fvPatch
A finiteVolume patch using a polyPatch and a fvBoundaryMesh.
Definition: fvPatch.H:61
Foam::dictionary
A list of keyword definitions, which are a keyword followed by any number of values (e....
Definition: dictionary.H:137
Foam
Namespace for OpenFOAM.
Definition: combustionModel.C:30
Foam::fixedPressureCompressibleDensityFvPatchScalarField::pName_
word pName_
Name of static pressure field.
Definition: fixedPressureCompressibleDensityFvPatchScalarField.H:126
Foam::fixedPressureCompressibleDensityFvPatchScalarField::TypeName
TypeName("fixedPressureCompressibleDensity")
Runtime type information.
fixedValueFvPatchFields.H
Foam::fvPatchFieldMapper
Foam::fvPatchFieldMapper.
Definition: fvPatchFieldMapper.H:45
Foam::Ostream
An Ostream is an abstract base class for all output systems (streams, files, token lists,...
Definition: Ostream.H:53
Foam::DimensionedField
Field with dimensions and associated with geometry type GeoMesh which is used to size the field and a...
Definition: DimensionedField.H:51
Foam::fixedPressureCompressibleDensityFvPatchScalarField::write
virtual void write(Ostream &) const
Write.
Definition: fixedPressureCompressibleDensityFvPatchScalarField.C:126