FreeFOAM The Cross-Platform CFD Toolkit
timeVaryingMappedTotalPressureFvPatchScalarField.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) 1991-2010 OpenCFD Ltd.
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::timeVaryingMappedTotalPressureFvPatchScalarField
26 
27 Description
28  Foam::timeVaryingMappedTotalPressureFvPatchScalarField
29 
30 SourceFiles
31  timeVaryingMappedTotalPressureFvPatchScalarField.C
32 
33 \*---------------------------------------------------------------------------*/
34 
35 #ifndef timeVaryingMappedTotalPressureFvPatchScalarField_H
36 #define timeVaryingMappedTotalPressureFvPatchScalarField_H
37 
39 
40 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
41 
42 namespace Foam
43 {
44 
45 /*---------------------------------------------------------------------------*\
46  Class timeVaryingMappedTotalPressureFvPatch Declaration
47 \*---------------------------------------------------------------------------*/
48 
50 :
51  public timeVaryingMappedFixedValueFvPatchScalarField
52 {
53  // Private data
54 
55  //- Name of the velocity field
56  word UName_;
57 
58  //- Name of the flux transporting the field
59  word phiName_;
60 
61  //- Name of the density field used to normalise the mass flux
62  // if neccessary
63  word rhoName_;
64 
65  //- Rho value used to normalise the total pressure for incompressible flow
66  scalar rho_;
67 
68  //- Name of the compressibility field used to calculate the wave speed
69  word psiName_;
70 
71  //- Heat capacity ratio
72  scalar gamma_;
73 
74 
75 public:
76 
77  //- Runtime type information
78  TypeName("timeVaryingMappedTotalPressure");
79 
80 
81  // Constructors
82 
83  //- Construct from patch and internal field
85  (
86  const fvPatch&,
88  );
89 
90  //- Construct from patch, internal field and dictionary
92  (
93  const fvPatch&,
95  const dictionary&
96  );
97 
98  //- Construct by mapping given timeVaryingMappedTotalPressureFvPatchScalarField
99  // onto a new patch
101  (
103  const fvPatch&,
105  const fvPatchFieldMapper&
106  );
107 
108  //- Construct as copy
110  (
112  );
113 
114  //- Construct and return a clone
116  {
118  (
120  );
121  }
122 
123  //- Construct as copy setting internal field reference
125  (
128  );
129 
130  //- Construct and return a clone setting internal field reference
132  (
134  ) const
135  {
137  (
139  );
140  }
141 
142 
143  // Member functions
144 
145  // Access
146 
147  //- Return the name of the velocity field
148  const word& UName() const
149  {
150  return UName_;
151  }
152 
153  //- Return reference to the name of the velocity field
154  // to allow adjustment
156  {
157  return UName_;
158  }
159 
160  //- Return the heat capacity ratio
161  scalar gamma() const
162  {
163  return gamma_;
164  }
165 
166  //- Return reference to the heat capacity ratio to allow adjustment
167  scalar& gamma()
168  {
169  return gamma_;
170  }
171 
172 
173  // Mapping functions
174 
175  //- Map (and resize as needed) from self given a mapping object
176  virtual void autoMap
177  (
178  const fvPatchFieldMapper&
179  );
180 
181  //- Reverse map the given fvPatchField onto this fvPatchField
182  virtual void rmap
183  (
184  const fvPatchScalarField&,
185  const labelList&
186  );
187 
188 
189  // Evaluation functions
190 
191  //- Update the coefficients associated with the patch field
192  // using the given patch velocity field
193  virtual void updateCoeffs(const vectorField& Up);
194 
195  //- Update the coefficients associated with the patch field
196  virtual void updateCoeffs();
197 
198 
199  //- Write
200  virtual void write(Ostream&) const;
201 };
202 
203 
204 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
205 
206 } // End namespace Foam
207 
208 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
209 
210 #endif
211 
212 // ************************ vim: set sw=4 sts=4 et: ************************ //