reducedUnitsIO.C
Go to the documentation of this file.
1 /*---------------------------------------------------------------------------*\
2  ========= |
3  \\ / F ield | OpenFOAM: The Open Source CFD Toolbox
4  \\ / O peration | Website: https://openfoam.org
5  \\ / A nd | Copyright (C) 2011-2018 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 \*---------------------------------------------------------------------------*/
25 
26 #include "reducedUnits.H"
27 #include "IOstreams.H"
28 
29 // * * * * * * * * * * * * * * * IOstream Operators * * * * * * * * * * * * //
30 
32 {
33  os << nl << "Defined: " << nl
34  << tab << "refLength = " << rU.refLength() << " m" << nl
35  << tab << "refTime = " << rU.refTime() << " s" << nl
36  << tab << "refMass = " << rU.refMass() << " kg" << nl
37  << tab << "Boltzmann constant, kb = " << reducedUnits::kb << " J/K"
38  << nl << "Calculated: " << nl
39  << tab << "refEnergy = " << rU.refEnergy() << " J" << nl
40  << tab << "refTemp = " << rU.refTemp() << " K" << nl
41  << tab << "refForce = " << rU.refForce() << " N" << nl
42  << tab << "refVelocity = " << rU.refVelocity() << " m/s" << nl
43  << tab << "refVolume = " << rU.refVolume() << " m^3" << nl
44  << tab << "refPressure = " << rU.refPressure() << " N/m^2" << nl
45  << tab << "refMassDensity = " << rU.refMassDensity() << " kg/m^3" << nl
46  << tab << "refNumberDensity = " << rU.refNumberDensity() << " m^-3"
47  << endl;
48 
49  // Check state of Ostream
50  os.check
51  (
52  "Foam::Ostream& Foam::operator<<(Foam::Ostream&, "
53  "const Foam::reducedUnits&)"
54  );
55 
56  return os;
57 }
58 
59 
60 // ************************************************************************* //
scalar refLength() const
Definition: reducedUnitsI.H:28
scalar refEnergy() const
Definition: reducedUnitsI.H:52
static const char tab
Definition: Ostream.H:259
virtual bool check(const char *operation) const
Check IOstream status for given operation.
Definition: IOstream.C:92
Ostream & endl(Ostream &os)
Add newline and flush stream.
Definition: Ostream.H:251
Useful combination of include files which define Sin, Sout and Serr and the use of IO streams general...
scalar refTime() const
Definition: reducedUnitsI.H:34
scalar refNumberDensity() const
Definition: reducedUnitsI.H:88
scalar refVolume() const
Definition: reducedUnitsI.H:70
An Ostream is an abstract base class for all output systems (streams, files, token lists...
Definition: Ostream.H:54
static const char nl
Definition: Ostream.H:260
scalar refMass() const
Definition: reducedUnitsI.H:40
scalar refTemp() const
Definition: reducedUnitsI.H:46
scalar refForce() const
Definition: reducedUnitsI.H:58
Ostream & operator<<(Ostream &, const ensightPart &)
scalar refVelocity() const
Definition: reducedUnitsI.H:64
scalar refPressure() const
Definition: reducedUnitsI.H:76
scalar refMassDensity() const
Definition: reducedUnitsI.H:82