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

reducedUnits.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) 2008-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::reducedUnits
00026 
00027 Description
00028 
00029 SourceFiles
00030     reducedUnitsI.H
00031     reducedUnits.C
00032     reducedUnitsIO.C
00033 
00034 \*---------------------------------------------------------------------------*/
00035 
00036 #ifndef reducedUnits_H
00037 #define reducedUnits_H
00038 
00039 #include <OpenFOAM/scalar.H>
00040 #include <OpenFOAM/IOdictionary.H>
00041 
00042 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
00043 
00044 namespace Foam
00045 {
00046 
00047 /*---------------------------------------------------------------------------*\
00048                          Class reducedUnits Declaration
00049 \*---------------------------------------------------------------------------*/
00050 
00051 class reducedUnits
00052 {
00053     // Private data
00054 
00055         // Reduced units
00056 
00057             // Fundamental values
00058 
00059                 scalar refLength_;
00060 
00061                 scalar refTime_;
00062 
00063                 scalar refMass_;
00064 
00065             // Derived values
00066 
00067                 scalar refEnergy_;
00068 
00069                 scalar refTemp_;
00070 
00071                 scalar refForce_;
00072 
00073                 scalar refVelocity_;
00074 
00075                 scalar refVolume_;
00076 
00077                 scalar refPressure_;
00078 
00079                scalar refMassDensity_;
00080 
00081                 scalar refNumberDensity_;
00082 
00083 
00084     // Private Member Functions
00085 
00086         void calcRefValues();
00087 
00088         //- Disallow default bitwise copy construct
00089         reducedUnits(const reducedUnits&);
00090 
00091         //- Disallow default bitwise assignment
00092         void operator=(const reducedUnits&);
00093 
00094 
00095 public:
00096 
00097     // Static data members
00098 
00099         //- Static data someStaticData
00100         static const scalar kb;
00101 
00102 
00103     // Constructors
00104 
00105         //- Construct with no argument, uses default values:
00106         // length  = 1nm
00107         // mass = 1.660538782e-27kg (unified atomic mass unit)
00108         // temperature = 1K (therefore, energy = 1*kb)
00109         reducedUnits();
00110 
00111         //- Construct from components
00112         reducedUnits
00113         (
00114             scalar refLength,
00115             scalar refTime,
00116             scalar refMass
00117         );
00118 
00119         //- Construct from dictionary
00120         reducedUnits(const IOdictionary& reducedUnitsDict);
00121 
00122 
00123     // Destructor
00124 
00125         ~reducedUnits();
00126 
00127 
00128     // Member Functions
00129 
00130         void setRefValues
00131         (
00132             scalar refLength,
00133             scalar refTime,
00134             scalar refMass
00135         );
00136 
00137         void setRefValues(const IOdictionary& reducedUnitsDict);
00138 
00139 
00140         // Access
00141 
00142             inline scalar refLength() const;
00143 
00144             inline scalar refTime() const;
00145 
00146             inline scalar refMass() const;
00147 
00148             inline scalar refTemp() const;
00149 
00150             inline scalar refEnergy() const;
00151 
00152             inline scalar refForce() const;
00153 
00154             inline scalar refVelocity() const;
00155 
00156             inline scalar refVolume() const;
00157 
00158             inline scalar refPressure() const;
00159 
00160             inline scalar refMassDensity() const;
00161 
00162             inline scalar refNumberDensity() const;
00163 
00164 
00165     // IOstream Operators
00166 
00167         friend Ostream& operator<<(Ostream&, const reducedUnits&);
00168 };
00169 
00170 
00171 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
00172 
00173 } // End namespace Foam
00174 
00175 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
00176 
00177 #include <molecule/reducedUnitsI.H>
00178 
00179 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
00180 
00181 #endif
00182 
00183 // ************************ vim: set sw=4 sts=4 et: ************************ //
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Defines