initial commit for version 1.6.x patch release
[OpenFOAM-1.6.x.git] / src / finiteVolume / fields / fvPatchFields / derived / totalPressure / totalPressureFvPatchScalarField.H
blob4206f1f081f07c3fba6623628615096194c84495
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::totalPressureFvPatchScalarField
28 Description
29     Foam::totalPressureFvPatchScalarField
31 SourceFiles
32     totalPressureFvPatchScalarField.C
34 \*---------------------------------------------------------------------------*/
36 #ifndef totalPressureFvPatchScalarField_H
37 #define totalPressureFvPatchScalarField_H
39 #include "fixedValueFvPatchFields.H"
41 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
43 namespace Foam
46 /*---------------------------------------------------------------------------*\
47                            Class totalPressureFvPatch Declaration
48 \*---------------------------------------------------------------------------*/
50 class totalPressureFvPatchScalarField
52     public fixedValueFvPatchScalarField
54     // Private data
56         //- Name of the velocity field
57         word UName_;
59         //- Name of the flux transporting the field
60         word phiName_;
62         //- Name of the density field used to normalise the mass flux
63         //  if neccessary
64         word rhoName_;
66         //- Name of the compressibility field used to calculate the wave speed
67         word psiName_;
69         //- Heat capacity ratio
70         scalar gamma_;
72         //- Total pressure
73         scalarField p0_;
76 public:
78     //- Runtime type information
79     TypeName("totalPressure");
82     // Constructors
84         //- Construct from patch and internal field
85         totalPressureFvPatchScalarField
86         (
87             const fvPatch&,
88             const DimensionedField<scalar, volMesh>&
89         );
91         //- Construct from patch, internal field and dictionary
92         totalPressureFvPatchScalarField
93         (
94             const fvPatch&,
95             const DimensionedField<scalar, volMesh>&,
96             const dictionary&
97         );
99         //- Construct by mapping given totalPressureFvPatchScalarField
100         //  onto a new patch
101         totalPressureFvPatchScalarField
102         (
103             const totalPressureFvPatchScalarField&,
104             const fvPatch&,
105             const DimensionedField<scalar, volMesh>&,
106             const fvPatchFieldMapper&
107         );
109         //- Construct as copy
110         totalPressureFvPatchScalarField
111         (
112             const totalPressureFvPatchScalarField&
113         );
115         //- Construct and return a clone
116         virtual tmp<fvPatchScalarField> clone() const
117         {
118             return tmp<fvPatchScalarField>
119             (
120                 new totalPressureFvPatchScalarField(*this)
121             );
122         }
124         //- Construct as copy setting internal field reference
125         totalPressureFvPatchScalarField
126         (
127             const totalPressureFvPatchScalarField&,
128             const DimensionedField<scalar, volMesh>&
129         );
131         //- Construct and return a clone setting internal field reference
132         virtual tmp<fvPatchScalarField> clone
133         (
134             const DimensionedField<scalar, volMesh>& iF
135         ) const
136         {
137             return tmp<fvPatchScalarField>
138             (
139                 new totalPressureFvPatchScalarField(*this, iF)
140             );
141         }
144     // Member functions
146         // Access
148             //- Return the name of the velocity field
149             const word& UName() const
150             {
151                 return UName_;
152             }
154             //- Return reference to the name of the velocity field
155             //  to allow adjustment
156             word& UName()
157             {
158                 return UName_;
159             }
161             //- Return the heat capacity ratio
162             scalar gamma() const
163             {
164                 return gamma_;
165             }
167             //- Return reference to the heat capacity ratio to allow adjustment
168             scalar& gamma()
169             {
170                 return gamma_;
171             }
173             //- Return the total pressure
174             const scalarField& p0() const
175             {
176                 return p0_;
177             }
179             //- Return reference to the total pressure to allow adjustment
180             scalarField& p0()
181             {
182                 return p0_;
183             }
186         // Mapping functions
188             //- Map (and resize as needed) from self given a mapping object
189             virtual void autoMap
190             (
191                 const fvPatchFieldMapper&
192             );
194             //- Reverse map the given fvPatchField onto this fvPatchField
195             virtual void rmap
196             (
197                 const fvPatchScalarField&,
198                 const labelList&
199             );
202         // Evaluation functions
204             //- Update the coefficients associated with the patch field
205             //  using the given patch velocity field
206             virtual void updateCoeffs(const vectorField& Up);
208             //- Update the coefficients associated with the patch field
209             virtual void updateCoeffs();
212         //- Write
213         virtual void write(Ostream&) const;
217 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
219 } // End namespace Foam
221 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
223 #endif
225 // ************************************************************************* //