fixedRhoFvPatchScalarField.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::fixedRhoFvPatchScalarField
26 
27 Group
28  grpInletBoundaryConditions
29 
30 Description
31  Foam::fixedRhoFvPatchScalarField
32 
33  This boundary condition provides a fixed density inlet condition for
34  compressible solvers, where the density of calculated using:
35 
36  \f[
37  \rho = \psi p
38  \f]
39 
40  where
41  \vartable
42  p | pressure [Pa]
43  \rho | density [kg/m3]
44  \endvartable
45 
46 
47 Usage
48  \table
49  Property | Description | Required | Default value
50  p | Pressure field name | no | p
51  psi | Compressibility field name | no | thermo:psi
52  \endtable
53 
54  Example of the boundary condition specification:
55  \verbatim
56  <patchName>
57  {
58  type fixedRho;
59  }
60  \endverbatim
61 
62 SourceFiles
63  fixedRhoFvPatchScalarField.C
64 
65 \*---------------------------------------------------------------------------*/
66 
67 #ifndef fixedRhoFvPatchScalarField_H
68 #define fixedRhoFvPatchScalarField_H
69 
71 
72 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
73 
74 namespace Foam
75 {
76 
77 /*---------------------------------------------------------------------------*\
78  Class fixedRhoFvPatchScalarField Declaration
79 \*---------------------------------------------------------------------------*/
80 
81 class fixedRhoFvPatchScalarField
82 :
83  public fixedValueFvPatchScalarField
84 {
85 
86 private:
87 
88  // Private data
89 
90  //- Pressure field name, default = "p"
91  word pName_;
92 
93  //- Compressibility field name, default = "thermo:psi"
94  word psiName_;
95 
96 
97 public:
98 
99  //- Runtime type information
100  TypeName("fixedRho");
101 
102 
103  // Constructors
104 
105  //- Construct from patch and internal field
107  (
108  const fvPatch&,
110  );
111 
112  //- Construct from patch, internal field and dictionary
114  (
115  const fvPatch&,
117  const dictionary&
118  );
119 
120  //- Construct by mapping given fixedRhoFvPatchScalarField
121  // onto a new patch
123  (
125  const fvPatch&,
127  const fvPatchFieldMapper&
128  );
129 
130  //- Construct as copy
132  (
134  );
135 
136  //- Construct and return a clone
137  virtual tmp<fvPatchScalarField> clone() const
138  {
140  (
141  new fixedRhoFvPatchScalarField(*this)
142  );
143  }
144 
145  //- Construct as copy setting internal field reference
147  (
150  );
151 
152  //- Construct and return a clone setting internal field reference
154  (
156  ) const
157  {
159  (
160  new fixedRhoFvPatchScalarField(*this, iF)
161  );
162  }
163 
164 
165  // Member functions
166 
167  // Evaluation functions
168 
169  //- Update the coefficients associated with the patch field
170  virtual void updateCoeffs();
171 
172 
173  //- Write
174  virtual void write(Ostream&) const;
175 };
177 
178 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
179 
180 } // End namespace Foam
181 
182 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
183 
184 #endif
185 
186 // ************************************************************************* //
A list of keyword definitions, which are a keyword followed by any number of values (e...
Definition: dictionary.H:137
A finiteVolume patch using a polyPatch and a fvBoundaryMesh.
Definition: fvPatch.H:61
fixedRhoFvPatchScalarField(const fvPatch &, const DimensionedField< scalar, volMesh > &)
Construct from patch and internal field.
Foam::fixedRhoFvPatchScalarField.
TypeName("fixedRho")
Runtime type information.
Foam::fvPatchFieldMapper.
virtual tmp< fvPatchScalarField > clone() const
Construct and return a clone.
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...
virtual void write(Ostream &) const
Write.
virtual void updateCoeffs()
Update the coefficients associated with the patch field.
A class for managing temporary objects.
Definition: PtrList.H:54
Namespace for OpenFOAM.