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