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

timeVaryingMappedTotalPressureFvPatchScalarField.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::timeVaryingMappedTotalPressureFvPatchScalarField
00026 
00027 Description
00028     Foam::timeVaryingMappedTotalPressureFvPatchScalarField
00029 
00030 SourceFiles
00031     timeVaryingMappedTotalPressureFvPatchScalarField.C
00032 
00033 \*---------------------------------------------------------------------------*/
00034 
00035 #ifndef timeVaryingMappedTotalPressureFvPatchScalarField_H
00036 #define timeVaryingMappedTotalPressureFvPatchScalarField_H
00037 
00038 #include <finiteVolume/timeVaryingMappedFixedValueFvPatchFields.H>
00039 
00040 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
00041 
00042 namespace Foam
00043 {
00044 
00045 /*---------------------------------------------------------------------------*\
00046            Class timeVaryingMappedTotalPressureFvPatch Declaration
00047 \*---------------------------------------------------------------------------*/
00048 
00049 class timeVaryingMappedTotalPressureFvPatchScalarField
00050 :
00051     public timeVaryingMappedFixedValueFvPatchScalarField
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         //- Rho value used to normalise the total pressure for incompressible flow
00066         scalar rho_;
00067 
00068         //- Name of the compressibility field used to calculate the wave speed
00069         word psiName_;
00070 
00071         //- Heat capacity ratio
00072         scalar gamma_;
00073 
00074 
00075 public:
00076 
00077     //- Runtime type information
00078     TypeName("timeVaryingMappedTotalPressure");
00079 
00080 
00081     // Constructors
00082 
00083         //- Construct from patch and internal field
00084         timeVaryingMappedTotalPressureFvPatchScalarField
00085         (
00086             const fvPatch&,
00087             const DimensionedField<scalar, volMesh>&
00088         );
00089 
00090         //- Construct from patch, internal field and dictionary
00091         timeVaryingMappedTotalPressureFvPatchScalarField
00092         (
00093             const fvPatch&,
00094             const DimensionedField<scalar, volMesh>&,
00095             const dictionary&
00096         );
00097 
00098         //- Construct by mapping given timeVaryingMappedTotalPressureFvPatchScalarField
00099         //  onto a new patch
00100         timeVaryingMappedTotalPressureFvPatchScalarField
00101         (
00102             const timeVaryingMappedTotalPressureFvPatchScalarField&,
00103             const fvPatch&,
00104             const DimensionedField<scalar, volMesh>&,
00105             const fvPatchFieldMapper&
00106         );
00107 
00108         //- Construct as copy
00109         timeVaryingMappedTotalPressureFvPatchScalarField
00110         (
00111             const timeVaryingMappedTotalPressureFvPatchScalarField&
00112         );
00113 
00114         //- Construct and return a clone
00115         virtual tmp<fvPatchScalarField> clone() const
00116         {
00117             return tmp<fvPatchScalarField>
00118             (
00119                 new timeVaryingMappedTotalPressureFvPatchScalarField(*this)
00120             );
00121         }
00122 
00123         //- Construct as copy setting internal field reference
00124         timeVaryingMappedTotalPressureFvPatchScalarField
00125         (
00126             const timeVaryingMappedTotalPressureFvPatchScalarField&,
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 timeVaryingMappedTotalPressureFvPatchScalarField(*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 
00173         // Mapping functions
00174 
00175             //- Map (and resize as needed) from self given a mapping object
00176             virtual void autoMap
00177             (
00178                 const fvPatchFieldMapper&
00179             );
00180 
00181             //- Reverse map the given fvPatchField onto this fvPatchField
00182             virtual void rmap
00183             (
00184                 const fvPatchScalarField&,
00185                 const labelList&
00186             );
00187 
00188 
00189         // Evaluation functions
00190 
00191             //- Update the coefficients associated with the patch field
00192             //  using the given patch velocity field
00193             virtual void updateCoeffs(const vectorField& Up);
00194 
00195             //- Update the coefficients associated with the patch field
00196             virtual void updateCoeffs();
00197 
00198 
00199         //- Write
00200         virtual void write(Ostream&) const;
00201 };
00202 
00203 
00204 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
00205 
00206 } // End namespace Foam
00207 
00208 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
00209 
00210 #endif
00211 
00212 // ************************ vim: set sw=4 sts=4 et: ************************ //
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Defines