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

fixedPressureCompressibleDensityFvPatchScalarField.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::fixedPressureCompressibleDensityFvPatchScalarField
00027 
00028 Description
00029     Calculate compressible density as a function of pressure and fluid
00030     properties.
00031 
00032     Example of the boundary condition specification:
00033     @verbatim
00034         inlet
00035         {
00036             type        fixedPressureCompressibleDensity;
00037             p           p;               // Name of static pressure field
00038             value       uniform 1;       // Initial value
00039         }
00040     @endverbatim
00041 
00042 SourceFiles
00043     fixedPressureCompressibleDensityFvPatchScalarField.C
00044 
00045 \*---------------------------------------------------------------------------*/
00046 
00047 #ifndef fixedPressureCompressibleDensityFvPatchScalarField_H
00048 #define fixedPressureCompressibleDensityFvPatchScalarField_H
00049 
00050 #include "fixedValueFvPatchFields.H"
00051 
00052 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
00053 
00054 namespace Foam
00055 {
00056 
00057 /*---------------------------------------------------------------------------*\
00058       Class fixedPressureCompressibleDensityFvPatchScalarField Declaration
00059 \*---------------------------------------------------------------------------*/
00060 
00061 class fixedPressureCompressibleDensityFvPatchScalarField
00062 :
00063     public fixedValueFvPatchScalarField
00064 {
00065     // Private data
00066 
00067         //- Name of static pressure field
00068         word pName_;
00069 
00070 
00071 public:
00072 
00073     //- Runtime type information
00074     TypeName("fixedPressureCompressibleDensity");
00075 
00076 
00077     // Constructors
00078 
00079         //- Construct from patch and internal field
00080         fixedPressureCompressibleDensityFvPatchScalarField
00081         (
00082             const fvPatch&,
00083             const DimensionedField<scalar, volMesh>&
00084         );
00085 
00086         //- Construct from patch, internal field and dictionary
00087         fixedPressureCompressibleDensityFvPatchScalarField
00088         (
00089             const fvPatch&,
00090             const DimensionedField<scalar, volMesh>&,
00091             const dictionary&
00092         );
00093 
00094         //- Construct by mapping given
00095         //  fixedPressureCompressibleDensityFvPatchScalarField
00096         //  onto a new patch
00097         fixedPressureCompressibleDensityFvPatchScalarField
00098         (
00099             const fixedPressureCompressibleDensityFvPatchScalarField&,
00100             const fvPatch&,
00101             const DimensionedField<scalar, volMesh>&,
00102             const fvPatchFieldMapper&
00103         );
00104 
00105         //- Construct as copy
00106         fixedPressureCompressibleDensityFvPatchScalarField
00107         (
00108             const fixedPressureCompressibleDensityFvPatchScalarField&
00109         );
00110 
00111         //- Construct and return a clone
00112         virtual tmp<fvPatchScalarField> clone() const
00113         {
00114             return tmp<fvPatchScalarField>
00115             (
00116                 new fixedPressureCompressibleDensityFvPatchScalarField(*this)
00117             );
00118         }
00119 
00120         //- Construct as copy setting internal field reference
00121         fixedPressureCompressibleDensityFvPatchScalarField
00122         (
00123             const fixedPressureCompressibleDensityFvPatchScalarField&,
00124             const DimensionedField<scalar, volMesh>&
00125         );
00126 
00127         //- Construct and return a clone setting internal field reference
00128         virtual tmp<fvPatchScalarField> clone
00129         (
00130             const DimensionedField<scalar, volMesh>& iF
00131         ) const
00132         {
00133             return tmp<fvPatchScalarField>
00134             (
00135                 new fixedPressureCompressibleDensityFvPatchScalarField
00136                 (
00137                     *this,
00138                     iF
00139                 )
00140             );
00141         }
00142 
00143 
00144     // Member functions
00145 
00146         //- Update the coefficients associated with the patch field
00147         virtual void updateCoeffs();
00148 
00149         //- Write
00150         virtual void write(Ostream&) const;
00151 };
00152 
00153 
00154 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
00155 
00156 } // End namespace Foam
00157 
00158 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
00159 
00160 #endif
00161 
00162 // ************************************************************************* //
Copyright © 2000-2009 OpenCFD Ltd