Commit 46a853bc authored by Mark Olesen's avatar Mark Olesen Committed by Andrew Heather
Browse files

ENH: add bar/Pa conversions

parent 0983eae1
......@@ -2,7 +2,7 @@
========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration |
\\ / A nd |
\\ / A nd | Copyright (C) 2019 OpenCFD Ltd.
\\/ M anipulation |
-------------------------------------------------------------------------------
| Copyright (C) 2011-2017 OpenFOAM Foundation
......@@ -161,7 +161,9 @@ UNARY_FUNCTION(scalar, scalar, y1)
UNARY_FUNCTION(scalar, scalar, degToRad)
UNARY_FUNCTION(scalar, scalar, radToDeg)
UNARY_FUNCTION(scalar, scalar, atmToPa)
UNARY_FUNCTION(scalar, scalar, barToPa)
UNARY_FUNCTION(scalar, scalar, paToAtm)
UNARY_FUNCTION(scalar, scalar, paToBar)
#define BesselFunc(func) \
......
......@@ -2,7 +2,7 @@
========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration |
\\ / A nd |
\\ / A nd | Copyright (C) 2019 OpenCFD Ltd.
\\/ M anipulation |
-------------------------------------------------------------------------------
| Copyright (C) 2011-2017 OpenFOAM Foundation
......@@ -139,7 +139,9 @@ UNARY_FUNCTION(scalar, scalar, y1)
UNARY_FUNCTION(scalar, scalar, degToRad)
UNARY_FUNCTION(scalar, scalar, radToDeg)
UNARY_FUNCTION(scalar, scalar, atmToPa)
UNARY_FUNCTION(scalar, scalar, barToPa)
UNARY_FUNCTION(scalar, scalar, paToAtm)
UNARY_FUNCTION(scalar, scalar, paToBar)
#define BesselFunc(func) \
void func(scalarField& Res, const int n, const UList<scalar>& sf); \
......
......@@ -2,7 +2,7 @@
========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration |
\\ / A nd |
\\ / A nd | Copyright (C) 2017 OpenCFD Ltd.
\\/ M anipulation |
-------------------------------------------------------------------------------
| Copyright (C) 2011-2016 OpenFOAM Foundation
......
......@@ -2,7 +2,7 @@
========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration |
\\ / A nd |
\\ / A nd | Copyright (C) 2017-2019 OpenCFD Ltd.
\\/ M anipulation |
-------------------------------------------------------------------------------
| Copyright (C) 2011 OpenFOAM Foundation
......@@ -99,12 +99,25 @@ inline constexpr scalar atmToPa(const scalar atm) noexcept
return (atm*101325.0);
}
//- Conversion from atm to Pa
//- Conversion from bar to Pa
inline constexpr scalar barToPa(const scalar bar) noexcept
{
return (bar*100000.0);
}
//- Conversion from Pa to atm
inline constexpr scalar paToAtm(const scalar pa) noexcept
{
return (pa/101325.0);
}
//- Conversion from Pa to bar
inline constexpr scalar paToBar(const scalar pa) noexcept
{
return (pa/100000.0);
}
//- User literal for degrees to radians conversion (integers)
inline constexpr scalar operator "" _deg(unsigned long long int deg) noexcept
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment