Download as pdf or txt
Download as pdf or txt
You are on page 1of 16

LDC-2012-001

4/6/2012
ON THERMODYNAMICALLY-CONSISTENT ANALYTIC
NON-IDEAL-GAS EQUATIONS OF STATE
Lawrence D. Cloutman
adastera47@yahoo.com
Abstract
Thermodynamic consistency of the thermal and caloric equations of state is a nec-
essary condition for accurate computational uid dynamics simulations. First, we list
the consistency conditions and discuss their signicance. Then we consider two equa-
tions of state that have been used in previous studies, a stiened gas and a truncated
virial equation of state. We show how to make them consistent. We also present a
convective stability analysis for the virial equation of state to show that inconsistency
can lead to unphysical results. A computational uid dynamics simulation is presented
that illustrates such a result.
Copyright c 2012 by Lawrence D. Cloutman
All rights reserved
1
1 Introduction
Much applied research requires consideration of the thermodynamics of real uids. An
especially important area is uid 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 partial
dierential 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 eects are signicant, including high-pressure industrial processes, inertial connement
fusion experiments, and in astrophysical bodies such as low-mass stars and Jovian planets.
The equations of state for any real uid must obey certain stability and consistency
conditions. These are touched upon in many of the standard thermodynamics texts, but
their signicance is seldom discussed and examples of how their violation can lead to phys-
ical diculties are virtually nonexistent. Although equations of state that violate these
conditions cannot be physically realized, their use in theoretical and computational uid
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
uid 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)
C
V
=
_
I
T
_

> 0, (2)
_
P
T
_

=
1
T
_
P
2
_
I

_
T
_
, (3)
_
P
T
_

> 0, (4)
and
_

2
P
V
2
_
T
=
2
_

2
P

__
T
> 0, (5)
where P is the pressure, I is the specic internal energy, T is the temperature (in Kelvin),
C
V
is the specic heat at constant volume, and is the uid density. Thermodynamicists
2
traditionally use the specic volume V = 1/ instead of the density.
1
However, it is usually
more convenient to use the density in uid 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
c
2
=
_
P

_
s
=
_
P

_
T
=
_
P

_
T
+
T
_
P
T
_
2

2
_
I
T
_

> 0, (6)
where = C
P
/C
V
is the usual ratio of specic heats at constant pressure and volume. The
thermal stability condition (2) requires a uid 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
M
T, (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 satised. 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 stratied layer of uid.
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 stiened
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 nd 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 uid ows. Section 6 discusses examples of consistent virial equations of state. We
conclude with the summary in section 7.
1
Actually the situation is even more confusing as there is a propensity for the use of the molar specic
volume M/, where M is the mean molecular weight, for the specic volume. However, it is my experience
that it is generally more convenient in CFD to work with mass density rather than molar density.
3
2 A More General Equation of State
A simple but interesting generalization of the ideal gas equation of state is
P =
R
M
T + f() (8)
and
I =
_
T
0
C
V
() d + g(), (9)
where C
V
(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 requires
_
P

_
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 sucient condition for mechanical stability is df/d > 0. In the presence of
the ideal gas term, df/d 0 is a sucient condition for mechanical stability.
The thermal stability condition is
_
I
T
_

= C
v
(T) > 0 (11)
for all functions g().
The conditions (4) and (5) are also easy to impose. Equation (4) is trivially satised
for any function f(). Equation (5) becomes
_

2
P
V
2
_
T
=
3
_
2RT
M
+ 2
df
d
+
d
2
f
d
2
_
> 0. (12)
Mechanical stability limits df/d, so this condition provides a restriction on the values of
d
2
f/d
2
. In many cases, df/d 0 and d
2
f/d
2
0, which is sucient for this condition
to be satised.
The thermodynamic consistency requirement is a little more interesting. It requires
f() =
2
dg()
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 uid
dynamics with real uids, 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
3 The Stiened Gas Equation of State
An equation of state sometimes used for liquids or dense gases is the stiened gas [4, 5]
P =
RT
M
+ a
2
s
(
0
), (14)
where a
2
s
and
0
are non-negative constants.
2
This equation is a simplication of the
commonly used Gr uneisen 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 = C
v
T, (15)
where C
v
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 satised except for equation (3).
Upon integrating equation (13), we obtain consistency by replacing equation (15) by
I = C
v
T + a
2
s
ln +
a
2
s

+ I
0
, (16)
where C
v
is still constant and I
0
is a constant of integration. Perhaps the most natural choice
is I
0
= a
2
s
(1 + ln
0
), which makes I = 0 at T = 0 and =
0
. With this choice of I
0
, the
equation of state may be written in the more symmetric form
I = C
v
T + a
2
s
ln

a
2
s
(
0
)

. (17)
2
The ideal gas term in equation (14) is often written as ( 1)I where the ratio of specic heats and
C
v
= R/M( 1) are assumed constant. However, this is not correct for the consistent caloric equation of
state (16).
5
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)] = C
V
T
_
1 +
b(T)
V
_
, (19)
where is the ratio of specic heats (in the ideal gas limit), and C
V
is the specic heat at
constant volume (in the ideal gas limit). We assume that M, , and C
V
are constants.
It is trivial to verify that the mechanical stability condition (1) may be satised by
the condition
a(T)
V
2
. (20)
The thermal stability condition (2) is a bit more involved. Dierentiation of equation (19)
shows that we require
b(T) + T
db(T)
dT
V. (21)
The consistency condition equation (3) reduces to the constraint
T
da(T)
dT
=
b(T)
1
. (22)
Condition (4) reduces to
a(T) + T
da(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 satises 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 dierent from
the supercially similar stiened gas equation of state, which diers by a factor of T in the
non-ideal-gas term in equation (18).
6
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 coecients [7], which were determined by a crude data t to a crude
molecular dynamics calculation [8]. Such uid dynamics simulations can produce unphysical
uid ows, 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) nds the same stability condition from a meteorological viewpoint. In all cases,
the density of an adiabatically displaced uid 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,
dI
P

