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

staticPressure.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) 2009-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::staticPressure
00026 
00027 Description
00028     Converts kinematic pressure to static pressure, from the name of the
00029     pressure field, and density, i.e.
00030 
00031         p_static = density*p_kinematic
00032 
00033 SourceFiles
00034     staticPressure.C
00035     IOstaticPressure.H
00036 
00037 \*---------------------------------------------------------------------------*/
00038 
00039 #ifndef staticPressure_H
00040 #define staticPressure_H
00041 
00042 #include <OpenFOAM/pointFieldFwd.H>
00043 
00044 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
00045 
00046 namespace Foam
00047 {
00048 
00049 // Forward declaration of classes
00050 class objectRegistry;
00051 class dictionary;
00052 class mapPolyMesh;
00053 
00054 /*---------------------------------------------------------------------------*\
00055                            Class staticPressure Declaration
00056 \*---------------------------------------------------------------------------*/
00057 
00058 class staticPressure
00059 {
00060     // Private data
00061 
00062         //- Name of this set of staticPressure objects
00063         word name_;
00064 
00065         const objectRegistry& obr_;
00066 
00067         //- on/off switch
00068         bool active_;
00069 
00070         //- Name of pressure field, default is "p"
00071         word pName_;
00072 
00073         //- Density value
00074         scalar rho_;
00075 
00076 
00077     // Private Member Functions
00078 
00079         //- Return true if the pressure field corresponds to kinematic pressure
00080         bool isKinematicPressure();
00081 
00082         //- Disallow default bitwise copy construct
00083         staticPressure(const staticPressure&);
00084 
00085         //- Disallow default bitwise assignment
00086         void operator=(const staticPressure&);
00087 
00088 
00089 public:
00090 
00091     //- Runtime type information
00092     TypeName("staticPressure");
00093 
00094 
00095     // Constructors
00096 
00097         //- Construct for given objectRegistry and dictionary.
00098         //  Allow the possibility to load fields from files
00099         staticPressure
00100         (
00101             const word& name,
00102             const objectRegistry&,
00103             const dictionary&,
00104             const bool loadFromFiles = false
00105         );
00106 
00107 
00108     // Destructor
00109 
00110         virtual ~staticPressure();
00111 
00112 
00113     // Member Functions
00114 
00115         //- Return name of the set of staticPressure
00116         virtual const word& name() const
00117         {
00118             return name_;
00119         }
00120 
00121         //- Read the staticPressure data
00122         virtual void read(const dictionary&);
00123 
00124         //- Execute, currently does nothing
00125         virtual void execute();
00126 
00127         //- Execute at the final time-loop, currently does nothing
00128         virtual void end();
00129 
00130         //- Calculate the staticPressure and write
00131         virtual void write();
00132 
00133         //- Update for changes of mesh
00134         virtual void updateMesh(const mapPolyMesh&)
00135         {}
00136 
00137         //- Update for changes of mesh
00138         virtual void movePoints(const pointField&)
00139         {}
00140 };
00141 
00142 
00143 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
00144 
00145 } // End namespace Foam
00146 
00147 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
00148 
00149 #endif
00150 
00151 // ************************ vim: set sw=4 sts=4 et: ************************ //
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Defines