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
469c9ff0
Commit
469c9ff0
authored
Jun 26, 2019
by
Andrew Heather
Browse files
COMP: Added some volatile statements for clang
TODO: need to revisit
parent
3800ed8d
Changes
7
Hide whitespace changes
Inline
Side-by-side
doc/BuildIssues.md
View file @
469c9ff0
## Known Build Issues (OpenFOAM-v1906)
### Intel MPI with Gcc/Clang)
### Thermo problems with Clang
Clang builds required updates to the thermophysical libraries to prevent
optimised builds from generating sigFpe's. The changes are wrapped in
`#ifdef`
`__clang__`
statements to not affect other compilers.
The following tutorials experience known failures:
-
combustion/XiFoam/RAS/moriyoshiHomogeneous
-
multiphase/reactingTwoPhaseEulerFoam/laminar/bubbleColumnEvaporatingDissolving
This will be further investigated to identify the root cause.
### Intel MPI with Gcc/Clang
Either
`I_MPI_ROOT`
(preferred) or
`MPI_ROOT`
can be used to specify
the Intel-MPI installation directory path.
...
...
@@ -86,7 +101,7 @@ packages:
It appears that spack will otherwise ignore any
`paraview+qt`
version
and attempt to install a
`paraview~qt`
version instead.
--
<!-- Links -->
[
page ParaView
]:
http://www.paraview.org/
...
...
src/thermophysicalModels/specie/thermo/absoluteEnthalpy/absoluteEnthalpy.H
View file @
469c9ff0
...
...
@@ -82,7 +82,14 @@ public:
const
scalar
T
)
const
{
#ifdef __clang__
// Using volatile to prevent compiler optimisations leading to
// a sigfpe
volatile
const
scalar
cp
=
thermo
.
Cp
(
p
,
T
);
return
cp
;
#else
return
thermo
.
Cp
(
p
,
T
);
#endif
}
//- Cp/Cp []
...
...
@@ -104,7 +111,14 @@ public:
const
scalar
T
)
const
{
#ifdef __clang__
// Using volatile to prevent compiler optimisations leading to
// a sigfpe
volatile
const
scalar
ha
=
thermo
.
Ha
(
p
,
T
);
return
ha
;
#else
return
thermo
.
Ha
(
p
,
T
);
#endif
}
//- Temperature from absolute enthalpy
...
...
@@ -117,7 +131,14 @@ public:
const
scalar
T0
)
const
{
#ifdef __clang__
// Using volatile to prevent compiler optimisations leading to
// a sigfpe
volatile
const
scalar
tha
=
thermo
.
THa
(
h
,
p
,
T0
);
return
tha
;
#else
return
thermo
.
THa
(
h
,
p
,
T0
);
#endif
}
};
...
...
src/thermophysicalModels/specie/thermo/absoluteInternalEnergy/absoluteInternalEnergy.H
View file @
469c9ff0
...
...
@@ -83,7 +83,14 @@ public:
const
scalar
T
)
const
{
#ifdef __clang__
// Using volatile to prevent compiler optimisations leading to
// a sigfpe
volatile
const
scalar
cv
=
thermo
.
Cv
(
p
,
T
);
return
cv
;
#else
return
thermo
.
Cv
(
p
,
T
);
#endif
}
//- Cp/Cv []
...
...
@@ -94,7 +101,14 @@ public:
const
scalar
T
)
const
{
#ifdef __clang__
// Using volatile to prevent compiler optimisations leading to
// a sigfpe
volatile
const
scalar
gamma
=
thermo
.
gamma
(
p
,
T
);
return
gamma
;
#else
return
thermo
.
gamma
(
p
,
T
);
#endif
}
// Absolute internal energy [J/kg]
...
...
@@ -105,7 +119,14 @@ public:
const
scalar
T
)
const
{
#ifdef __clang__
// Using volatile to prevent compiler optimisations leading to
// a sigfpe
volatile
const
scalar
ea
=
thermo
.
Ea
(
p
,
T
);
return
ea
;
#else
return
thermo
.
Ea
(
p
,
T
);
#endif
}
//- Temperature from absolute internal energy
...
...
@@ -118,7 +139,14 @@ public:
const
scalar
T0
)
const
{
#ifdef __clang__
// Using volatile to prevent compiler optimisations leading to
// a sigfpe
volatile
const
scalar
tea
=
thermo
.
TEa
(
e
,
p
,
T0
);
return
tea
;
#else
return
thermo
.
TEa
(
e
,
p
,
T0
);
#endif
}
};
...
...
src/thermophysicalModels/specie/thermo/sensibleEnthalpy/sensibleEnthalpy.H
View file @
469c9ff0
...
...
@@ -74,7 +74,7 @@ public:
return
"h"
;
}
// Heat capacity at constant pressure [J/(kg K)]
//
-
Heat capacity at constant pressure [J/(kg K)]
scalar
Cpv
(
const
Thermo
&
thermo
,
...
...
@@ -82,7 +82,14 @@ public:
const
scalar
T
)
const
{
#ifdef __clang__
// Using volatile to prevent compiler optimisations leading to
// a sigfpe
volatile
const
scalar
cp
=
thermo
.
Cp
(
p
,
T
);
return
cp
;
#else
return
thermo
.
Cp
(
p
,
T
);
#endif
}
//- Cp/Cp []
...
...
@@ -96,7 +103,7 @@ public:
return
1
;
}
// Sensible enthalpy [J/kg]
//
-
Sensible enthalpy [J/kg]
scalar
HE
(
const
Thermo
&
thermo
,
...
...
@@ -104,7 +111,14 @@ public:
const
scalar
T
)
const
{
#ifdef __clang__
// Using volatile to prevent compiler optimisations leading to
// a sigfpe
volatile
const
scalar
hs
=
thermo
.
Hs
(
p
,
T
);
return
hs
;
#else
return
thermo
.
Hs
(
p
,
T
);
#endif
}
//- Temperature from sensible enthalpy
...
...
@@ -117,7 +131,14 @@ public:
const
scalar
T0
)
const
{
#ifdef __clang__
// Using volatile to prevent compiler optimisations leading to
// a sigfpe
volatile
const
scalar
ths
=
thermo
.
THs
(
h
,
p
,
T0
);
return
ths
;
#else
return
thermo
.
THs
(
h
,
p
,
T0
);
#endif
}
};
...
...
src/thermophysicalModels/specie/thermo/thermo/EtoHthermo.H
View file @
469c9ff0
...
...
@@ -4,7 +4,13 @@ inline scalar Cp
const
scalar
T
)
const
{
#ifdef __clang__
volatile
const
scalar
cv
=
Cv
(
p
,
T
);
volatile
const
scalar
cpmcv
=
EquationOfState
::
CpMCv
(
p
,
T
);
return
cv
+
cpmcv
;
#else
return
Cv
(
p
,
T
)
+
EquationOfState
::
CpMCv
(
p
,
T
);
#endif
}
inline
scalar
Hs
...
...
@@ -13,7 +19,13 @@ inline scalar Hs
const
scalar
T
)
const
{
#ifdef __clang__
volatile
const
scalar
es
=
Es
(
p
,
T
);
volatile
const
scalar
rho
=
EquationOfState
::
rho
(
p
,
T
);
return
es
+
p
/
rho
;
#else
return
Es
(
p
,
T
)
+
p
/
EquationOfState
::
rho
(
p
,
T
);
#endif
}
inline
scalar
Ha
...
...
@@ -22,5 +34,11 @@ inline scalar Ha
const
scalar
T
)
const
{
#ifdef __clang__
volatile
const
scalar
ea
=
Ea
(
p
,
T
);
volatile
const
scalar
rho
=
EquationOfState
::
rho
(
p
,
T
);
return
ea
+
p
/
rho
;
#else
return
Ea
(
p
,
T
)
+
p
/
EquationOfState
::
rho
(
p
,
T
);
#endif
}
src/thermophysicalModels/specie/thermo/thermo/HtoEthermo.H
View file @
469c9ff0
...
...
@@ -4,7 +4,13 @@ inline scalar Cv
const
scalar
T
)
const
{
#ifdef __clang__
volatile
const
scalar
cp
=
Cp
(
p
,
T
);
volatile
const
scalar
cpmcv
=
EquationOfState
::
CpMCv
(
p
,
T
);
return
cp
-
cpmcv
;
#else
return
Cp
(
p
,
T
)
-
EquationOfState
::
CpMCv
(
p
,
T
);
#endif
}
inline
scalar
Es
...
...
@@ -13,7 +19,13 @@ inline scalar Es
const
scalar
T
)
const
{
#ifdef __clang__
volatile
const
scalar
hs
=
Hs
(
p
,
T
);
volatile
const
scalar
rho
=
EquationOfState
::
rho
(
p
,
T
);
return
hs
-
p
/
rho
;
#else
return
Hs
(
p
,
T
)
-
p
/
EquationOfState
::
rho
(
p
,
T
);
#endif
}
inline
scalar
Ea
...
...
@@ -22,5 +34,11 @@ inline scalar Ea
const
scalar
T
)
const
{
#ifdef __clang__
volatile
const
scalar
ha
=
Ha
(
p
,
T
);
volatile
const
scalar
rho
=
EquationOfState
::
rho
(
p
,
T
);
return
ha
-
p
/
rho
;
#else
return
Ha
(
p
,
T
)
-
p
/
EquationOfState
::
rho
(
p
,
T
);
#endif
}
src/thermophysicalModels/specie/thermo/thermo/thermoI.H
View file @
469c9ff0
...
...
@@ -118,7 +118,12 @@ template<class Thermo, template<class> class Type>
inline
Foam
::
scalar
Foam
::
species
::
thermo
<
Thermo
,
Type
>::
gamma
(
const
scalar
p
,
const
scalar
T
)
const
{
#ifdef __clang__
volatile
const
scalar
Cp
=
this
->
Cp
(
p
,
T
);
#else
const
scalar
Cp
=
this
->
Cp
(
p
,
T
);
#endif
return
Cp
/
(
Cp
-
this
->
CpMCv
(
p
,
T
));
}
...
...
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