FreeFOAM The Cross-Platform CFD Toolkit
timeVaryingUniformTotalPressureFvPatchScalarField.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::timeVaryingUniformTotalPressureFvPatchScalarField
26 
27 Description
28  A time-varying form of a uniform total pressure boundary condition.
29 
30 See Also
31  Foam::timeVaryingUniformFixedValueFvPatchField
32  and Foam::totalPressureFvPatchScalarField.H
33 
34 SourceFiles
35  timeVaryingUniformTotalPressureFvPatchScalarField.C
36 
37 \*---------------------------------------------------------------------------*/
38 
39 #ifndef timeVaryingUniformTotalPressureFvPatchScalarField_H
40 #define timeVaryingUniformTotalPressureFvPatchScalarField_H
41 
44 
45 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
46 
47 namespace Foam
48 {
49 
50 /*---------------------------------------------------------------------------*\
51  Class timeVaryingTotalPressureFvPatch Declaration
52 \*---------------------------------------------------------------------------*/
53 
55 :
56  public fixedValueFvPatchScalarField
57 {
58  // Private data
59 
60  //- Name of the velocity field
61  word UName_;
62 
63  //- Name of the flux transporting the field
64  word phiName_;
65 
66  //- Name of the density field used to normalise the mass flux
67  // if neccessary
68  word rhoName_;
69 
70  //- Name of the compressibility field used to calculate the wave speed
71  word psiName_;
72 
73  //- Heat capacity ratio
74  scalar gamma_;
75 
76  //- Total pressure
77  scalar p0_;
78 
79  //- Table of time vs total pressure, including the bounding treatment
80  interpolationTable<scalar> timeSeries_;
81 
82 
83 public:
84 
85  //- Runtime type information
86  TypeName("timeVaryingTotalPressure");
87 
88 
89  // Constructors
90 
91  //- Construct from patch and internal field
93  (
94  const fvPatch&,
96  );
97 
98  //- Construct from patch, internal field and dictionary
100  (
101  const fvPatch&,
103  const dictionary&
104  );
105 
106  //- Construct by mapping given patch field onto a new patch
108  (
110  const fvPatch&,
112  const fvPatchFieldMapper&
113  );
114 
115  //- Construct as copy
117  (
119  );
120 
121  //- Construct and return a clone
123  {
125  (
127  );
128  }
129 
130  //- Construct as copy setting internal field reference
132  (
135  );
136 
137  //- Construct and return a clone setting internal field reference
139  (
141  ) const
142  {
144  (
146  );
147  }
148 
149 
150  // Member functions
151 
152  // Access
153 
154  //- Return the name of the velocity field
155  const word& UName() const
156  {
157  return UName_;
158  }
159 
160  //- Return reference to the name of the velocity field
161  // to allow adjustment
163  {
164  return UName_;
165  }
166 
167  //- Return the heat capacity ratio
168  scalar gamma() const
169  {
170  return gamma_;
171  }
172 
173  //- Return reference to the heat capacity ratio to allow adjustment
174  scalar& gamma()
175  {
176  return gamma_;
177  }
178 
179  //- Return the total pressure
180  scalar p0() const
181  {
182  return p0_;
183  }
184 
185  //- Return reference to the total pressure to allow adjustment
186  scalar p0()
187  {
188  return p0_;
189  }
190 
191  //- Return the time series used
193  {
194  return timeSeries_;
195  }
196 
197 
198  // Evaluation functions
199 
200  //- Update the coefficients associated with the patch field
201  // using the given patch velocity field
202  virtual void updateCoeffs(const vectorField& Up);
203 
204  //- Update the coefficients associated with the patch field
205  virtual void updateCoeffs();
206 
207 
208  //- Write
209  virtual void write(Ostream&) const;
210 };
211 
212 
213 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
214 
215 } // End namespace Foam
216 
217 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
218 
219 #endif
220 
221 // ************************ vim: set sw=4 sts=4 et: ************************ //