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 | www.openfoam.com
6  \\/ M anipulation |
7 -------------------------------------------------------------------------------
8  Copyright (C) 2011-2016 OpenFOAM Foundation
9 -------------------------------------------------------------------------------
10 License
11  This file is part of OpenFOAM.
12 
13  OpenFOAM is free software: you can redistribute it and/or modify it
14  under the terms of the GNU General Public License as published by
15  the Free Software Foundation, either version 3 of the License, or
16  (at your option) any later version.
17 
18  OpenFOAM is distributed in the hope that it will be useful, but WITHOUT
19  ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
20  FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
21  for more details.
22 
23  You should have received a copy of the GNU General Public License
24  along with OpenFOAM. If not, see <http://www.gnu.org/licenses/>.
25 
26 Class
27  Foam::fixedRhoFvPatchScalarField
28 
29 Group
30  grpInletBoundaryConditions
31 
32 Description
33  Foam::fixedRhoFvPatchScalarField
34 
35  This boundary condition provides a fixed density inlet condition for
36  compressible solvers, where the density of calculated using:
37 
38  \f[
39  \rho = \psi p
40  \f]
41 
42  where
43  \vartable
44  p | pressure [Pa]
45  \rho | density [kg/m3]
46  \endvartable
47 
48 
49 Usage
50  \table
51  Property | Description | Required | Default value
52  p | Pressure field name | no | p
53  psi | Compressibility field name | no | thermo:psi
54  \endtable
55 
56  Example of the boundary condition specification:
57  \verbatim
58  <patchName>
59  {
60  type fixedRho;
61  }
62  \endverbatim
63 
64 SourceFiles
65  fixedRhoFvPatchScalarField.C
66 
67 \*---------------------------------------------------------------------------*/
68 
69 #ifndef fixedRhoFvPatchScalarField_H
70 #define fixedRhoFvPatchScalarField_H
71 
73 
74 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
75 
76 namespace Foam
77 {
78 
79 /*---------------------------------------------------------------------------*\
80  Class fixedRhoFvPatchScalarField Declaration
81 \*---------------------------------------------------------------------------*/
82 
83 class fixedRhoFvPatchScalarField
84 :
85  public fixedValueFvPatchScalarField
86 {
87 
88 private:
89 
90  // Private data
91 
92  //- Pressure field name, default = "p"
93  word pName_;
94 
95  //- Compressibility field name, default = "thermo:psi"
96  word psiName_;
97 
98 
99 public:
100 
101  //- Runtime type information
102  TypeName("fixedRho");
103 
104 
105  // Constructors
106 
107  //- Construct from patch and internal field
109  (
110  const fvPatch&,
112  );
113 
114  //- Construct from patch, internal field and dictionary
116  (
117  const fvPatch&,
119  const dictionary&
120  );
121 
122  //- Construct by mapping given fixedRhoFvPatchScalarField
123  // onto a new patch
125  (
127  const fvPatch&,
129  const fvPatchFieldMapper&
130  );
131 
132  //- Construct as copy
134  (
136  );
137 
138  //- Construct as copy setting internal field reference
140  (
143  );
144 
145  //- Return a clone
146  virtual tmp<fvPatchField<scalar>> clone() const
147  {
148  return fvPatchField<scalar>::Clone(*this);
149  }
150 
151  //- Clone with an internal field reference
153  (
155  ) const
156  {
157  return fvPatchField<scalar>::Clone(*this, iF);
158  }
159 
160 
161  // Member functions
162 
163  // Evaluation functions
164 
165  //- Update the coefficients associated with the patch field
166  virtual void updateCoeffs();
167 
168 
169  //- Write
170  virtual void write(Ostream&) const;
171 };
172 
173 
174 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
175 
176 } // End namespace Foam
177 
178 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
179 
180 #endif
181 
182 // ************************************************************************* //
A list of keyword definitions, which are a keyword followed by a number of values (eg...
Definition: dictionary.H:129
A finiteVolume patch using a polyPatch and a fvBoundaryMesh.
Definition: fvPatch.H:70
fixedRhoFvPatchScalarField(const fvPatch &, const DimensionedField< scalar, volMesh > &)
Construct from patch and internal field.
virtual tmp< fvPatchField< scalar > > clone() const
Return a clone.
static tmp< fvPatchField< Type > > Clone(const DerivedPatchField &pf, Args &&... args)
Clone a patch field, optionally with internal field reference etc.
Definition: fvPatchField.H:597
Foam::fixedRhoFvPatchScalarField.
TypeName("fixedRho")
Runtime type information.
A FieldMapper for finite-volume patch fields.
virtual void write(Ostream &) const
Write.
Field with dimensions and associated with geometry type GeoMesh which is used to size the field and a...
virtual void updateCoeffs()
Update the coefficients associated with the patch field.
A class for managing temporary objects.
Definition: HashPtrTable.H:50
Namespace for OpenFOAM.