reducedUnits.H
Go to the documentation of this file.
1 /*---------------------------------------------------------------------------*\
2  ========= |
3  \\ / F ield | OpenFOAM: The Open Source CFD Toolbox
4  \\ / O peration |
5  \\ / A nd | Copyright (C) 2011 OpenFOAM Foundation
6  \\/ M anipulation |
7 -------------------------------------------------------------------------------
8 License
9  This file is part of OpenFOAM.
10 
11  OpenFOAM is free software: you can redistribute it and/or modify it
12  under the terms of the GNU General Public License as published by
13  the Free Software Foundation, either version 3 of the License, or
14  (at your option) any later version.
15 
16  OpenFOAM is distributed in the hope that it will be useful, but WITHOUT
17  ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
18  FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
19  for more details.
20 
21  You should have received a copy of the GNU General Public License
22  along with OpenFOAM. If not, see <http://www.gnu.org/licenses/>.
23 
24 Class
25  Foam::reducedUnits
26 
27 Description
28 
29 SourceFiles
30  reducedUnitsI.H
31  reducedUnits.C
32  reducedUnitsIO.C
33 
34 \*---------------------------------------------------------------------------*/
35 
36 #ifndef reducedUnits_H
37 #define reducedUnits_H
38 
39 #include "scalar.H"
40 #include "IOdictionary.H"
41 
42 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
43 
44 namespace Foam
45 {
46 
47 /*---------------------------------------------------------------------------*\
48  Class reducedUnits Declaration
49 \*---------------------------------------------------------------------------*/
50 
51 class reducedUnits
52 {
53  // Private data
54 
55  // Reduced units
56 
57  // Fundamental values
58 
59  scalar refLength_;
60 
61  scalar refTime_;
62 
63  scalar refMass_;
64 
65  // Derived values
66 
67  scalar refEnergy_;
68 
69  scalar refTemp_;
70 
71  scalar refForce_;
72 
73  scalar refVelocity_;
74 
75  scalar refVolume_;
76 
77  scalar refPressure_;
78 
79  scalar refMassDensity_;
80 
81  scalar refNumberDensity_;
82 
83 
84  // Private Member Functions
85 
86  void calcRefValues();
87 
88  //- Disallow default bitwise copy construct
89  reducedUnits(const reducedUnits&);
90 
91  //- Disallow default bitwise assignment
92  void operator=(const reducedUnits&);
93 
94 
95 public:
96 
97  // Static data members
98 
99  //- Static data someStaticData
100  static const scalar kb;
101 
102 
103  // Constructors
104 
105  //- Construct with no argument, uses default values:
106  // length = 1nm
107  // mass = 1.660538782e-27kg (unified atomic mass unit)
108  // temperature = 1K (therefore, energy = 1*kb)
109  reducedUnits();
110 
111  //- Construct from components
113  (
114  scalar refLength,
115  scalar refTime,
116  scalar refMass
117  );
118 
119  //- Construct from dictionary
120  reducedUnits(const IOdictionary& reducedUnitsDict);
121 
122 
123  //- Destructor
124  ~reducedUnits();
125 
126 
127  // Member Functions
128 
129  void setRefValues
130  (
131  scalar refLength,
132  scalar refTime,
133  scalar refMass
134  );
135 
136  void setRefValues(const IOdictionary& reducedUnitsDict);
137 
138 
139  // Access
140 
141  inline scalar refLength() const;
142 
143  inline scalar refTime() const;
144 
145  inline scalar refMass() const;
146 
147  inline scalar refTemp() const;
148 
149  inline scalar refEnergy() const;
150 
151  inline scalar refForce() const;
152 
153  inline scalar refVelocity() const;
154 
155  inline scalar refVolume() const;
156 
157  inline scalar refPressure() const;
158 
159  inline scalar refMassDensity() const;
160 
161  inline scalar refNumberDensity() const;
162 
163 
164  // IOstream Operators
165 
166  friend Ostream& operator<<(Ostream&, const reducedUnits&);
167 };
168 
169 
170 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
171 
172 } // End namespace Foam
173 
174 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
175 
176 #include "reducedUnitsI.H"
177 
178 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
179 
180 #endif
181 
182 // ************************************************************************* //
Foam::reducedUnits::calcRefValues
void calcRefValues()
Definition: reducedUnits.C:35
Foam::IOdictionary
IOdictionary is derived from dictionary and IOobject to give the dictionary automatic IO functionalit...
Definition: IOdictionary.H:53
Foam::reducedUnits::reducedUnits
reducedUnits()
Construct with no argument, uses default values:
Definition: reducedUnits.C:73
Foam::reducedUnits::refNumberDensity_
scalar refNumberDensity_
Definition: reducedUnits.H:80
Foam::reducedUnits::refVelocity_
scalar refVelocity_
Definition: reducedUnits.H:72
Foam::reducedUnits::refPressure
scalar refPressure() const
Definition: reducedUnitsI.H:76
Foam::reducedUnits::refMass
scalar refMass() const
Definition: reducedUnitsI.H:40
Foam::reducedUnits::operator<<
friend Ostream & operator<<(Ostream &, const reducedUnits &)
Foam::reducedUnits::refForce_
scalar refForce_
Definition: reducedUnits.H:70
Foam::reducedUnits::refForce
scalar refForce() const
Definition: reducedUnitsI.H:58
Foam::reducedUnits::refTime_
scalar refTime_
Definition: reducedUnits.H:60
Foam::reducedUnits::~reducedUnits
~reducedUnits()
Destructor.
Definition: reducedUnits.C:110
Foam::reducedUnits::refVelocity
scalar refVelocity() const
Definition: reducedUnitsI.H:64
Foam::reducedUnits::refNumberDensity
scalar refNumberDensity() const
Definition: reducedUnitsI.H:88
Foam::reducedUnits::refTime
scalar refTime() const
Definition: reducedUnitsI.H:34
Foam::reducedUnits::refVolume_
scalar refVolume_
Definition: reducedUnits.H:74
Foam::reducedUnits::operator=
void operator=(const reducedUnits &)
Disallow default bitwise assignment.
Definition: reducedUnits.C:150
Foam::reducedUnits::refEnergy_
scalar refEnergy_
Definition: reducedUnits.H:66
Foam::reducedUnits::refLength
scalar refLength() const
Definition: reducedUnitsI.H:28
Foam::reducedUnits::refPressure_
scalar refPressure_
Definition: reducedUnits.H:76
Foam::reducedUnits::refMassDensity_
scalar refMassDensity_
Definition: reducedUnits.H:78
scalar.H
Foam::reducedUnits::refVolume
scalar refVolume() const
Definition: reducedUnitsI.H:70
Foam
Namespace for OpenFOAM.
Definition: combustionModel.C:30
Foam::reducedUnits::refMassDensity
scalar refMassDensity() const
Definition: reducedUnitsI.H:82
Foam::reducedUnits::refTemp
scalar refTemp() const
Definition: reducedUnitsI.H:46
IOdictionary.H
Foam::reducedUnits::refTemp_
scalar refTemp_
Definition: reducedUnits.H:68
Foam::reducedUnits::refLength_
scalar refLength_
Definition: reducedUnits.H:58
Foam::reducedUnits::setRefValues
void setRefValues(scalar refLength, scalar refTime, scalar refMass)
Definition: reducedUnits.C:117
Foam::reducedUnits::refEnergy
scalar refEnergy() const
Definition: reducedUnitsI.H:52
Foam::reducedUnits::refMass_
scalar refMass_
Definition: reducedUnits.H:62
Foam::reducedUnits::kb
static const scalar kb
Static data someStaticData.
Definition: reducedUnits.H:99
Foam::Ostream
An Ostream is an abstract base class for all output systems (streams, files, token lists,...
Definition: Ostream.H:53
Foam::reducedUnits
Definition: reducedUnits.H:50
reducedUnitsI.H