Time-Dependent Boundary Conditions For Hyperbolic Systems, II
Time-Dependent Boundary Conditions For Hyperbolic Systems, II
1. INTRODUCTION
This paper presents a unified formalism for the treatment of boundary conditions
for systems of hyperbolic equations. This treatment is intended to encompass all
possible boundary conditions for first-order hyperbolic systems in any number of
dimensions. A general theory of boundary conditions is given first, which is then
followed by a more detailed exposition for common problems in computational
fluid dynamics.
This paper differs from earlier work in that it attempts to unify all types of
physically reasonable boundary conditions into a single formalism. The resulting
formalism makes possible a “cookbook” approach to boundary conditions, in
which new boundary “recipes” may be derived from the formalism, and old ones
are simply looked up as needed. The latter portion of this paper (Section 3.2) begins
a compendium of boundary conditions for problems in fluid dynamics.
The central concept of this paper is that hyperbolic systems of equations
represent the propagation of waves and that at any boundary some of the waves are
propagating into the computational volume while others are propagating out of it.
The outward propagating waves have their behavior defined entirely by the solu-
tion at and within the boundary, and no boundary conditions can be specified for
them. The inward propagating waves depend on the solution exterior to the model
volume and therefore require boundary conditions to complete the specification of
their behavior. This paper describes how to decompose hyperbolic equations into
439
0021-9991/90$3.00
Copyright ?‘ 1990 by Academtc Press. Inc.
All nghfs of reproductmn in any form reserved
440 KEVINW.THOMPSON
wave modes of definite velocity and then how to specify boundary conditions for
those modes which require them.
The paper begins with theory and ends with practice. Section 2 looks at the
problem of boundary conditions for general hyperbolic systems. Section 3
represents several common boundary conditions for fluid dynamics problems.
Finally, Section 4 describes the complete numerical solution of the fluid equations
with boundary conditions.
Let U(x, t) be a vector of m components Ui, each of which is a time varying field
defined in a finite n dimensional volume V. The general behavior of U is described
by a hyperbolic set of m first-order differential equations in the II spatial coordinates
xk and time t. The time dependent solution for U is completely determined by
(i) the governing differential equations; (ii) the initial values for U in Y; and
(iii) the time dependent boundary conditions on the boundary of Y”.
Some ambiguity exists as to what exactly constitutes a boundary condition. This
paper presents the following conceptual model: a boundary condition consists
of a single mathematical expression of information which (i) is external to the
calculation, i.e., cannot be obtained solely from knowledge of U within Y’“; and
(ii) contributes to, but does not by itself define, the values of XJ/dt along the
boundary. In other words, the boundary conditions contain whatever information
is needed to completely specify au/at, and which cannot be obtained from informa-
tion within Y.
It is important to separate the concept of boundary conditions from that of the
boundary treatment. The boundary treatment is the complete algorithm for deter-
mining the values of XJ/dt along the boundary of *Y-,and incorporates information
from within -Y- as well as the boundary conditions. One must have a boundary
treatment at all boundaries of the computational domain when obtaining a solution
for U within Y. However, in the case of hyperbolic equations, the number of
boundary conditions required at a given point on the boundary ranges from 0 to
m and may vary with time and position as the solution evolves (e.g., an initially
subsonic and outward-directed flow may become supersonic at some later time,
reducing the number of boundary conditions from one to zero).
Another important point is that at any time t the boundary conditions contribute
only to the determination of XI/at at the boundary, and never define U itself. For
example, a boundary treatment which explicitly sets the normal velocity of a fluid
to zero at a wall boundary is not allowed in this model. Instead one would set the
normal velocity to zero in the initial data and then specify boundary conditions
which would force the time derivative of the normal velocity to be zero at all times.
One advantage of this approach is that it decouples the boundary treatment from
the time integration of the differential equations, so that the integration may be
performed without reference to any special behavior at the boundaries.
TIME-DEPENDENT BOUNDARY CONDITIONS, II 441
where Fk is the vector of fluxes in the kth coordinate direction and fi is a vector
of inhomogeneous terms which do not involve derivatives of any of the components
of u.l
Other equations may be required to close the system, such as algebraic relations
between the variables (including equations of state), constraint equations (such as
V. B = 0 in magnetohydrodynamics [S]), or other differential equations (such as
V2@= 47cGpfor the gravitational potential in self gravitating systems). However,
such auxiliary equations do not alter the boundary condition analysis, although
they are required by the solution process as a whole.
’ For example, D may contain source terms, such as heating, cooling, or gravitational forces; or it
may contain inhomogeneous terms from the breakup of divergence terms, such as
teristic velocities, which in turn are functions of the local solution and generally
vary in space and time. These characteristic velocities are given as the solutions to
an eigenvalue problem below.
The equations of one-dimensional fluid dynamics may be put into a characteristic
form in which the waves propagate in a single well-defined direction because only
one direction is available. However, no unique direction of propagation exists in
multidimensional problems [3,4], because the coeffkient matrices involved are not
simultaneously diagonalizable. Fortunately, the boundary condition analysis only
requires that any one coordinate direction be diagonalizable at a time, and this may
always be done.
Let the vector of primitive solution variables be U, and let the conservative
vector U depend only on fields which are contained in U (for example, the
definition of total energy density should not depend on the gravitational potential;
this requirement simplifies the analysis, as shown below for the equations of fluid
dynamics.) Then we may write [ 1]
(3)
t!&k!?$ k = 1, 2, 3, (4)
k k
Consider now the characteristic analysis for the x1 direction. (The other
directions are similar). All terms not involving x, derivatives of Uj are carried along
passively and do not contribute in any substantive fashion to the analysis; therefore
we may lump them together and write
(6)
Transform Eq. (6) into primitive form by multiplying it by P- ’ and using (4),
which gives
f.XJ
i'r+A1~+A2~+~'~+J-l2 (7)
I 3
TIME-DEPENDENT BOUNDARY CONDITIONS. II 443
or
au
,.r+A1g+C=O, C=A’~+A’E+D, (8)
I 2 .3
where
Ak 5 P-‘Qk, CsPp’C, D=P-‘f+i (9)
The m left and right eigenvectors of A’ will be taken as fi and r,, and satisfy
ITA’ = &I,‘, A’ri = E$ri, i= 1, .... m, (10)
The eigenvalues are real and are ordered so that I, < 2, d . . . d 2,. (A system of
equations of the form of (7) is defined to be hyperbolic if the eigenvalues of the
coefftcient matrices Ak are real.)
A diagonalizing similarity transformation may be generated for A’ by forming
the matrix S such that its columns are the right eigenvectors r,, and its inverse S ‘,
whose rows are the left eigenvectors f:. The similarity transformation is then
%‘A%= A, (13)
where A is the diagonal matrix of eigenvalues: /ii, = 0 for i #j, Ati = 2, for i = j.
Applying this transformation to Eq. (8) gives
(14)
L+i,r:~ (16)
,I
444 KEVIN W. THOMPSON
(17)
Ifg+2q+rrc=o, i = 1, .... m.
The purpose of this analysis is to rewrite the original system of Eqs. (1) in a form
which contains the quantities g, as it is these quantities which we will use to
specify boundary conditions. Equations (17) and (18) are the starting point for the
boundary treatment.
If only the primitive time derivatives are required, then we simply put (8) for the
definition of C back into (19) and we are done, as dU/& is now completely defined.
If, on the other hand, we want the conservative derivatives, then we multiply
Eq. (19) by P to obtain
(20)
at the x, boundaries.
The only terms which contain spatial derivatives in a direction normal to the
boundary occur in the 3 terms, where they are taken care of by the boundary
conditions described below. The remaining terms in (20) involve derivatives in
directions transverse to the boundary and may be evaluated just as in the interior
of Iv. (The same is true for the corresponding terms in the primitive equation
in (19))
TIME-DEPENDENT BOUNDARY CONDITIONS, II 445
for d. Problems in fluid dynamics normally involve simple enough matrices that
Eq. (21) can easily be solved by hand. More complicated problems, such as in
magnetohydrodynamics (MHD), are too difficult for (21) to be solved analytically,
and require numerical solutions.
Some problems, however, are sufticiently simple that one set of boundary condi-
tions may be specified for all time. (The flow of a fluid next to a solid wall is such
a case.)
While the number of boundary conditions required is rigidly governed by the
interior solution, the type of each condition is not. The researcher has considerable
freedom to impose physically appropriate boundary conditions. The following
sections provide several examples of useful boundary conditions for common
problems in fluid dynamics.
3. FLUID DYNAMICS
~+~(Pu,)+~(Pu2)+~(Pu3)=0, (22)
1 2 3
am, a
~+~(m,~,)+~(m,~,)+~(m,~,)+~-~g,=O~ (24)
I 2 3 1
am, a
t+~(m2u,)+~(m2u2)+~(m2ul)+~-pg2=O; (25)
I 2 3 2
-;i;+r(m3u,)+~(m3u,)f~(m3u3)+~-pg3=0.
am, a (26)
I 2 3 3
where
3
and where p is the mass density, p is the thermodynamic pressure, E is the thermal
energy density, y is the (assumed constant) ratio of specific heats, rnk is the xk direc-
tion momentum density, e is the total energy density (kinetic + thermal), @ is the
gravitational potential field, and g, is the gravitational acceleration. For many
problems @ and g, are specified functions of position, usually time independent.
For problems involving self-gravitating fluids, @ is obtained by solving Poisson’s
equation :
V2cD= 471Gp, (31)
where G is the gravitational constant.
The inclusion of gravitational fields introduces some ambiguity in the definition
of the total energy density, depending on whether one includes the gravitational
potential energy term p@ in the definition of e in (27). The gravitational potential
is omitted from the total energy for the following reasons:
1. Adding p@ to (27) requires putting p &S/at on the right side of Eq. (23),
which is difficult to evaluate for time varying gravitational fields.
2. The inclusion of a spatially varying field (CD)in the definition of the conser-
vative variable vector ij (in the e component), when that field does not appear as
a component of the primitive vector U, invalidates Eqs. (2) and (4). We would have
to replace these equations by
aU au aZra@
(32)
nt=px+z57t’
and
aFk au aFk a@
k = 1, 2, 3.
zg- -Q” &+zcix,’
(33)
While this substitution can be made, it seemsmore trouble than it is worth and will
not be done here.
The fluid equations given here are in the conservative form of (1 ), with
PUI PU2
(e+p)ul (e + PI ~2
mlu3 ‘i i m2u3 (
PU3 0
(e + P) ~3 -PC:=, Ukgk
F3 E m3u1 OE -Pgl
-Pgl
m3u2
m3u3 + p ’ i -Pi?2
- Pg3
448 KEVIN W. THOMPSON
(35)
UI 0 p 0 0 (36)
u2 0 0 P 0
P= i u3 0 0 0 P 1
ap ap ap ap
at+% ~+Uz~+“‘-gy+YP (38)
1 2 3
au, au,
li+u,2+u2gl+ 243z + -1 -ap - g, = 0, (39)
1 2 3 P axI
au2
~+u,~+u2~+u3~+~~-g2=o, (40)
I ’ 2 3 pax2
au3 au3 1 ap
x+u,g+u22+ u,dXj+---g3=0. (41)
1 2 pax3
Now we may set up the boundary condition analysis for the x1 direction. Write
Eqs. (37)-(41) as
(42)
as in (8), where A’ is
UI 0 P 0 0
0 Ul YP 0 0
u, , (43)
0 0 0 u*o
0
A’= i 0 0
l/p 0 00 u,
0i
TIME-DEPENDENT BOUNDARY CONDITIONS, II 449
and the C vector contains all remaining terms which do not involve elements of
au/ax1
The eigenvalues of A ’ are
c==-.YP (45)
P
Eigenvalues 2, and I,, are the velocities of sound waves moving in the negative and
positive x1 directions; A2 is the velocity for entropy advection; while lb3and & are
the velocities at which u2 and u3 are advected in the x, direction.
Next form the quantities L$ from Eq. (16), and get
(47)
ap 1 Y2 1 - .L$ - &Yr
-=-T
ax, c [ u,+z ( u,+c+u,-c 11 ’
ap
_1
ax, -4”5
z
-( 2 u,+c+u,-c >’
(48)
Multiplying Eq. (42) by the left eigenvectors gives Eqs. (17) and (18). The
similarity transformation matrix S-l has as its rows the left eigenvectors l,? given
in (46), while the vector 3 has its components given in Eq. (47). The produce SY
which is required in Eq. (19) has the components
This result may be obtained by setting up and solving Eq. (21), or by substituting
Eqs. (48) for W/ax, in terms of 64 into the terms A’ XJ/ax, of Eq. (42). Either
way we end up with the primitive equations in the form
ap 1 s+;(g+g) +u2g+u3-+p
z+c’ iI3 (Z+Z)=o, (50)
[ I 2
ap 1 ap ap
~+IjM+%)+%~+%aX+.lP (Z+Z)=o, (51)
2 3
au
u1+1(~-~)+U2~+u3~-~,=o,
at 2pc
(52)
2 3
au2
~+Y3+u2~+u3~+---p2=o.
1 ap (53)
2 3 Pax2
au3
~+94+u2~+u3~+=-g3=o. (54)
2 3 P ax3
TIME-DEPENDENT BOUNDARY CONDITIONS, II 451
If only the primitive equations are desired, we can stop at this point. Otherwise
multiply the vector of Eqs. (50)-(54) by P to get (20) as
ap
;1+4 +~(P"')+~(P%~=o~ (55)
2 3
ae 1( C3 d >4+ - 4
z+2 + PU, 4 + pu2 4 + PU, 4
k=l Y-1
~+u,d,+pd,+~(m,u,)+~(m,u,)-pg,=O, (57)
2 3
~+u2d,+pd,+~(m,u,)+~(mlu,)+~-W,=O, (58)
2 3 2
~+u,d,+pd,+~(m,u,)+~(m,u,)+~i--Pfi,=O, (59)
2 3 3
581/89/Z-14
452 KEVIN W. THOMPSON
(60)
(61)
-rq=g2-lAk
Pax2
A+g2-;$
Y+--$ T4=g,--1c?p
Pax,
25 = 3, + 2pcg,
TIME-DEPENDENT BOUNDARY CONDITIONS. II 453
x3= g2 -%=g,
=%=s3 %= g3
The initial data must also specify supersonic inflow at the boundaries, in order
to be consistent with the boundary conditions.
($-Pcg+%+Pcg,=o, (63)
where the expression in parentheses represents the time derivative of the amplitude
of the characteristic wave (see, for example, Whitham [3], or Landau and
Lifshitz [7], for a discussion of characteristic waves and Riemann invariants). The
wave amplitude remains constant if we set 9r = -peg,.
Thus the nonreflecting boundary condition for subsonic outflow is
xl=a, (-c<u,<O) x,=b,(O<u,<c)
(64)
=% = PQYl % = -peg,
From Eq. (39) we see that imposing a zero net force in the x1 direction requires
that
(65)
A good example of when the force-free condition is useful is the case when a
pressure equilibrium (or other zero net force) exists at the boundary. A pressure
equilibrium is maintained by the propagation of sound waves, which serve to
equalize the pressure across the boundary; therefore the exterior solution must
communicate this equilibrium to the interior. In this case fluid elements follow
“ballistic” trajectories. The homologous expansion of a uniform gas [ 1] is such a
problem, for which the nonreflecting boundary conditions destroy the pressure
balance.
3.2.6.3. Constant pressure boundary condition. There are some problems for
which a particular constraint must be satisfied. This section describes the case
where the pressure is known to be constant at the boundary. Other such conditions
may be handled in a similar fashion (as was the case of zero normal velocity
previously).
It is usually the case the one wants ap/at = 0 in the absence of transverse effects,
but not otherwise. This condition is satisfied if & + 5?‘r= 0, giving
x,=al (-c<u,<O) x,=b, (O<u,<c)
(67)
q= -9, g = -g
entropy is constant in the x, direction. Setting L& = g, and gb = g, will hold the
u2 and u3 velocities constant in the absence of tangential effects.
Note that any of these conditions may be used in conjunction with any of the
conditions from the previous sections.
3.2.7.2 Constant massjlux. Some problems assume mass flux pu, at the inflow
boundary. If the correct mass flux is specified initially, then it will be maintained at
later times if
-$m,)=p~+u,
$0,
From (50) and (52), ignoring tangential effects, we get
which gives
x,=a, (O<u,<c) x,=b,(-c<u,<O)
assuming that T2 has been specified. If Y: is not known, then we might specify L?,
(or Y,,) from one of the methods of Section 3.2.6 and solve for P2 from (69) as
x,=a,(O<u,<c) x,=b,(-c<u,<O)
4. NUMERICAL IMPLEMENTATION
af
- i= 1, .... N, - 1; (72)
ax, ijk =l-(fi+ljk-L-ljklr
2 Ax1
(73)
(74)
af
-ax zL [8(~+1jk-fi~Ijk)-(fr+2ik-fr--jk)l,
I i,k 12 Ax,
i = 2, .... N, - 2; (75)
af
- =L [2(fijk-f~jk)+6(f2jk-f?ik)-(f?ik-f?ik)1; (77)
axl Ijk 6 Axl
af
=L [2(fN~jk-fN~-~jk)+6(fN~-~~k-fN~-~jk)
ax, N,-ljk 6Ax,
-(fN,-I]k-fN,-3jk)l; (78)
af
=L [18(fNljk-fNI~Ijk)-9(.fN,,k-fN,-2jk)
dx, N,Jk 6 Ax,
+2(fh’ljk-fNI-3jk)l; (79)
One of the simplest and most efficient fourth order time integrators is the classic
fourth-order Runge-Kutta method, which may be written
nj:,r=pk+‘nt-
2
duvk
dt
”
’
(or similarly for U, if a nonconservative (primitive) form has been chosen for the
fluid equations). This scheme should be used along with the fourth-order spatial
derivative approximations to achieve a globally fourth-order convergent calcula-
tion. (For a suitable second-order integrator, see Cl].) Note that d~ok/dtl@” refers
to the time derivative of U at the grid points (xii, xzj, x~~) as computed from the
intermediate step solution a(-).
The time step At is given by
where (T (the “Courant number”) may be given any value <2.0612..., which is the
maximum stable limit [2]. Values of (T= 0.5 or CJ= 1 are conservative and normally
work well.
5. CONCLUSION
This paper has presented a unified framework for specifying boundary conditions
for systems of hyperbolic equations. The framework is flexible enough to encompass
virtually any type of boundary condition. Many useful conditions have been
derived for common problems in computational fluid dynamics.
ACKNOWLEDGMENTS
This work has been done in part under the auspices of a special NASA astrophysics theory program
which supports a joint Center for Star Studies at NASA Ames Research Center, U. C. Berkeley, and
U. C. Santa Cruz. This work has also been supported by the Center for Turbulence Research, a joint
program between NASA Ames Research Center and Stanford University.
TIME-DEPENDENT BOUNDARY CONDITIONS, II 461
REFERENCES