reducedUnitsIO.C
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 OpenFOAM Foundation
9 -------------------------------------------------------------------------------
10 License
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 
26 \*---------------------------------------------------------------------------*/
27 
28 #include "reducedUnits.H"
29 #include "IOstreams.H"
30 
31 // * * * * * * * * * * * * * * * IOstream Operators * * * * * * * * * * * * //
32 
34 {
35  os << nl << "Defined: " << nl
36  << tab << "refLength = " << rU.refLength() << " m" << nl
37  << tab << "refTime = " << rU.refTime() << " s" << nl
38  << tab << "refMass = " << rU.refMass() << " kg" << nl
39  << tab << "Boltzmann constant, kb = " << reducedUnits::kb << " J/K"
40  << nl << "Calculated: " << nl
41  << tab << "refEnergy = " << rU.refEnergy() << " J" << nl
42  << tab << "refTemp = " << rU.refTemp() << " K" << nl
43  << tab << "refForce = " << rU.refForce() << " N" << nl
44  << tab << "refVelocity = " << rU.refVelocity() << " m/s" << nl
45  << tab << "refVolume = " << rU.refVolume() << " m^3" << nl
46  << tab << "refPressure = " << rU.refPressure() << " N/m^2" << nl
47  << tab << "refMassDensity = " << rU.refMassDensity() << " kg/m^3" << nl
48  << tab << "refNumberDensity = " << rU.refNumberDensity() << " m^-3"
49  << endl;
50 
51  os.check(FUNCTION_NAME);
52  return os;
53 }
54 
55 
56 // ************************************************************************* //
scalar refLength() const
Definition: reducedUnitsI.H:23
scalar refEnergy() const
Definition: reducedUnitsI.H:47
constexpr char nl
The newline &#39;\n&#39; character (0x0a)
Definition: Ostream.H:50
Ostream & endl(Ostream &os)
Add newline and flush stream.
Definition: Ostream.H:531
constexpr char tab
The tab &#39;\t&#39; character(0x09)
Definition: Ostream.H:49
Useful combination of include files which define Sin, Sout and Serr and the use of IO streams general...
scalar refTime() const
Definition: reducedUnitsI.H:29
scalar refNumberDensity() const
Definition: reducedUnitsI.H:83
scalar refVolume() const
Definition: reducedUnitsI.H:65
An Ostream is an abstract base class for all output systems (streams, files, token lists...
Definition: Ostream.H:56
scalar refMass() const
Definition: reducedUnitsI.H:35
OBJstream os(runTime.globalPath()/outputName)
#define FUNCTION_NAME
scalar refTemp() const
Definition: reducedUnitsI.H:41
scalar refForce() const
Definition: reducedUnitsI.H:53
Ostream & operator<<(Ostream &, const boundaryPatch &p)
Write boundaryPatch as dictionary entries (without surrounding braces)
Definition: boundaryPatch.C:77
scalar refVelocity() const
Definition: reducedUnitsI.H:59
scalar kb
scalar refPressure() const
Definition: reducedUnitsI.H:71
scalar refMassDensity() const
Definition: reducedUnitsI.H:77