Beruflich Dokumente
Kultur Dokumente
Spring 2007
Jim E. Jones
Computational Science and Engineering
Seminar Series
Applied Computer
Mathematics Science
Science
Engineering
Disciplines
Computational Science and Engineering is
inherently interdisciplinary
Applied Computer
Mathematics Science
CS&E
Science
Engineering
Disciplines
A CS&E example we will come back to later
Ground
Water Table
Realistic simulation of variably saturated flow
requires many components
• Environmental Sciences: define physical problem,
determine parameters, mathematical modeling,
validation of results, …
• Applied Mathematics: mathematical modeling,
solution algorithms, error control, …
• Computer Science: efficient implementation of
algorithms, impact of computer architecture on
implementation and algorithm, …
PDEs, Grids, and Matrices
Many physical processes can be modeled with
Partial Differential Equations (PDEs)
Poisson Equation modeling steady-
state temperature in 2d plate H
E
t
u xx u yy f
E
H E
t
Wave Equation modeling wave Maxwell’s equations relating
propagation at speed v
electric and magnetic fields
1 2
2 2
2
v t
Partial Differential Equations (PDEs) :
2nd order model problems
au xx bu xy cu yy du x eu y fu g
• PDE classified by discriminant: b2-4ac.
– Negative discriminant = Elliptic PDE. Example
Laplace’s equation
u xx u yy 0
s( p) Kk ( p)
r p gz q
t
Simplifying:
s(p)=p, kr(p) and constants =1
p
p z q
t
or
pt pxx g
Challenging features of Richards equation for
numerical simulation
Au f
Finite difference discretization based on Taylor’s
approximation.
1
u xx ( x, y ) (u ( x h, y ) 2u ( x, y ) u ( x h, y ))
h2
Finite difference discretization based on Taylor’s
approximation.
1
u xx ( x, y ) (u ( x h, y ) 2u ( x, y ) u ( x h, y ))
h2
Approximated derivative at a
point by an algebraic equation
involving function values at
nearby points
Au f
Error in approximation is
determined by the mesh
size h. Difference between
differential solution and
algebraic solution goes to
zero as h does.
A Few details of the Richards equation
discretization used
K i K i 1
K
K i K i 1
1
i i+1
2 i
Richards’ equation is a common model for two-
phase air/water flow
s( p) Kk ( p)
r p gz q
t
F ( p) 0
Solution algorithms for the algebraic system in
the linear case
Au f
• The linear system is very sparse
– Each grid point couples only to nearby neighbors.
– Number of non-zeros in A << n2, typically O(n).
• Option 1: Direct solvers (Gaussian elimination), very good
(parallel) codes exit, but for large problems can be too costly.
• Option 2: Iterative methods.
– “Classical methods”: Jacobi, Gauss-Seidel, SOR
– Krylov Methods: Conjugate Gradient, GMRES r f Auk
– Multigrid Methods
Solution algorithms for the algebraic system in
the nonlinear case
F (u ) 0
• Recall single variable Newton’s Method via Taylor’s
approximation
f ( x) f ( x0 ) f ( x0 )( x x0 )
• Iterate
xk 1 xk f ( xk ) / f ( xk )
Solution algorithms for the algebraic system in
the nonlinear case
F (u ) 0
• Multivariate Newton
uk 1 uk ( J (uk )) 1 F (uk )
• Multivariate Newton
uk 1 uk ( J (uk )) 1 F (uk )
• Implemented in C & MPI using existing codes and frameworks when possible
– Hypre and KINSOL
Richards equation simulation scaled efficiency
results
1 55,296 33 86 16.57
2 110,592 33 86 17.23
4 221,184 33 85 17.01
8 442,386 33 83 18.13
16 884,736 33 83 18.14
32 1,769,472 32 80 19.62
64 3,538,944 31 76 19.65
Discrete Model
Discrete Solver
• Codes
– hypre linear solvers library
http://www.llnl.gov/CASC/linear_solvers/
– KINSOL nonlinear solvers
http://www.llnl.gov/CASC/sundials/