ENH: add bar/Pa conversions

This commit is contained in:
Mark Olesen
2019-03-11 18:37:18 +01:00
committed by Andrew Heather
parent 0983eae192
commit 46a853bc80
4 changed files with 22 additions and 5 deletions

View File

@ -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) \

View File

@ -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); \

View File

@ -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

View File

@ -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