Upload
hoangque
View
227
Download
4
Embed Size (px)
Citation preview
Introduction to groundwater flow modeling: finite difference
methods
Tyson Strand
1) Darcy’s law, continuity, and the groundwater flow equation
2) Fundamentals of finite difference methods
3) FD solution of Laplace’s equation
4) FD solution of Poisson’s equation
5) Transient flow
1) Darcy’s law, continuity, and the groundwater flow equation
qx
qy
qy+dy
qx+dx
0)()( =−+−++ yydyyyxxdxxx
qqdxqqdy
Everything that goes in, must come out
00==
−+
− ++
dxdydy
dxqq yydyyyxxdxxx
After dividing by the volume (area), let dx and dy go to zero
0=∂
∂+
∂∂
yq
xq yx Continuity
Darcy’s law: isotropic medium
xhKqx ∂∂
−=
yhKqy ∂∂
−=
zhKqz ∂∂
−=
Scalar form
hKkzhj
yhi
xhK ∇−=
∂∂
+∂∂
+∂∂
−= )ˆˆˆ(
Vector form
Darcy’s law + continuity (in 2D)
xhKqx ∂∂
−=yhKqy ∂∂
−= 0=∂
∂+
∂∂
yq
xq yx
02
2
2
2
=
∂∂
+∂∂
−=
∂∂
−∂∂
+
∂∂
−∂∂
yh
xhK
yhK
yxhK
x
02 =∇ h Laplace’s equation
The groundwater flow equation
thSW
zhK
zyhK
yxhK
x szzyyxx ∂∂
=−
∂∂
∂∂
+
∂∂
∂∂
+
∂∂
∂∂
Sources and sinks
Transient flow term
Darcy’s law + continuity
Simplifying assumptions
• Isotropic medium: K = Kxx = Kyy = Kzz W = f(x,y,t)
• Steady-state flow (Poisson’s equation W = f(x,y))
• Steady-state flow, no sources/sinks (Laplace’s equation)
thSWhK s ∂∂
=−∇2
KWh =∇2
02 =∇ h
Fundamentals of finite difference methods
• Discretization of space
• Discretization of (continuous) quantities
• Discretization of time
• The first spatial derivative
• The second spatial derivative
• Boundary conditions and initial conditions
• Solving the problem
Disctretization of space
(i,j)
(i,j+1)
(i,j-1)
(i-1,j) (i+1,j)
(i,j)
xdx
yLx = (Nx – 1)dx
dy
Discretization of quantitiesEach spatial location (i,j) has associated with it a head value and a vector darcy flux
(i,j)
(i,j+1)
(i,j-1)
(i-1,j) (i+1,j)h(i,j)qx(i,j)qy(i,j)
Discretization of time
t = n n+1∆t n+2∆t n+3∆t n+4∆t n+5∆t
tm+2 tm+3 tm+4 tm+5tm tm+1
Increasing time
The first spatial derivative
∆−
+∆−
=
∆∆
≅∂∂ +−
xhh
xhh
xh
xh iiii
ji
11
),( 21
(i,j)
(i,j+1)
(i,j-1)
(i-1,j) (i+1,j)xhh
xh
xh ii
ji ∆−
=∆∆
≅∂∂ −1
),(
Upstream difference
Central difference
The second spatial derivative: step 1
xhh
xh ii
i ∆−
≅∂∂ −
−
1
21
xhh
xh ii
i ∆−
≅∂∂ +
+
1
21
(i,j)
(i,j+1)
(i,j-1)
(i-1,j) (i+1,j)
NOTE: This is essentially a central differenceapproximation of the first derivative evaluatedat the mid-positions
The second spatial derivative: step 2
∂∂
∂∂
=∂∂
xh
xxh2
2
( )211
11
21
21
2
2 2x
hhhx
xhh
xhh
x
xh
xh
xh iii
iiiiii
∆+−
=∆
∆−
−∆−
=∆
∂∂
−∂∂
≅∂∂ −+
−+−+
The second derivative is just the derivative of the derivative
Boundary conditionsWhat are boundary conditions and why are they necessary?
1.0=∂∂xhConsider the simple problem:
We can solve this directly by separating variables and integrating:
Cxhxh +=→∂=∂∫ ∫ 1.01.0
There are an infinitenumber of solutionsto this equation.
They are referred toas a family of curves
Cxh += 1.0h
x
We must specify avalue of h at a knownposition x in order tosolve for C.
For a second (spatial) derivative, two boundary conditionsmust be specified. There are 3 types of bc’s that we can apply
1) Head is specified at a boundary
- Called Dirichlet conditions
2) Flow (first derivative of head) is specified at a boundary
- Called Neumann conditions
3) Some combination of 1) and 2)
- Called mixed conditions
Initial conditions
Equivalent to boundary conditions, except that the boundaryis now temporal instead of spatial
Typically, the state of the system (i.e. head values) arespecified at time t = 0
thSW
zhK
zyhK
yxhK
x szzyyxx ∂∂
=−
∂∂
∂∂
+
∂∂
∂∂
+
∂∂
∂∂
Question: How many boundary and initial conditionsWould be needed to solve the above governing equation?
Solving the problem
After Wang & Anderson, 1982
Set of differentialequations
(Mathematical model)
Set of algebraicequations
(discrete model)
Finite DifferenceFinite Element
Fieldobservations
Analytical solution (Not always possible)
Calculustechniques
Iterative ordirect methods
Approximatesolution
CompareIf possible
Recall how we arrived at Laplace’s equation
xhKqx ∂∂
−=yhKqy ∂∂
−= 0=∂
∂+
∂∂
yq
xq yx
02
2
2
2
=
∂∂
+∂∂
−=
∂∂
−∂∂
+
∂∂
−∂∂
yh
xhK
yhK
yxhK
x
02 =∇ h Laplace’s equation
We are focusing on iterative methods
Solving Laplace’s equation (2D)
02
2
2
2
=∂∂
+∂∂
yh
xh02 =∇ h
( )2),1(),(),1(
2
2 2x
hhhxh jijiji
∆
+−≅
∂∂ −+
( )2)1,(),()1,(
2
2 2y
hhhyh jijiji
∆
+−≅
∂∂ −+
Let ∆x = ∆y
( )2),1(),(),1(
2
2 2x
hhhxh jijiji
∆
+−≅
∂∂ −+
( )2)1,(),()1,(
2
2 2y
hhhyh jijiji
∆
+−≅
∂∂ −+
+
( )[ ]),()1,()1,(),1(),1(2 41
jijijijiji hhhhhx
−+++∆ +−+−
( )[ ]),()1,()1,(),1(),1(2 41
jijijijiji hhhhhx
−+++∆ +−+−
Set equal to zero
04 ),()1,()1,(),1(),1( =−+++ +−+− jijijijiji hhhhh
The above equation is the basic finite difference solution to Laplace’s equation
Now we rearrange the previousequation so that we can implement
it into our regular grid
Solve for h(i,j)
4)1,()1,(),1(),1(
),(+−+− +++
= jijijijiji
hhhhh
Now what do we do?
(i,j)
Specify boundary conditions
Guess at initial values for headat all (i,j) locations
Begin iterations
What does it mean to “iterate”?
Given: We know the boundary conditions and haveinitial guess values for head(position)
Do: Update head values at every (i,j) locationbased on previous equation (including boundaries if applicable)
While: Convergence criteria are not met
Convergence
1) Compare obtained head values at a giveniteration to those at the previous iteration
2) Continue to iterate as long as head valuescontinue to change within some preset limit
3) Test the solution (to be described)
Testing a computational model
Comparison to other analytical results/field data (validation?)
Changing the grid spacing
Changing the convergence criterion
Mass balance check
Validation/verification
1) Analytical solution is known (uncommon)
2) Comparison to field data
3) Test on simple situations for which 1 or 2are known
4) Check model predictions
Possible model problems
Stability
Robustness
Sample problem: Laplace’s equation
Lecture 2• Poisson’s equation
– Digression: Inflow, outflow, and sign conventions• Finite difference form for Poisson’s equation• Example programs solving Poisson’s equation• Transient flow
– Digression: Storage parameters• Finite difference form for transient gw flow
equation (explicit methods & stability)• Example transient flow program • Implicit iterative methods • Example transient flow program, fully implicit
Solving Poisson’s equation
−==∇
TyxR
KWh ),(2 What is W?
KW
yh
xh
=∂∂
+∂∂
2
2
2
2
byxRW ),(
−=
Where b is the thickness of the aquifer (z dimension)
Inflow, outflow, and sign conventions
Think about the magnitudes of qout and qinWhat does it mean in terms of sources/sinks?
x
02
2
=∂∂xh
02
2
>∂∂xh
Sign conventions
02
2
<∂∂xh
02
2
<∂∂xh
There must be recharge (or someother source) at the REV (steady-state assumption)
02
2
>∂∂xh There must be discharge (or some
other sink) at the REV(steady-state assumption)
−==∇
TyxR
KWh ),(2
• You need to be careful as to how things are defined
• W MUST be defined discharge (sink) positive• It is more intuitive to define a recharge (source)
function R(x,y) that is positive for recharge (sources) and negative for discharge (sinks)
• This will also help give us an intuitive understanding of the transient gw flow equation
Back to Poisson’s equation
TyxRh ),(2 −=∇ Proceeding as we did for Laplace’s equation
( )[ ]
TR
hhhhhx
jijijijijiji
),(),()1,()1,(),1(),1(2 41
−=−+++∆ +−+−
Solving for h(i,j)
( )
∆++++= +−+− T
Rxhhhhh ji
jijijijiji),(
2
)1,()1,(),1(),1(),( 41
Solving Poisson’s equation numerically
• Basically, we can proceed exactly as we did for Laplace’s equation, using the previous finite difference approximation for h(i,j)
• Define boundary conditions• Set initial guess values• Iterate• Check results
Sample problem: Poisson’s equation with uniform recharge/discharge
Sample problem: Poisson’s equation with point source
recharge/discharge
Solving transient flow problems
btyxR
thShK s
),,(2 −∂∂
=∇
We’ve learned how to take care of everything except the time derivative
thh
th
th m
jimji
∆
−=
∆∆
≈∂∂ +
),(1),( Forward difference approximation
thh
th
th m
jimji
∆
−=
∆∆
≈∂∂ −1
),(),( Backward difference approximation
Central difference approximation
thh
th
th m
jimji
∆
−=
∆∆
≈∂∂ −+
2
1),(
1),(
= BAD NEWS
• The central difference approximation is unconditionally unstable (for time derivative)
• This method should NOT be used to estimate the first time derivative
Storage parameters• S = storage coefficient, or storativity
– Dimensionless– Measures the volume of water expelled (absorbed) per
unit surface area per unit head change
• Ss = specific storage = S/b– Units [1/L] also called elastic storage coeff.– Measures the water volume per unit aquifer volume that
is expelled (stored) due to compressibility (matrix & water) per unit head change
– Used for confined units or the saturated parts of an unconfined unit
– b = aquifer thickness for confined units, use bs = thickness of the saturated region for unconfined systems
Specific yield• Sy = specific yield
– Dimensionless– Used to describe unconfined systems– Ratio of water volume that drains from a saturated
region of aquifer due to gravity forces per unit aquifer volume
– Generally several orders of magnitude larger than bsSsexcept in very fine grained systems
• Relationship between Sy, Ss, and S
ssy SbSS +=Fetter, 1994
Storage parameters (concl.)
• In unconfined systems, the specific storage can generally be neglected– Except in very fine grained media
• In confined systems, only the specific storage is pertinent (so long as head values remain above the upper confining unit)
• In general, for computational models, it is best to use the storage coefficient (storativity)
• Definitions of storage parameters are not always consistent in literature, be careful
Transient flow• So, let’s consider the transient flow equation in
the form
TtyxR
th
TS
yh
xh ),,(
2
2
2
2
−∂∂
=∂∂
+∂∂
Assume the left hand size is negative (out > in):then, by the convention we’ve set , either rechargeis positive or the time rate of change of storage is negative (right?)
TtyxR
th
TS
yh
xh ),,(
2
2
2
2
−∂∂
=∂∂
+∂∂
Let’s write the finite difference approximation for this equation
TR
thh
TS
yhhh
xhhh
mji
mji
mji
mji
mji
mji
mji
mji
mji
),(),(1),(
2)1,(),()1,(
2),1(),(),1(
)(2
)(2
−∆
−=
∆
+−+
∆
+−
+
−+−+
This is called the explicit representation, since all spatial termsare evaluated at the “old” time = m
Let ∆x = ∆y, and solve for the head at (i,j) at time index m+1
[ ]mji
mji
mji
mji
mjim
jimji hhhh
xStT
SRth
xStTh )1,()1,(),1(),1(2
),(),(2
1),(
41 −+−++ +++
∆∆
+∆+
∆∆
−=
The explicit equation is easy to solve:
• Given a set of initial conditions (& bc’s)• The head at all (i,j) locations at time index
m+1 can be calculated directly from the head values at the previous time index m
• Notice, there is no iteration, once you have an initial condition it is a simple matter to step forward in time by an amount ∆t
Stability of the explicit method• One must be careful to keep the time steps small
enough such that the explicit method remains stable
• If the time step is too large, fluctuations will develop in the head as a function of time, which will be amplified as the model continues to step through time
• The stability criteria are:
25.02 <∆∆xStT 5.02 <∆
∆xStT
2-D 1-D
Example transient problem:Explicit solution, 1D
Initial
Final
We are interested in what happensin between the initial and final states
The head at the right boundary dropsfrom blue to red at time t = 0+
The red potentiometric surface is thefinal state
Implicit methods
• Notice in the explicit formulation that we have evaluated all spatial derivatives at the old time (tm)
• Is that the best?• What if we evaluated spatial derivatives at
the new time (tm+1)?• What if we evaluated spatial derivatives
halfway between?
2),1(),(),1(
2
1),1(
1),(
1),1(
2
2
)(2
)1()(
2x
hhhx
hhhxh m
jimji
mji
mji
mji
mji
∆
+−−+
∆
+−≈
∂∂ −+
+−
+++ αα
Where α can vary between 0 (fully explicit) and 1 (fully implicit)
A similar expression can be written for the second derivativewith respect to y
We simplify the algebra by defining the following and letting ∆x=∆y
4~ )1,()1,(),1(),1(
),(+−+− +++
= jijijijiji
hhhhh
[ ] [ ]mji
mji
mji
mji hh
xhh
xyh
xh
),(),(21),(
1),(22
2
2
2 ~)1(4~4−
∆−
+−∆
≈∂∂
+∂∂ ++ αα
Put this approximation into the gw flow equation
[ ] [ ]TR
thh
TShh
xhh
x
mji
mji
mjim
jimji
mji
mji
),(),(1),(
),(),(21),(
1),(2
~)1(4~4−
∆
−=−
∆−
+−∆
+++ αα
Rearrange
( )[ ]TRx
hhhtTSxhh
tTSx m
jimji
mji
mji
mji
mji 4
~14
~4
),(2
),(),(),(
21),(
1),(
2 ∆+−−+
∆∆
=−
∆
∆+ ++ ααα
Solving the previous equation for the new head value at (i,j)
( )[ ]
∆+−−+
∆∆
+
∆∆
+= ++
TRx
hhhtTSxh
tTSx
hmjim
jimji
mji
mji
mji 4
~14
~
4
1 ),(2
),(),(),(
21),(2
1),( αα
α
This is the fundamental implicit finite difference approximationα = 0 Fully explicitα = ½ Crank-Nicolsonα = 1 Fully implicit
The above expression can be solved by iterative or direct methods
We will continue to focus on iterative methods
The advantage of implicit methods is STABILITY
To solve iteratively:- Sweep through the lattice, updating the (i,j) head
value at the new time by the above formula- Continue to sweep through the lattice, updating,
as long as the new head values keep changing- Stop when new head values do not change
within preset limits- (update as you go along:
called Gauss-Seidel iteration)- Repeat for the next time step
Fully implicit, 1D sample problem
∆
∆+
∆∆
+= ++ m
imi
mi h
tTSxh
tTSx
h )(
21
)(21)( 2
~
21
1
1)(
~ +mihWhere is now defined by
+=
++
+−+
2~ 1
)1(1)1(1
)(
mi
mim
i
hhh
References
• H. F. Wang and M. P. Anderson, 1982. Introduction to Groundwater Modeling, Academic Press, Inc.
• C. W. Fetter, 1994. Applied Hydrogeology, Macmillan College Publishing Company.
• F. W. Schwartz and H. Zhang, 2003. Fundamentals of Ground Water, Wiley publishing.