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

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