OpenFOAM logo
The Open Source CFD Toolbox
  Source Guide OpenCFD Solutions Contact OpenFOAM

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-2009 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 the
00013     Free Software Foundation; either version 2 of the License, or (at your
00014     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, write to the Free Software Foundation,
00023     Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
00024 
00025 Class
00026     Foam::totalPressureFvPatchScalarField
00027 
00028 Description
00029     Foam::totalPressureFvPatchScalarField
00030 
00031 SourceFiles
00032     totalPressureFvPatchScalarField.C
00033 
00034 \*---------------------------------------------------------------------------*/
00035 
00036 #ifndef totalPressureFvPatchScalarField_H
00037 #define totalPressureFvPatchScalarField_H
00038 
00039 #include "fixedValueFvPatchFields.H"
00040 
00041 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
00042 
00043 namespace Foam
00044 {
00045 
00046 /*---------------------------------------------------------------------------*\
00047                            Class totalPressureFvPatch Declaration
00048 \*---------------------------------------------------------------------------*/
00049 
00050 class totalPressureFvPatchScalarField
00051 :
00052     public fixedValueFvPatchScalarField
00053 {
00054     // Private data
00055 
00056         //- Name of the velocity field
00057         word UName_;
00058 
00059         //- Name of the flux transporting the field
00060         word phiName_;
00061 
00062         //- Name of the density field used to normalise the mass flux
00063         //  if neccessary
00064         word rhoName_;
00065 
00066         //- Name of the compressibility field used to calculate the wave speed
00067         word psiName_;
00068 
00069         //- Heat capacity ratio
00070         scalar gamma_;
00071 
00072         //- Total pressure
00073         scalarField p0_;
00074 
00075 
00076 public:
00077 
00078     //- Runtime type information
00079     TypeName("totalPressure");
00080 
00081 
00082     // Constructors
00083 
00084         //- Construct from patch and internal field
00085         totalPressureFvPatchScalarField
00086         (
00087             const fvPatch&,
00088             const DimensionedField<scalar, volMesh>&
00089         );
00090 
00091         //- Construct from patch, internal field and dictionary
00092         totalPressureFvPatchScalarField
00093         (
00094             const fvPatch&,
00095             const DimensionedField<scalar, volMesh>&,
00096             const dictionary&
00097         );
00098 
00099         //- Construct by mapping given totalPressureFvPatchScalarField
00100         //  onto a new patch
00101         totalPressureFvPatchScalarField
00102         (
00103             const totalPressureFvPatchScalarField&,
00104             const fvPatch&,
00105             const DimensionedField<scalar, volMesh>&,
00106             const fvPatchFieldMapper&
00107         );
00108 
00109         //- Construct as copy
00110         totalPressureFvPatchScalarField
00111         (
00112             const totalPressureFvPatchScalarField&
00113         );
00114 
00115         //- Construct and return a clone
00116         virtual tmp<fvPatchScalarField> clone() const
00117         {
00118             return tmp<fvPatchScalarField>
00119             (
00120                 new totalPressureFvPatchScalarField(*this)
00121             );
00122         }
00123 
00124         //- Construct as copy setting internal field reference
00125         totalPressureFvPatchScalarField
00126         (
00127             const totalPressureFvPatchScalarField&,
00128             const DimensionedField<scalar, volMesh>&
00129         );
00130 
00131         //- Construct and return a clone setting internal field reference
00132         virtual tmp<fvPatchScalarField> clone
00133         (
00134             const DimensionedField<scalar, volMesh>& iF
00135         ) const
00136         {
00137             return tmp<fvPatchScalarField>
00138             (
00139                 new totalPressureFvPatchScalarField(*this, iF)
00140             );
00141         }
00142 
00143 
00144     // Member functions
00145 
00146         // Access
00147 
00148             //- Return the name of the velocity field
00149             const word& UName() const
00150             {
00151                 return UName_;
00152             }
00153 
00154             //- Return reference to the name of the velocity field
00155             //  to allow adjustment
00156             word& UName()
00157             {
00158                 return UName_;
00159             }
00160 
00161             //- Return the heat capacity ratio
00162             scalar gamma() const
00163             {
00164                 return gamma_;
00165             }
00166 
00167             //- Return reference to the heat capacity ratio to allow adjustment
00168             scalar& gamma()
00169             {
00170                 return gamma_;
00171             }
00172 
00173             //- Return the total pressure
00174             const scalarField& p0() const
00175             {
00176                 return p0_;
00177             }
00178 
00179             //- Return reference to the total pressure to allow adjustment
00180             scalarField& p0()
00181             {
00182                 return p0_;
00183             }
00184 
00185 
00186         // Mapping functions
00187 
00188             //- Map (and resize as needed) from self given a mapping object
00189             virtual void autoMap
00190             (
00191                 const fvPatchFieldMapper&
00192             );
00193 
00194             //- Reverse map the given fvPatchField onto this fvPatchField
00195             virtual void rmap
00196             (
00197                 const fvPatchScalarField&,
00198                 const labelList&
00199             );
00200 
00201 
00202         // Evaluation functions
00203 
00204             //- Update the coefficients associated with the patch field
00205             //  using the given patch velocity field
00206             virtual void updateCoeffs(const vectorField& Up);
00207 
00208             //- Update the coefficients associated with the patch field
00209             virtual void updateCoeffs();
00210 
00211 
00212         //- Write
00213         virtual void write(Ostream&) const;
00214 };
00215 
00216 
00217 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
00218 
00219 } // End namespace Foam
00220 
00221 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
00222 
00223 #endif
00224 
00225 // ************************************************************************* //
Copyright © 2000-2009 OpenCFD Ltd