mirror of
https://develop.openfoam.com/Development/openfoam.git
synced 2025-11-28 03:28:01 +00:00
ENH: add bar/Pa conversions
This commit is contained in:
committed by
Andrew Heather
parent
0983eae192
commit
46a853bc80
@ -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
|
||||
|
||||
Reference in New Issue
Block a user