FreeFOAM The Cross-Platform CFD Toolkit
Hosted by SourceForge:
Get FreeFOAM at SourceForge.net.
            Fast, secure and Free Open Source software downloads

totalPressureFvPatchScalarField.H

Go to the documentation of this file.
00001 /*---------------------------------------------------------------------------*\
00002   =========                 |
00003   \\      /  F ield         | OpenFOAM: The Open Source CFD Toolbox
00004    \\    /   O peration     |
00005     \\  /    A nd           | Copyright (C) 1991-2010 OpenCFD Ltd.
00006      \\/     M anipulation  |
00007 -------------------------------------------------------------------------------
00008 License
00009     This file is part of OpenFOAM.
00010 
00011     OpenFOAM is free software: you can redistribute it and/or modify it
00012     under the terms of the GNU General Public License as published by
00013     the Free Software Foundation, either version 3 of the License, or
00014     (at your option) any later version.
00015 
00016     OpenFOAM is distributed in the hope that it will be useful, but WITHOUT
00017     ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
00018     FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
00019     for more details.
00020 
00021     You should have received a copy of the GNU General Public License
00022     along with OpenFOAM.  If not, see <http://www.gnu.org/licenses/>.
00023 
00024 Class
00025     Foam::totalPressureFvPatchScalarField
00026 
00027 Description
00028     Foam::totalPressureFvPatchScalarField
00029 
00030 SourceFiles
00031     totalPressureFvPatchScalarField.C
00032 
00033 \*---------------------------------------------------------------------------*/
00034 
00035 #ifndef totalPressureFvPatchScalarField_H
00036 #define totalPressureFvPatchScalarField_H
00037 
00038 #include <finiteVolume/fixedValueFvPatchFields.H>
00039 
00040 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
00041 
00042 namespace Foam
00043 {
00044 
00045 /*---------------------------------------------------------------------------*\
00046                            Class totalPressureFvPatch Declaration
00047 \*---------------------------------------------------------------------------*/
00048 
00049 class totalPressureFvPatchScalarField
00050 :
00051     public fixedValueFvPatchScalarField
00052 {
00053     // Private data
00054 
00055         //- Name of the velocity field
00056         word UName_;
00057 
00058         //- Name of the flux transporting the field
00059         word phiName_;
00060 
00061         //- Name of the density field used to normalise the mass flux
00062         //  if neccessary
00063         word rhoName_;
00064 
00065         //- Name of the compressibility field used to calculate the wave speed
00066         word psiName_;
00067 
00068         //- Heat capacity ratio
00069         scalar gamma_;
00070 
00071         //- Total pressure
00072         scalarField p0_;
00073 
00074 
00075 public:
00076 
00077     //- Runtime type information
00078     TypeName("totalPressure");
00079 
00080 
00081     // Constructors
00082 
00083         //- Construct from patch and internal field
00084         totalPressureFvPatchScalarField
00085         (
00086             const fvPatch&,
00087             const DimensionedField<scalar, volMesh>&
00088         );
00089 
00090         //- Construct from patch, internal field and dictionary
00091         totalPressureFvPatchScalarField
00092         (
00093             const fvPatch&,
00094             const DimensionedField<scalar, volMesh>&,
00095             const dictionary&
00096         );
00097 
00098         //- Construct by mapping given totalPressureFvPatchScalarField
00099         //  onto a new patch
00100         totalPressureFvPatchScalarField
00101         (
00102             const totalPressureFvPatchScalarField&,
00103             const fvPatch&,
00104             const DimensionedField<scalar, volMesh>&,
00105             const fvPatchFieldMapper&
00106         );
00107 
00108         //- Construct as copy
00109         totalPressureFvPatchScalarField
00110         (
00111             const totalPressureFvPatchScalarField&
00112         );
00113 
00114         //- Construct and return a clone
00115         virtual tmp<fvPatchScalarField> clone() const
00116         {
00117             return tmp<fvPatchScalarField>
00118             (
00119                 new totalPressureFvPatchScalarField(*this)
00120             );
00121         }
00122 
00123         //- Construct as copy setting internal field reference
00124         totalPressureFvPatchScalarField
00125         (
00126             const totalPressureFvPatchScalarField&,
00127             const DimensionedField<scalar, volMesh>&
00128         );
00129 
00130         //- Construct and return a clone setting internal field reference
00131         virtual tmp<fvPatchScalarField> clone
00132         (
00133             const DimensionedField<scalar, volMesh>& iF
00134         ) const
00135         {
00136             return tmp<fvPatchScalarField>
00137             (
00138                 new totalPressureFvPatchScalarField(*this, iF)
00139             );
00140         }
00141 
00142 
00143     // Member functions
00144 
00145         // Access
00146 
00147             //- Return the name of the velocity field
00148             const word& UName() const
00149             {
00150                 return UName_;
00151             }
00152 
00153             //- Return reference to the name of the velocity field
00154             //  to allow adjustment
00155             word& UName()
00156             {
00157                 return UName_;
00158             }
00159 
00160             //- Return the heat capacity ratio
00161             scalar gamma() const
00162             {
00163                 return gamma_;
00164             }
00165 
00166             //- Return reference to the heat capacity ratio to allow adjustment
00167             scalar& gamma()
00168             {
00169                 return gamma_;
00170             }
00171 
00172             //- Return the total pressure
00173             const scalarField& p0() const
00174             {
00175                 return p0_;
00176             }
00177 
00178             //- Return reference to the total pressure to allow adjustment
00179             scalarField& p0()
00180             {
00181                 return p0_;
00182             }
00183 
00184 
00185         // Mapping functions
00186 
00187             //- Map (and resize as needed) from self given a mapping object
00188             virtual void autoMap
00189             (
00190                 const fvPatchFieldMapper&
00191             );
00192 
00193             //- Reverse map the given fvPatchField onto this fvPatchField
00194             virtual void rmap
00195             (
00196                 const fvPatchScalarField&,
00197                 const labelList&
00198             );
00199 
00200 
00201         // Evaluation functions
00202 
00203             //- Update the coefficients associated with the patch field
00204             //  using the given patch velocity field
00205             virtual void updateCoeffs(const vectorField& Up);
00206 
00207             //- Update the coefficients associated with the patch field
00208             virtual void updateCoeffs();
00209 
00210 
00211         //- Write
00212         virtual void write(Ostream&) const;
00213 };
00214 
00215 
00216 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
00217 
00218 } // End namespace Foam
00219 
00220 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
00221 
00222 #endif
00223 
00224 // ************************ vim: set sw=4 sts=4 et: ************************ //
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Defines