ADA553075
ADA553075
ADA553075
Douglas V. Nance
AFRL/RWPC
101 W. Eglin Blvd.
Eglin AFB, FL 32542-6810
December 2011
INTERIM REPORT
Using Government drawings, specifications, or other data included in this document for any purpose
other than Government procurement does not in any obligate the U.S. Government. The fact that the
Government formulated or supplied the drawings, specifications, or other data does not license the
holder or any other person or corporation, or convey any rights or permission to manufacture, use, or
sell any patented invention that may relate to them.
This report was cleared for public release by the 96th Air Base Wing, Public Affairs Office, and is
available to the general public, including foreign nationals. Copies may be obtained from the Defense
Technical Information Center (DTIC) < http://www.dtic.mil/dtic/index/html>.
This report is published in the interest of scientific and technical information exchange, and its
publication does not constitute the Government’s approval or disapproval of its ideas or findings.
Form Approved
REPORT DOCUMENTATION PAGE OMB No. 0704-0188
The public reporting burden for this collection of information is estimated to average 1 hour per response, including the time for reviewing instructions, searching existing data sources,
gathering and maintaining the data needed, and completing and reviewing the collection of information. Send comments regarding this burden estimate or any other aspect of this collection of
information, including suggestions for reducing the burden, to Department of Defense, Washington Headquarters Services, Directorate for Information Operations and Reports (0704-0188),
1215 Jefferson Davis Highway, Suite 1204, Arlington, VA 22202-4302. Respondents should be aware that notwithstanding any other provision of law, no person shall be subject to any
penalty for failing to comply with a collection of information if it does not display a currently valid OMB control number.
PLEASE DO NOT RETURN YOUR FORM TO THE ABOVE ADDRESS.
1. REPORT DATE (DD-MM-YYYY) 2. REPORT TYPE 3. DATES COVERED (From - To)
01-12-2011 INTERIM 01-10-2011 - 31-10-2011
4. TITLE AND SUBTITLE 5a. CONTRACT NUMBER
Basic Detonation Physics Algorithms N/A
5b. GRANT NUMBER
N/A
5c. PROGRAM ELEMENT NUMBER
62602F
6. AUTHOR(S) 5d. PROJECT NUMBER
Douglas V. Nance 2502
5e. TASK NUMBER
67
5f. WORK UNIT NUMBER
63
7. PERFORMING ORGANIZATION NAME(S) AND ADDRESS(ES) 8. PERFORMING ORGANIZATION
REPORT NUMBER
AFRL/RWPC
101 W. Eglin Blvd. AFRL-RW-EG-TR-2011-159
Eglin AFB, FL 32542-6810
14. ABSTRACT
This report presents the theory behind a series of detonation physics algorithms used to simulate the detonation of a condensed
explosive. The numerical scheme implemented in this case is the Roe flux difference splitting scheme due to Glaister. This report
contains a detailed discussion of the mathematical derivation along with a printing of the source code. We also include a discussion
of methods for implementing Lagrangian tracking algorithms for solid inclusions within the condensed explosive.
16. SECURITY CLASSIFICATION OF: 17. LIMITATION OF 18. NUMBER 19a. NAME OF RESPONSIBLE PERSON
a. REPORT b. ABSTRACT c. THIS PAGE ABSTRACT OF Douglas V. Nance
PAGES
UL 19b. TELEPHONE NUMBER (Include area code)
UNCLAS UNCLAS UNCLAS 102
Standard Form 298 (Rev. 8/98)
Reset Prescribed by ANSI Std. Z39.18
TABLE OF CONTENTS
Section Page
1 INTRODUCTION 1
2 GOVERNING EQUATIONS 4
3 SYSTEM EIGEN-STRUCTURE 10
5 PARTICLE MOTION 28
6 RESULTS 32
8 RECOMMENDATIONS 39
REFERENCES 40
Figure Page
1 Interface Notation 23
Steady increases in large scale circuit integration indicate that the Twenty-First
Century will promise significant advances in High Performance Computing (HPC)
machinery. Today, one may obtain desk-side Linux systems containing eight processors
(and thirty-two or more cores) for comparatively reasonable prices. Moreover, common
laptop systems wield significant computing power with central processing unit (CPU)
speeds in the neighborhood of 3.0 GHz (maybe more by the time this report is certified)
and random access memory (RAM) storage capability in hundreds of Gigabytes (GB). In
the realm of “Big Iron”, the Department of Defense (DoD) High Performance Computing
(HPC) Modernization Office recently began operating clusters each with tens of
thousands of cores, and the Department of Energy laboratory community has even larger
systems. These developments have significant implications for the relatively small
Computational Physics research community. This research community represented by
disciplines such as high energy physics, quantum chemistry and computational fluid
dynamics has an ever increasing need for computer memory and for parallel processing
speed.
Computational Fluid Dynamics (CFD) has drawn on HPC resources for many
years to help with aircraft and fluid system design. Some problems like high Reynolds
number direct numerical simulations are still computationally inaccessible, but these
situations are fewer in number than just one decade ago. For instance, we routinely solve
problems involving the large eddy simulation (LES) of compressible turbulence with
good results. Older techniques such as Reynolds-Averaged Navier-Stokes (RANS)
simulation now teeter on the brink of obsolescence. Moreover, massive computing power
now permits us to invade new territory previously relegated to analytical solutions
supported by many assumptions and highly simplified, under-resolved computational
studies. Quantum physics now benefits widely from HPC science in the areas of quantum
chemistry and molecular dynamics. These areas of physics now impact design
engineering. Although it occupies only a very small part of the research community,
detonation physics, a close relative of CFD, can benefit handsomely from ever more
powerful computational techniques and equipment.
The reactive Euler equations are frequently used to represent detonation flow
fields based upon a reaction progress equation and a mixture equation of state.2 The
equations for the conservation of mass, momentum, energy and reaction progress may be
readily expressed in vector form. The equation for a detonation field set in one space
dimension may be written as
U F
S G S Rx S P (2.1.1)
t x
where
U [ , u, E, ]T (2.1.2)
F [ u, u 2 P, u( E P), u ]T
(2.1.3)
j
SG [ u, u 2 , u ( E P), u ]T (2.1.4)
x
E e u2 (2.1.7)
2
Distribution A. Approved for public release, distribution unlimited. (96ABW-2011-0548)
4
where e is the internal energy per unit mass. The equation of state may be written in the
general form
P P( , e, ) (2.1.8)
N
P
r k (1 ) (2.1.9)
PCJ
where PCJ is the Chapman-Jouquet pressure for HMX; k , N and are constants
chosen to fit experimental data.5 Note that this reaction rate law is dependent upon both
pressure and reaction progress. The source term vector S P has been added to the system
by the author. It represents the dynamic coupling between the detonation products and a
field of discrete, massive Lagrangian particles. The coupling is based upon both
momentum and thermal effects.6 The specific forms of the coupling terms are presented
in a later section.
For the detonation problem, relevant equations of state are cast in the form of
(2.1.8). This form is complicated since pressure varies as a function of density, internal
energy per unit mass and reaction progress. In this analysis, the reaction progress variable
is analogous to a species mass fraction commonly used in reacting gas flows. Moreover,
it is used to compute the specific internal energy for the detonating mixture by forming a
weighted sum of the equation of state (EOS) for the solid explosive and the EOS for the
detonation products. The resulting expression for specific internal energy is called the
mixture EOS.2 Our governing equations (2.1.1), discretized in accordance with the finite
volume method, rely upon the mixed cell approach. Each flow cell is assumed to contain
a mixture – part solid explosive and part detonation products. The mixture fraction is
given by the reaction progress variable , and is defined as the mass fraction of the
s g (2.2.1)
so is given by
g
(2.2.2)
and
s
1 (2.2.3)
Hence, we have that is the mass fraction of the gas (detonation products) phase. We
also assert that the internal energy for a given finite volume cell may be expressed as
e eg (1 ) es (2.2.5)
where e g and es are the specific internal energies for the gas and solid phases,
respectively. This mixing rule differs from the archived approach based upon specific
volume, but to date, we have not been successful in applying Xu’s closure.7 Assume the
same pressure for both phases with each phase having its own equation of state, i.e.,
eg e g ( g , P ) (2.2.6)
es es ( s , P) (2.2.7)
In the previous section, we showed that one part of our mixture EOS represents
the solid explosive. In the discussions that follow, we apply two different forms of an
EOS originally developed by Hayes.8 The first form of this EOS (Hayes-I) works very
well for mechanical effects.2 The Hayes-I EOS is given as
P P0 P0 s 0
s
N 1
s0
es ( s , P) t3 1
t
4
( N 1)1 1 (2.3.1)
s 0 s s
s 0
g
where
Cvs T0 g
t3 (2.3.3)
s0
H1
t4 (2.3.4)
s 0 N ( N 1)
The second form of the Hayes EOS (Hayes-II) functions well mechanically but
also incorporates temperature. The Hayes-II EOS is given as
1 H 1 s
N
P0 s 0
es ( s , P) P P0
1 t3 1
g N s 0 s 0 s
(2.3.5)
N 1
t 4 s ( N 1)1 s 0 1
s 0 s
This version of the Hayes EOS may be derived by using Reference 1; however,
additional terms are incorporated in (2.3.5) to match the behavior of (2.3.1) at ambient
pressure. The temperature of the solid explosive is given by
1 H1
N
s
T ( s , P) P P0 1 T0 (2.3.6)
t3 N s 0
As equation (2.2.5) indicates, part of the mixture EOS must address the gaseous
products resulting from the detonation of the solid explosive. For the purposes of this
work, we have selected the Jones-Wilkins-Lee (JWL) EOS.1 The JWL EOS is somewhat
controversial, but nevertheless, it is widely applied in hydrocodes. Also, many explosives
have been characterized for this EOS. We apply the JWL EOS in the following form.
1 g Rˆ g Rˆ
eg ( g , P ) P A1 exp 1 B1 exp 2 Q e0 (2.4.1)
g Rˆ1 Rˆ 2
g g
where A , B , , R̂1 and R̂2 are coefficients produced by curve-fitting for the explosive
under consideration. Also, note that
Rˆ1 R1 s 0 , (2.4.2)
and
Rˆ 2 R2 s 0 . (2.4.3)
Q is the heat of detonation for the explosive, and e0 is the reference value for specific
internal energy. There is no firm rule for determining e0 , but we will define e0 as
e0 Cvg T0 . (2.4.4)
Cvg is the constant volume specific heat for the detonation products. The data used for
HMX in the JWL EOS is listed in Table 2.2 For the studies performed later in this work,
Distribution A. Approved for public release, distribution unlimited. (96ABW-2011-0548)
8
we select one of the Hayes equations of state in combination with the JWL EOS to form a
mixture EOS.
is called the flux Jacobian matrix. The term Fi simply denotes the ith element of the flux
vector F . Equation (3.1.1) is already annotated with the specific elements of U . It is
important to note that our equation of state is cast in a general form, so the calculation of
the specific elements of (3.1.1) is made more complicated. The method for calculating
these matrix entries relies heavily on the derivatives of pressure taken with respect to the
conservative variables.10 For convenience, the pressure derivatives for this Jacobian are
given below. For the three-dimensional case, the detailed derivation of these pressure
derivatives is presented in Reference 11. For pressure given in the form of (2.1.8), let
P P P
P ; Pe ; P (3.1.2)
e, e , ,e
P u2 E
P Pe 2 P (3.1.3)
u , E ,
P u
Pe (3.1.4)
( u ) , E ,
P P
e (3.1.5)
E , u ,
Clearly, the pressure derivatives taken with respect to the conservative variables depend
on the pressure derivatives defined in (3.1.2). These derivatives, in turn, depend on the
specific form of the equation of state (2.1.8). Accordingly, the derivation of the elements
of (3.1.1) is a complicated process not to be presented here. Instead, the reader is referred
to a work containing like, yet detailed, mathematical derivations.11 For completeness, the
flux Jacobian matrix for (2.1.1) is given below.
0 1 0 0
2 P Pe P
a u u 2 e
2
A (3.1.7)
2 u 2
Pe u
u (a H ) H Pe u1 P
u 0 u
where
EP
H (3.1.8)
Pe P
(H u2 ) (3.1.9)
P Pe
a 2 P . (3.1.10)
2
We can also define a vector of non-conservative variables for the reactive Euler
equations as V , where
V [ , u, P, ]T . (3.1.11)
As you may surmise, the governing equations may also be written in terms of the non-
conservative variables, and we may define a non-conservative flux Jacobian matrix Â
such that11
( ) ( )
r (3.1.13)
t x
( u )
u r (3.1.14)
t x t x
The first term in (3.1.14) vanishes since it is just a scalar multiple of the continuity
equation (component one of 2.1.1), so we obtain
u r (3.1.15)
t x
3.2 Eigenvalues
The eigenvalues of the flux Jacobian matrix contain important information on the
physics of our detonation problem. We think of any fluid mechanics problem (as well as
most solid mechanics problems) in terms of interacting waves. The detonation problem
can be decomposed into a set of characteristic waves.2 The speeds at which these waves
propagate are given by the eigenvalues of the flux Jacobian matrix.12 For any square
matrix A , the eigenvalues are defined as the set of numbers such that
A I 0 (3.2.1)
where I is the identity matrix. We may note that the conservative matrix (3.1.7) is
heavily populated, so it is very difficult to obtain the eigenvalues by using (3.2.1).
Fortunately, the non-conservative matrix (3.1.12) is a simpler form mathematically
equivalent to (3.1.7), so these matrices must have the same eigenvalues.11 Using (2.3.1),
the eigenvalues of (3.1.12) are easily shown to be
{u a, u, u, u a} (3.2.2)
3.3 Eigenvectors
In order to determine the characteristic waves for (2.1.1), we must determine the
eigenvectors for the conservative Jacobian matrix (3.1.7). When we use the term
eigenvector, in this case, we are referring to a right eigenvector.10
Equation (3.3.1) is useful in that it tells us how to find right eigenvectors. To find a right
eigenvector for (3.1.7) associated to an eigenvalue , we first define the components of
right eigenvector r . Let
r (1, 2 , 3 , 4 )T (3.3.2)
Now we apply (3.1.7) and (3.3.1) to create a linear system of equations in the
components of r .
0 1 0 0
2 P P P 1 1
a u u 2 e
2 e
2
2
(3.3.3)
2 u2 Pe u 3 3
u (a H ) H Pe u 1 P
4
4
u 0 u
The system (3.3.3) directly leads to a system of four eigenvector equations. The
eigenvector equations do not have a unique solution; in fact, they have an infinite number
of solutions, so care is required in structuring prospective choices for the components of
r to design a proper numerical treatment for the problem. Also, it is important to observe
that the number of linearly independent eigenvectors must be same as the order of the
system. For this detonation problem, the Jacobian matrix is of the fourth order, so we
must determine four linearly independent eigenvectors even though we have only three
distinct eigenvalues; the eigenvalue u is repeated.
1 1 ; 2 (3.3.5)
Equation (3.3.5) may be used in (3.3.3) to produce the remaining three eigenvector
equations
u P P
a 2 u 2 2u Pe e 3 0 (3.3.6)
u2 u u
u (a H ) H i Pe 3 P 4 0
2
(3.3.7)
u (u )4 0 (3.3.8)
Based upon (3.3.5), we may produce the eigenvector associated to eigenvalue u . Set
u in (3.3.8), and we see that this equation is trivially satisfied with no restrictions on
4 . Now we set u in (3.3.7) and (3.3.8); by simplifying, we can show that both of
these equations reduce to the same equation, i.e.,
u2 Pe P
a2 Pe 3 4 0 (3.3.9)
Since there are no restrictions on 4 , we may freely choose 4 and solve for 3 .
a3 P
3 H ( 4 ) . (3.3.10)
Pe Pe
T
a 2 Pe
r 1, u, H , 0 (3.3.11)
Pe P
1 1 ; 2 u a (3.3.13)
4 (3.3.14)
We can produce another eigenvector equation associated with this eigenvalue by using
(3.3.14) and setting u a in (3.3.6). By doing so and solving for 3 , we have that
3 H u a (3.3.15)
One may show that (3.3.13), (3.3.14) and (3.3.15) satisfy (3.3.7), and the eigenvector
associated to eigenvalue u a is
r (1, u a, H u a, )T (3.3.16)
1 1 ; 2 u a (3.3.17)
Equation (3.3.8) can be applied to again obtain the result (3.3.14). By substituting
(3.3.17) and (3.3.14) into (3.3.6), we can solve for 3 ,i.e.,
3 H u a . (3.3.18)
Subsequently, one can show that (3.3.17), (3.3.18) and (3.3.14) satisfy equation (3.3.7).
Hence, the eigenvector associated to eigenvalue u a , may be written as
r (1, u a, H u a, )T (3.3.19)
Equations (3.3.11), (3.3.12), (3.3.18) and (3.3.19) are the eigenvectors for the reactive
Euler equations in one dimension. We can form R , the matrix of right eigenvectors, by
allowing each eigenvector to form a column of this matrix. Hence,
1 1 1 1
ua u u u a
R a 2 P a 2 P (3.3.20)
H ua H H ( 1) H u a
Pe Pe Pe Pe
0 1
So far, our development of the eigen-structure for the reactive Euler equations closely
coincides with Glaister’s derivation performed for the real gas equation of state.10 From
(3.3.21), we can see that our eigenvectors are well-defined and constitute a non-singular
system for realistic values of density and the speed of sound with Pe 0 . As a result, R
is invertible under the same conditions, and we can calculate the matrix of left
eigenvectors L with L R 1 , and by using the adjoint matrix for R (the transpose of
the matrix of cofactors) in conjunction with the definition of the inverse matrix, we have
that
a P a
a H u 2 (u a) a u
Pe Pe Pe
2a (1 )(u H ) ( a P ( 1)) 2u a( 1)
2 2
1 Pe
L
R 2 1
2a u H ( a 2 P ) 2u a
Pe
a P a
a H u 2 (u a) a u
Pe Pe Pe
P
a a
Pe
a 2 P
2a(1 ) 2a ( 1)
Pe Pe (3.3.22)
a 2
P
2a 2a
Pe Pe
a a
P
Pe
Each row of the matrix shown in (3.3.22) is a left eigenvector for the Jacobian matrix
found in (3.1.7).
Although we have not yet presented explicit forms for the pressure derivatives,
we have accomplished a great deal of work in this section. Equations (3.2.2), (3.3.20) and
(3.3.22) offer a complete description of the structure of the eigen-space associated with
the flux Jacobian matrix A shown in 3.1.7. Moreover, we can formulate a special
similarity transformation, i.e.,
or
Λ LAR (3.3.24)
and
u a 0 0 0
0 u 0 0
Λ (3.3.25)
0 0 u 0
0 0 0 u a
is the diagonal matrix of eigenvalues.11 Recall that matrix L is the inverse of R . Our
discussion of the numerical physics behind Roe’s scheme for the reactive Euler equations
is now complete. The Roe formulation is quite important from the theoretical standpoint,
but this method is difficult to implement for two or more non-Cartesian space
dimensions. Fortunately, other flux-based discretization methods such as the Harten, Lax
and van Leer (HLL) family of schemes can easily be applied to this problem. Moreover,
these methods do not require the calculation of pressure derivatives (yet to be discussed)
for the mixture equation of state. This fact affords greater of ease of calculation for a
production numerical scheme.
In this section, we pull together all of the aspects of detonation physics and
mathematics discussed in preceding sections and dedicate our efforts to the solution of
our benchmark problem – simulating the detonation of a finite sphere of HMX. In order
to accomplish this goal, we begin by presenting detailed pressure derivatives for our
mixture equation of state. Then we discuss the details associated with our chosen
numerical integration scheme including formulation of the numerical flux vector.
H1
N
e e
II I
1 (4.1.1)
gN 0
s s
These expressions for the internal energy of the solid explosive differ by only one term.
The Hayes-I/JWL mixture EOS may be written as
H1 (1 )
N
(1 )
e (1 ) e 1 eg (4.1.3)
II I
gN 0
M s
where we have used (2.2.3). A general formula for the Hayes- K /JWL mixture EOS may
be written as
N
K H 1 (1 ) (1 )
eM (1 ) es II
K I
1 eg (4.1.4)
gN 0
Accordingly, equations (2.3.1) through (2.3.4) may be used to expand (4.1.4) and obtain
0
M
1 Rˆ 1 Rˆ
A exp 1 B exp 2 (Q e0 ) (4.1.5)
ˆ ˆ
R1 R2
H 1 (1 ) (1 )
N
K
1
gN 0
II
where
1 1
D (4.1.6)
g
P
t3 0 (4.1.7)
0
( N 1) t4 (4.1.8)
P0
t5 t 4 (4.1.9)
g
1
N 1
P eMK 1 0 t 4 (1 ) N t5 (1 )
D 0
1 Rˆ 1 Rˆ
A exp 1 B exp 2 (Q e0 ) (4.1.10)
ˆ ˆ
R1 R2
N
H1 N 1
( ) ( )
K
1 1
II
gN 0
1 8
P ci i ,
D i 1
(4.1.11)
so we may use linearity and differentiate each term individually. If we designate a non-
conservative variable of differentiation as q , q { , , e} , then we have that
P 1 8
i D
2
q D
c D q
i i .
q
(4.1.12)
i 1
N 1 N 2
3 N 1
3 (1 )
N
; c3 t 4 ; (1 ) N
0 0 0
N 1
(4.1.15)
3 3
N (1 ) N 1 ; 0
0 e
4 4 4
4 1 ; c4 t4 ; 0; 1; 0 (4.1.16)
e
1 Rˆ 5
5 exp 1 ; c5 A ; 0
ˆ
R1 e
5 1 Rˆ 1 Rˆ
2 1 1 exp 1 (4.1.17)
5 Rˆ1 1 1 Rˆ1
exp
( ) 2 Rˆ1
1 Rˆ 6
6 exp 2 ; c6 B ; 0
ˆ
R2 e
6 1 Rˆ 1 Rˆ
2 2 1 exp 2 (4.1.18)
6 Rˆ 2 1 1 Rˆ 2
exp
( ) 2 Rˆ 2
7 7 7
7 ; c7 Q e0 ; 0; 1; 0. (4.1.19)
e
D 1 D 1 D
2 ; ; 0 (4.1.21)
g e
Clearly, we may use (4.1.12) through (4.1.21) to evaluate the pressure derivatives
required by the eigen-space decomposition discussed in Section 3.
U F
S (4.2.1)
t x
where S is a vector containing all of the source terms. To enact the finite volume
discretization, we integrate (4.2.1) in 1-D space as follows
U F
xi 1 / 2 x
i 1 / 2 x
i 1 / 2
t
xi 1 / 2
dx x
xi 1 / 2
dx S dx
xi 1 / 2
(4.2.2)
Moreover, we obtain
U
xi 1 / 2 xi 1 / 2
F S dx (4.2.3)
xi 1 / 2
dx
xi 1 / 2
t xi 1 / 2
xi 1 / 2
Since the limits are fixed in the first term of (4.2.3) and since we assume that U is
continuous on the interval ( xi 1/ 2 , xi 1/ 2 ) , we may interchange the order of integration and
differentiation to find that
i 1 / 2
x xi 1 / 2
t xi 1 / 2 S dx
U F (4.2.4)
xi 1 / 2
dx xi 1 / 2
xi 1 / 2
By observing that the integral in the first term is taken over space, we may evaluate it as
U dx U ( x
xi1/ 2
i i 1/ 2 xi 1/ 2 ) (4.2.5)
~
where U i is the average of U U( x, t ) taken over space in the interval [ xi 1/ 2 , xi 1/ 2 ] .
This interval defines cell i in the finite volume grid. Because of the integration, observe
~ ~
that Ui Ui ( x) . If we also apply this idea to the source term, (4.2.4) becomes
~
dU i ~
( xi 1/ 2 xi 1/ 2 ) F xi1/ 2 Si ( xi 1/ 2 xi 1/ 2 ) (4.2.6)
x
dt i 1 / 2
The values of F used in (4.2.7) are evaluated at cell interfaces (natural locations for
possible discontinuities in Euler solutions). As a result, at each interface, F is evaluated
as a numerical flux through the use of an upwind discretization scheme based on the
~
values of U i defined at the cell centers. The upwind scheme, described later in
Subsection 4.4, makes use of the theory developed in Section 3.
Basically, equation (4.3.2) implements the Euler time integration method.14 The only
numerical stability control we place on (4.3.2) involves a restriction on the time-step t .
This restriction is enforced through a Courant-Friedrichs-Lewy (CFL) criterion. We
apply a factor of 0.5 to the new predicted time-step given by
xi
t pred min
(4.3.3)
ui ai
1i i max
1 ~
f (FL FR A (U R U L )) (4.3.4)
2
~
where A is the flux Jacobian matrix defined by (3.3.23) and evaluated at the interface in
question. The (~) notation indicates that this evaluation is conducted with the use of Roe-
averaged variables. The designations L and R are best explained by referring to Figure 1.
The subscript L or R designates that the quantity is defined just to left or right of the
Distribution A. Approved for public release, distribution unlimited. (96ABW-2011-0548)
23
interface, respectively. In Figure 1, the interface is located at xi 1 / 2 between cell i and
cell i 1 . Why would the left and right interface values of some property differ? The
answer is very simple. Remember that we stated earlier that our method involves
solutions of the Riemann problem. These solutions admit discontinuities, e.g., shock
waves. Hence, by the nature of a discontinuity, the properties taken to the left and the
right of an interface differ. In the simplest view, we can say that the properties to the left
of the interface taken on the values defined in cell i ; it follows that the properties to the
right of the interface take on the values defined in cell i 1 . This means of selecting the
left and right interface values renders first-order accuracy on uniform meshes. There are
other ways to define these upwind values. A higher order method is discussed in a later
subsection. Our Roe averages are computed from these upwind (L and R) variables.
~ L R (4.3.5)
u L uR R
u~ L (4.3.6)
L R
~ H L H R R
H L (4.3.7)
L R
~ e L eR R
e L (4.3.8)
L R
~ L L R R
(4.3.9)
L R
~ ~ 1
P ~ H e~ u~ 2 (4.3.10)
2
~~
~ 2 ~ P Pe
a P ~ 2 (4.3.11)
One may note that (3.3.20) through (3.3.22), (3.3.25) and (4.3.11) require Roe-averaged
pressure derivatives. Recall that explicit formulas for these derivatives are presented in
(4.1.12) through (4.1.20). The derivatives are presented in terms of the primitive
variables, so we claim that Roe-averaged values of the pressure derivatives may be
Distribution A. Approved for public release, distribution unlimited. (96ABW-2011-0548)
24
obtained by simply evaluating these formulas for the Roe-averaged variables presented in
(4.3.5) through (4.3.10). In practice, this procedure seems to work well.
We may now address the practical evaluation of the numerical flux vector as it is
defined in (4.3.4). The vectors FL and FR are the standard Euler flux vectors (2.1.3)
evaluated for the upwind conservative variables U L and U R (or primitive variables q R
and q L ), respectively. The remaining term
~
A (U R U L ) (4.3.12)
is denoted as the numerical viscosity expression. The difference between the conservative
variables left and right of the interface may be easily evaluated through the use of (2.1.2).
~
A may be evaluated as follows.
~ ~ ~~
A R ΛL (4.3.13)
where the (~) notation indicates that all of the entries in the matrices are calculated with
~
the use of averaged variables. The matrix Λ is created by taking the absolute value of
~
each element of Λ , the diagonal matrix of eigenvalues. Finally, (4.3.12) is computed by
a series of simple matrix-matrix and matrix-vector multiplications; (4.3.4) is easily
evaluated by using vectors sums.
The scheme described in the preceding subsection is only accurate to the first
order, and it is highly dissipative, a detriment to the sharp resolution of detonation waves.
In this subsection, we briefly describe an enhancement to the first order scheme that is
third-order accurate on uniform grids. As you may have concluded, the left and right
interface values are constructed from the cell-center values to the left and right of the
interface, respectively. To increase the order of accuracy for the scheme, we instead
reconstruct the interface values using interpolating polynomials involving more than one
cell-center value. One way to apply this idea is through the use of a Monotone Upwind
Scheme for Conservation Laws (MUSCL).12 The equations for the left and right interface
variables are provided below for the interface located at i 1/ 2 . Consider the primitive
variable q , q , u , P , .
1 1
qL qi 1 (1 ) (rL )(qi 1 qi 2 ) (1 ) (qi qi 1)
4 rL
(4.4.1)
r2 r
(r ) (4.4.3)
1 r 2
1 1
qR qi (1 ) (rR )(qi 1 qi ) (1 ) (qi qi 1) (4.4.4)
4 rR
qi qi 1
rR (4.4.5)
qi 1 qi
Equations (4.4.1) through (4.4.5) cannot be implemented without due cognizance. The
left interpolant involves cell-center values located at i 2 , i 1 and i . As a result, we
must ensure that
Otherwise, the cell-center data is non-monotone, and the interface values must be set to
the first-order values
qL qi 1
(4.4.7)
qR qi
in order to properly smooth the solution. For the right interpolant, we must ensure that
or we must use the first-order interpolation values (4.4.7). In addition, after the criteria
(4.4.6) and (4.4.8) are satisfied, we are required to limit on the ratios (4.4.2) and (4.4.5).
Based on the data, these ratios may become undefined, so the limiter function (4.4.3)
must be modified ensure that its value always remains finite. If this interpolation strategy
is used properly, the Roe algorithm becomes a high-resolution flux difference splitting
scheme.
Distribution A. Approved for public release, distribution unlimited. (96ABW-2011-0548)
26
4.6 Boundary Conditions
0 1
u0 u1
P0 P1 (4.5.1)
0 1
e0 e1
We have assumed that the first flow field cell adjacent to this boundary has the index
i 1.
At the outer surface of the sphere, we apply extrapolated boundary conditions to
mimic a supersonic outflow. We implement this condition by installing a ghost cell at
i iMAX . We set conditions in this cell as follows.
IMAX IMAX -1
uIMAX u IMAX -1
PIMAX PIMAX -1 (4.5.2)
IMAX IMAX -1
eIMAX eIMAX -1
Boundary conditions (4.5.1) and (4.5.2) function well for the detonation of a finite
spherical mass of HMX.
(i) The particle collection exists in the diffuse limit. Particles are assumed not to
interact with one another.
(ii) Particles are assumed to exist as rigid spheres. The do not deform or change
phase during the detonation event.
(iii) This model is restricted to one dimension. We can only establish initial
particle positions along a single ray.
Based on these assumptions, we can investigate the efficacy of this model in predicting
the post-detonation conditions for a mass of solid HMX loaded with particles.
We may now discuss the coupling terms (source terms) for particles presented in
equations (2.1.1) and (2.1.6). Fs and Q s have relatively simple descriptions. Fs
represents the transfer of momentum between the gas phase and the particle phase while
Q s represents the similar transfer of thermal energy. For spherical particles, these terms
may be written in a simple form.6 Assume that the total number of particles is N p .
4
N
p
du p
Fs p rp3
(5.1.1)
p 1 3 dt
~
pN
Q s 4 hp rp2 (T Tp ) (5.1.2)
p 1
where p , rp and u p are the solid density, radius and velocity of the p th particle,
~
respectively. Therefore, du p / dt is the acceleration of the p th particle. Also, T is the
temperature of the gas phase at the surface of the particle, and T p is the particle
~
temperature. Actually, T is the Favre-filtered temperature; this filtering operation is used
to take the presence of turbulence into account. Our simulation is non-viscous, so we
~
simply set T equal to the gas phase temperature T . The parameter h p is the heat transfer
coefficient that governs the transfer of thermal energy at the particle/fluid interface. In
Distribution A. Approved for public release, distribution unlimited. (96ABW-2011-0548)
28
general, h p is experimentally determined. By specifying (5.1.1) and (5.1.2), we can
accurately describe the coupling between the gas and particulate phases. Of course, these
equations only apply to particles of fixed mass. Additional terms (including mass
conservation) must be specified for particles that react with the gas phase.
dx p
up (5.2.1)
dt
The particle velocity u p must be determined from the evolution equation given by a
model. We have two alternatives for this model; the first is called the “Spray Model”
which may be described as follows.6
du p 3 CD Re p
(u u p ) (5.2.2)
dt 16 p rp2
The drag coefficient for the particle C D is conveyed by the “Spray Drag Law”, i.e.,
24 Re 2p/ 3
1 Re p 1000
Re
p 6
CD (5.2.4)
0.44 Re p 1000
, and u are the density, dynamic viscosity and velocity of the gas phase in the
vicinity of the particle. This model is not appropriate for detonation problems, but it still
serves well for testing. For the problem of a detonation with solid inclusions, we apply a
high speed gas flow model originally developed for solid rocket motors.
In order to maintain our notation consistent with the literature, (5.2.5) is written in terms
of the particle diameter d p instead of the radius. Also, m p is the mass of the p th particle.
This high speed drag law provides the drag coefficient through a more complicated
calculation. First, we calculate a “Mach-zero” drag coefficient, C D 0 , i.e.,
C1 2 0.08
(0.45 2 ) C1 ( 2 0.08) C2 0.08 2 0.45
CD0 0.37
C2 2 0.45
(5.2.6)
24 4.4
C1 0.42 (5.2.7)
Re p Re p
4 150 2
.
C2 1.75 (5.2.8)
31 1 Re p
In (5.2.6) and (5.22.8), we have introduced two new parameters 1 and 2 ; they are the
volume concentrations of the gas and particle phases, respectively. These parameters
require interpretation when considering the detonation problem. At the outset of the
problem, the solid explosive has not been detonated, so there is no gas phase at this point.
The best course of action is to compute the initial values of 1 and 2 based upon the
volume of the solid explosive and the volume of particles. Since we are not simulating
details of the shock interaction with metal particles, we calculate 1 and 2 on this basis
of the initial calculation and maintain them fixed for the duration of the detonation. We
must then calculate a final value of C D based on a Mach correction.17 This correction
exists due to the natural variation in the drag coefficient with Mach number. If we do not
wish to implement a drag correction, then we set C D CD 0 ; otherwise the corrected value
of C D may be calculated from
From the start of this effort, several versions of our current numerical detonation
computer code have been developed by the author. The purpose of this section is to
present some of the results produced for typical problems. Specifically, we discuss three
results. The first set of results is intended to show that our detonation program is
functioning properly and producing physically correct solutions. In a second calculation,
we address the numerical detonation of a spherical mass of pure HMX. For this problem,
we have computed results by using both the Hayes-I and Hayes-II equations of state for
the solid explosive combined with the JWL EOS for the detonation products. Finally, we
discuss the results for the detonation of a spherical mass of HMX loaded with steel
particles.
This test problem, described in Reference 2, is used to show whether or not the
flux difference splitting scheme is working properly. In this case, we endeavor to solve a
Deflagration to Detonation Transition (DDT) problem in one dimension. Both the
explosive and the detonation products are modeled by using the calorically perfect gas
EOS. The associated mixture EOS is given as
P
e Q (6.1.1)
( 1)
This density distribution initiates the reaction in the region near x 0 by boosting the
reaction rate term.
This problem does not possess an “exact” solution, but Xu et al. have obtained a
fully converged numerical solution using a mesh consisting on 3200 cells.2 This problem
provides an excellent test detonation physics algorithms. Accordingly, we have generated
three numerical solutions on grids comprised of 200, 800 and 3200 cells, respectively.
The numerical solutions for density, velocity, pressure and the reaction progress variable
are provided in Figures 2 through 5, respectively, at the dimensionless time 3.0. In each
figure, solution plots are color-coded to correspond to the mesh used. The behavior
shown in each plot agrees quite well with archived plots.2 We have observed only one
anomaly in our solutions. Strangely enough, on the mesh consisting of only 200 cells,
there are noticeable oscillations in the reaction progress variable. These oscillations
dissipate with increasing mesh density. The explanation for this behavior is not
immediately evident. In some of our solutions, the reaction progress variable has been
observed to hunt between the solid and gaseous equations of state. In fact, this variable is
Distribution A. Approved for public release, distribution unlimited. (96ABW-2011-0548)
34
very sensitive and couples strongly to the reaction rate. We apply no post-solution
filtering to this variable. Secondly, we are using a weak time integration scheme with
poor numerical stability performance. The oscillations become less prevalent with
increasing grid density, so the space scheme may be compensating for the time scheme.
This phenomenon bears further investigation as this work continues. We will also re-
examine the nonlinear limiter coding. Nevertheless, our converged solution agrees well
with the converged archival solution.2
Figure 7. Numerical detonation solution Hayes-I/JWL in HMX at 3 μs. Horizontal axis is distance in
meters.
This test case is the final detonation problem addressed by this report. We
consider the detonation of a spherical mass of HMX loaded with a radial distribution of
steel particles. The mass of the HMX sphere remains the same as is used for the
preceding problem, and we still have 800 finite volume cells defined along the charge
radius. For this example, we have placed ten particles, at uniform spacing, along the
charge radius. The particles each have a radius of 463 μm and a material density of 7860
kg/m3. We assume the gas viscosity has a value of 1.7x10-5 kg/(m.s). Furthermore, in this
simulation study, we have applied the high speed flow drag law. The results for particle
locations are presented in Figure 8 while the plot of particle velocities is given in Figure
9. The particle tracks shown in Figure 8 clearly indicate the passage of the detonation
wave. For particles farther away from the charge center, the particle tracks show changes
in slope at progressively larger times. The sudden change in track slope concurs with the
nearly discontinuous change seen in the particle velocity traces shown in Figure 9. Also,
in Figure 9, the effect of the drag law can clearly be seen as the particle velocities rise
rapidly in the wake of the detonation wave then fall quickly under the action of drag in
the region behind the wave. We have also applied the Mach correction to the rocket drag
law. In the velocity trace for the particle closest to the charge center, we can see the
velocity begin to level off at 4.5 μs. Available data indicates that the calculated terminal
velocity at or near 375 m/s is an acceptable value. This simulation does not include
thermal effects since we are still in the process of completing our detonation products
EOS.
Figure 8. Radial locations for steel particles embedded in a mass of detonating HMX
In this report, we have presented the governing equations for the direct numerical
simulation of the detonation of a solid explosive material. Proper equations of state have
been discussed for both the solid explosive material and for the gaseous detonation
products. From these equations of state, we have developed a mixture equation of state
relating the specific internal energy for the detonation to the thermodynamic pressure.
The resulting computer program has been tested on an archival detonation problem for
the purpose of comparison. We have presented results for the detonation of a spherical
mass of pure HMX.
8 RECOMMENDATIONS
During the months ahead, detonation physics algorithms are scheduled for
implementation in LESLIE3D. The development of the present work has been a learning
experience accompanied by a large number of difficulties, especially in the
implementation of Roe’s flux difference splitting scheme. A first recommendation is that
the HLL family of schemes be used instead. These schemes are more robust and do not
require the use of pressure derivatives. Also, these schemes already operate well inside of
LESLIE3D. The detonation physics solver will also benefit from the interface tracking
scheme already coded into LESLIE3D. Clearly, the governing equation differ at the
interface between the condensed explosive and the surrounding gas field. This situation
necessitates an interface to maintain code stability.
The detonation physics algorithms discussed here must be adapted for curvilinear
coordinates in three dimensions. For HLL flux forms, this process should not be difficult.
The author has already done some work in this area. However, the pressure and specific
volume (or density) closures associated with the mixture equation of state do require
attention. The Gas-Interpolated Stewart-Prasad-Asay (GISPA) method requires these
closures to address the multiphase physics of detonation. There is no unique set of
closures available for this process, but the chosen closures must be carefull accomplished.
Some difficulty has been encountered in the use of the specific volume closure (due to
Xu), and this difficulty should be investigated and resolved.
The Hayes equation of state for the solid explosive is an older relationship that
characterizes very few explosives. The Mie-Gruneisen equation of state characterizes
many more explosive materials. That is to say, there is data available. However, the
Distribution A. Approved for public release, distribution unlimited. (96ABW-2011-0548)
39
mixture equation of state must be rederived for the Mie-Gruneisen formulation. It may be
combined with the JWL adiabat for the detonation products, or with another real gas state
equation. The “Wide-Ranging” detonation equation of state may also be implemented.4
Ultimately, the particle phase algorithms discussed here must be rewritten for
dense phase fields. The detonation of a condensed explosive with solid inclusions is a
dense phase problem. Also, the computer program is currently not properly written even
in the diffuse limit as regards the nonhomogeneous source terms. The integration scheme
should be changed to reflect the use of Strang splitting.1 That is to say, the spatial
integration scheme should be advanced in separate step from the nonhomogeneous terms.
For the latter step, the integration should be conducted in the temporal manner at each
grid cell just like an initial value problem.
REFERENCES
1. Strang, G., “On the construction and comparison of difference schemes”, SIAM J.
Numer. Anal., Vol. 5, No. 3, pp. 506-517, 1968.
2. Xu, S., Aslam, T. and Stewart, D.S., “High resolution numerical simulation of ideal
and non-ideal compressible reacting flows with embedded internal boundaries”,
Combust. Theory Modeling, Vol. 1, pp. 113-142, 1997.
3. Bdzil, J.B., Stewart, D. S. and Jackson, T.L., “Program burn algorithms based on
detonation shock dynamics: Discrete approximations of detonation flows with
discontinuous front models”, Journal of Computational Physics, Vol. 174, No. 2, pp.
870-902, 2001.
5. Stewart, D.S., “Tools for Design of Advanced Explosive Systems and Other
Investigations on Ignition and Transient Detonation”, Final Report on a Grant from the
U.S. Air Force Research Laboratory Munition Directorate to the University of Illinois,
2005.
6. Chen, K.H. and Shuen, J.S., “A Coupled Multi-Block Solution Procedure for Spray
Combustion in Complex Geometries”, AIAA Paper 93-0108, American Institute for
Aeronautics and Astronautics, 31st Aerospace Sciences Meeting and Exhibit, January
1993.
8. Hayes, D.B., “A Pnt Detonation Criterion From Thermal Explosion Theory”, Sixth
Symposium (International) on Detonation, Pasadena, California, 1976.
Distribution A. Approved for public release, distribution unlimited. (96ABW-2011-0548)
40
9. Davis, W.C., “Complete equation of state for unreacted solid explosive”, Combustion
and Flame, Vol. 120, pp. 399-403, 2000.
10. Glaister, P., “An approximate linearised Riemann solver for the Euler equations for
real gases”, Journal of Computational Physics, Vol. 74, pp. 382-408, 1988.
11. Nance, D.V., “Flux Difference Splitting Algorithms for Real Gas Mixtures”,
Technical Memorandum, Munitions Directorate, Air Force Research Laboratory, March
2006.
12. Hirsch, C., Numerical Computation of Internal and External Flows, Vol. 2, John
Wiley & Sons, New York, 1991.
13. Collela, P. and Woodward, P.R., “The piece-wise parabolic method for gas-
dynamical simulations”, Journal of Computational Physics, Vol. 54, pp. 174-201, 1984.
14. Burden, R.L., Faires, J.D. and Reynolds, A.C., Numerical Analysis, 2nd Ed., Prindle,
Weber & Schmidt, Boston, 1981.
15. Roe, P.L., “Approximate Riemann solvers, parameter vectors and difference
schemes”, Journal of Computational Physics, Vol. 43, p. 357, 1981.
16. Akhatov, I.S. and Vainshtein, P.B., “Transition of porous explosive combustion into
detonation”, Combustion, Explosion and Shock Waves, Vol. 20, No.1, pp. 63-70, 1984.
17. Carlson, D.J. and Hoglund, R.F., “Particle drag and heat transfer in rocket nozzles”,
AIAA Journal, Vol. 2, No. 11, pp. 1980-1984, 1964.
Instructions:
The source code that follows has been developed over a period of six years, but in
a sporadic manner, as time has permitted. FORTRAN 77 is used throughout the computer
program, and an in-line coding structure has been used. The programming is designed for
research and is thus rather crude. The initial conditions (shock-based initiation) are all
rigidly coded. Different initiation options exist, but they must be enabled or disabled by
commenting. The detonation reaction rate laws are treated in the same way. The desired
reaction rate law must be commented in for the initial conditions and for the first and
second time step segments of the solver. The calorically perfect gas and Jones-Wilkins-
Lee test problems are also activated or deactivated by commenting in/out code segments.
This computer program is written for standard explosives like HMX for which we
have plenty of data. Especially for the Hayes equation of state, a great deal of data input
is required. This data is simply entered directly into the source code. This statement is
also true as pertains to the Jones-Wilkins-Lee detonation product data as well as the
particle field data. This code functions in one dimension only: Cartesian, cylindrical or
spherical. The domain boundaries are contained between x1 and x2. The number of cells
in the detonation field is given by imax-1. The variable NSTP tells the code how many
iterations (time steps) to execute while the variable NDMP tells the code how many
iterations to perform between dump files. The variable IRST controls code execution.
With IRST set at zero, the code begins with the coded initial conditions. With IRST set at
one, the code reads the restart.data file to obtain its starting conditions. The IEOS
variable switches between the mixture equations of state. IEOS equal zero sets calorically
perfect gas conditions. IEOS at one sets JWL conditions while IEOS equal 2 or 3 sets the
Hayes-I/JWL and Hayes-II/JWL formulations. The reader should be advised that the pure
JWL option does not work well. The fault of this equation is that there is not a sufficient
energy separation between the adiabats to result in detonation.
This detonation physics program utilizes a number of flags and control parameters
in order to stabilize code operation. Some of these parameters set tolerances on the
variables (like the reaction progress variable) to prevent “hunting”. Other flags control
solution progress. For instance, internal energy updates are lagged by one iteration to
keep temperature from turning negative. It is also important to observe that the equations
of state used here have constant specific heat formulations. Over time, this limitation
should be lifted, but better equation of state data is required to do so. We also zero the
detonation reaction rate in the far field. As it happens, the flux scheme will erroneously
allow reaction rate to creep up slowly in the unreacted explosive mass. This effect is
damaging to the solution and had to be corrected.
c * * * * * * * * * * * * * EZ1_MASTER * * * * * * * * * * * *
c * * * * * * * * * * * * * * * ** * * * * * * * * * * * * * *
c Program for 1-D detonation test problem
c Simple coding structure
Distribution A. Approved for public release, distribution unlimited. (96ABW-2011-0548)
42
c Monotonicity check implemented on extrapolation
c Direct adaptations for calorically perfect gas and JWL
program ez1_master
implicit none
c Parameter statements
integer imax
c parameter (imax = 20001)
parameter (imax = 2001)
integer npar
parameter (npar = 1000)
real*8 c12
parameter (c12 = 0.5d0)
real*8 c13
parameter (c13 = 1d0/3d0)
real*8 c14
parameter (c14 = 0.25d0)
real*8 c18
parameter (c18 = 0.125d0)
real*8 c23
parameter (c23 = 2d0/3d0)
real*8 c43
parameter (c43 = 4d0/3d0)
real*8 c316
parameter (c316 = 3d0/16d0)
real*8 pi
parameter (pi = 3.141592654d0)
c Debug flags
integer idbg1
integer idbgf
integer idbgs
integer idbgp
c Control flags
integer irst
integer ieos
integer igeo
integer irxn
integer ipar
integer idrg
integer imach
Distribution A. Approved for public release, distribution unlimited. (96ABW-2011-0548)
43
integer iext
integer iav
integer ilim
integer imon
integer iefx
integer item
c Counters
integer i
integer n,nn,np
integer l,m
integer k
integer nstart
integer nstp
integer ndmp
integer nfil
c Detonation data
real*8 qdet0
real*8 e0
real*8 eact
real*8 rk
real*8 rk1
real*8 rk2
real*8 pexp
real*8 zexp
real*8 th1
real*8 th2
real*8 rh1
real*8 rh2
real*8 rht
real*8 rhti
real*8 wr1
real*8 wr2
real*8 wr1r
real*8 wr2r
real*8 time
real*8 tend
real*8 dt
real*8 dt0
real*8 dt1
real*8 dtmx
real*8 cfl
real*8 offs
c Derived data
real*8 et
real*8 ra
real*8 ra2
real*8 ea
real*8 za
real*8 rz
real*8 omz
real*8 rxmin
real*8 bot
real*8 bot2
real*8 botr
real*8 botz
Distribution A. Approved for public release, distribution unlimited. (96ABW-2011-0548)
45
real*8 dpdr
real*8 dpde
real*8 dpdz
real*8 a2
real*8 psgn
real*8 kap
real*8 eps
real*8 epsm
real*8 epsp
real*8 off
real*8 tmp
real*8 rl,rr
real*8 ul,ur
real*8 pl,pr
real*8 zl,zr
real*8 el,er
real*8 eel,eer
real*8 hhl,hhr
real*8 dqer,dqwr,dqir
real*8 dqeu,dqwu,dqiu
real*8 dqep,dqwp,dqip
real*8 dqez,dqwz,dqiz
real*8 denm
real*8 dra,drb,drc,drd,dre
real*8 dua,dub,duc,dud,due
real*8 dpa,dpb,dpc,dpd,dpe
real*8 dza,dzb,dzc,dzd,dze
real*8 rat
real*8 phir
real*8 phiu
real*8 phip
real*8 phiz
real*8 phi
real*8 vhi
real*8 sqrl
real*8 sqrr
real*8 rsumi
real*8 rav
real*8 ri
real*8 uav
real*8 zav
real*8 eav
real*8 hav
real*8 aav
real*8 pav
real*8 delr
real*8 delv
real*8 delp
real*8 delz
Distribution A. Approved for public release, distribution unlimited. (96ABW-2011-0548)
46
real*8 detr
real*8 pest
c Array declarations
real*8 x(imax)
real*8 r(0:imax)
real*8 p(0:imax)
Distribution A. Approved for public release, distribution unlimited. (96ABW-2011-0548)
47
real*8 u(0:imax)
real*8 z(0:imax)
real*8 ei(0:imax)
real*8 a(0:imax)
real*8 rxr(0:imax)
real*8 c(8)
real*8 top(8)
real*8 topr(8)
real*8 topz(8)
real*8 rp(0:imax)
real*8 pp(0:imax)
real*8 up(0:imax)
real*8 zp(0:imax)
real*8 eip(0:imax)
real*8 etp(0:imax)
real*8 ap(0:imax)
real*8 tk(imax)
real*8 dtk(imax)
real*8 zzl(imax)
real*8 zzr(imax)
real*8 qv(imax,4)
real*8 qvp(imax,4)
real*8 sg(imax,4)
real*8 srx(imax,4)
real*8 sp(imax,4)
real*8 s(imax,4)
real*8 aeg(4)
real*8 evr(4,4)
real*8 cwm(4)
real*8 chk1(4,4)
real*8 chk2(4,4)
real*8 dq(4)
real*8 v1(4)
real*8 vn(4)
real*8 fl(4)
real*8 fr(4)
real*8 fn(imax,4)
real*8 dqv(4)
real*8 derv(imax,2)
c Particle arrays
integer pcel(npar)
real*8 px(npar)
real*8 pu(npar)
real*8 pa(npar)
Distribution A. Approved for public release, distribution unlimited. (96ABW-2011-0548)
48
real*8 pxp(npar)
real*8 pup(npar)
real*8 pq(npar)
real*8 ptk(npar)
real*8 ptkp(npar)
ccccccccccccccccccccccccccccccccccccccccccccccccccccccccc
ccccccccccccccccccccccccccccccccccccccccccccccccccccccccc
c Main Data Entry Section
ccccccccccccccccccccccccccccccccccccccccccccccccccccccccc
ccccccccccccccccccccccccccccccccccccccccccccccccccccccccc
c Grid data
x1 = 0d0
c x2 = 200d0
x2 = 3.6d-2
chx = 3.8d-2
ccccccccccccccccccccccccccccccccccccccccccccccccccccccccc
c Detonation reaction data
ccccccccccccccccccccccccccccccccccccccccccccccccccccccccc
c CPG Test
eact = 10d0
rk = 16.418d0
c th1 = 0d0
c th2 = 0d0
c rxmin = rk*dexp(-eact)
c qdet0 = 25d0
c HMX Test
c pcj = 42d9
c rk1 = 110d6
c rk2 = 0d0
c pexp = 3.5d0
c zexp = 0.93d0
c th1 = 0d0
c th2 = 0d0
c rxmin = rk1*((pamb/pcj)**pexp)
c qdet0 = (7.91d0 - 4.33d0*(r0*1d-3 - 1.3d0)**2
c & -0.934d0*(r0*1d-3 - 1.3d0))*1d6
c NM Test
c pcj = 12.5d9
c pexp = 1d0
c zexp = 0.95d0
c rk1 = 7.75d10
Distribution A. Approved for public release, distribution unlimited. (96ABW-2011-0548)
50
c rk2 = 1.5d12
c th1 = 14500d0
c th2 = 29700d0
c rxmin = rk1*dexp(-th1/tk0)
c qdet0 = 4.530d5
c RDX Test
pcj = 26.5d9
rk1 = 110d6
rk2 = 0d0
pexp = 3.5d0
zexp = 0.93d0
th1 = 0d0
th2 = 0d0
rxmin = rk1*((pamb/pcj)**pexp)
qdet0 = 5.375d6
c Particle data
xp1 = 1.0d-2
xp2 = 5.9d-2
pmass = 4.3d0
rop = 7860d0
rdp = 280d-6
pcp = 446d0
mu = 1.7d-5
c mu = 1.0d-3
tcon = 2.57d-2
ccccccccccccccccccccccccccccccccccccccccccccccccccccccccc
ccccccccccccccccccccccccccccccccccccccccccccccccccccccccc
c Code control data and flags
ccccccccccccccccccccccccccccccccccccccccccccccccccccccccc
ccccccccccccccccccccccccccccccccccccccccccccccccccccccccc
c Data
off = 1d-6
cfl = 0.5d0
n = 0
nfil = 0
nstart = 0
nstp = 10
ndmp = 1
dtmx = 1d-2
time = 0d0
tend = 50d0
c Flags
irst = 1
iav = 1
iext = 1
ilim = 1
ieos = 3
igeo = 1
irxn = 1
iefx = 2
ipar = 0
idrg = 1
imach = 1
Distribution A. Approved for public release, distribution unlimited. (96ABW-2011-0548)
51
c Debug control
idbg1 = 0
idbgf = 0
idbgs = 0
idbgp = 0
pause
c Derived data
c Thermal data
cpg = rgas + cvg
ppr = cpg*tcon/mu
crppr = ppr**c13
c EOS Parameters
rh1 = r1*r0
rh2 = r2*r0
wr1 = wj/rh1
wr1r = wr1/r0
wr2 = wj/rh2
wr2r = wr2/r0
cjh = cj*(r0**(-(1d0 + wj)))
nhp1 = nh + 1d0
alfa = nh - 1d0
nhm1 = alfa
nhm2 = nh - 2d0
e0 = cvg*tk0
c Hayes-I EOS
t3 = cvs*tk0*gh/r0
t4 = h1/r0/nh/alfa
t5 = pamb/gh + t4
t7 = pamb/gh + beta + t4
Distribution A. Approved for public release, distribution unlimited. (96ABW-2011-0548)
52
thta = t3 - pamb/r0
beta = thta + alfa*t4
alf21 = alf2/alf1
c Other constants
epsm = c14*(1d0 - kap)
epsp = c14*(1d0 + kap)
gam1 = gamm - 1d0
ccccccccccccccccccccccccccccccccccccccccccccccccccccccccc
ccccccccccccccccccccccccccccccccccccccccccccccccccccccccc
c Grid Generation Section
ccccccccccccccccccccccccccccccccccccccccccccccccccccccccc
ccccccccccccccccccccccccccccccccccccccccccccccccccccccccc
dx = (x2 - x1)/(imax-1)
offs = 0.1d0
do i = 1,imax
x(i) = x1 + (i-1)*dx
c write(*,*) ' i = ',i,' x = ',x(i)
enddo
ccccccccccccccccccccccccccccccccccccccccccccccccccccccccc
ccccccccccccccccccccccccccccccccccccccccccccccccccccccccc
c Initial Conditions and Restart File Section
ccccccccccccccccccccccccccccccccccccccccccccccccccccccccc
ccccccccccccccccccccccccccccccccccccccccccccccccccccccccc
ccccccccccccccccccccccccccccccccccccccccccccccccccccccccc
c Set initial conditions (no restart)
ccccccccccccccccccccccccccccccccccccccccccccccccccccccccc
if (irst .eq. 0) then
ccccccccccccccccccccccccccccccccccccccccccccccccccccccccc
c CPG EOS ICs
ccccccccccccccccccccccccccccccccccccccccccccccccccccccccc
if (ieos .eq. 0) then
r(i) = 1d0/(1d0 + 3d0*dexp(-xc*xc))
p(i) = 1d0
u(i) = 0d0
z(i) = 0d0
ccccccccccccccccccccccccccccccccccccccccccccccccccccccccc
c JWL EOS ICs
ccccccccccccccccccccccccccccccccccccccccccccccccccccccccc
else if (ieos .eq. 1) then
r(i) = 1.2d0
c p(i) = 25d0*pamb/(1.00001d0 - dexp(-xc*xc))
u(i) = 0d0
z(i) = 0d0
ccccccccccccccccccccccccccccccccccccccccccccccccccccccccc
c Hayes-I/JWL EOS ICs
ccccccccccccccccccccccccccccccccccccccccccccccccccccccccc
else if (ieos .eq. 2) then
r(i) = r0
c p(i) = pamb
c HMX or NM
p(i) = 2d0*pcj*dexp(-xc*xc/0.001d0/0.001d0) + pamb
u(i) = 0d0
z(i) = 0d0
tk(i) = tk0
ccccccccccccccccccccccccccccccccccccccccccccccccccccccccc
c Hayes-II/JWL EOS ICs
ccccccccccccccccccccccccccccccccccccccccccccccccccccccccc
else if (ieos .eq. 3) then
r(i) = r0
c HMX/RDX/NM
c p(i) = 2d0*pcj*dexp(-xc*xc/0.004d0/0.004d0) + pamb
c NM
c p(i) = 2d0*pcj*dexp(-xc*xc/0.0005d0/0.0005d0) + pamb
u(i) = 0d0
z(i) = 0d0
enddo
ccccccccccccccccccccccccccccccccccccccccccccccccccccccccc
c Particle ICs
ccccccccccccccccccccccccccccccccccccccccccccccccccccccccc
if (ipar .eq. 1) then
endif
ccccccccccccccccccccccccccccccccccccccccccccccccccccccccc
c Read the restart file
ccccccccccccccccccccccccccccccccccccccccccccccccccccccccc
write(*,*) ' Reading restart file.'
open(40,file='restart.data',form='unformatted')
read(40) nstart
read(40) nfil
read(40) time
do i = 1,imax-1
read(40) r(i),p(i),u(i),z(i)
enddo
close(40)
else
write(*,*) ' '
write(*,*) ' Unknown restart option.'
Distribution A. Approved for public release, distribution unlimited. (96ABW-2011-0548)
57
write(*,*) ' '
endif
ccccccccccccccccccccccccccccccccccccccccccccccccccccccccc
c Compute initial derived flow variables for the cells
ccccccccccccccccccccccccccccccccccccccccccccccccccccccccc
do i = 1,imax-1
ccccccccccccccccccccccccccccccccccccccccccccccccccccccccc
c CPG EOS internal energy and pressure derivatives
ccccccccccccccccccccccccccccccccccccccccccccccccccccccccc
ei(i) = p(i)/r(i)/gam1 - z(i)*qdet0
ccccccccccccccccccccccccccccccccccccccccccccccccccccccccc
c JWL EOS internal energy and pressure derivatives
ccccccccccccccccccccccccccccccccccccccccccccccccccccccccc
rht = r(i)/r0
rhti = 1d0/rht
ri = 1d0/r(i)
ccccccccccccccccccccccccccccccccccccccccccccccccccccccccc
c Hayes-I/JWL EOS internal energy and pressure derivatives
ccccccccccccccccccccccccccccccccccccccccccccccccccccccccc
ra = r(i)
ra2 = ra*ra
za = z(i)
rz = ra*za
omz = 1d0 - za
dpdr = beta*r0*gh/ra2
Distribution A. Approved for public release, distribution unlimited. (96ABW-2011-0548)
58
& - alfa*gh*t4*(ra**(alfa-1d0))/(r0**alfa)
dpde = gh
c Mixed phases
else if (ztol1 .lt. za .and. za .lt. ztol2) then
ei(i) = p(i)/wj/ra
& - aj*(1d0/wj/ra - 1d0/rh1)*dexp(-rh1/ra)
& - bj*(1d0/wj/ra - 1d0/rh2)*dexp(-rh2/ra)
& - qdet0 - e0
Distribution A. Approved for public release, distribution unlimited. (96ABW-2011-0548)
59
dpdr = wj*ei(i)
& + aj*(rh1/ra2 - wj/ra - wj/rh1)*dexp(-rh1/ra)
& + bj*(rh2/ra2 - wj/ra - wj/rh2)*dexp(-rh2/ra)
& + wj*(qdet0 + e0)
dpde = wj*ra
endif
ccccccccccccccccccccccccccccccccccccccccccccccccccccccccc
c Hayes-II/JWL EOS internal energy and pressure derivatives
ccccccccccccccccccccccccccccccccccccccccccccccccccccccccc
ra = r(i)
ra2 = ra*ra
za = z(i)
rz = ra*za
omz = 1d0 - za
dpdr = beta*r0*gh/ra2
& - alfa*gh*t4*(ra**(alfa-1d0))/(r0**alfa)
& + h1/r0*((ra/r0)**nhm1)
dpde = gh
c Mixed phases
else if (ztol1 .lt. za .and. za .lt. ztol2) then
ei(i) = p(i)/wj/ra
& - aj*(1d0/wj/ra - 1d0/rh1)*dexp(-rh1/ra)
& - bj*(1d0/wj/ra - 1d0/rh2)*dexp(-rh2/ra)
& - qdet0 - e0
dpdr = wj*ei(i)
& + aj*(rh1/ra2 - wj/ra - wj/rh1)*dexp(-rh1/ra)
& + bj*(rh2/ra2 - wj/ra - wj/rh2)*dexp(-rh2/ra)
& + wj*(qdet0 + e0)
dpde = wj*ra
endif
else
write(*,*) ' '
write(*,*) ' Unknown EOS'
write(*,*) ' '
stop
endif
ccccccccccccccccccccccccccccccccccccccccccccccccccccccccc
c Initial reaction rate
ccccccccccccccccccccccccccccccccccccccccccccccccccccccccc
c Floor on 1 - z near 0
if (z(i) .gt. ztol2) then
omz = 0d0
else
omz = 1d0 - z(i)
endif
c Test Rate 1
c rxr(i) = rk1*dsqrt(omz)
c if (p(i,j) - 1d9 .lt. 0d0) rxr(i) = 0d0
c if (p(i,j) - 1d9 .eq. 0d0) rxr(i) = 0.5d0*rxr(i)
c NM Test Rate
c rxr(i) = (rk1*dexp(-th1/tk(i))*omz
c & + rk2*dexp(-th2/tk(i))*z(i))*(omz**zexp) - rxmin
c if (rxr(i) .lt. 0d0) rxr(i) = 0d0
enddo
72 format(1x,d12.6,1x,d12.6,1x,d12.6,1x,d12.6,1x,d12.6,1x,d12.6,
& 1x,d12.6,1x,d12.6,1x,d12.6)
do i = 1,imax-1
xc = c12*(x(i) + x(i+1))
write(21,72) xc,r(i),u(i),p(i),z(i),ei(i),a(i),rxr(i),tk(i)
Distribution A. Approved for public release, distribution unlimited. (96ABW-2011-0548)
62
enddo
close(21)
write(*,*) ' ICs ready.'
write(*,*) ' '
pause
ccccccccccccccccccccccccccccccccccccccccccccccccccccccccc
ccccccccccccccccccccccccccccccccccccccccccccccccccccccccc
c Set the internal energy correction and scale variables
ccccccccccccccccccccccccccccccccccccccccccccccccccccccccc
ccccccccccccccccccccccccccccccccccccccccccccccccccccccccc
e0cr = 0d0
eta = 0.999d0
ccccccccccccccccccccccccccccccccccccccccccccccccccccccccc
ccccccccccccccccccccccccccccccccccccccccccccccccccccccccc
c Main Solver Loop
ccccccccccccccccccccccccccccccccccccccccccccccccccccccccc
ccccccccccccccccccccccccccccccccccccccccccccccccccccccccc
do while (n .lt. nstp .and. time .lt. tend)
ccccccccccccccccccccccccccccccccccccccccccccccccccccccccc
c Allocate particles to cells
ccccccccccccccccccccccccccccccccccccccccccccccccccccccccc
if (ipar .eq. 1) then
do np = 1,npar
pcel(np) = int((px(np) - x1)/dx) + 1
c write(*,*) ' px(',np,') = ',px(np)
c write(*,*) ' pcel(',np,') = ',pcel(np)
c write(*,*) ' '
enddo
pum = 0d0
pam = 0d0
do np = 1,npar
if (dabs(pu(np)) .gt. pum) pum = dabs(pu(np))
if (dabs(pa(np)) .gt. pam) pam = dabs(pa(np))
enddo
endif
ccccccccccccccccccccccccccccccccccccccccccccccccccccccccc
c Compute time step
ccccccccccccccccccccccccccccccccccccccccccccccccccccccccc
dt = 1d2
do i = 1,imax-1
dx = x(i+1) - x(i)
dt0 = dx/(dabs(u(i)) + a(i))
Distribution A. Approved for public release, distribution unlimited. (96ABW-2011-0548)
63
if (ipar .eq. 1) then
dt1 = dx/(dabs(u(i)) + pum)
dt0 = min(dt0,dt1)
c dt1 = 2d1*dx/pam
c dt0 = min(dt0,dt1)
endif
if (dt0 .lt. dt) dt = dt0
enddo
dt = cfl*dt
dt = min(dt,dtmx)
c Fixed at x = xmax
c r(imax) = 1d0
c u(imax) = 0d0
c p(imax) = 1d0
c z(imax) = 0d0
c ei(imax) = p(imax)/r(imax)/gam1
c Extrapolated at x = xmax
r(imax) = r(imax-1)
u(imax) = u(imax-1)
p(imax) = p(imax-1)
z(imax) = z(imax-1)
ei(imax) = ei(imax-1)
ccccccccccccccccccccccccccccccccccccccccccccccccccccccccc
c Minimum reaction rate taken at cell imax-1
ccccccccccccccccccccccccccccccccccccccccccccccccccccccccc
Distribution A. Approved for public release, distribution unlimited. (96ABW-2011-0548)
64
c Floor on 1 - z near 0
if (z(imax-1) .gt. ztol2) then
omz = 0d0
else
omz = 1d0 - z(imax-1)
endif
ccccccccccccccccccccccccccccccccccccccccccccccccccccccccc
c Compute conservative variables; assemble source terms
ccccccccccccccccccccccccccccccccccccccccccccccccccccccccc
do i = 1,imax-1
qv(i,1) = r(i)
qv(i,2) = r(i)*u(i)
et = ei(i) + 0.5d0*u(i)*u(i)
qv(i,3) = r(i)*et
qv(i,4) = r(i)*z(i)
ccccccccccccccccccccccccccccccccccccccccccccccccccccccccc
c Compute the source vectors
ccccccccccccccccccccccccccccccccccccccccccccccccccccccccc
c Geometric
xc = c12*(x(i) + x(i+1))
sg(i,1) = -r(i)*u(i)/xc
sg(i,2) = -r(i)*u(i)*u(i)/xc
sg(i,3) = -u(i)*(r(i)*et + p(i))/xc
sg(i,4) = -r(i)*u(i)*z(i)/xc
ccccccccccccccccccccccccccccccccccccccccccccccccccccccccc
c Reaction rate
ccccccccccccccccccccccccccccccccccccccccccccccccccccccccc
c Floor on 1 - z near 0
if (z(i) .gt. ztol2) then
omz = 0d0
else
omz = 1d0 - z(i)
endif
c NM Test Rate
Distribution A. Approved for public release, distribution unlimited. (96ABW-2011-0548)
65
c rxr(i) = (rk1*dexp(-th1/tk(i))*omz
c & + rk2*dexp(-th2/tk(i))*z(i))*(omz**zexp) - rxmin
c if (rxr(i) .lt. 0d0) rxr(i) = 0d0
c Particle phase
sp(i,1) = 0d0
sp(i,2) = 0d0
sp(i,3) = 0d0
sp(i,4) = 0d0
enddo
ccccccccccccccccccccccccccccccccccccccccccccccccccccccccc
c Compute particle phase coupling terms
ccccccccccccccccccccccccccccccccccccccccccccccccccccccccc
if (ipar .eq. 1) then
do np = 1,npar
c Momentum
sp(pcel(np),2) = sp(pcel(np),2) - p0mas*pa(np)
c Energy
sp(pcel(np),3) = sp(pcel(np),3) - pq(np)
enddo
endif
ccccccccccccccccccccccccccccccccccccccccccccccccccccccccc
c Compute the total source vector
ccccccccccccccccccccccccccccccccccccccccccccccccccccccccc
do i = 1,imax-1
do m = 1,4
s(i,m) = igeo*sg(i,m) + irxn*srx(i,m) + ipar*sp(i,m)
enddo
ccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccc
c Compute the numerical flux at each grid point
ccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccc
71 format(2x,d12.6,2x,d12.6,2x,d12.6,2x,d12.6)
do i = 1,imax
rr = r(i)
ur = u(i)
pr = p(i)
zr = z(i)
c Density
rl = r(i-1) + iext*phir*(epsm*dqwr + epsp*dqer)
rr = r(i) - iext*phir*(epsm*dqir + epsp*dqer)
c Velocity
ul = u(i-1) + iext*phiu*(epsm*dqwu + epsp*dqeu)
ur = u(i) - iext*phiu*(epsm*dqiu + epsp*dqeu)
c Pressure
pl = p(i-1) + iext*phip*(epsm*dqwp + epsp*dqep)
pr = p(i) - iext*phip*(epsm*dqip + epsp*dqep)
c Rx Progress
zl = z(i-1) + iext*phiz*(epsm*dqwz + epsp*dqez)
zr = z(i) - iext*phiz*(epsm*dqiz + epsp*dqez)
c Check monotonicity
imon = 1
if (dra*drb .lt. 0d0) imon = 0
if (drb*drc .lt. 0d0) imon = 0
if (dua*dub .lt. 0d0) imon = 0
if (dub*duc .lt. 0d0) imon = 0
if (dpa*dpb .lt. 0d0) imon = 0
if (dpb*dpc .lt. 0d0) imon = 0
if (dza*dzb .lt. 0d0) imon = 0
if (dzb*dzc .lt. 0d0) imon = 0
rr = r(i)
ur = u(i)
pr = p(i)
zr = z(i)
else
endif
else
write(*,*) ' '
write(*,*) ' Unknown limiting strategy'
write(*,*) ' '
endif
else
rr = r(i)
ur = u(i)
pr = p(i)
zr = z(i)
endif
c zzl(i) = zl
c zzr(i) = zr
ccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccc
c CPG EOS
ccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccc
el = pl/gam1/rl - zl*qdet0
er = pr/gam1/rr - zr*qdet0
ccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccc
c JWL EOS
ccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccc
rht = rl/r0
rhti = 1d0/rht
ri = 1d0/rl
tmp = pl - aj*(1d0 - wr1*rl)*dexp(-rh1*ri)
& - bj*(1d0 - wr2*rl)*dexp(-rh2*ri)
el = tmp*ri/wj - zl*qdet0
rht = rr/r0
rhti = 1d0/rht
ri = 1d0/rr
tmp = pr - aj*(1d0 - wr1*rr)*dexp(-rh1*ri)
& - bj*(1d0 - wr2*rr)*dexp(-rh2*ri)
er = tmp*ri/wj - zr*qdet0
ccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccc
c Hayes-I/JWL EOS
ccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccc
c Left of interface; set arguments
ra = rl
za = zl
rz = ra*za
omz = 1d0 - za
c Mixed phases
else if (ztol1 .lt. za .and. za .lt. ztol2) then
el = bot*pl
do nn = 2,7
el = el - c(nn)*top(nn)
enddo
el = pl/wj/ra
& - aj*(1d0/wj/ra - 1d0/rh1)*dexp(-rh1/ra)
& - bj*(1d0/wj/ra - 1d0/rh2)*dexp(-rh2/ra)
& - qdet0 - e0
endif
c Mixed phases
else if (ztol1 .lt. za .and. za .lt. ztol2) then
er = pr/wj/ra
& - aj*(1d0/wj/ra - 1d0/rh1)*dexp(-rh1/ra)
& - bj*(1d0/wj/ra - 1d0/rh2)*dexp(-rh2/ra)
& - qdet0 - e0
endif
ccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccc
c Hayes-II/JWL EOS
ccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccc
c Left of interface; set arguments
ra = rl
za = zl
rz = ra*za
omz = 1d0 - za
c Mixed phases
else if (ztol1 .lt. za .and. za .lt. ztol2) then
el = bot*pl
do nn = 2,8
Distribution A. Approved for public release, distribution unlimited. (96ABW-2011-0548)
73
el = el - c(nn)*top(nn)
enddo
el = pl/wj/ra
& - aj*(1d0/wj/ra - 1d0/rh1)*dexp(-rh1/ra)
& - bj*(1d0/wj/ra - 1d0/rh2)*dexp(-rh2/ra)
& - qdet0 - e0
endif
c Mixed phases
else if (ztol1 .lt. za .and. za .lt. ztol2) then
er = pr/wj/ra
& - aj*(1d0/wj/ra - 1d0/rh1)*dexp(-rh1/ra)
Distribution A. Approved for public release, distribution unlimited. (96ABW-2011-0548)
74
& - bj*(1d0/wj/ra - 1d0/rh2)*dexp(-rh2/ra)
& - qdet0 - e0
endif
else
write(*,*) ' '
write(*,*) ' Unknown EOS'
write(*,*) ' '
stop
endif
c Total energy/mass
eel = el + 0.5d0*ul*ul
hhl = eel + pl/rl
eer = er + 0.5d0*ur*ur
hhr = eer + pr/rr
c80 format(2x,d12.6,2x,d12.6,2x,d12.6)
c if (n .eq. 177) then
c write(25,80) r(i-1),rr,r(i)
c endif
c Roe averages
if (iav .eq. 1) then
sqrl = dsqrt(rl)
sqrr = dsqrt(rr)
rsumi = 1d0/(sqrl + sqrr)
rav = sqrl*sqrr
uav = (sqrl*ul + sqrr*ur)*rsumi
zav = (sqrl*zl + sqrr*zr)*rsumi
zav = min(zav,1d0)
Distribution A. Approved for public release, distribution unlimited. (96ABW-2011-0548)
75
eav = (sqrl*el + sqrr*er)*rsumi
hav = (sqrl*hhl + sqrr*hhr)*rsumi
else
ccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccc
c CPG EOS
ccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccc
dpdr = gam1*eav + gam1*zav*qdet0
dpde = gam1*rav
dpdz = gam1*rav*qdet0
ccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccc
c JWL EOS
ccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccc
ri = 1d0/rav
tmp = aj*(rh1*ri*ri - wj*ri - wj/rh1)*dexp(-rh1*ri)
tmp = tmp + bj*(rh2*ri*ri - wj*ri - wj/rh2)*dexp(-rh2*ri)
ccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccc
c Hayes-I/JWL EOS
ccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccc
ra = rav
ra2 = ra*ra
ea = eav
za = zav
rz = ra*za
omz = 1d0 - za
c Mixed phases
else if (ztol1 .lt. za .and. za .lt. ztol2) then
topz(1) = 0d0
topz(2) = -1d0
topz(3) = -nh*((omz*ra/r0)**alfa)
topz(4) = -1d0
topz(5) = (rh1/wj/rz/rz - 1d0/rz - 1d0/rh1)*dexp(-
rh1/rz)
topz(6) = (rh2/wj/rz/rz - 1d0/rz - 1d0/rh2)*dexp(-
rh2/rz)
topz(7) = 1d0
dpdr = wj*ei(i)
& + aj*(rh1/ra2 - wj/ra - wj/rh1)*dexp(-rh1/ra)
& + bj*(rh2/ra2 - wj/ra - wj/rh2)*dexp(-rh2/ra)
& + wj*(qdet0 + e0)
dpde = wj*ra
endif
ccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccc
c Hayes-II/JWL EOS
ccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccc
ra = rav
ra2 = ra*ra
ea = eav
za = zav
rz = ra*za
omz = 1d0 - za
dpde = gh
c Mixed phases
else if (ztol1 .lt. za .and. za .lt. ztol2) then
topz(1) = 0d0
topz(2) = -1d0
topz(3) = -nh*((omz*ra/r0)**alfa)
topz(4) = -1d0
topz(5) = (rh1/wj/rz/rz - 1d0/rz - 1d0/rh1)*dexp(-
rh1/rz)
topz(6) = (rh2/wj/rz/rz - 1d0/rz - 1d0/rh2)*dexp(-
rh2/rz)
topz(7) = 1d0
topz(8) = 1d0 - nhp1*((ra/r0*omz)**nh)
dpdr = wj*ei(i)
& + aj*(rh1/ra2 - wj/ra - wj/rh1)*dexp(-rh1/ra)
& + bj*(rh2/ra2 - wj/ra - wj/rh2)*dexp(-rh2/ra)
& + wj*(qdet0 + e0)
dpde = wj*ra
endif
aav = dsqrt(a2)
c Eigenvalues
aeg(1) = dabs(uav - aav)
aeg(2) = dabs(uav)
aeg(3) = dabs(uav)
aeg(4) = dabs(uav + aav)
c Right eigenvectors
evr(1,1) = 1d0
evr(1,2) = 1d0
evr(1,3) = 1d0
evr(1,4) = 1d0
evr(4,1) = zav
evr(4,2) = 0d0
evr(4,3) = 1d0
evr(4,4) = zav
c |R|
detr = -2d0*rav*a2*aav/dpde
c Compute R |eg| L dq
do l = 1,4
Distribution A. Approved for public release, distribution unlimited. (96ABW-2011-0548)
81
vn(l) = 0d0
do m = 1,4
vn(l) = vn(l) + aeg(m)*cwm(m)*evr(l,m)
enddo
enddo
fr(1) = rr*ur
fr(2) = rr*ur*ur + pr
fr(3) = rr*ur*hhr
fr(4) = rr*ur*zr
ccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccc
c End of flux calculation loop
ccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccc
do i = 1,imax-1
do l = 1,4
dqv(l) = dt/dx*(fn(i+1,l) - fn(i,l))
enddo
do l = 1,4
qvp(i,l) = qv(i,l) - dqv(l) + dt*s(i,l)
enddo
enddo
tk(i) = tk0
else
write(*,*) ' '
write(*,*) ' Unknown iefx value.'
write(*,*) ' '
stop
endif
c pause
endif
ccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccc
c Calculate pressure and its derivatives
ccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccc
if (ieos .eq. 0) then
ccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccc
c CPG EOS
ccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccc
pp(i) = gam1*rp(i)*eip(i) + gam1*rp(i)*zp(i)*qdet0
ccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccc
c Hayes-I/JWL EOS
ccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccc
ra = rp(i)
ra2 = ra*ra
ea = eip(i)
za = zp(i)
rz = ra*za
omz = 1d0 - za
dpde = gh
c Mixed phases
else if (ztol1 .lt. za .and. za .lt. ztol2) then
topz(1) = 0d0
topz(2) = -1d0
topz(3) = -nh*((omz*ra/r0)**alfa)
topz(4) = -1d0
topz(5) = (rh1/wj/rz/rz - 1d0/rz - 1d0/rh1)*dexp(-
rh1/rz)
topz(6) = (rh2/wj/rz/rz - 1d0/rz - 1d0/rh2)*dexp(-
rh2/rz)
topz(7) = 1d0
dpdr = wj*ea
& + aj*(rh1/ra2 - wj/ra - wj/rh1)*dexp(-rh1/ra)
Distribution A. Approved for public release, distribution unlimited. (96ABW-2011-0548)
86
& + bj*(rh2/ra2 - wj/ra - wj/rh2)*dexp(-rh2/ra)
& + wj*(qdet0 + e0)
dpde = wj*ra
endif
ccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccc
c Hayes-II/JWL EOS
ccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccc
ra = rp(i)
ra2 = ra*ra
ea = eip(i)
za = zp(i)
rz = ra*za
omz = 1d0 - za
dpde = gh
c Mixed phases
else if (ztol1 .lt. za .and. za .lt. ztol2) then
topz(1) = 0d0
topz(2) = -1d0
topz(3) = -nh*((omz*ra/r0)**alfa)
topz(4) = -1d0
topz(5) = (rh1/wj/rz/rz - 1d0/rz - 1d0/rh1)*dexp(-
rh1/rz)
topz(6) = (rh2/wj/rz/rz - 1d0/rz - 1d0/rh2)*dexp(-
rh2/rz)
topz(7) = 1d0
topz(8) = 1d0 - nhp1*((ra/r0*omz)**nh)
dpdr = wj*ea
& + aj*(rh1/ra2 - wj/ra - wj/rh1)*dexp(-rh1/ra)
& + bj*(rh2/ra2 - wj/ra - wj/rh2)*dexp(-rh2/ra)
& + wj*(qdet0 + e0)
Distribution A. Approved for public release, distribution unlimited. (96ABW-2011-0548)
88
dpdz = aj*(rh1/ra - wj - wj*ra/rh1)*dexp(-rh1/ra)
& + bj*(rh2/ra - wj - wj*ra/rh2)*dexp(-rh2/ra)
& + ra*wj*(qdet0 + e0)
dpde = wj*ra
endif
else
write(*,*) ' '
write(*,*) ' Unknown EOS'
write(*,*) ' '
stop
endif
ccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccc
c Estimate mixture temperature Hayes-II/JWL EOS only
ccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccc
item = 0
if (ieos .eq. 3) then
item = 1
dtkmx = 0d0
denmx = 0d0
de1 = 0d0
de2 = 0d0
de3 = 0d0
de4 = 0d0
de5 = 0d0
de6 = 0d0
dtk(i) = numr/denm
endif
ccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccc
c Update particle properties and positions
ccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccc
if (ipar .eq. 1) then
do np = 1,npar
pa(np) = c316*mu*cdp*rep/rop/rdp/rdp*delu
c Mach correction
if (imach .eq. 1) then
mach = (adelu/ap(i))**4.63d0
cdp = cd0*(1d0 + dexp(-0.427d0/mach))
else
cdp = cd0
endif
pa(np) = c18*pi*dip*dip*cdp*ra*adelu*delu/p0mas
else
write(*,*) ' '
write(*,*) ' Unknown drag law.'
write(*,*) ' '
stop
endif
c write(*,*) ' rep = ',rep
c write(*,*) ' cdp = ',cdp
c write(*,*) ' pa = ',pa(np)
Distribution A. Approved for public release, distribution unlimited. (96ABW-2011-0548)
92
c write(*,*) ' '
endif
enddo
endif
ccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccc
c Update time and iteration number
ccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccc
n = n + 1
time = time + dt
c Solution file
90 format('sol_',i3.3,'.data')
write(filex,90) nfil
open(22,file=filex,form='formatted')
write(22,*) '# ',time
do i = 1,imax-1
xc = c12*(x(i) + x(i+1))
write(22,72) xc,rp(i),up(i),pp(i),zp(i),eip(i),ap(i),
& rxr(i),tk(i)
enddo
close(22)
c Particle file
91 format('par_',i3.3,'.data')
if (ipar .eq. 1) then
write(parex,91) nfil
open(22,file=parex,form='formatted')
do np = 1,npar
write(22,*) pxp(np),' ',pup(np),' ',ptkp(np)
enddo
close(22)
endif
c Derivatives file
open(22,file='deriv.data',form='formatted')
do i = 1,imax-1
write(22,*) i,' ',derv(i,1),' ',derv(i,2)
enddo
close(22)
c L/R Z files
c open(22,file='zlzr.data',form='formatted')
c do i = 1,imax
c write(22,*) i,' ',zzl(i),' ',zzr(i)
c enddo
c close(22)
c Restart file
open(40,file='restart.data',form='unformatted')
write(40) nstart+n
write(40) nfil
write(40) time
do i = 1,imax-1
write(40) rp(i),pp(i),up(i),zp(i)
enddo
close(40)
endif
c Reset arrays
Distribution A. Approved for public release, distribution unlimited. (96ABW-2011-0548)
94
do i = 1,imax-1
r(i) = rp(i)
u(i) = up(i)
z(i) = zp(i)
ei(i) = eip(i)
p(i) = pp(i)
a(i) = ap(i)
enddo
92 format(2x,d15.9,2x,d15.9,2x,d15.9,2x,d15.9,2x,i5)
enddo
endif
c pause
ccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccc
c End of solver loop
ccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccc
enddo
c Termination codes
if ( time .gt. tend) then
write(*,*) ' '
write(*,*) ' TIME > TEND.'
else if (n .ge. nstp) then
write(*,*) ' '
write(*,*) ' N > NSTP.'
else
write(*,*) ' UNKNOWN TERMINATION CRITERIA.'
endif
AFRL/RWG - 1 Copy
AFRL/RWM - 1 Copy
AFRL/RWA - 1 Copy