2
d = 0. (26)
Substitution of equations (18) and (19) into equation (26) gives
_
1 +
T
(1 + b)
db
dT
_
1
T
_
dT
dr
_
ad
=
( 1)(1 + a) b
1 + b
1

_
d
dr
_
ad
. (27)
Similarly, if we dierentiate equation (18) to nd 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 + T
da
dT
_
[( 1)(1 + a) b]
(1 + a)
_
1 + b + T
db
dT
_
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
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
=
1
1

_
d
dr
_
ad
, (31)
1
P
_
dP
dr
_
ad
=

2

2
1
1
T
_
dT
dr
_
ad
, (32)
and
1
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 a
mixture of an ideal gas and radiation in the single-temperature gray approximation. For the
present virial equation of state,
1
is dened 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 uid layer. Stability is
investigated by adiabatically moving an element of uid 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
=
_

2
g
P
_
(1 + a)
_
1 + b + T
db
dT
_
(1 + 2a)
_
1 + b + T
db
dT
_
+
_
1 + a + T
da
dT
_
[( 1)(1 + a) b]
_
d
dr
_
ad
=
_
gM
RT
_
_
1 + b + T
db
dT
_
(1 + 2a)
_
1 + b + T
db
dT
_
+
_
1 + a + T
da
dT
_
[( 1)(1 + a) b]
.
(35)
8
A sucient 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 + b + T
db
dT
_
(1 + 2a)
_
1 + b + T
db
dT
_
+
_
1 + a + T
da
dT
_
[( 1)(1 + a) b]
.
Since the left-hand side is always positive, we may rewrite this as
(1 + 2a)
_
1 + b + T
db
dT
_
(1 + 2a)
_
1 + b + T
db
dT
_
+
_
1 + a + T
da
dT
_
[( 1)(1 + a) b]
> 1.
(1 + 2a)
_
1 + b + T
db
dT
_
+
_
1 + a + T
da
dT
_
[( 1)(1 + a) b]
(1 + 2a)
_
1 + b + T
db
dT
_
< 1
_
1 + a + T
da
dT
_
[( 1)(1 + a) b]
(1 + 2a)
_
1 + b + T
db
dT
_
< 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 sucient 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)
If b and are suciently 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 of a 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/cm
3
. However, this equation of
state is thermodynamically inconsistent. The consistency condition (22) requires b = 0 for
constant a. In this case, an isothermal atmosphere is always stable, just as we would expect.
9
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 stratied isothermal layer of uid. Physically, this situation is stable, but we
shall see that the inconsistent equation of state produces a strong convective ow.
We shall consider the case of the virial equation of state with constant values of the
virial coecient a, which has been implemented in the latest version of COYOTE [15]. This
program solves the full nonlinear transient Navier-Stokes equations using a nite dierence
method. We adopt the following parameter values.
1. Layer thickness = 1.785 10
9
cm = half the layer width
2. Gravitational acceleration = 4500 cm/s
2
3. T = 5000 K
4. Average density = 2.15483 g/cm
3
5. M = 2.3
6. = 1.3385
7. C
v
= 1.066 10
8
erg/g-K
8. Kinematic viscosity = 1.0 10
13
cm
2
/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-slip
boundaries on the top and bottom.
11. 120 by 80 grid in Cartesian coordinates
The initial conditions for all cases are an isothermal, constant-density uid. 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
uid 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 dierence 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 10
20
and 10
21
ergs.
10
The consistent solution with (a = 1.0, b = 0.0) is an up-and-down gravity mode
that will be slowly damped. Typical uid speed is 1 m/s. As with the ideal gas case, the
uid 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 10
20
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 10
28
ergs and a typical maximum uid speed of 3.1 km/s. Figures 1 through 3 show
the velocity vectors, mass ux u, and temperature at 48 hr. This is a good example of
an inconsistent equation of state producing a convective ow in a case where the physical
solution is a stratied isothermal uid at rest.
11
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 ensure
thermodynamic consistency when using analytic ts to real-gas equations of state and tabular
equations of state. Failure to do so may result in the production of bogus solutions to uid
dynamical problems.
12
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 Scientic Laboratory
report LA-4700, 1971.
[7] L. D. Cloutman, Numerical simulation of compressible convection in dense hydrogen-
helium uids. 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., G ottingen, 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
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
flx cycle = 527653 vmax = 7.1806D+05
Cell center indices 2- 121, 2- 81, t= 1.728004D+05
Figure 2: Mass ux u vectors at 48 hr for the inconsistent virial equation of state.
15
Temper cycle= 527653 t= 1.728004D+05 dt= 4.000000D-01
min = 4.449592D+03 max = 5.982211D+03 dq = 1.532619D+02
M
L
b
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
g
g
g
g
g
g
g
g
h
h
h
h
i i
j
Figure 3: Isotherms at 48 hr for the inconsistent virial equation of state.
16

You might also like