8/2/2019 Consist
1/16
LDC-2012-0014/6/2012
ON THERMODYNAMICALLY-CONSISTENT ANALYTIC
NON-IDEAL-GAS EQUATIONS OF STATE
Lawrence D. Cloutman
Abstract
Thermodynamic consistency of the thermal and caloric equations of state is a nec-essary condition for accurate computational fluid dynamics simulations. First, we listthe consistency conditions and discuss their significance. Then we consider two equa-tions of state that have been used in previous studies, a stiffened gas and a truncatedvirial equation of state. We show how to make them consistent. We also present aconvective stability analysis for the virial equation of state to show that inconsistencycan lead to unphysical results. A computational fluid dynamics simulation is presentedthat illustrates such a result.
Copyright c2012 by Lawrence D. CloutmanAll rights reserved
1
8/2/2019 Consist
2/16
1 Introduction
Much applied research requires consideration of the thermodynamics of real fluids. An
especially important area is fluid dynamics, where in general one requires a thermal equation
of state for the pressure P(, T), where is the mass density and T is the temperature,
and a caloric equation of state for the internal energy density I(, T) to close the partialdifferential equations that express mass, momentum, and energy conservation. In many
applications, the ideal gas laws are adequate. However, there are important cases where real-
gas effects are significant, including high-pressure industrial processes, inertial confinement
fusion experiments, and in astrophysical bodies such as low-mass stars and Jovian planets.
The equations of state for any real fluid must obey certain stability and consistency
conditions. These are touched upon in many of the standard thermodynamics texts, but
their significance is seldom discussed and examples of how their violation can lead to phys-
ical difficulties are virtually nonexistent. Although equations of state that violate these
conditions cannot be physically realized, their use in theoretical and computational fluid
dynamics studies may produce results that violate the second law of thermodynamics. Here
we discuss the stability and consistency conditions appropriate to a typical computational
fluid dynamics (CFD) simulation, provide two examples of real-gas equations of state, and
present an example where a violation of the consistency condition leads to physical nonsense.
The stability and consistency conditions that we shall consider here are summarized
by Fontaine, Graboske, and Van Horn [1]:
P
T > 0, (1)
CV =
I
T
> 0, (2)
P
T
=1
T
P 2
I
T
, (3)
P
T
> 0, (4)
and
2P
V2
T
= 2
2
P
T
> 0, (5)
where P is the pressure, I is the specific internal energy, T is the temperature (in Kelvin),
CV is the specific heat at constant volume, and is the fluid density. Thermodynamicists
2
8/2/2019 Consist
3/16
traditionally use the specific volume V = 1/ instead of the density. 1 However, it is usually
more convenient to use the density in fluid dynamics, and we shall adopt that convention
for the most part.
The mechanical stability condition equation (1) is required to prevent a collapse of a
gas toward any value of for which P(, T) has a (local) minimum. This condition is related
to the condition that the isentropic (reversible adiabatic) sound speed c must obey
c2 =
P
s
=
P
T
=
P
T
+TPT
2
2IT
> 0, (6)
where = CP/CV is the usual ratio of specific heats at constant pressure and volume. The
thermal stability condition (2) requires a fluid to get hotter as energy is added to it at
constant volume (assuming there are no phase changes). Equation (3) is derived in many
standard texts, such as [2] and [3]. This condition insures the physically correct rate of
entropy production. The last two conditions are not strictly required thermodynamically
but are usually obeyed.
Perhaps the most commonly used equation of state is that for an ideal gas,
P =R
MT, (7)
where R is the universal gas constant and M is the mean molecular weight. If I is a
monotonically increasing function of only T, then it is easy to verify that equations (1)
through (5) are satisfied. However, when we begin considering real gases, we must be careful
to ensure that the thermal and caloric equations of state are consistent. Otherwise we can
obtain unphysical results. Later we shall discuss just such a failure in the convective stability
conditions of a stratified layer of fluid.
In Section 2, we apply the consistency conditions to a somewhat generalized equation
of state with a non-ideal component. In section 3, we treat the special case of the stiffened
gas equation of state and analytically derive a caloric equation of state that is consistent
with the thermal equation of state. In section 4, we find the general stability and consistency
conditions for a truncated virial equation of state. In section 5, we examine the convective
stability properties of this equation of state as an example of inconsistency producing un-physical fluid flows. Section 6 discusses examples of consistent virial equations of state. We
conclude with the summary in section 7.
1Actually the situation is even more confusing as there is a propensity for the use of the molar specificvolume M/, where M is the mean molecular weight, for the specific volume. However, it is my experiencethat it is generally more convenient in CFD to work with mass density rather than molar density.
3
8/2/2019 Consist
4/16
2 A More General Equation of State
A simple but interesting generalization of the ideal gas equation of state is
P =R
MT + f() (8)
andI =
T0
CV() d + g(), (9)
where CV(T) is a function only of temperature, and f() and g() are functions of only
density. In the case of an ideal gas, f = g = 0.
The mechanical stability condition requiresP
T
=RT
M+
df()
d> 0. (10)
If the thermal equation of state is independent of T (that is, no ideal gas term), then the
necessary and sufficient condition for mechanical stability is df/d > 0. In the presence ofthe ideal gas term, df/d 0 is a sufficient condition for mechanical stability.
The thermal stability condition isI
T
= Cv(T) > 0 (11)
for all functions g().
The conditions (4) and (5) are also easy to impose. Equation (4) is trivially satisfied
for any function f(). Equation (5) becomes
2
PV2
T
= 3
2RTM
+ 2 dfd
+ d2
fd2
> 0. (12)
Mechanical stability limits df/d, so this condition provides a restriction on the values of
d2f/d2. In many cases, df/d 0 and d2f/d2 0, which is sufficient for this condition
to be satisfied.
The thermodynamic consistency requirement is a little more interesting. It requires
f() = 2dg()
d. (13)
Once one selects either f or g, the other is determined completely except for a possible
integration constant in g. This should not be surprising since the consistency condition is
a consequence of energy conservation [3], with g representing the energy stored by doing
work against the pressure force produced by f. This is a reminder that when doing fluid
dynamics with real fluids, the correct apportioning between kinetic and internal energies
and the correct production of entropy require internal consistency between the thermal and
caloric equations of state, not just accurate solution of the energy conservation equation.
4
8/2/2019 Consist
5/16
3 The Stiffened Gas Equation of State
An equation of state sometimes used for liquids or dense gases is the stiffened gas [4, 5]
P =RT
M+ a2s( 0), (14)
where a2s and 0 are non-negative constants.2 This equation is a simplification of the
commonly used Gruneisen equation of state for solids and liquids limited to small deviations
of the density from the reference density 0 [6]. This thermal equation of state is often used
with the caloric equation of state
I = CvT, (15)
where Cv is constant. However, this caloric equation of state is thermodynamically incon-
sistent with the thermal equation of state (14).
This is a special case of the equation of state discussed in the previous section. It is
trivial to verify that all of the consistency conditions are satisfied except for equation (3).
Upon integrating equation (13), we obtain consistency by replacing equation (15) by
I = CvT + a2
s ln +a2s0
+ I0, (16)
where Cv is still constant and I0 is a constant of integration. Perhaps the most natural choice
is I0 = a2
s(1 + ln 0), which makes I = 0 at T = 0 and = 0. With this choice of I0, the
equation of state may be written in the more symmetric form
I = CvT + a2s ln 0 a
2
s( 0
) . (17)
2The ideal gas term in equation (14) is often written as ( 1)Iwhere the ratio of specific heats andCv = R/M( 1) are assumed constant. However, this is not correct for the consistent caloric equation ofstate (16).
5
8/2/2019 Consist
6/16
4 The Virial Equation of State
A truncated virial equation of state is a computationally convenient means of introducing
corrections to the ideal gas equation of state. Consider the thermal and caloric equations of
state
P =RT
M [1 + a(T)] =RT
MV
1 +a(T)
V
(18)
and
I =RT
( 1)M[1 + b(T)] = CVT
1 +
b(T)
V
, (19)
where is the ratio of specific heats (in the ideal gas limit), and CV is the specific heat at
constant volume (in the ideal gas limit). We assume that M, , and CV are constants.
It is trivial to verify that the mechanical stability condition (1) may be satisfied by
the condition
a(T) V
2. (20)
The thermal stability condition (2) is a bit more involved. Differentiation of equation (19)
shows that we require
b(T) + Tdb(T)
dT V. (21)
The consistency condition equation (3) reduces to the constraint
Tda(T)
dT=
b(T)
1. (22)
Condition (4) reduces to
a(T) + Tda(T)
dT= a(T)
b(T)
1> V. (23)
Condition (5) reduces to
a(T) > V
3. (24)
As expected, the ideal gas limit a = b = 0 satisfies all of these conditions. We also
see from equation (22) that if a(T) is a nonzero constant, then b(T) must be zero. That is,
the caloric equation of state must be independent of the density. This result is different from
the superficially similar stiffened gas equation of state, which differs by a factor of T in the
non-ideal-gas term in equation (18).
6
8/2/2019 Consist
7/16
5 Convective Stability Analysis
An example of where the stability and consistency conditions for a truncated virial equation
of state were not obeyed was published in a study that used a = 1.0 and b = 0.5 (cgs
units) for the virial coefficients [7], which were determined by a crude data fit to a crude
molecular dynamics calculation [8]. Such fluid dynamics simulations can produce unphysicalfluid flows, as we shall demonstrate.
Schwarzschild [9] presented a heuristic stability argument that predicts convection in
an atmosphere with a constant mean molecular weight when the actual temperature gradient
is less than the (negative) adiabatic temperature gradient. This argument is found in many
books on stellar evolution, such as the classic introductory text by Cox and Giuli [10]. This
result was put on a more rigorous footing by Kaniel and Kovetz [11] and Rosencrans [12].
It was extended to the case of variable molecular weight by Ledoux [13]. Thompson [14]
(pp. 65-69) finds the same stability condition from a meteorological viewpoint. In all cases,
the density of an adiabatically displaced fluid element is compared to the density of its new
surroundings to see if the buoyancy force at the new location tends to increase or decrease
its displacement. Thus, both the Schwarzschild and Ledoux criteria for instability in a star
or planetary atmosphere may be written as
d
dr<
d
dr
ad
, (25)
where r is the coordinate antiparallel to the direction of the gravitational acceleration, and
the subscript ad denotes the adiabatic gradient. We shall show that this condition can be
met even in an isothermal atmosphere for certain values of and b.
For an adiabatic process,
dIP
2d = 0. (26)
Substitution of equations (18) and (19) into equation (26) gives1 +
T
(1 + b)
db
dT
1
T
dT
dr
ad
=( 1)(1 + a) b
1 + b
1
d
dr
ad
. (27)
Similarly, if we differentiate equation (18) to find dP/P and use equation (27) to eliminate
dT/T, we obtain
1
P
dP
dr
ad
=(1 + 2a)
1 + b + T db
dT
+
1 + a + TdadT
[( 1)(1 + a) b]
(1 + a)
1 + b + T dbdT
1
d
dr
ad
.
(28)
Note that equations (27) and (28) reduce to the usual adiabatic relations for ideal gases
when a = b = 0 and also in the limit of small for nonzero a and b.
7
8/2/2019 Consist
8/16
For a hydrostatic atmosphere obeying the thermal equation of state (18),
dP
dr= g =
R
M
1 + a + T
da
dT
dT
dr+ T(1 + 2a)
d
dr
, (29)
where g < 0 is the gravitational acceleration. Clearly, dP/dr is always negative since g is
negative. For an isothermal atmosphere,d
dr=
gM
RT(1 + 2a)< 0. (30)
For an adiabatic process involving any equation of state, we can write (for example,
Chandrasekhar [3], p. 56)1
P
dP
dr
ad
= 11
d
dr
ad
, (31)
1
P
dP
dr
ad
=2
2 1
1
T
dT
dr
ad
, (32)
and1
T
dT
dr
ad
= (3 1)1
d
dr
ad
, (33)
where 1, 2, and 3 are the generalized adiabatic exponents. If we eliminate the pressure
between equations (31) and (32), we see that
3 1
1=
2 1
2. (34)
In the case of an ideal gas, 1 = 2 = 3 = . However, none of these equalities hold
for a general equation of state. Chandrasekhar [3] (pp. 53-59) works out the example of amixture of an ideal gas and radiation in the single-temperature gray approximation. For the
present virial equation of state, 1 is defined by equation (28), which is all we really need to
investigate the stability of an isothermal atmosphere.
Equation (25) is the condition for convective instability in a fluid layer. Stability is
investigated by adiabatically moving an element of fluid a distance dr in pressure equilibrium
with the ambient medium. This means we can identify the adiabatic pressure gradient with
the actual pressure gradient. Combining the hydrostatic condition, equation (29), and the
thermal equation of state (18) with equation (28) yields
d
dr
ad
=
2g
P
(1 + a)
1 + b + T db
dT
(1 + 2a)
1 + b + T db
dT
+
1 + a + TdadT
[( 1)(1 + a) b]
d
dr
ad
=
gM
RT
1 + b + T dbdT
(1 + 2a)
1 + b + T db
dT
+
1 + a + TdadT
[( 1)(1 + a) b]
.
(35)
8
8/2/2019 Consist
9/16
A sufficient condition for convective instability of an isothermal atmosphere is found
by substituting equations (30) and (35) into the Schwarzschild/Ledoux criterion (25):
1
1 + 2a 1.
(1 + 2a)
1 + b + T dbdT
+
1 + a + TdadT
[( 1)(1 + a) b]
(1 + 2a)
1 + b + T dbdT
< 1
1 + a + Tda
dT[( 1)(1 + a) b]
(1 + 2a)
1 + b + T dbdT < 0. (36)
We are interested only in cases where > 1, a 0, and b 0. Furthermore, we shall
be interested only in conditions where all of the expressions inside parentheses and square
brackets are greater than zero. In the simplest case where a = b = 0, the sufficient condition
for instability is < 1, which we will never encounter. An isothermal atmosphere of an ideal
gas and constant molecular weight is stable against natural convection.
Now consider the case where a and b are positive constants. Then the criterion for
instability is
[( 1)(1 + a) b] < 0. (37)Ifb and are sufficiently large, then we have the possibility of natural convection occurring in
an isothermal atmosphere. This was found in the numerical simulations reported earlier [7]
where we used a = 1.0, b = 0.5, and = 1.3385. For these values ofa and b, the atmosphere
is stable for 1.5. For smaller values of , instability can occur if the density is greater
than a critical value
c = 1
1.5. (38)
The critical density for the published simulations is 2.1 g/cm3. However, this equation of
state is thermodynamically inconsistent. The consistency condition (22) requires b = 0 forconstant a. In this case, an isothermal atmosphere is always stable, just as we would expect.
9
8/2/2019 Consist
10/16
6 Numerical Examples
We present a numerical example where a thermodynamically inconsistent equation of state
produces a physically incorrect numerical solution. We apply the virial equation of state
applied to a stratified isothermal layer of fluid. Physically, this situation is stable, but we
shall see that the inconsistent equation of state produces a strong convective flow.We shall consider the case of the virial equation of state with constant values of the
virial coefficient a, which has been implemented in the latest version of COYOTE [15]. This
program solves the full nonlinear transient Navier-Stokes equations using a finite difference
method. We adopt the following parameter values.
1. Layer thickness = 1.785 109 cm = half the layer width
2. Gravitational acceleration = 4500 cm/s2
3. T = 5000 K
4. Average density = 2.15483 g/cm3
5. M = 2.3
6. = 1.3385
7. Cv = 1.066 108 erg/g-K
8. Kinematic viscosity = 1.0 1013 cm2/s, Prandtl number = 0.7
9. (a, b) = (0.0, 0.0) (ideal gas), (1.0, 0.0) (consistent virial eos), and (1.0, 0.5) (inconsis-tent virial eos)
10. Adiabatic rigid free-slip boundaries on the sides of the mesh and isothermal free-slipboundaries on the top and bottom.
11. 120 by 80 grid in Cartesian coordinates
The initial conditions for all cases are an isothermal, constant-density fluid. The grid
was divided in half, and the velocity in the left half was set to u = (90.0, 90.0) cm/s. The
velocity in the right half was set to (-90.0, 90.0) cm/s. This insures that the initial condition
is not strictly one-dimensional. The initial strong transient is dominated by vertical motions
that quickly establish a nearly hydrostatic pressure gradient. Thereafter the transient decays
to a steady-state solution.
The ideal gas case (a = b = 0.0) was run out to a time of 40 hr, at which time
the solution was clearly settling down toward a stationary isothermal steady state. The
fluid at that time was sloshing horizontally with a typical maximum speed of 1-2 m/s. This
mode is damped very slowly. At 40 hr, the difference between the minimum and maximum
temperatures in the grid oscillated semi-regularly at a value near 0.2 K. The total kinetic
energy in the grid varied between 1020 and 1021 ergs.
10
8/2/2019 Consist
11/16
The consistent solution with (a = 1.0, b = 0.0) is an up-and-down gravity mode
that will be slowly damped. Typical fluid speed is 1 m/s. As with the ideal gas case, the
fluid is nearly isothermal with a temperature variation of 4 K when the run was terminated
at 32 hr. At that time the total kinetic energy was 1.7 1020 ergs and was decaying almost
monotonically.
The ideal gas case (a = b = 1.0) was run out to a time of 48 hr. The solution is not
quite steady at this time, but it is approaching a steady state with a total kinetic energy of
2.2 1028 ergs and a typical maximum fluid speed of 3.1 km/s. Figures 1 through 3 show
the velocity vectors, mass flux u, and temperature at 48 hr. This is a good example of
an inconsistent equation of state producing a convective flow in a case where the physical
solution is a stratified isothermal fluid at rest.
11
8/2/2019 Consist
12/16
7 Summary
Thermodynamic consistency and stability conditions on the thermal and caloric equations
of state must be obeyed if unphysical results are to be avoided. The virial equation of
state provides a numerical example of an unphysical convective instability produced by
an inconsistent equation of state. This result serves as a warning that one must ensurethermodynamic consistency when using analytic fits to real-gas equations of state and tabular
equations of state. Failure to do so may result in the production of bogus solutions to fluid
dynamical problems.
12
8/2/2019 Consist
13/16
References
[1] G. Fontaine, H. C. Graboske, Jr., and H. M. Van Horn, Equations of state for stellar
partial ionization zones, Ap. J. Suppl. 35, 293 (1977).
[2] M. W. Zemansky, Heat and Thermodynamics, (McGraw-Hill, NY, 1957).
[3] S. Chandrasekhar, An Introduction to the Study of Stellar Structure (University of
Chicago Press, Chicago, 1939).
[4] F. H. Harlow and W. E. Pracht, Formation and penetration of high-speed collapse
jets, Phys. Fluids 9, 1951 (1966).
[5] F. H. Harlow and A. A. Amsden, Numerical Calculation of Almost Incompressible
Flow, J. Comput. Phys. 3, 80 (1968).
[6] F. H. Harlow and A. A. Amsden, Fluid Dynamics, Los Alamos Scientific Laboratoryreport LA-4700, 1971.
[7] L. D. Cloutman, Numerical simulation of compressible convection in dense hydrogen-
helium fluids. A novel instability, Astron. Astrophys. 138, 231 (1984).
[8] W. L. Slattery and W. B. Hubbard, Thermodynamics of a solar mixture of molecular
hydrogen and helium at high pressure, Icarus 29, 187 (1976).
[9] K. Schwarzschild, Akad. d. Wiss., Gottingen, Math.-Phys. 1, 41 (1906).
[10] J. P. Cox and R. T. Giuli, 1968, Principles of Stellar Structure, Vol. 1. Physical Prin-
ciples (New York: Gordon and Breach).
[11] S. Kaniel and A. Kovetz, Phys. Fluids 10, 1186 (1967).
[12] S. Rosencrans, On Schwarzschilds criterion, SIAM J. Appl. Math. 17, 231 (1969).
[13] P. Ledoux, Stellar models with convection and with discontinuity of the mean molecular
weight, Ap. J. 105, 305 (1947).
[14] Thompson, P. A.; Compressible Fluid Dynamics; McGraw-Hill, NY, 1972.
[15] L. D. Cloutman, COYOTE: A Computer Program for 2D Reactive Flow Simulations,
Lawrence Livermore National Laboratory report UCRL-ID-103611, 1990.
13
8/2/2019 Consist
14/16
vel cycle = 527653 vmax = 3.1401D+05
Cell center indices 2- 121, 2- 81, t= 1.728004D+05
Figure 1: Velocity vectors at 48 hr for the inconsistent virial equation of state.
14
8/2/2019 Consist
15/16
flx cycle = 527653 vmax = 7.1806D+05
Cell center indices 2- 121, 2- 81, t= 1.728004D+05
Figure 2: Mass flux u vectors at 48 hr for the inconsistent virial equation of state.
15
8/2/2019 Consist
16/16
Temper cycle= 527653 t= 1.728004D+05 dt= 4.000000D-01
min = 4.449592D+03 max = 5.982211D+03 dq = 1.532619D+02
M
Lb b
c
c
c
c
d d d
d
d
d
d
d
e
e
e e
e
e e
e
e
e
e
e
e
e
e
e
e
e
f
f
f
f
f
f
f
f
f
f
f
f
f
f
gg
g
g
g
g
gg
hh
h
h
i i
j
Figure 3: Isotherms at 48 hr for the inconsistent virial equation of state.
16