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

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