initial commit for version 1.6.x patch release
[OpenFOAM-1.6.x.git] / src / finiteVolume / fields / fvPatchFields / derived / timeVaryingUniformTotalPressure / timeVaryingUniformTotalPressureFvPatchScalarField.H
blob86b3727d8f526e9f61943ce4167aa61c23c70c6c
1 /*---------------------------------------------------------------------------*\
2   =========                 |
3   \\      /  F ield         | OpenFOAM: The Open Source CFD Toolbox
4    \\    /   O peration     |
5     \\  /    A nd           | Copyright (C) 1991-2009 OpenCFD Ltd.
6      \\/     M anipulation  |
7 -------------------------------------------------------------------------------
8 License
9     This file is part of OpenFOAM.
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 the
13     Free Software Foundation; either version 2 of the License, or (at your
14     option) any later version.
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.
21     You should have received a copy of the GNU General Public License
22     along with OpenFOAM; if not, write to the Free Software Foundation,
23     Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
25 Class
26     Foam::timeVaryingUniformTotalPressureFvPatchScalarField
28 Description
29     A time-varying form of a uniform total pressure boundary condition.
31 See Also
32     Foam::timeVaryingUniformFixedValueFvPatchField
33     and Foam::totalPressureFvPatchScalarField.H
35 SourceFiles
36     timeVaryingUniformTotalPressureFvPatchScalarField.C
38 \*---------------------------------------------------------------------------*/
40 #ifndef timeVaryingUniformTotalPressureFvPatchScalarField_H
41 #define timeVaryingUniformTotalPressureFvPatchScalarField_H
43 #include "fixedValueFvPatchFields.H"
44 #include "interpolationTable.H"
46 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
48 namespace Foam
51 /*---------------------------------------------------------------------------*\
52                Class timeVaryingTotalPressureFvPatch Declaration
53 \*---------------------------------------------------------------------------*/
55 class timeVaryingUniformTotalPressureFvPatchScalarField
57     public fixedValueFvPatchScalarField
59     // Private data
61         //- Name of the velocity field
62         word UName_;
64         //- Name of the flux transporting the field
65         word phiName_;
67         //- Name of the density field used to normalise the mass flux
68         //  if neccessary
69         word rhoName_;
71         //- Name of the compressibility field used to calculate the wave speed
72         word psiName_;
74         //- Heat capacity ratio
75         scalar gamma_;
77         //- Total pressure
78         scalar p0_;
80         //- Table of time vs total pressure, including the bounding treatment
81         interpolationTable<scalar> timeSeries_;
84 public:
86     //- Runtime type information
87     TypeName("timeVaryingTotalPressure");
90     // Constructors
92         //- Construct from patch and internal field
93         timeVaryingUniformTotalPressureFvPatchScalarField
94         (
95             const fvPatch&,
96             const DimensionedField<scalar, volMesh>&
97         );
99         //- Construct from patch, internal field and dictionary
100         timeVaryingUniformTotalPressureFvPatchScalarField
101         (
102             const fvPatch&,
103             const DimensionedField<scalar, volMesh>&,
104             const dictionary&
105         );
107         //- Construct by mapping given patch field onto a new patch
108         timeVaryingUniformTotalPressureFvPatchScalarField
109         (
110             const timeVaryingUniformTotalPressureFvPatchScalarField&,
111             const fvPatch&,
112             const DimensionedField<scalar, volMesh>&,
113             const fvPatchFieldMapper&
114         );
116         //- Construct as copy
117         timeVaryingUniformTotalPressureFvPatchScalarField
118         (
119             const timeVaryingUniformTotalPressureFvPatchScalarField&
120         );
122         //- Construct and return a clone
123         virtual tmp<fvPatchScalarField> clone() const
124         {
125             return tmp<fvPatchScalarField>
126             (
127                 new timeVaryingUniformTotalPressureFvPatchScalarField(*this)
128             );
129         }
131         //- Construct as copy setting internal field reference
132         timeVaryingUniformTotalPressureFvPatchScalarField
133         (
134             const timeVaryingUniformTotalPressureFvPatchScalarField&,
135             const DimensionedField<scalar, volMesh>&
136         );
138         //- Construct and return a clone setting internal field reference
139         virtual tmp<fvPatchScalarField> clone
140         (
141             const DimensionedField<scalar, volMesh>& iF
142         ) const
143         {
144             return tmp<fvPatchScalarField>
145             (
146                 new timeVaryingUniformTotalPressureFvPatchScalarField(*this, iF)
147             );
148         }
151     // Member functions
153         // Access
155             //- Return the name of the velocity field
156             const word& UName() const
157             {
158                 return UName_;
159             }
161             //- Return reference to the name of the velocity field
162             //  to allow adjustment
163             word& UName()
164             {
165                 return UName_;
166             }
168             //- Return the heat capacity ratio
169             scalar gamma() const
170             {
171                 return gamma_;
172             }
174             //- Return reference to the heat capacity ratio to allow adjustment
175             scalar& gamma()
176             {
177                 return gamma_;
178             }
180             //- Return the total pressure
181             scalar p0() const
182             {
183                 return p0_;
184             }
186             //- Return reference to the total pressure to allow adjustment
187             scalar p0()
188             {
189                 return p0_;
190             }
192             //- Return the time series used
193             const interpolationTable<scalar>& totalPressureTimeSeries() const
194             {
195                 return timeSeries_;
196             }
199         // Evaluation functions
201             //- Update the coefficients associated with the patch field
202             //  using the given patch velocity field
203             virtual void updateCoeffs(const vectorField& Up);
205             //- Update the coefficients associated with the patch field
206             virtual void updateCoeffs();
209         //- Write
210         virtual void write(Ostream&) const;
214 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
216 } // End namespace Foam
218 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
220 #endif
222 // ************************************************************************* //