Fix tutorials: typo in tutorials/viscoelastic/viscoelasticFluidFoam/S-MDCPP/constant...
[OpenFOAM-1.6-ext.git] / src / finiteVolume / fields / fvPatchFields / derived / timeVaryingMappedTotalPressure / timeVaryingMappedTotalPressureFvPatchScalarField.H
blob3b65684777952d6d9001bffadfc614df4125c0a7
1 /*---------------------------------------------------------------------------*\
2   =========                 |
3   \\      /  F ield         | OpenFOAM: The Open Source CFD Toolbox
4    \\    /   O peration     |
5     \\  /    A nd           | Copyright held by original author
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::timeVaryingMappedTotalPressureFvPatchScalarField
28 Description
29     Foam::timeVaryingMappedTotalPressureFvPatchScalarField
31 SourceFiles
32     timeVaryingMappedTotalPressureFvPatchScalarField.C
34 \*---------------------------------------------------------------------------*/
36 #ifndef timeVaryingMappedTotalPressureFvPatchScalarField_H
37 #define timeVaryingMappedTotalPressureFvPatchScalarField_H
39 #include "timeVaryingMappedFixedValueFvPatchFields.H"
41 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
43 namespace Foam
46 /*---------------------------------------------------------------------------*\
47            Class timeVaryingMappedTotalPressureFvPatch Declaration
48 \*---------------------------------------------------------------------------*/
50 class timeVaryingMappedTotalPressureFvPatchScalarField
52     public timeVaryingMappedFixedValueFvPatchScalarField
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         //- Rho value used to normalise the total pressure for incompressible flow
67         scalar rho_;
69         //- Name of the compressibility field used to calculate the wave speed
70         word psiName_;
72         //- Heat capacity ratio
73         scalar gamma_;
76 public:
78     //- Runtime type information
79     TypeName("timeVaryingMappedTotalPressure");
82     // Constructors
84         //- Construct from patch and internal field
85         timeVaryingMappedTotalPressureFvPatchScalarField
86         (
87             const fvPatch&,
88             const DimensionedField<scalar, volMesh>&
89         );
91         //- Construct from patch, internal field and dictionary
92         timeVaryingMappedTotalPressureFvPatchScalarField
93         (
94             const fvPatch&,
95             const DimensionedField<scalar, volMesh>&,
96             const dictionary&
97         );
99         //- Construct by mapping given timeVaryingMappedTotalPressureFvPatchScalarField
100         //  onto a new patch
101         timeVaryingMappedTotalPressureFvPatchScalarField
102         (
103             const timeVaryingMappedTotalPressureFvPatchScalarField&,
104             const fvPatch&,
105             const DimensionedField<scalar, volMesh>&,
106             const fvPatchFieldMapper&
107         );
109         //- Construct as copy
110         timeVaryingMappedTotalPressureFvPatchScalarField
111         (
112             const timeVaryingMappedTotalPressureFvPatchScalarField&
113         );
115         //- Construct and return a clone
116         virtual tmp<fvPatchScalarField> clone() const
117         {
118             return tmp<fvPatchScalarField>
119             (
120                 new timeVaryingMappedTotalPressureFvPatchScalarField(*this)
121             );
122         }
124         //- Construct as copy setting internal field reference
125         timeVaryingMappedTotalPressureFvPatchScalarField
126         (
127             const timeVaryingMappedTotalPressureFvPatchScalarField&,
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 timeVaryingMappedTotalPressureFvPatchScalarField(*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             }
174         // Mapping functions
176             //- Map (and resize as needed) from self given a mapping object
177             virtual void autoMap
178             (
179                 const fvPatchFieldMapper&
180             );
182             //- Reverse map the given fvPatchField onto this fvPatchField
183             virtual void rmap
184             (
185                 const fvPatchScalarField&,
186                 const labelList&
187             );
190         // Evaluation functions
192             //- Update the coefficients associated with the patch field
193             //  using the given patch velocity field
194             virtual void updateCoeffs(const vectorField& Up);
196             //- Update the coefficients associated with the patch field
197             virtual void updateCoeffs();
200         //- Write
201         virtual void write(Ostream&) const;
205 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
207 } // End namespace Foam
209 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
211 #endif
213 // ************************************************************************* //