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

timeVaryingUniformTotalPressureFvPatchScalarField.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::timeVaryingUniformTotalPressureFvPatchScalarField
00026 
00027 Description
00028     A time-varying form of a uniform total pressure boundary condition.
00029 
00030 See Also
00031     Foam::timeVaryingUniformFixedValueFvPatchField
00032     and Foam::totalPressureFvPatchScalarField.H
00033 
00034 SourceFiles
00035     timeVaryingUniformTotalPressureFvPatchScalarField.C
00036 
00037 \*---------------------------------------------------------------------------*/
00038 
00039 #ifndef timeVaryingUniformTotalPressureFvPatchScalarField_H
00040 #define timeVaryingUniformTotalPressureFvPatchScalarField_H
00041 
00042 #include <finiteVolume/fixedValueFvPatchFields.H>
00043 #include <OpenFOAM/interpolationTable.H>
00044 
00045 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
00046 
00047 namespace Foam
00048 {
00049 
00050 /*---------------------------------------------------------------------------*\
00051                Class timeVaryingTotalPressureFvPatch Declaration
00052 \*---------------------------------------------------------------------------*/
00053 
00054 class timeVaryingUniformTotalPressureFvPatchScalarField
00055 :
00056     public fixedValueFvPatchScalarField
00057 {
00058     // Private data
00059 
00060         //- Name of the velocity field
00061         word UName_;
00062 
00063         //- Name of the flux transporting the field
00064         word phiName_;
00065 
00066         //- Name of the density field used to normalise the mass flux
00067         //  if neccessary
00068         word rhoName_;
00069 
00070         //- Name of the compressibility field used to calculate the wave speed
00071         word psiName_;
00072 
00073         //- Heat capacity ratio
00074         scalar gamma_;
00075 
00076         //- Total pressure
00077         scalar p0_;
00078 
00079         //- Table of time vs total pressure, including the bounding treatment
00080         interpolationTable<scalar> timeSeries_;
00081 
00082 
00083 public:
00084 
00085     //- Runtime type information
00086     TypeName("timeVaryingTotalPressure");
00087 
00088 
00089     // Constructors
00090 
00091         //- Construct from patch and internal field
00092         timeVaryingUniformTotalPressureFvPatchScalarField
00093         (
00094             const fvPatch&,
00095             const DimensionedField<scalar, volMesh>&
00096         );
00097 
00098         //- Construct from patch, internal field and dictionary
00099         timeVaryingUniformTotalPressureFvPatchScalarField
00100         (
00101             const fvPatch&,
00102             const DimensionedField<scalar, volMesh>&,
00103             const dictionary&
00104         );
00105 
00106         //- Construct by mapping given patch field onto a new patch
00107         timeVaryingUniformTotalPressureFvPatchScalarField
00108         (
00109             const timeVaryingUniformTotalPressureFvPatchScalarField&,
00110             const fvPatch&,
00111             const DimensionedField<scalar, volMesh>&,
00112             const fvPatchFieldMapper&
00113         );
00114 
00115         //- Construct as copy
00116         timeVaryingUniformTotalPressureFvPatchScalarField
00117         (
00118             const timeVaryingUniformTotalPressureFvPatchScalarField&
00119         );
00120 
00121         //- Construct and return a clone
00122         virtual tmp<fvPatchScalarField> clone() const
00123         {
00124             return tmp<fvPatchScalarField>
00125             (
00126                 new timeVaryingUniformTotalPressureFvPatchScalarField(*this)
00127             );
00128         }
00129 
00130         //- Construct as copy setting internal field reference
00131         timeVaryingUniformTotalPressureFvPatchScalarField
00132         (
00133             const timeVaryingUniformTotalPressureFvPatchScalarField&,
00134             const DimensionedField<scalar, volMesh>&
00135         );
00136 
00137         //- Construct and return a clone setting internal field reference
00138         virtual tmp<fvPatchScalarField> clone
00139         (
00140             const DimensionedField<scalar, volMesh>& iF
00141         ) const
00142         {
00143             return tmp<fvPatchScalarField>
00144             (
00145                 new timeVaryingUniformTotalPressureFvPatchScalarField(*this, iF)
00146             );
00147         }
00148 
00149 
00150     // Member functions
00151 
00152         // Access
00153 
00154             //- Return the name of the velocity field
00155             const word& UName() const
00156             {
00157                 return UName_;
00158             }
00159 
00160             //- Return reference to the name of the velocity field
00161             //  to allow adjustment
00162             word& UName()
00163             {
00164                 return UName_;
00165             }
00166 
00167             //- Return the heat capacity ratio
00168             scalar gamma() const
00169             {
00170                 return gamma_;
00171             }
00172 
00173             //- Return reference to the heat capacity ratio to allow adjustment
00174             scalar& gamma()
00175             {
00176                 return gamma_;
00177             }
00178 
00179             //- Return the total pressure
00180             scalar p0() const
00181             {
00182                 return p0_;
00183             }
00184 
00185             //- Return reference to the total pressure to allow adjustment
00186             scalar p0()
00187             {
00188                 return p0_;
00189             }
00190 
00191             //- Return the time series used
00192             const interpolationTable<scalar>& totalPressureTimeSeries() const
00193             {
00194                 return timeSeries_;
00195             }
00196 
00197 
00198         // Evaluation functions
00199 
00200             //- Update the coefficients associated with the patch field
00201             //  using the given patch velocity field
00202             virtual void updateCoeffs(const vectorField& Up);
00203 
00204             //- Update the coefficients associated with the patch field
00205             virtual void updateCoeffs();
00206 
00207 
00208         //- Write
00209         virtual void write(Ostream&) const;
00210 };
00211 
00212 
00213 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
00214 
00215 } // End namespace Foam
00216 
00217 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
00218 
00219 #endif
00220 
00221 // ************************ vim: set sw=4 sts=4 et: ************************ //
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Defines