ArticlePDF Available

An Unconditionally Stable MacCormack Method

Authors:

Abstract and Figures

The back and forth error compensation and correction (BFECC) method advects the solution forward and then backward in time. The result is compared to the original data to estimate the error. Although inappropriate for parabolic and other non-reversible par- tial differential equations, it is useful for often troublesome advec- tion terms. The error estimate is used to correct the data before advection raising the method to second order accuracy, even though each individual step is only first order accurate. In this paper, we rewrite the MacCormack method to illustrate that it estimates the error in the same exact fashion as BFECC. The difference is that the MacCormack method uses this error estimate to correct the already computed forward advected data. Thus, it does not require the third advection step in BFECC reducing the cost of the method while still obtaining second order accuracy in space and time. Recent work re- placed each of the three BFECC advection steps with a simple first order accurate unconditionally stable semi-Lagrangian method yield- ing a second order accurate unconditionally stable BFECC scheme. We use a similar approach to create a second order accurate uncon- ditionally stable MacCormack method.
Content may be subject to copyright.
An Unconditionally Stable
MacCormack Method
Andrew SelleRonald FedkiwByungMoon Kim
Yingjie Liu§Jarek Rossignac
June 29, 2007
Abstract
The back and forth error compensation and correction (BFECC)
method advects the solution forward and then backward in time.
The result is compared to the original data to estimate the error.
Although inappropriate for parabolic and other non-reversible par-
tial differential equations, it is useful for often troublesome advec-
tion terms. The error estimate is used to correct the data before
advection raising the method to second order accuracy, even though
each individual step is only first order accurate. In this paper, we
rewrite the MacCormack method to illustrate that it estimates the
error in the same exact fashion as BFECC. The difference is that the
MacCormack method uses this error estimate to correct the already
computed forward advected data. Thus, it does not require the third
advection step in BFECC reducing the cost of the method while still
obtaining second order accuracy in space and time. Recent work re-
placed each of the three BFECC advection steps with a simple first
order accurate unconditionally stable semi-Lagrangian method yield-
ing a second order accurate unconditionally stable BFECC scheme.
We use a similar approach to create a second order accurate uncon-
ditionally stable MacCormack method.
Stanford University, 353 Serra Mall Room 206, Stanford, CA 94305,
Phone: 650-714-4426, Fax: 650-723-0033
Compute Science Department, Stanford University, Stanford, CA,
email: aselle@cs.stanford.edu
College of Computing, Georgia Institute of Technology, Atlanta, GA
§School of Mathematics, Georgia Institute of Technology, Atlanta, GA
1
1 Introduction
Courant et al. [2] proposed a simple method of characteristics scheme for
discretizing advection equations. These semi-Lagrangian type schemes are
popular in many areas (for example in the atmospheric sciences commu-
nity [25]), because they can be made unconditionally stable. The simplest
semi-Lagrangian scheme traces back a straight line characteristic and uses
trilinear interpolation to estimate the data, and thus is first order accu-
rate in space and time. The order of accuracy can be improved by tracing
back curved characteristics and using higher order interpolation (e.g. [19]).
However, this can significantly increase the complexity and computational
cost of the method especially since high order polynomial interpolants re-
quire limiters to avoid oscillations, new extrema and possible instability.
See for example the appendix of [9] which illustrates the use of a non-
oscillatory cubic spline interpolant. Another way to improve the fidelity
of semi-Lagrangian schemes is via auxiliary information. For example, af-
ter [24] popularized the semi-Lagrangian method in the field of computer
graphics, [9] showed that vorticity confinement [26] could be used to alle-
viate the high amount of dissipation allowing for visually intricate, albeit
non-physical flows (see also [22] which used vortex particles). Similarly, [6]
showed that the simple first order accurate semi-Lagrangian scheme can
be used to obtain very accurate level set tracking as long as particles are
tracked with higher order accuracy. The original particle level set method
[5] used fifth order accurate Hamilton-Jacobi WENO [12] and third order
accurate TVD Runge-Kutta [23] making it difficult to extend the method to
more complicated data structures. In contrast, the simple semi-Lagrangian
approach proposed in [6] allowed for straightforward extension to octree
[17, 16] (see also [27]) and run length encoded [11] data structures.
Back and forth error compensation and correction (BFECC) was first
proposed in [3] with the aim of reducing mass loss in level set methods
(see [21, 20]). The key idea was to realize that a reversible differential
equation could be evolved forward and then backward in time to obtain
an error estimate. The difference between the final result and the origi-
nal data is approximately twice the advection error. While inappropriate
for non-reversible differential equations such as the heat equation or level
set reinitialization [28], it is useful for problematic advection terms in hy-
perbolic differential equations. First, the forward advection operator Ais
applied to get ˆ
φn+1 =A(φn), and then the backward advection operator
ARis applied to get ˆ
φn=AR(ˆ
φn+1). The result is used to estimate the
error in an advection step as ˆ
φnφn= 2eor e= ( ˆ
φnφn)/2. Next,
this error estimate is used to adjust the initial condition of the final ad-
vection via ¯
φn=φneand then φn+1 =A(¯
φn). If Awas linear, this
could be viewed as evolving both the equation and the error forward in
2
1
2
1
2
3
4
33
(b) Cheaper BFECC(a) Original BFECC
1
2
3
4
1
2
3
Figure 1: A conceptual diagram of the steps of the original BFECC method
and the cheaper modified BFECC method (which is actually a modified
MacCormack scheme).
time, i.e. φn+1 =A(φne) = A(φn)A(e). Intuitively, this treats eas
if it were a time nquantity that needs to be advected forward in time to
time n+ 1. Since there is no strong evidence that eis a time nquantity,
one could just as well add it directly to the time n+ 1 state to obtain
φn+1 =A(φn)e=ˆ
φn+1 e. And since ˆ
φn+1 has already been computed
in the error estimation step, this strategy alleviates the need to carry out
a third advection step making the method significantly cheaper. Figure 1
shows a conceptual diagram of these two methods applied.
Originally, [3] focused on the application of BFECC to the level set
equation φt+V· ∇φ= 0 using forward Euler time integration com-
bined with first order accurate upwinding and downwinding for the for-
ward and backward time evolution, respectively. More recently, a series
of papers [13, 14, 4] showed that the forward and backward advection op-
erators could be replaced by a first order accurate unconditionally stable
semi-Lagrangian scheme without changing the desirable properties of the
method. This produces an unconditionally stable, fully second order ac-
curate semi-Lagrangian method composed of simple first order accurate
building blocks. This has the desirable simplicity of TVD Runge-Kutta
methods [23], and interestingly contains backward time evolution similar
to the higher order accurate TVD Runge-Kutta methods. Thus, the or-
der of accuracy of the simple semi-Lagrangian scheme can be raised from
one to two by increasing the amount of work by a factor of three, since
3
three semi-Lagrangian advections are required. Alternatively, as pointed
out above, the error estimate could be added directly to ˆ
φn+1 removing the
last advection step, thus requiring only twice the effort of the first order
accurate scheme.
The motivation for this cheaper version of the BFECC scheme came
from the MacCormack method [18], which uses a combination of upwind-
ing and downwinding to achieve second order accuracy in space and time.
Consider the cheaper version of the BFECC scheme applied to the one di-
mensional wave equation φt+φx= 0, with λ= ∆t/x,φ=φiφi1
and +φ=φi+1 φi. The forward advection step is ˆ
φn+1
i=φn
iλφn,
the backward advection step is ˆ
φn
i=ˆ
φn+1
i+λ+ˆ
φn+1, and the error
estimate is ei= ( ˆ
φn
iφn
i)/2 = ( ˆ
φn+1
iφn
i+λ+ˆ
φn+1)/2. Finally,
φn+1
i=ˆ
φn+1
ie= (φn
i+ˆ
φn+1
iλ+ˆ
φn+1)/2. This is the same as
equation (2b) from the original [18] if one switches with +through-
out. That is, [18] proposed unstable downwind differencing for the forward
step, and unstable upwind differencing for the backward step, whereas we
propose the stable versions for both steps. Note that this slight modifi-
cation is also typically referred to as a MacCormack method or modified
MacCormack method, see e.g. [29] and [1]1. Thus while this particular
modification of BFECC is not novel, it adds insight to the (modified) Mac-
Cormack method allowing us to extend it to be unconditionally stable via
simple semi-Lagrangian building blocks. Moreover, when viewed in this
fashion many other improvements can be made. For example, one can
automatically revert to the first order accurate scheme when the upwind
and downwind building blocks pull data from non-commensurate regions
(e.g. if one gets information from the fluid and the other from a solid wall
boundary). It also becomes straightforward to apply limiters to prevent
new extrema, which is important since the error correction step of both
BFECC and our newly proposed MacCormack scheme can produce new
extrema leading to instability.
2 Temporal Accuracy and Stability
Consider the model ordinary differential equation y=λy and the Taylor
expansion yn+1 =yn+λtyn+ ∆t2λ2yn/2 + ∆t3λ3yn/6 + O(∆t4). For-
ward Euler time integration is yn+1
fe = (1 + ∆)ynwith a leading order
truncation error of t2λ2yn/2. The subsequent step backwards in time
from yn+1
fe to ˆynis ˆyn= (1 )yn+1
fe = (1 t2λ2)yn, so the error is
e= (ˆynyn)/2 = t2λ2yn/2. BFECC computes a new initial value
1page 224
4
Forward Euler BFECC MacCormack (RK2)
tError Order Error Order Error Order
1.000 -6.61e-02 – -3.35e-02 – 1.73e-02
.500 -3.35e-02 1.0 -7.13e-03 2.2 3.40e-03 2.3
.250 -1.67e-02 1.0 -1.59e-03 2.2 7.66e-04 2.2
.125 -8.36e-03 1.0 -3.72e-04 2.1 1.82e-04 2.1
Table 1: y=y/2 with y0= 1.3. As predicted the error of the MacCor-
mack scheme is about half in magnitude and positive compared the to the
back and forth scheme.
¯yn=ynewhich is advanced forward in time via yn+1
fb = (1 + ∆)¯yn, i.e.
yn+1
fb =1 + ∆+1
2t2λ2+1
2t3λ3yn
with a leading order truncation error of t3λ3yn/3. The version of the
MacCormack scheme we consider in this paper is
yn+1
m=yn+1
fe e= (1 + ∆+1
2t2λ2)yn
with a leading order truncation error of ∆t3λ3yn/6. That is, the MacCor-
mack method is identical to second order accurate Runge-Kutta for ordi-
nary differential equations. All this can be illustrated by solving y=y/2
with y0= 1.3 as shown in Table 1.
Next, we consider the regions of stability. As usual, forward Euler
requires |1 + ∆| ≤ 1 so ∆=x+yi must satisfy (x+ 1)2+y21.
Similarly, BFECC requires (1 + x+1
2x21
2y2+1
2x33
2xy2)2+ (xy +
y+3
2x2y1
2y3)21. The graphs of the stability regions are shown in
Figure 2. Note that the BFECC method includes a significant portion of
the imaginary axis similar to third order TVD Runge-Kutta.
5
-2 -1 012 3
-2
-1
0
1
2
RK3
BFECC
MacCormack RK2
Forward Euler
Figure 2: Stability regions for ordinary differential equations.
6
3 The Wave Equation
Consider the model problem ut+ux= 0 discretized with forward Euler in
time. First order accurate spatial upwinding is given by
un+1
i=un
it
x(un
iun
i1) = (1 λ)un
i+λun
i1
with λ= ∆t/x. BFECC can be written as a step forward in time
ˆun+1
i= (1 λ)un
i+λun
i1
followed by a step backward in time
ˆun
i= (1 λun+1
i+λˆun+1
i+1 = ((1 λ)2+λ2)un
i+λ(1 λ)(un
i1+un
i+1)
followed by a correction of the original data using the estimated error
˜un
i=un
iun
iun
i)/2 = un
iλ(1 λ)(un
i+1 2un
i+un
i1)/2
followed by a step forward in time using this error corrected data
un+1
i= (1 λun
i+λ˜un
i1
=1
2λ2+1
2λ3un
i2+1
2λ+ 2λ23
2λ3un
i1
+15
2λ2+3
2λ3un
i+1
2λ+λ21
2λ3un
i+1.
Taylor expanding un
i2,un
i1and un
i+1, and using ut+ux= 0 leads to
un+1
i=un
ix(un
i)xλ+x2
2(un
i)xxλ2x3
6(un
i)xxx(3λ2+λ+ 3λ3)
+
X
i=4
ξbf(i, x, t)
=un
i+ ∆t(un
i)t+t2
2(un
i)tt +t3
6(un
i)ttt 3
λ+1
λ2+ 3
+
X
i=4
ξbf(i, x, t)
where ξbf(i, x, t) = O(∆xi2t2+ ∆xi3t3+ (imod 2)∆xi1t).
Thus, the final terms can be simplified to P
i=4 ξbf(i, x, t) = O(∆x2t2+
xt3+ ∆x4t).
7
The MacCormack method instead uses the error estimate to correct the
already advected data resulting in
un+1
i= ˆun+1
iun
iun
i)/2
=1
2λ+1
2λ2un
i1+ (1 λ2)un
i+1
2λ+1
2λ2un
i+1.
Taylor expansions and ut+ux= 0 can be used to rewrite this as
un+1
i=un
ix(un
i)xλ+x2
2(un
i)xxλ2x3
6(un
i)xxxλ+
X
i=4
ξm(i, x, t)
=un
i+ ∆t(un
i)t+t2
2(un
i)tt +t3
6(un
i)ttt
1
λ2+O(∆x2t2+ ∆x4t)
since ξm(i, x, t) = O(∆xi2t2) when ieven and ξm(i, x, t) =
O(∆xi1t) when iis odd.
For a fixed CFL number (i.e. fixed λ) with ∆t=λx, the final sum-
mations in both methods become O(∆x4) or identically O(∆t4). Note
that the first three terms of these expressions agree with the exact solu-
tion, so the fourth term in each expression is the leading local truncation
error. We write the truncation error as E(λ)∆t3uttt/6 + O(∆t4) where
Ebf (λ) = 123+ 2 for BFECC and Em(λ) = 121 for the
MacCormack method. Note that these results were derived for the wave
equation under the assumption that λ1. Since an unconditionally stable
approach allows for larger λ’s, a similar piecewise analysis can be carried
out for λ(1,2], λ(2,3], etc. to obtain
Ebf (λ) =
2 + 1
λ23
λλ1
26
λ3+13
λ29
λ1< λ 2
230
λ3+37
λ215
λ2< λ 3
(1)
and
Emac(λ) =
1 + 1
λ2λ1
16
λ3+7
λ21< λ 2
130
λ3+19
λ22< λ 3
(2)
and so on. Using these expressions, we can compute the leading truncation
error at each grid point xias |t3uttt(xi, t)E(λ)/6|and the average error
over ngrid points as (1/n)Pn
i=1 |t3uttt(xi, t)E(λ)/6|. Computing this
for a single time step of ut+ux= 0 with u(0, x) = sin 4πx and n= 400
while varying the CFL number λproduces the graph depicted below.
8
Solving the same problem numerically for one time step and graphing the
computed average error magnitude similarly yields the following graph.
Next, consider solving the wave equation with u(0, x) = sin 4πx and
periodic boundary conditions to a final time of t=.5 (one period). Table 2
compares the average errors obtained using first order accurate upwinding,
9
Upwinding BFECC MacCormack
nError Order Error Order Error Order
101 6.0e-2 – 1.3e-3 – 4.7e-3 –
201 3.1e-2 1.02 3.3e-4 2.09 1.2e-3 1.96
401 1.6e-2 1.01 8.2e-5 1.97 2.9e-4 2.01
801 7.8e-3 1.00 2.1e-5 1.99 7.2e-5 2.00
Table 2: Wave equation solved with upwind building blocks and CFL=.75.
Semi-Lagrangian BFECC MacCormack
nError Order Error Order Error Order
101 2.6e-2 5.6e-4 5.3e-3
201 1.3e-2 .98 1.4e-4 2.09 1.3e-3 2.21
401 6.7e-3 1.02 3.5e-5 1.96 3.4e-4 2.05
801 3.3e-3 1.02 8.8e-6 1.99 8.4e-5 2.05
Table 3: Wave equation solved with semi-Lagrangian building blocks and
CFL=1.75.
BFECC and the MacCormack method with a CFL of .75. Since the CFL
is less than one, upwind building blocks are used for both BFECC and the
MacCormack method. Spatial refinement shows the expected results for
all three methods. Table 3 shows similar results for a CFL of 1.75 where
semi-Lagrangian building blocks are used for BFECC and the MacCormack
method. Note that the the first order accurate upwinding was replaced with
the first order accurate semi-Lagrangian method as well.
10
4 New Extrema
Whether first order accurate upwind building blocks (and a CFL less than
one) or simple semi-Lagrangian building blocks are used, the first step for-
ward in time and the subsequent step backward in time produce monotone
data. That is, ˆunis bounded by ˆun+1 which is in turn bounded by un.
However, nothing special can be stated about the manner in which the er-
ror is computed, or the result obtained when the error estimate is applied
to either unin BFECC or ˆun+1 in the MacCormack scheme. In particular,
this error correction step can lead to new extrema and possible instabil-
ity. Figure 3 shows the oscillations obtained when using BFECC and the
MacCormack scheme to advect a square wave for one period. A simple
choice of limiter consists of limiting the final solution at each grid point to
be bound by the values used in computing the first advection step from un
to ˆun+1. For example, if the base of the semi-Lagrangian ray used in this
first advection step interpolated data from the interval [xj, xj+1], then we
would postprocess the final result (from either BFECC or MacCormack) to
be clamped between min(un
j, un
j+1) and max(un
j, un
j+1). This readily gen-
eralizes to multiple spatial dimensions, adaptive and non-Cartesian grids.
Another commonly used limiter reverts to a first order accurate method
when the higher order accurate method would overshoot (see e.g. [10]). For
our method this requires no further computation as an out of bounds value
is simply replaced with the value from the first semi-Lagrangian advection
step, that is, no error correction is used. Figure 3 shows the results ob-
tained by applying the clamping limiter to advection of the square wave
initial data, and though it is not depicted we also ran the example using
the reversion to first order accurate approach which yielded nearly identi-
cal results to clamping. We also compared clamping to reversion using a
2D flow example in Figure 9 in which we noticed no significant difference
between the two methods. Despite this, we prefer the reversion approach
as it yields better results when the semi-Lagrangian MacCormack scheme
is applied to free surface flows where the reversible PDE assumption of our
modified MacCormack scheme (and also BFECC) breaks down due to the
linear extrapolation of velocities to outside the fluid region.
11
Figure 3: Both BFECC and the MacCormack method can create new
extrema, as shown here where a square wave is advected for one period. Of
course, these oscillations can be avoided with a simple limiting technique.
12
5 General Stability and Accuracy Results for
Linear Equations in Multi Dimensions
Consider the equation
ut+v· ∇u= 0,x[0,1]d,(3)
with periodic boundary conditions, where vRdis a constant vector.
Assume a uniform partition of the domain so that xj= (j1, j2,···, jd)h,
jl∈ {0,1,···, J}, and h= 1/J is the mesh size. Let un
jbe a numerical
solution at (xj, tn). A linear scheme A(such as the first order accurate
semi-Lagrangian scheme) is a linear operator ˆun+1 =A(un) such that
ˆun+1
j=X
i
αiun
j+i,
where {αi}are constants depending on t/h, ∆t=tn+1 tn. We can
obtain stability and accuracy results by applying similar arguments as in
[4]. Expanding un
jinto the finite Fourier series
un
j=X
k
cn
ke2πik·xj,
where k= (k1, k2,···, kd), kl∈ {0,±1,···,±(J1)}, we obtain a relation
between two adjacent time steps cn+1
k=ρA(k)cn
k, where ρA(k) is called
the Fourier symbol of Aand maxk|ρA(k)|is called the amplification factor
of A. Let AR: ˆun=ARun+1 ) be the corresponding linear scheme that
solves the time reversed equation of (3). Then the modified MacCormack
scheme acting on Ais
F:un+1 =F(un) = A+1
2(IARA)(un),
where Iis the identity operator. The Fourier symbol of Fis
ρF=ρA+1
2(1 ρARρA).
We have the following theorem.
Theorem 1. Suppose ρAR=ρA, then |ρF| ≤ 1 if |ρA| ≤ 1.
Most conventional first order accurate linear schemes satisfy the condi-
tion of Theorem 1, e.g., the upwind scheme, Lax-Friedrichs scheme and in
particular the Courant-Isaacson-Rees scheme (CIR or first order accurate
semi-Lagrangian scheme).
13
A linear scheme Lis said to be accurate of order rif for any solution u
of (3) having continuous derivatives up to order r+ 1,
u(xj, tn+1)L(u(·, tn))|xj=O(hr+1),
where ∆t/h is fixed during the mesh refinement. A convenient way to
check the accuracy of scheme Fis to compare the discrete Fourier symbol
ρFto the corresponding Fourier symbol for the exact solution uby using
the Lax’s theorem [15]. Expanding uinto the Fourier series
u(x, t) = X
kZd
ck(t)e2πik·x
and substituting it into (3) to obtain dck(t)
dt =P(ik)ck(t), we obtain
ck(tn+ ∆t) = etP (ik)ck(tn),
where Pis a homogeneous polynomial of degree one with real coefficients
and etP (ik)is the Fourier symbol for the exact solution u. Therefore for
an r-th order linear scheme A, following the Lax’s theorem
ρA(k) = etP (ik)+Qr+1(ikh) + O(|kh|r+2),
where Qr+1 is a homogeneous polynomial of degree r+ 1 with real coeffi-
cients. If ris an odd positive integer, then Qr+1(ikh) is a real number. In
addition, if ρAR=ρA, then
ρF(k) = ρA(k) + 1
2[1 ρAR(k)ρA(k)]
=ρA(k)1
2[etP (ik)+etP (ik)]Qr+1(ikh) + O(|kh|r+2)
=etP (ik)+Qr+1(ikh)1
2[etP (ik)+etP (ik)]Qr+1(ikh) + O(|kh|r+2)]
=etP (ik)+O(|kh|r+2).
We have the following theorem.
Theorem 2. Suppose ρAR=ρAand scheme Ais accurate of order rfor
equation (3), where ris an odd positive integer, then scheme Fis accurate
of order r+ 1.
14
6 Zalesask’s Disc
We use the the standard Zalesask’s Disc test to illustrate the behavior of
these methods for multidimensional advection. The initial data is a slotted
circle centered at (50,75) with radius 15 and a 5 by 25 size slot. We
show the results after advecting one rotation (to t= 628) in a rotational
velocity field V=π
314 (50 y, x 50). Although BFECC was originally
proposed for level set methods, this particular example is not meant to
test these methods ability to treat interfaces. Instead, we are focusing on
how these methods behave for multidimensional advection. Thus, we do
not consider reinitialization [28] or the addition of particles [5]. In fact,
[6] showed that the addition of accurately advected particles allows one
to reduce high order accurate level set advection to first order accuracy
without adverse results. Still, accurate multidimensional advection is quite
useful for various other problems such as for incompressible flows. In the
figures, we plot the zero isocontours for visualization purposes but stress
that the errors are computed across the entire domain (i.e. all isocontours).
In particular, we compute the order of accuracy by comparing the error eon
the coarse grid to the error eon the fine grid at coincident node locations
as log2
e(i,j)
e(2i1,2j1) and average all of these values to obtain the values
shown in the tables below.
Figure 4 compares first order accurate upwinding with the versions of
BFECC and the MacCormack scheme obtained using first order accurate
upwind building blocks. Figure 5 compares the simple first order accurate
semi-Lagrangian method with the versions of BFECC and the MacCormack
scheme obtained using simple first order accurate semi-Lagrangian building
blocks. Note that the semi-Lagrangian method is fully multidimensional,
so even though the CFL is .75 in both Figure 4 and Figure 5 the resulting
numerical methods are all different (in contrast to one spatial dimension
where semi-Lagrangian and upwind building blocks are identical for CFL’s
less than one). Finally, Figure 6 repeats the calculations from Figure 5
using a higher CFL of 1.75.
15
Upwinding BFECC MacCormack
Grid Size Error Order Error Order Error Order
10121.8 – 8.9e-2 – 1.6e-1 –
20129.6e-1 1.05 3.9e-2 1.79 6.3e-2 1.93
40125.2e-1 1.04 1.8e-2 1.77 3.2e-2 1.59
80122.8e-1 1.02 7.6e-3 1.98 1.3e-2 2.08
160121.5e-1 1.01 3.1e-3 2.04 5.5e-3 2.08
Figure 4: Zalesask’s disc rotation comparing simple upwinding with the
versions of BFECC and the MacCormack scheme obtained using first order
accurate upwind building blocks (CFL=.75).
Semi-Lagrangian BFECC MacCormack
Grid Size Error Order Error Order Error Order
10121.8 9.9e-2 – 1.7e-1 –
20121.0 1.04 4.1e-2 1.73 6.7e-2 1.95
40125.4e-1 1.03 2.0e-2 1.67 3.3e-2 1.60
80122.9e-1 1.02 8.4e-3 1.93 1.4e-2 2.06
160121.5e-1 1.01 3.5e-3 2.00 5.9e-3 2.06
Figure 5: Zalesask’s disc rotation comparing the simple first order accurate
semi-Lagrangian method with the versions of BFECC and the MacCormack
scheme obtained using simple first order accurate semi-Lagrangian blocks
(CFL=.75).
16
Semi-Lagrangian BFECC MacCormack
Grid Size Error Order Error Order Error Order
10122.0 5.4e-2 – 1.5e-1 –
20121.1 1.02 2.4e-2 1.81 6.0e-2 1.82
40125.6e-1 1.02 1.0e-2 1.84 3.0e-2 1.62
80123.0e-1 1.01 4.0e-3 1.98 1.2e-2 1.99
160121.5e-1 1.02 1.5e-3 2.07 5.2e-3 2.01
Figure 6: Zalesask’s disc rotation comparing the simple first order accurate
semi-Lagrangian method with the versions of BFECC and the MacCormack
scheme obtained using simple first order accurate semi-Lagrangian blocks
(CFL=1.75).
17
7 Incompressible Flow
Consider inviscid incompressible flow on a standard MAC grid. First the
advection terms are updated to obtain an intermediate velocity, and then
a Poisson equation is solved for the pressure which is subsequently used to
make the intermediate velocity divergence free.
Consider a [0,3] ×[0,1] domain divided into 300 ×100 MAC grid cells
with a radius .125 circle centered at (.5, .5). The horizontal velocity is set
to one at the left and right boundaries, and the vertical velocity is set to
zero at the top and bottom boundaries. Zero derivative Neumann bound-
ary conditions are used for the pressure on all four boundaries. Figure 7
compares the first order accurate semi-Lagrangian method to BFECC and
the MacCormack method using first order accurate semi-Lagrangian build-
ing blocks. The MacCormack method is shown both with and without the
extrema clamping procedure discussed earlier. Note that each component
of the velocity field is separately advected and limited. Note that BFECC
and the MacCormack method both achieve similarly higher Reynolds num-
ber flows than the first order accurate semi-Lagrangian method. Whereas
Figure 7 was obtained with a CFL of .75, comparable results are shown in
Figure 8 with a higher CFL of 1.75. In Figure 9 we depict the results of
applying the extrema clamping strategies discussed in Section 4.
Both BFECC and the MacCormack method do not perform well when
information is mixed from disparate regions of the flow. This happens
frequently near domain boundaries leading to poor error estimates in these
regions. Thus, for both BFECC and the MacCormack method, we revert
to the first order accurate semi-Lagrangian scheme at any grid point whose
semi-Lagrangian characteristic could source from a solid wall or solid circle
boundary (i.e. CFL ×max(∆x, y)).
Now consider free surface flows which combine incompressible flow with
level set advection for interface tracking. We use the basic free surface
model described in [7] with the improved second order accurate free sur-
face pressure boundary condition proposed in [8] and the improved fast
marching method from [16]. In addition, we use first order accurate semi-
Lagrangian level set advection together with second order accurate Runge-
Kutta advection for the particles because [6] showed that the Particle Level
Set Method with a second order accurate particle advection scheme obvi-
ates the need for high order level set advection.
As [7] does, we extrapolate a divergence free velocity field across the
interface for the level set and incompressible advection, resulting in lower
order values in those regions. The BFECC or semi-Lagrangian MacCor-
mack error computation then depends on these less accurate values which
creates new extrema which we could clamp. Unfortunately, clamping tends
to pollute the solution with the incorrect error correction, thus when new
18
Figure 7: Inviscid incompressible flow comparing the first order accurate
semi-Lagrangian method to BFECC and the MacCormack method using
first order accurate semi-Lagrangian building blocks (CFL=.75).
19
Figure 8: Inviscid incompressible flow comparing the first order accurate
semi-Lagrangian method to BFECC and the MacCormack method using
first order accurate semi-Lagrangian building blocks (CFL=1.75).
20
Figure 9: Inviscid incompressible flow comparing the semi-Lagrangian
MacCormack method with clamping to the semi-Lagrangian MacCormack
method with reversion to first order when new extrema are detected
(CFL=.75).
21
extrema are detected we advocate reverting to first order accurate semi-
Lagrangian advection instead.
Consider a spherical radius .5 drop located at (.5, .75, .5) falling (with
gravity vector (0,9.8,0)) into a pool at height .412134 contained in a
walled domain of [0,1] ×[0,1.5] ×[0,1] as shown in Figure 10, 11 and
12. As with the flow past circle example, advection was reverted to the
first order accurate semi-Lagrangian method in cells close to the domain
boundaries. Without any limiter the simulation becomes unstable so we
apply the following limiter variants: (1) clamping of new extrema, (2)
clamping of new extrema but always using the first order accurate semi-
Lagrangian method near the interface and (3) reverting to the first order
accurate semi-Lagrangian method at cells where new extrema are found.
(1) and (3) do well at producing higher Reynolds number flows while (2)
mitigates most of the benefit of the second order accurate approach.
Finally, consider a radius .2 solid ball splashing into a pool of water
in a [0,1.5] ×[0,1] ×[0,1] domain. The ball is kinematically moved from
(1.25, .55, .5) to (.8, .1, .5) between time 0 and .075 using linear interpola-
tion, and the fluid has the gravity vector (0,9.8,0). Figure 13, 14 and
15 show a comparison between the first order accurate semi-Lagrangian
method and the three limiter strategies described above. Again we note
that without a limiter, the simulation is unstable. Also, as with the flow
past circle example and the falling drop example, advection near the do-
main boundaries and the ob ject boundaries is reverted to the first order
accurate semi-Lagrangian method.
22
Semi-Lagrangian MacCormack (Clamp Extrema)
MacCormack (Revert) MacCormack (Clamp Extrema)
first order accurate near interface
Figure 10: Inviscid incompressible free surface flow of a drop falling into
a pool. Notice how the MacCormack methods (top right, bottom left)
produce additional detail. Using the first order accurate semi-Lagrangian
advection near the interface (bottom right) removes much of the advantage
of the second order accurate method (bottom r ight). (200 ×300 ×200 grid,
t= 6/24, CFL=1.75).
23
Semi-Lagrangian MacCormack (Clamp Extrema)
MacCormack (Revert) MacCormack (Clamp Extrema)
first order accurate near interface
Figure 11: Inviscid incompressible free surface flow of a drop falling into a
pool (200 ×300 ×200 grid, t= 10/24, CFL=1.75).
24
Semi-Lagrangian MacCormack (Clamp Extrema)
MacCormack (Revert) MacCormack (Clamp Extrema)
first order accurate near interface
Figure 12: Inviscid incompressible free surface flow of a drop falling into a
pool (200 ×300 ×200 grid, t= 18/24, CFL=1.75).
25
Semi-Lagrangian MacCormack (Clamp Extrema)
MacCormack (Revert) MacCormack (Clamp Extrema)
first order accurate near interface
Figure 13: Inviscid incompressible free surface flow of a solid ball thrown
into a pool. Note that the clamp and reversion MacCormack variants (up-
per right, lower left) capture the vortex sheeting due to the ball’s penetra-
tion that is missed when using the semi-Lagrangian method or the clamped
MacCormack method that uses the first order accurate semi-Lagrangian
method near the interface (upper left, lower right). (450 ×300 ×300 grid,
CFL=1.75, t=4/24)
26
Semi-Lagrangian MacCormack (Clamp Extrema)
MacCormack (Revert) MacCormack (Clamp Extrema)
first order accurate near interface
Figure 14: Inviscid incompressible free surface flow of a solid ball thrown
into a pool. (450 ×300 ×300 grid, CFL=1.75, t=10/24)
27
Semi-Lagrangian MacCormack (Clamp Extrema)
MacCormack (Revert) MacCormack (Clamp Extrema)
first order accurate near interface
Figure 15: Inviscid incompressible free surface flow of a solid ball thrown
into a pool. (450 ×300 ×300 grid, CFL=1.75, t=40/24)
28
8 Conclusion
Motivated by the BFECC method, we rewrote a version of the MacCor-
mack method into a similar form facilitating its extension to unconditional
stability while still preserving second order accuracy in space in time. The
MacCormack method only requires two first order accurate advection steps
whereas BFECC is 50% more expensive requiring three advection steps.
Although the semi-Lagrangian versions of BFECC and the MacCormack
scheme are not fully monotone, we proposed a simple limiter that preserves
monotonicity. We illustrated the expected behavior of the method on both
simple and more complex problems, noting that difficulties could arise if
the semi-Lagrangian rays mix information from disparate regions such as
from both solid wall boundaries and fluid regions. In those instances, it is
simple to revert to the first order accurate semi-Lagrangian method. We
also saw that using an increasing number of simple semi-Lagrangian rays
can improve accuracy. In particular one ray yields the first order accurate
semi-Lagrangian method, two rays yield the second order accurate Mac-
Cormack method and three rays yield the second order accurate BFECC
method, which has a lower truncation error magnitude than the MacCor-
mack method in some problems. Thus an obvious question is whether
one can do better than the BFECC method with three rays, perhaps even
obtaining third order accuracy.
Acknowledgments
A. Selle and R. Fedkiw were supported in part by an ONR YIP award and
a PECASE award (ONR N00014-01-1-0620), a Packard Foundation Fellow-
ship, a Sloan Research Fellowship, ONR N0014-06-1-0393, ONR N00014-
03-1-0071, ONR N00014-02-1-0720, ONR N00014-05-1-0479 (for a SUN
computing cluster), ARO DAAD19-03-1-0331, NSF IIS-0326388, NSF ITR-
0205671, NSF ITR-0121288, NSF ACI-0323866 and NIH U54-GM072970.
Y. Liu was supported by NSF grant DMS-0511815.
References
[1] J.D. Anderson. Computational Fluid Dynamics: The Basics With
Applications. McGraw-Hill, 1995. New York, NY.
[2] R. Courant, E. Issacson, and M. Rees. On the solution of nonlinear
hyperbolic differential equations by finite differences. Comm. Pure and
Applied Math, 5:243–255, 1952.
29
[3] T. Dupont and Y. Liu. Back and forth error compensation and cor-
rection methods for removing errors induced by uneven gradients of
the level set function. J. Comput. Phys., 190/1:311–324, 2003.
[4] T. Dupont and Y. Liu. Back and forth error compensation and cor-
rection methods for semi-Lagrangian schemes with application to level
set interface computations. Math. Comp., In Press., 2006.
[5] D. Enright, R. Fedkiw, J. Ferziger, and I. Mitchell. A hybrid particle
level set method for improved interface capturing. J. Comput. Phys.,
183:83–116, 2002.
[6] D. Enright, F. Losasso, and R. Fedkiw. A fast and accurate semi-
Lagrangian particle level set method. Computers and Structures,
83:479–490, 2005.
[7] D. Enright, S. Marschner, and R. Fedkiw. Animation and rendering
of complex water surfaces. ACM Trans. Graph. (SIGGRAPH Proc.),
21(3):736–744, 2002.
[8] D. Enright, D. Nguyen, F. Gibou, and R. Fedkiw. Using the particle
level set method and a second order accurate pressure boundary con-
dition for free surface flows. In Proc. 4th ASME-JSME Joint Fluids
Eng. Conf., number FEDSM2003–45144. ASME, 2003.
[9] R. Fedkiw, J. Stam, and H. Jensen. Visual simulation of smoke. In
Proc. of ACM SIGGRAPH 2001, pages 15–22, 2001.
[10] M. Herrmann and G. Blanquart. Flux corrected finite volume scheme
for preserving scalar boundedness in reacting large-eddy simulations.
AIAA J., 44(12):2879–2886, 2006.
[11] G. Irving, E. Guendelman, F. Losasso, and R. Fedkiw. Efficient simu-
lation of large bodies of water by coupling two and three dimensional
techniques. ACM Trans. Graph. (SIGGRAPH Proc.), 25(3):805–811,
2006.
[12] G.-S. Jiang and D. Peng. Weighted ENO schemes for Hamilton-Jacobi
equations. SIAM J. Sci. Comput., 21:2126–2143, 2000.
[13] B.-M. Kim, Y. Liu, I. Llamas, and J. Rossignac. Using BFECC for
fluid simulation. In Eurographics Workshop on Natural Phenomena
2005, 2005.
[14] B.-M. Kim, Y. Liu, I. Llamas, and J. Rossignac. Advections with
significantly reduced dissipation and diffusion. IEEE Trans. on Vis.
and Comput. Graph., In Press., 2006.
30
[15] P.D. Lax. On the stability of difference approximations to solutions
of hyperbolic equations with variable coefficients. Comm. Pure Appl.
Math., 14:497–520, 1961.
[16] F. Losasso, R. Fedkiw, and S. Osher. Spatially adaptive techniques
for level set methods and incompressible flow. Computers and Fluids,
35:995–1010, 2006.
[17] F. Losasso, F. Gibou, and R. Fedkiw. Simulating water and smoke with
an octree data structure. ACM Trans. Graph. (SIGGRAPH Proc.),
23:457–462, 2004.
[18] R. MacCormack. The effect of viscosity in hypervelocity impact cra-
tering. In AIAA Hypervelocity Impact Conference, 1969. AIAA paper
69-354.
[19] C. Min and F. Gibou. A second order accurate pro jection method
for the incompressible Navier-Stokes equation on non-graded adaptive
grids. J. Comput. Phys., 219:912–929, 2006.
[20] S. Osher and R. Fedkiw. Level Set Methods and Dynamic Implicit
Surfaces. Springer-Verlag, 2002. New York, NY.
[21] S. Osher and J. Sethian. Fronts propagating with curvature-dependent
speed: Algorithms based on Hamilton-Jacobi formulations. J. Com-
put. Phys., 79:12–49, 1988.
[22] A. Selle, N. Rasmussen, and R. Fedkiw. A vortex particle method
for smoke, water and explosions. ACM Trans. Graph. (SIGGRAPH
Proc.), 24(3):910–914, 2005.
[23] C.-W. Shu and S. Osher. Efficient implementation of essentially non-
oscillatory shock capturing schemes. J. Comput. Phys., 77:439–471,
1988.
[24] J. Stam. Stable fluids. In Proc. of SIGGRAPH 99, pages 121–128,
1999.
[25] A. Staniforth and J. Cote. Semi-Lagrangian integration schemes for
atmospheric models: A review. Monthly Weather Review, 119:2206–
2223, 1991.
[26] J. Steinhoff and D. Underhill. Modification of the Euler equations for
“vorticity confinement”: Application to the computation of interacting
vortex rings. Phys. of Fluids, 6(8):2738–2744, 1994.
[27] J. Strain. Tree methods for moving interfaces. J. Comput. Phys.,
151:616–648, 1999.
31
[28] M. Sussman, P. Smereka, and S. Osher. A level set approach for
computing solutions to incompressible two-phase flow. J. Comput.
Phys., 114:146–159, 1994.
[29] R.F. Warming and R.M. Beam. Upwind second-order difference
schemes and applications in aerodynamic flows. AIAA J., 14(9):1241–
1249, 1976.
32
... The former has garnered much attention across a wide span of scientific communities, and among a multitude of research work we refer to [23] for a review. The latter was originally designed to enhance the interface level set and fluid simulations [13,28], but has recently been expanded in its applications to computational electrodynamics [32,36]. We also refer to the modified MacCormack method [28] which is unconditionally stable. ...
... The latter was originally designed to enhance the interface level set and fluid simulations [13,28], but has recently been expanded in its applications to computational electrodynamics [32,36]. We also refer to the modified MacCormack method [28] which is unconditionally stable. ...
Preprint
We propose a finite difference method to solve Maxwell's equations in time domain in the presence of a perfect electric conductor that impedes the propagations of electromagnetic waves. Our method is a modification of the existing approach by Zou and Liu [36], from a locally perturbed body-fitted grid to a uniform orthogonal one for complicated PEC objects. Similar to their work we extrapolate ghost point values by exploiting the level set function of the interface and the PDE-based extension technique, which allows us to circumvent scrutinizing local geometries of the interface. We stipulate a mild requirement on the accuracy of our extrapolation that the ghost values need only be locally second order accurate. Nevertheless the resulting accuracy of our method is second order thanks to the application of back and forth error correction and compensation, which also relaxes CFL conditions. We demonstrate the effectiveness of our approach with some numerical examples.
... Fedkiw et al. [31] tackle the numerical diffusion problem by using a sharper form of spatial interpolation based on a Catmull-Rom interpolation as well as vorticity confinement. Since then, many methods have been developed using advection schemes as detail-preserving as possible [58,109,75,141,138,80]. Enright et al. [29] generate particles on both sides of a liquid surface, using them to maintain an accurate representation of the surface. ...
Thesis
Physics-based animation can generate dynamic systems of very complex and realistic behaviors. Unfortunately, controlling them is a daunting task. In particular, fluid simulation brings up particularly difficult problems to the control process. Although many methods and tools have been developed to convincingly simulate and render fluids, too few methods provide efficient and intuitive control over a simulation. Since control often comes with extra computations on top of the simulation cost, art-directing a high-resolution simulation leads to long iterations of the creative process. In order to shorten this process, editing could be performed on a faster, low-resolution model. Therefore, we can consider that the process of generating an art-directed fluid could be split into two stages: a control stage during which an artist modifies the behavior of a low-resolution simulation, and an upresolution stage during which a final high-resolution version of this simulation is driven. This thesis presents two projects, each one improving on the state of the art related to each of these two stages.First, we introduce a new particle-based liquid control system. Using this system, an artist selects patches of precomputed liquid animations from a database, and places them in a simulation to modify its behavior. At each simulation time step, our system uses these entities to control the simulation in order to reproduce the artist’s vision. An intuitive graphical user interface inspired by video editing tools has been developed, allowing a nontechnical user to simply edit a liquid animation.Second, a tracking solution for smoke upresolution is described. We propose to add an extra tracking step after the projection of a classical Eulerian smoke simulation. During this step, we solve for a divergence-free velocity perturbation field resulting in a better matching of the low-frequency density distribution between the low-resolution guide and the high-resolution simulation. The resulting smoke animation faithfully reproduces the coarse aspect of the low-resolution input, while being enhanced with simulated small-scale details.
... where a is the advection velocity, and the vector field of interest is the advected quantity f = u. It is well known that traditional spatial representations, such as grid-based finite differences, exhibit numerical dissipation for the advection equation (Courant et al., 1952;Selle et al., 2008). ...
Preprint
Full-text available
Numerically solving partial differential equations (PDEs) often entails spatial and temporal discretizations. Traditional methods (e.g., finite difference, finite element, smoothed-particle hydrodynamics) frequently adopt explicit spatial discretizations, such as grids, meshes, and point clouds, where each degree-of-freedom corresponds to a location in space. While these explicit spatial correspondences are intuitive to model and understand, these representations are not necessarily optimal for accuracy, memory-usage, or adaptivity. In this work, we explore implicit neural representation as an alternative spatial discretization, where spatial information is implicitly stored in the neural network weights. With implicit neural spatial representation, PDE-constrained time-stepping translates into updating neural network weights, which naturally integrates with commonly adopted optimization time integrators. We validate our approach on a variety of classic PDEs with examples involving large elastic deformations, turbulent fluids, and multiscale phenomena. While slower to compute than traditional representations, our approach exhibits higher accuracy, lower memory consumption, and dynamically adaptive allocation of degrees of freedom without complex remeshing.
... When interpolation points are located at centroids of grid cells, BFECC interpolation gives 4th order accuracy in 2D, see Table 2. BFECC interpolation is also compared to interpolation based on the modified MacCormack scheme. Since the interpolation between two grids is equivalent to solving an advection equation for one time step by a numerical scheme, we have also tested another simple scheme, the modified MacCormack scheme [21] which uses only two advection steps. While both methods have 3rd order of accuracy, we can observe lower errors for BFECC. ...
Article
Full-text available
The accuracy of information transmission while solving domain decomposed problems is crucial to the smooth transition of a solution around the interface/overlapping region. This paper describes a systematical study on an accuracy-enhancing interface treatment algorithm based on the back and forth error compensation and correction method (BFECC). By repetitively employing a low order interpolation technique (usually local 2nd order) 3 times, this algorithm achieves local 3rd order accuracy. Analytical derivation for any dimensions is made, and the “superconvergence” phenomenon (4th order accuracy) is found for specific positioning of the source and target grids. Its limitation has also been studied. With rotated grids or grids of different sizes, this method can still reduce the error but fails to improve the order of the underlying interpolation technique. A series of numerical experiments on meshes with various translations, rotations, spacing ratios, and perturbations have been tested. Different interface treatments applied to cavity flow are compared. The 3D flow example shows that the BFECC method positively impacts the convergence of the domain decomposed problem.
... The computational domain is discretized on a uniform Cartesian grid with a finite-difference scheme on a marker-and-cell staggered grid, more extensively explained by Harlow and Welch (1965). First, the density is convected along streamlines, using an unconditionally stable, secondorder accurate Maccormack semi-Lagrangian method, as described by Selle et al. (2008). Once the density field is advected, the momentum equation is solved through a splitting method, where the velocity field is first advected similarly to the density field, and then modified by the external forces with a forward Euler scheme, resulting in the velocity field u * . ...
Article
Full-text available
The resolution of the Poisson equation is usually one of the most computationally intensive steps for incompressible fluid solvers. Lately, DeepLearning, and especially convolutional neural networks (CNNs), has been introduced to solve this equation, leading to significant inference time reduction at the cost of a lack of guarantee on the accuracy of the solution.This drawback might lead to inaccuracies, potentially unstable simulations and prevent performing fair assessments of the CNN speedup for different network architectures. To circumvent this issue, a hybrid strategy is developed, which couples a CNN with a traditional iterative solver to ensure a user-defined accuracy level. The CNN hybrid method is tested on two flow cases: (a) the flow around a 2D cylinder and (b) the variable-density plumes with and without obstacles (both 2D and 3D), demonstrating remarkable generalization capabilities, ensuring both the accuracy and stability of the simulations. The error distribution of the predictions using several network architectures is further investigated in the plume test case. The introduced hybrid strategy allows a systematic evaluation of the CNN performance at the same accuracy level for various network architectures. In particular, the importance of incorporating multiple scales in the network architecture is demonstrated, since improving both the accuracy and the inference performance compared with feedforward CNN architectures. Thus, in addition to the pure networks’ performance evaluation, this study has also led to numerous guidelines and results on how to build neural networks and computational strategies to predict unsteady flows with both accuracy and stability requirements.
... The solid wall boundary condition is adopted for the smoke flow around the obstacle domain in Equation 3, where n denotes the normal vector on the solid boundary. In this work, we used the semi-Lagrangian method [36] for advection term, and the Mac-Cormack method [33] to suppress the numerical diffusion on grids. ...
Preprint
Full-text available
The dynamic effects of smoke are impressive in illustration design, but it is a troublesome and challenging issue for common users to design the smoke effect without domain knowledge of fluid simulations. In this work, we propose DualSmoke, two stage global-to-local generation framework for the interactive smoke illustration design. For the global stage, the proposed approach utilizes fluid patterns to generate Lagrangian coherent structure from the user's hand-drawn sketches. For the local stage, the detailed flow patterns are obtained from the generated coherent structure. Finally, we apply the guiding force field to the smoke simulator to design the desired smoke illustration. To construct the training dataset, DualSmoke generates flow patterns using the finite-time Lyapunov exponents of the velocity fields. The synthetic sketch data is generated from the flow patterns by skeleton extraction. From our user study, it is verified that the proposed design interface can provide various smoke illustration designs with good user usability. Our code is available at: https://github.com/shasph/DualSmoke
... It allows researchers to ignore the restriction of the Courant-Friedrichs-Lewy condition on the time-step but leads to significant numerical dissipation. To solve the problem of numerical dissipation, various structure-preserving schemes have been proposed, such as the BFECC scheme [26], the Mac-Cormack scheme [27], the advection-reaction scheme [28], the "BiMocq2" method [29], the Clebsch method [30][31][32], and the impluse method [33]. These methods must be based on a predivided grid, also called the Eulerian grid method. ...
Article
Full-text available
Under the current background of navigation education, students generally lack a comprehensive grasp of ship firefighting equipment’s operation. Therefore, we develop a novel ship firefighting training simulator with a multi-sensory human–computer interaction function for teaching and training marine students. In the simulator, we consider a container ship of 1.8w containers as the prototype ship, and the entire ship models are built using three-dimensional modeling technology. We design various interactive modes and realize a full-process operation simulation of several standard ship firefighting equipment. Furthermore, we propose a purely Lagrangian vortex dynamics framework to simulate smoke and flame in fire scenarios. In this framework, we model fluids using velocity and vorticity fields discretized on discrete vortex segments. The main components of the framework include a stable geometric stretching solution and particle strength exchange method for solving the diffusion term. The simulation results show that the simulator has good behavioral realism and scene immersion and can be applied to ship firefighting training. To the best of our knowledge, this is the first study on real-time smoke simulation using a physics-based method in a firefighting training simulator.
Article
In this paper, we extend the curvilinear collocated-grid finite-difference method, which has been developed in the study of seismology, to the 2D electromagnetic simulation of ground penetrating radar (GPR). The method combines curvilinear coordinate and collocated grid, so it can better describe the geometry of the irregular interfaces than traditional finite difference method and is more efficient than finite element method which is suitable for complex geometries. Due to the differences in interfacial condition between elastic waves and electromagnetic waves, a novel scheme of equivalent electromagnetic fields is introduced to explicitly ensure discontinuous interfacial boundary conditions with collocated grid. Furthermore, this approach eliminates the need for orthogonality of the grid at the interface, which reduces the complexity of mesh generation. The proposed method is verified for a series of ground penetrating radar application models, by comparing synthetic waveforms with independent reference solutions. The perfect consistency of the comparisons indicates the accuracy of our new method in the simulation of GPR. Compared with the second-order gprMax, the proposed method is proved to be more efficient in terms of computing time and memory. Combination of collocated grid and the novel equivalent field method leads to reliable and accurate solutions of EM fields even on the ground surface.
Article
We propose a pure Lagrangian vortex particle dynamics framework to simulate the various phenomena of turbulent smoke and two-way coupling between fluid and solid. In the framework, we model the fluid using vorticity and velocity fields that are discretized on the vortex particles. We extend a segment-based vortex stretching strategy with the subdivision of long segments to capture the fine details of smoke while maintaining good numerical stability. In addition, a vorticity field correction mechanism based on the merging and splitting of particles is proposed to avoid excessive particle counts and reduce the associated unnecessary computational overhead. We also present a fast and approximate two-way coupling method for simulating the interaction between solid and fluid. Our method can be used to solve various fluid phenomena, including Kármán vortex streets, jets, and some examples of two-way fluid–solid coupling.
Article
The animation of delicate vortical structures of gas and liquids has been of great interest in computer graphics. However, common velocity-based fluid solvers can damp the vortical flow, while vorticity-based fluid solvers suffer from performance drawbacks. We propose a new velocity-based fluid solver derived from a reformulated Euler equation using covectors. Our method generates rich vortex dynamics by an advection process that respects the Kelvin circulation theorem. The numerical algorithm requires only a small local adjustment to existing advection-projection methods and can easily leverage recent advances therein. The resulting solver emulates a vortex method without the expensive conversion between vortical variables and velocities. We demonstrate that our method preserves vorticity in both vortex filament dynamics and turbulent flows significantly better than previous methods, while also improving preservation of energy.
Article
Full-text available
A new ‘‘vorticity confinement’’ method is described which involves adding a term to the momentum conservation equations of fluid dynamics. This term depends only on local variables and is zero outside vortical regions. The partial differential equations with this extra term admit solutions that consist of Lagrangian-like confined vortical regions, or covons, in the shape of two-dimensional (2-D) vortex ‘‘blobs’’ and three-dimensional (3-D) vortex filaments, which convect in a constant external velocity field with a fixed internal structure, without spreading, even if the equations contain diffusive terms. Solutions of the discretized equations on a fixed Eulerian grid show the same behavior, in spite of numerical diffusion. Effectively, the new term, together with diffusive terms, constitute a new type of regularization of the inviscid equations which appears to be very useful in the numerical solution of flow problems involving thin vortical regions. The discretized Euler equations with the extra term can be solved on fairly coarse, Eulerian computational grids with simple low-order (first- or second-) accurate numerical methods, but will still yield concentrated vortices which convect without spreading due to numerical diffusion. Since only a fixed grid is used with local variables, the vorticity confinement method is quite general and can automatically accommodate changes in vortex topology, such as merging. Applications are presented for incompressible flow in 3D, where pairs of thin vortex rings interact and, in some cases, merge.
Conference Paper
In this paper, we present an enhanced resolution capturing method for topologically complex two and three dimensional incompressible free surface flows. The method is based upon the level set method of Osher and Sethian to represent the interface combined with two recent advances in the treatment of the interface, a second order accurate discretization of the Dirichlet pressure boundary condition at the free surface (2002, J. Comput. Phys.176 , 205) and the use of massless marker particles to enhance the resolution of the interface through the use of the particle level set method (2002, J. Comput. Phys., 183 , 83). Use of these methods allow for the accurate movement of the interface while at the same time preserving the mass of the liquid, even on coarse computational grids. Also, these methods complement the level set method in its ability to handle changes in interface topology in a robust manner. Surface tension effects can be easily included in our method. The method is presented in three spatial dimensions, with numerical examples in both two and three spatial dimensions.
Article
A level set method for capturing the interface between two fluids is combined with a variable density projection method to allow for computation of two-phase flow where the interface can merge/break and the flow can have a high Reynolds number. A distance function formulation of the level set method enables one to compute flows with large density ratios (1000/1) and flows that are surface tension driven; with no emotional involvement. Recent work has improved the accuracy of the distance function formulation and the accuracy of the advection scheme. We compute flows involving air bubbles and water drops, to name a few. We validate our code against experiments and theory.
Article
It is shown that explicit second-order upwind difference schemes in combination with spatially symmetric schemes can produce large stability bounds and better numerical resolution than asymmetric schemes alone. However, if conservation form is essential, a special operator is required for transition between schemes. An operational approach has been devised for deriving transition operators so that strict conservation and local consistency are maintained. Various aspects of hybrid schemes are studied numerically for model linear and nonlinear equations. To demonstrate the utility of combining two different algorithms, MacCormack's explicit, noncentered, second-order method is combined with a completely upwind version, and numerical solutions of the Euler equations are obtained for two-dimensional, transonic flows with embedded supersonic regions and shock waves.
Article
In this paper, we present an enhanced resolution capturing method for topologically complex two and three dimensional incompressible free surface flows. The method is based upon the level set method of Osher and Sethian to represent the interface combined with two recent advances in the treatment of the interface, a second order accurate discretization of the Dirichlet pressure boundary condition at the free surface (2002, J. Comput. Phys. 176, 205) and the use of massless marker particles to enhance the resolution of the interface through the use of the particle level set method (2002, J. Comput. Phys., 183, 83). Use of these methods allow for the accurate movement of the interface while at the same time preserving the mass of the the liquid, even on coarse computational grids. Also, these methods complement the level set method in its ability to handle changes in interface topology in a robust manner. Surface tension eects can be easily included in our method. The method is presented in three spatial dimensions, with numerical examples in both two and three spatial dimensions.
Article
The semi-Lagrangian methodology is described for a hierarchy of applications (passive advection, forced advection, and coupled sets of equation) of increasing complexity, in one, two, and three dimensions. Attention is focused on its accuracy, stability, and efficiency properties. Recent developments in applying semi-Lagrangian methods to 2D and 3D atmospheric flows in both Cartesian and spherical geometries are then reviewed. Finally, the current status of development is summarized, followed by a short discussion of future perspectives. 80 refs.