Skip to content
GitLab
Projects
Groups
Snippets
/
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Menu
Open sidebar
Development
openfoam
Commits
46a853bc
Commit
46a853bc
authored
Mar 11, 2019
by
Mark OLESEN
Committed by
Andrew Heather
Mar 11, 2019
Browse files
ENH: add bar/Pa conversions
parent
0983eae1
Changes
4
Hide whitespace changes
Inline
Side-by-side
src/OpenFOAM/fields/Fields/scalarField/scalarField.C
View file @
46a853bc
...
...
@@ -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) \
...
...
src/OpenFOAM/fields/Fields/scalarField/scalarField.H
View file @
46a853bc
...
...
@@ -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); \
...
...
src/OpenFOAM/global/constants/mathematical/mathematicalConstants.H
View file @
46a853bc
...
...
@@ -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
...
...
src/OpenFOAM/global/unitConversion/unitConversion.H
View file @
46a853bc
...
...
@@ -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
...
...
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment