Formatting
[foam-extend-3.2.git] / src / foam / global / unitConversion / unitConversion.H
blobce5e29dc9f7227c246a3c71c7e9ec693c470b50b
1 /*---------------------------------------------------------------------------*\
2   =========                 |
3   \\      /  F ield         | foam-extend: Open Source CFD
4    \\    /   O peration     | Version:     3.2
5     \\  /    A nd           | Web:         http://www.foam-extend.org
6      \\/     M anipulation  | For copyright notice see file Copyright
7 -------------------------------------------------------------------------------
8 License
9     This file is part of foam-extend.
11     foam-extend is free software: you can redistribute it and/or modify it
12     under the terms of the GNU General Public License as published by the
13     Free Software Foundation, either version 3 of the License, or (at your
14     option) any later version.
16     foam-extend is distributed in the hope that it will be useful, but
17     WITHOUT ANY WARRANTY; without even the implied warranty of
18     MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
19     General Public License for more details.
21     You should have received a copy of the GNU General Public License
22     along with foam-extend.  If not, see <http://www.gnu.org/licenses/>.
24 InNamespace
25     Foam
27 Description
28     Unit conversion functions
30 \*---------------------------------------------------------------------------*/
32 #ifndef unitConversion_H
33 #define unitConversion_H
35 #include "mathematicalConstants.H"
37 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
39 namespace Foam
42 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
44 //- Conversion from degrees to radians
45 inline scalar degToRad(const scalar deg)
47     return (deg*mathematicalConstant::pi/180.0);
50 //- Conversion from radians to degrees
51 inline scalar radToDeg(const scalar rad)
53     return (rad*180.0/mathematicalConstant::pi);
56 //- Conversion from atm to Pa
57 inline scalar atmToPa(const scalar atm)
59     return (atm*101325.0);
62 //- Conversion from atm to Pa
63 inline scalar paToAtm(const scalar pa)
65     return (pa/101325.0);
68 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
70 } // End namespace Foam
72 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
74 #endif
76 // ************************************************************************* //