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