Spiegelman: Columbia University, February 18, 2002 Modeling Myths • Modeling is Difficult • Numerical models can do everything • Numerical models will solve your problems Modeling Facts • Modeling is simple book-keeping (plus a bit of magic) • There are no black boxes! • Numerical models have a life of their own and make their own problems 1 Spiegelman: Columbia University, February 18, 2002 Used carefully, numerical solutions are a very powerful tool for gaining insight into possible physical processes. Used indiscriminately, they become an intellectual black-hole. We need to emphasize the two end-member approaches to modeling 1. The Kitchen Sink Approach: Throw everything into it and hope something useful comes out (BAD IDEA) 2. The Model Problem Approach: Gain insight by developing simple model problems that balance interesting behaviour with comprehensibility (GOOD IDEA – but takes finesse). 2 Spiegelman: Columbia University, February 18, 2002 This course will stress the 2nd approach and will emphasize the following axioms • Be problem driven • Understand your problem • Keep it simple • Never model more than you can understand (or observe?) • Avoid the ‘reality trap’ (models 6= ‘reality’) • Choose your techniques to mimic the underlying physics. • The only successful model is an insightful model. 3 Spiegelman: Columbia University, February 18, 2002 Or more succinctly • Think before you model • Think while you model • Think after you model 4 Spiegelman: Columbia University, February 18, 2002 5 Some Earth science problems you ought to know (maybe) 1. Thermal convection (2-D Rayleigh-Benard) 2. The Lorenz Equations ( Chaos and ODE’s) 3. The shallow water equations 4. Seismic wave propagation 5. Flow in Porous Media Spiegelman: Columbia University, February 18, 2002 6 Thermal Convection (2-D Rayleigh Benard Convection) ∂T + V · ∇T = ∇2 T ∂t ∂T 1 ∂ω 2 + V · ∇ω = ∇ ω − Ra Pr ∂t ∂x ∇2 ψ = −ω V = ∇× ψk, α∆T gd3 , Ra = νκ ω = (∇× V) · k ν Pr = κ Spiegelman: Columbia University, February 18, 2002 The Lorenz Equations and chaos Let ψ(t, x) = W (t) sin(aπx) sin(πz) T (t, x) = (1 − z) + T1 (t) cos(aπx) sin(πz) + T2 (t) sin(2πz) Then RB convection becomes dW dt dT1 dt dT2 dt = Pr(T1 − W ) = −W T2 + rW − T1 = W T1 − bT2 7 Spiegelman: Columbia University, February 18, 2002 8 Lorenz Equations Ra=28 (W,T1,T2)=(0,1,0) 60.0 W(t) T1(t) T2(t) Variables 40.0 20.0 0.0 −20.0 −40.0 0.0 10.0 20.0 30.0 Time 40.0 50.0 Spiegelman: Columbia University, February 18, 2002 Linearized Shallow water equations equatorial β plane ∂v + βyk × v = −g∇η ∂t ∂η + ∇· (H v) = 0 ∂t With forcing and dissipation (ala Cane-Zebiak) ∂v + βyk × v = −gH0 ∇η + τ /ρ − rv ∂t ∂η + ∇· (H v) = −rη ∂t 9 Spiegelman: Columbia University, February 18, 2002 10 Sea Surface temperature anomalies LDEO2 El Niño model 0˚ 30˚S Latitude 30˚N Sea Surface temperature anomalies 150˚E 180˚ 150˚W 120˚W 90˚W Longitude -0.8˚C -0.6˚C -0.4˚C -0.2˚C 0˚C 0.2˚C 0.4˚C 0.6˚C 0.8˚C 1˚C 1.2˚C 1.4˚C temperature anomaly 0˚ 30˚S Latitude 30˚N Sep98 150˚E 180˚ 150˚W 120˚W 90˚W Longitude Dec98 -1˚C -0.5˚C 0˚C 0.5˚C temperature anomaly 1˚C 1.5˚C Spiegelman: Columbia University, February 18, 2002 Seismic Wave propagation ∂V = ∇· σ + f ∂t ∂Vj ∂σij ∂Vi + λ∇· Vδij =µ + ∂t ∂xj ∂xi ρ Solutions by Pseudo-spectral techniques ala Gustavo Correa (LDEO) 11 Spiegelman: Columbia University, February 18, 2002 12 2.0 4.5 2.5 3.0 3.5 4.0 2.0 4.5 2.5 3.0 3.5 4.0 Spiegelman: Columbia University, February 18, 2002 13 2.0 4.5 2.5 3.0 3.5 4.0 2.0 4.5 2.5 3.0 3.5 4.0 Spiegelman: Columbia University, February 18, 2002 14 Flow in heterogeneous porous media ∇· K [∇P − ρf g] = 0 µ elastic -3.5 -3 -2 rigid -2 -1 -1 0 0 1 1.5(rigid) 1 log Permeability 2 (elastic) Spiegelman: Columbia University, February 18, 2002 15 Flow in deformable porous media (magma migration) ∂(ρf φ) + ∇· (ρf φv) = Γ ∂t ∂[ρs (1 − φ)] + ∇· [ρs (1 − φ)V] = −Γ ∂t −kφ [∇P − ρf g] φ(v − V) = µ ∇P = −∇× [η∇× V] + ∇ [(ζ + 4η/3)∇· V] + G − ρ̄g a2 φn kφ ∼ b Spiegelman: Columbia University, February 18, 2002 16 Flow in deformable porous media (2-D potential form, non-dimensional) ∂φ + V · ∇φ = (1 − φ0 φ)C + Γ ∂t −∇· kφ ∇C + C = ∇· kφ [−∇× ωj − (1 − φ0 φ)k] + Γ ∇2 U s = C g ∂ρ 2 ∇ ω=− η ∂x ∇2 ψ s = −ω δρ ρf Spiegelman: Columbia University, February 18, 2002 17 Reactive Flow Localization Non-linear Porosity waves 5 80 height z/d 40 3 2 1 t=0 distance 0 0 1 Earth Science Applications 2 width x/d β=70.00°, U0= 8.00 cm/yr, slab age=150.00 Ma 3 4 Fluid Flow Thermal Structure 1400 0 60 70 1200 50 80 1000 90 100 800 150 600 200 depth (km) depth (km) time 4 100 110 120 400 130 200 250 0 140 50 100 150 200 distance (km) 250 300 0 150 160 mid-ocean ridges subduction zones 120 140 distance (km) 160 Spiegelman: Columbia University, February 18, 2002 18 Direction fields and solutions for dc = −c dt Concentration 1.5 1.0 0.5 0.0 0.0 0.5 1.0 Time 1.5 Spiegelman: Columbia University, February 18, 2002 19 Simple Stepping Schemes Concentration 1.0 0.5 True Solution Euler Step h (first order step) 0.0 0.0 0.5 1.0 1.5 Time Concentration 1.0 1 2 0.5 Mid-point Step 3 True Solution (second order step) (euler) h 0.0 0.0 0.5 1.0 Time 1.5 Spiegelman: Columbia University, February 18, 2002 20 4th Order Runge-Kutta Step Concentration 1.0 1 3 2 4 Runge-Kutta step 0.5 (mid-point) (4th order) True Solution (euler) h 0.0 0.0 0.5 1.0 Time 1.5 Spiegelman: Columbia University, February 18, 2002 Bulirsch-Stoer Stepping using Richardson Extrapolation 21 Spiegelman: Columbia University, February 18, 2002 22 Transport by Characteristics: Particle based methods t=0 2 4 6 t=10 8 concentration 2.5 2.0 1.5 1.0 0 10 20 distance V(x) = 0.2x 30 40 Spiegelman: Columbia University, February 18, 2002 23 FTCS Explodes! t=0 1 2 2 3 4 3 t=4 5 6 concentration 2.0 1.5 1.0 0.5 0 1 distance 7 8 9 10 Spiegelman: Columbia University, February 18, 2002 24 Staggered Leapfrog works (α < 1) α = 0.9 t=0 1 2 2 3 4 3 t=4 5 6 concentration 2.0 1.5 1.0 0.5 0 1 distance 7 8 9 10 Spiegelman: Columbia University, February 18, 2002 25 α = 1.01 t=0 1 2 2 concentration t=2.53 1 1 0 0 1 2 3 4 5 distance 6 7 8 9 10 Spiegelman: Columbia University, February 18, 2002 26 Staggered Leapfrog disperses (α = 0.5) 3.0 t=0 distance 2.5 2.0 1.5 1.0 t=100 0.5 0 1 2 3 4 5 concentration 6 7 8 9 10 Spiegelman: Columbia University, February 18, 2002 27 3.0 t=0 distance 2.5 2.0 1.5 t=100 1.0 0.5 0 1 2 3 4 5 concentration 6 7 8 9 10 Spiegelman: Columbia University, February 18, 2002 28 Simple Upwind diffuses (badly) (α = 0.5) t=0 3 concentration 2 2 1 t=100 1 0 0 1 2 3 4 5 distance 6 7 8 9 10 Spiegelman: Columbia University, February 18, 2002 29 Better schemes 3.5 3.5 3 3 2.5 concentration concentration t=0 t=0−100 2 1.5 1 0.5 0 2 4 6 8 0 2 4 b 3 3 2.5 2.5 concentration 3.5 t=0−100 2 1.5 1 6 8 10 distance 3.5 0.5 t=100 1.5 0.5 10 distance concentration 2 1 a c 2.5 t=0−100 (all identical) 2 1.5 1 0 2 4 6 distance 8 0.5 10 d 0 2 4 6 distance 8 10 Spiegelman: Columbia University, February 18, 2002 30 Semi-Lagrangian Schemes: a recipe true characteristic u(n+1,j) n+1 ∆t n+1/2 n c(n) xX ∆x x u(n+1/2) j Spiegelman: Columbia University, February 18, 2002 31 Behaviour with non-constant velocity concentration 3 60 15 75 90 105 45 3 120 2 2 t=0 1 1 staggered−leapfrog 0.09s concentration 30 1.32s 0 0 3 3 2 2 1 1 0 10 20 distance 90 15 105 30 120 45 75 t=0 semi−lagrangian 0.02s 0 60 mpdata (ncor=3, i3rd=1) pseudo−spectral 15.85s 30 0 0 10 20 distance 30 Spiegelman: Columbia University, February 18, 2002 32 Comparison of Pseudo-spectral and Semi-Lagrangian schemes semi−lagrangian (1024 pts, α=20, t=0.05s) 3 concentration 2 1 pseudo−spectral (256 pts,α=0.5,t=4.98s) 0 0 10 20 distance 30 Spiegelman: Columbia University, February 18, 2002 33 Advection-diffusion: FTCS 0.010 1 2 3 0.000 4 t=0 -0.005 -0.010 0.0 10.0 20.0 30.0 distance 40.0 50.0 3.0 t=0 True solution 2.5 Calculated solution Temperature relative error 0.005 2.0 1 2 1.5 1.0 0.0 10.0 3 4 20.0 30.0 distance 40.0 50.0 Spiegelman: Columbia University, February 18, 2002 34 Advection-diffusion: Crank-Nicholson 0.0040 0.0030 1 2 3 0.0010 0.0000 4 t=0 -0.0010 -0.0020 -0.0030 -0.0040 0.0 10.0 20.0 30.0 distance 40.0 50.0 3.0 t=0 True solution 2.5 Calculated solution Temperature relative error 0.0020 2.0 1 2 1.5 1.0 0.0 10.0 3 4 20.0 30.0 distance 40.0 50.0 Spiegelman: Columbia University, February 18, 2002 35 Advection-diffusion: Operator-Splitting MPDATA + CN (no corrections. . . upwind scheme) 0.000 t=0 -0.010 -0.020 1 -0.030 0.0 10.0 2 3 4 20.0 30.0 distance 40.0 50.0 3.0 t=0 True solution 2.5 Temperature relative error 0.010 Calculated Solution 2.0 1 2 1.5 1.0 0.0 10.0 3 4 20.0 30.0 distance 40.0 50.0 Spiegelman: Columbia University, February 18, 2002 36 Advection-diffusion: Operator-Splitting MPDATA + CN (one correction) 0.0004 relative error 0.0002 0 t=0 -0.0002 2 3 4 1 -0.0004 0.0 10.0 20.0 30.0 distance 40.0 50.0 3.0 t=0 True solution Temperature 2.5 Calculated Solution 2.0 1 2 1.5 1.0 0.0 10.0 3 4 20.0 30.0 distance 40.0 50.0 Spiegelman: Columbia University, February 18, 2002 37 Advection-diffusion: Operator-Splitting MPDATA + CN Da Woiks! (ncor=3, i3rd=1) 0.0002 1 2 0.0000 3 t=0 4 -0.0001 -0.0002 0.0 10.0 20.0 30.0 distance 40.0 50.0 3.0 t=0 True solution 2.5 Temperature relative error 0.0001 Calculated Solution 2.0 1 2 1.5 1.0 0.0 10.0 3 4 20.0 30.0 distance 40.0 50.0 Spiegelman: Columbia University, February 18, 2002 38 Advection-diffusion: Operator-Splitting Semi-Lagrangian + CN α = 2.5 0.0002 1 0.0000 2 3 4 t=0 -0.0001 -0.0002 0.0 10.0 20.0 30.0 distance 40.0 50.0 3.0 t=0 True solution 2.5 Temperature relative error 0.0001 Calculated Solution 2.0 1 2 1.5 1.0 0.0 10.0 3 4 20.0 30.0 distance 40.0 50.0 Spiegelman: Columbia University, February 18, 2002 39 Advection-diffusion: All-in-one Semi-LagrangianCN α = 2.5 0.0002 1 2 3 0.0000 4 t=0 −0.0001 −0.0002 0.0 10.0 20.0 30.0 40.0 50.0 distance 3.0 t=0 True solution 2.5 Temperature relative error 0.0001 Calculated Solution 2.0 1 2 3 1.5 1.0 0.0 10.0 20.0 4 30.0 distance 40.0 50.0 Spiegelman: Columbia University, February 18, 2002 40 2-D control volume i,j+1 Fy(i,j+1/2) Fx(i+1/2,j) i-1,j i,j i,j-1 i+1,j Spiegelman: Columbia University, February 18, 2002 41 Boundary condition pointers side 2 iout(2,1) iout(1,2) side 1 dir 2 (j) side 1 side 2 iout(1,1) iout(2,2) dir 1 (i) Spiegelman: Columbia University, February 18, 2002 42 Bicubic interpolation j+2 x j+1 x + (ri,rj) x j (i,j) x j-1 i-1 i i+1 i+2 Spiegelman: Columbia University, February 18, 2002 43 Some useful 2-D advection fields Rigid body rotation vs. a shear cell a 1 b 0.9 0.8 0.7 0.6 0.5 0.4 0.3 0.2 0.1 0 0 0.1 0.2 0.3 0.4 0.5 0.6 0.7 0.8 0.9 1 0 0.1 0.2 0.3 0.4 0.5 0.6 0.7 0.8 0.9 1 Spiegelman: Columbia University, February 18, 2002 Rigid Body rotation test: a methods sampler 44 Spiegelman: Columbia University, February 18, 2002 45 1.0 1.0 11 1 0.5 0.5 1 1 1 1 a 0.0 0.0 0.5 1.0 b 1.0 0.0 0.0 0.5 1 1 1 0.5 0.5 1 1 1 1 1 c 1 0.0 0.0 0.5 1.0 d 1.0 0.0 0.0 0.5 1.0 1.0 11 11 0.5 0.5 1 1 1 0.0 0.0 0.5 1 1 1 e 1.0 1.0 1.0 f 0.0 0.0 0.5 1.0 Spiegelman: Columbia University, February 18, 2002 Rigid Body rotation test: a methods sampler 46 Spiegelman: Columbia University, February 18, 2002 47 1.0 1.0 11 1 0.5 0.5 1 1 1 1 stag-leap 65 2 0.0 0.0 0.5 1.0 upwind 65 1.0 2 0.0 0.0 0.5 1.0 1 1 1 0.5 0.5 1 1 1 1 1 mpdata 1 65 2 0.0 0.0 1 0.5 1.0 mpdata 2 65 1.0 2 0.0 0.0 0.5 11 0.5 0.5 1 1 1 0.0 0.5 1 1 1 2 0.0 1.0 1.0 11 mpdata 33 65 1.0 1.0 stag-leap 129 2 0.0 0.0 0.5 1.0 Spiegelman: Columbia University, February 18, 2002 48 Shear cell test Staggered Leapfrog vs. Upwind 1.0 1. 5 1.0 0. 5 0.5 1 1 0.5 0.5 0.5 1.5 1 0.0 0.0 1.0 5 0.0 1.0 0.0 1.0 0.5 0.5 1.0 0.5 1.0 1 0.5 0. 5 1. 5 a -0. 5 0. 0.5 0.5 b 0.0 0.0 0.5 0.0 1.0 0.0 Spiegelman: Columbia University, February 18, 2002 49 Shear cell test Mpdata (with everything) vs. High res Staggered Leapfrog 1.0 0. 5 1. 5 1.0 1 0.5 1 0.5 0.5 1.5 1 0.0 0.0 1.0 0.0 1.0 0.0 1.0 0.5 0.5 1.0 1 0.5 0.5 0. 5 0.5 1.5 0.5 1.5 -0.5 1 0. 5 1.5 c 0.5 1 d 0.0 0.0 0.5 0.0 1.0 0.0 0.5 1.0 Spiegelman: Columbia University, February 18, 2002 50 The winner! Semi-Lagrangian behaviour Spiegelman: Columbia University, February 18, 2002 51 1.0 1.0 1 1 0.5 0.5 1 1 1 1 1 0.0 0.5 b 1.0 0.0 0.5 1.0 5 1.0 0.0 0. 1 5 1. 1 0.5 1 1.5 c 0.5 0.0 0.0 0.5 0.5 0.5 0.0 1.0 0.0 1.0 0.5 1.0 0.5 1 1.5 1 0. 5 1.0 0.5 0.5 0.5 5 1. 0. 0.0 1.5 a 1 5 1 0.5 d 0.0 0.0 0.5 0.0 1.0 0.0 0.5 1.0 1.0 Spiegelman: Columbia University, February 18, 2002 52 2-D Diffusion (booooring. . . ) 2-D FTCS scheme 1.0 1.0 0.5 1 5 0. 0.5 0.0 0.0 1 5 1. 0.5 0.0 1.0 0.0 1.0 0.5 1.0 0.5 0.5 1.0 0.5 0.5 0.5 0.0 0.5 1.0 0.5 0.0 1.0 0.0 1.0 0.5 0.5 1.0 0.5 0.0 0.5 0.0 0.0 0.5 0.0 1.0 0.0 0.5 1.0 Spiegelman: Columbia University, February 18, 2002 53 2-D Diffusion Errors for 2-D FTCS scheme 1.0 0 5e -50e -0 -05 5 0.5 -5e-05 5e- 05 0 5e-05 -5e-05 -5e-05 5e -05 0 0.0 0.0 0.5 1.0 1.0 15 0. 02 00 00 0.0 0. 00 01 5 01 55e-05 5 5e-0 2 00 0.0 00 .0 5 1 00 -0 0 -5e -05 15 0 5 00 5 001 0.0 001 -05 -5e 0. -5e-05 0.0 0 0 5 5e-0 0.0 0.0 0. -0.0 5 05 001e-0.0 -5 5e-05 0.5 5 5e-05 5 -0 5e -5e-05 2 -0. 15 000 01 00 00 -0. 5 00 0.0 05 e-5 5 01 00 5 5e-05 1 00 .0 -0 .0 0 0. 0.5 -0 5 -0 5e -5e-05 0.0001 0 015 15 00 .0 -0 0.00 15 00 02 0 0 1.0 0.0 1.0 0.0 1.0 0.5 0.5 1.0 0 0.5 0.0 1.0 0.0 15 00 001 5 -0 -5e 5e-05 0 -5e -05 5 01 5 .0 0 -0 -0.0 05 0.0 01 5e 0 -05 01 5 -0 5e-0 5 .0 00 15 0 15 -0.0001 5 001 00 -05 00 01 00 0.0 5e- 0.0 0.0 0. 0.0 5 5e-05 -05 -0.0001-5e -0. .00 0.5 5 15 000 -0 001 e-05 -5 -0. -5e-05 00 1 -05.0 001 5e 15 .0 0.0 -05 00 -0 -05 -5e -5e 0.0 05 e-5 0 15 15 00 00 015 .0 0.0 0.00 -0 0.5 5e -0. -05 000 15 0 0 1.0 0 05 5e- 0.5 1.0 Spiegelman: Columbia University, February 18, 2002 54 2-D Diffusion Errors for ADI scheme 1.0 0 0 0 0 0.5 0 0 0 0 0 0.0 0.0 1.0 0.5 1.0 0 0 0 0 0.5 0 0.5 1.0 0 0 0 0 0 0 0 0.0 0.0 0.0 1.0 0.0 1.0 0.5 1.0 0.5 1.0 -0.001 0 0 0 0 0.5 0 0.0 0.0 01 01 0 0 0 0 0.0 0.0 0.5 0 0 0 0.5 0.0 1.0 0.0 0.5 1.0 Spiegelman: Columbia University, February 18, 2002 55 Structure of the 5-point Laplacian Operator as a sparse matrix 0 50 100 150 200 0 50 100 nz = 1065 150 200 Spiegelman: Columbia University, February 18, 2002 56 0 5 10 15 20 25 30 35 40 45 50 0 10 20 30 nz = 217 40 50 Spiegelman: Columbia University, February 18, 2002 57 Structure of the inverse of the 5-point Laplacian Operator as a sparse matrix 20 40 60 80 100 120 140 160 180 200 220 50 100 150 200 Spiegelman: Columbia University, February 18, 2002 58 Testing Laplace Solvers: the sin-cell test Solution 1.0 0.5 0 -0.5 0 0.5 -0.5 0 0.5 0 0.0 0.0 0.5 Errors 1.0 Spiegelman: Columbia University, February 18, 2002 59 1.0 0 15 00 0.0 0.0001 -0.0001 0 0.5 0 -0 15 00 0 -0. 0 -0 5 01 00 -0. -0.0001 0.0001 0 0 15 00 0.0 0.0 0.0 0.5 1.0 Spiegelman: Columbia University, February 18, 2002 60 Convergence Behaviour of optimal SOR 4 10 2 L2 Norm of residual 10 0 10 10 10 10 10 10 −2 −4 −6 −8 −10 0 50 100 iterations 150 200 Spiegelman: Columbia University, February 18, 2002 61 A nested Multi-level Grid (A 3-level grid) Spiegelman: Columbia University, February 18, 2002 62 V-cycles and Full Multi-Grid (FMG) cycles 4 V-cycle coarsest grid S 3 R R 2 R R 1 S S R R R R finest grid R R S S 4 R R R R coarsest grid R 3 R 2 FMG-Vcycle 1 R R finest grid Spiegelman: Columbia University, February 18, 2002 63 Multi-Grid storage scheme ala Briggs grid 1 2 34 1 A 5 u rhs res ip(1) ip(2) ip(3) ip(4) Spiegelman: Columbia University, February 18, 2002 64 A V-cycle in the Briggs Scheme Going up! Spiegelman: Columbia University, February 18, 2002 65 grid 1 u initial Guess relax Npre times 2 34 0 0 0 fine rhs then calculate residual then restrict res ip(1) ip(2) u ip(3) ip(4) 0 relax Npre times rhs then calculate residual then restrict res u rhs res solve u Spiegelman: Columbia University, February 18, 2002 66 A V-cycle in the Briggs Scheme Coming Down! Spiegelman: Columbia University, February 18, 2002 67 grid 1 2 34 u add back relax Npost times rhs interpolate correction interp coarse ip(1) ip(2) ip(3) ip(4) u relax add rhs interpolate interp u much improved guess relax add rhs interpolate interp fine Spiegelman: Columbia University, February 18, 2002 68 The Big test! Timing and errors for solving Poisson problem with Dirichlet Boundaries on a 2-2 sin cell test ce s, O3 q o 3 qa c qau odb db 10 Fishpak Y12M MG−Vcycle FMG SOR 2 time (cpu seconds) 10 1 0 129 10 10 513 257 10 10 1025 −1 Ni=65 −2 3 10 4 10 5 10 Total Grid−points 6 10 7 10 Spiegelman: Columbia University, February 18, 2002 10 10 average error 10 10 10 10 10 10 69 ce s, O3 q o −2 qa c qau odb db −3 Fishpak Y12M MG−Vcycle FMG SOR −4 −5 −6 −7 −8 −9 −10 10 3 10 4 10 5 6 10 10 Total Grid−points 7 10 8 10 Spiegelman: Columbia University, February 18, 2002 70 General Conservation of Mass for chemistry ∂ ρs (1 − φ)cs + ∇· [ρs (1 − φ)Vcs ] = −I + Ds ∂t (1) ∂ f f ρf φc + ∇· ρf φvc = I + Df ∂t (2) For Fractional melting I = (cs /D)Γ, therefore cs ∂ s s ρs (1 − φ)c + ∇· [ρs (1 − φ)Vc ] = − Γ ∂t D (3) cs ∂ f f ρf φc + ∇· ρf φvc = Γ ∂t D (4) Spiegelman: Columbia University, February 18, 2002 71 Expanding By chain rule gives cs ∂ ρs (1 − φ) + ∇· [ρs (1 − φ)V] + ∂t s cs ∂c s + V · ∇c = − Γ ρs (1 − φ) ∂t D cf ∂ ρf φ + ∇· [ρf φv] + ∂t f cs ∂c f + v · ∇c = Γ ρf φ ∂t D But Conservation of total mass is ∂ ρs (1 − φ) + ∇· [ρs (1 − φ)V] = −Γ ∂t (5) ∂ ρf φ + ∇· [ρf φv] = Γ ∂t (6) Spiegelman: Columbia University, February 18, 2002 72 Therefore we can write the problem as cs Ds cs =− Γ −c Γ + ρs (1 − φ) Dt D (7) cs Df cf = Γ c Γ + ρf φ Dt D (8) s f Spiegelman: Columbia University, February 18, 2002 Rearranging 73 Ds c 1 Γ = −cs −1 Dt D ρs (1 − φ) s f Df c Γ c f = −c Dt D ρf φ s and Scaling with φ = φ 0 φ0 w0 0 t t = δ ρs φ0 w0 0 Γ Γ = δ cs = cs0 cs 0 cs0 f 0 f c c = D Yields (9) (10) Spiegelman: Columbia University, February 18, 2002 s φ0 Ds c =− cs Dt (1 − φ0 φ) 74 1 −1 Γ D Df cf s f ρs Γ = c −c Dt ρf φ (11) (12) Spiegelman: Columbia University, February 18, 2002 75 Numerics General Semi-Lagrangian solution of Dc = g(c, x, t) Dt is or 1 + c+ − c− − = g +g ∆t 2 ∆t + − g +g c =c + 2 + − Therefore for solid concentration can discretize s φ0 Ds c =− cs Dt (1 − φ0 φ) 1 −1 Γ D as cs + − cs (s−) = −(Acs )+ − (Acs )(s−) Spiegelman: Columbia University, February 18, 2002 where therefore 1 ∆tφ0 ( − 1)Γ A= 2(1 − φ0 φ) D 76 Spiegelman: Columbia University, February 18, 2002 77 Same for melt concentration; Df cf s f ρs Γ = c −c Dt ρf φ Becomes c f+ −c f (f −) = [B(cs − cf )]+ + [B(cs − cf )](f −) where B= ∆tρs Γ 2ρf φ (f −) f (f −) Therefore + (1 + B )c or c f+ = f+ = (1 − B )c + (Bcs )+ + (Bcs )(f −) h i (f −) + (Bcs )+ + (Bcs )(f −) (1 − B (f −) )cf Final Update Scheme: (1 + B + ) (13) Spiegelman: Columbia University, February 18, 2002 c c f+ = s+ 78 (1 − A(s−) ) s (s−) c = + (1 + A ) h i (f −) + (Bcs )+ + (Bcs )(f −) (1 − B (f −) )cf (1 + B + )
© Copyright 2026 Paperzz