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 and return a clone
139  virtual tmp<fvPatchScalarField> clone() const
140  {
142  (
143  new fixedRhoFvPatchScalarField(*this)
144  );
145  }
146 
147  //- Construct as copy setting internal field reference
149  (
152  );
153 
154  //- Construct and return a clone setting internal field reference
156  (
158  ) const
159  {
161  (
162  new fixedRhoFvPatchScalarField(*this, iF)
163  );
164  }
165 
166 
167  // Member functions
168 
169  // Evaluation functions
170 
171  //- Update the coefficients associated with the patch field
172  virtual void updateCoeffs();
173 
174 
175  //- Write
176  virtual void write(Ostream&) const;
177 };
178 
179 
180 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
181 
182 } // End namespace Foam
183 
184 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
185 
186 #endif
187 
188 // ************************************************************************* //
Foam::word
A class for handling words, derived from Foam::string.
Definition: word.H:65
Foam::tmp
A class for managing temporary objects.
Definition: PtrList.H:61
Foam::fixedRhoFvPatchScalarField
Foam::fixedRhoFvPatchScalarField.
Definition: fixedRhoFvPatchScalarField.H:105
Foam::fixedRhoFvPatchScalarField::fixedRhoFvPatchScalarField
fixedRhoFvPatchScalarField(const fvPatch &, const DimensionedField< scalar, volMesh > &)
Construct from patch and internal field.
Foam::fvPatch
A finiteVolume patch using a polyPatch and a fvBoundaryMesh.
Definition: fvPatch.H:65
Foam::fixedRhoFvPatchScalarField::TypeName
TypeName("fixedRho")
Runtime type information.
Foam::dictionary
A list of keyword definitions, which are a keyword followed by a number of values (eg,...
Definition: dictionary.H:123
Foam
Namespace for OpenFOAM.
Definition: atmBoundaryLayer.C:33
Foam::fixedRhoFvPatchScalarField::write
virtual void write(Ostream &) const
Write.
Foam::fixedRhoFvPatchScalarField::updateCoeffs
virtual void updateCoeffs()
Update the coefficients associated with the patch field.
fixedValueFvPatchFields.H
Foam::fvPatchFieldMapper
Foam::fvPatchFieldMapper.
Definition: fvPatchFieldMapper.H:47
Foam::Ostream
An Ostream is an abstract base class for all output systems (streams, files, token lists,...
Definition: Ostream.H:56
Foam::DimensionedField
Field with dimensions and associated with geometry type GeoMesh which is used to size the field and a...
Definition: DimensionedField.H:54
Foam::fixedRhoFvPatchScalarField::clone
virtual tmp< fvPatchScalarField > clone() const
Construct and return a clone.
Definition: fixedRhoFvPatchScalarField.H:161