A Seamless Multiscale Method and its Application to Complex Fluids Weiqing Ren Courant Institute New York University Multiscale Problems We are interested in the macroscale behavior of the system, which is described by the (incomplete) model: ∂t U = L(U ; D) We do not have an explicit and accurate model for D; A reliable microscale model is available: ∂τ u = L(u) but this is too expensive to be used directly. We focus on problems in which τε ! tM τε : the relaxation time for the microscale model; tM: the time scale for the dynamics of the macroscale variable. An example: Complex fluids Macroscale model: ρ(∂t U + (U · ∇)U ) + ∇P = ∇ · τd ∇·U =0 ! " τd = µ ∇U + (∇U ) for simple fluids τd : unknown for complex fluids T Microscale model: Molecular dynamics (MD) ! q̇i = pi /mi ṗi = fi , i = 1, 2, · · · N Solving the MD model is far too inefficient. Multiscale methods Goal: develop efficient multiscale strategies that accurately capture the macroscale behavior with the help of the microscale model, without using empirical macroscale models. Plan of the talk: Earlier work: Heterogeneous multiscale methods (HMM). Recent work: Seamless multiscale method; application to polymer fluids. Stability of domain-decomposition type of multiscale methods. Heterogeneous multiscale method (HMM) E, Engquist (2003) A general (top-down) framework for dealing with multiscale problems. Macroscale solver: Assume a form of macroscale model, and then choose a stable numerical scheme for the model; Estimate the missing data: Some data needed in the macro solver are missing due to the incomplete knowledge of the macro model. These data are estimated from the micro model. Macro solver - micro solver - data estimator ∆t t macro D U, ∇U, · · · Coupling scheme in HMM δτ t micro At each macro time step, the micro solver is invoked and solved for M steps, where τε < M δτ ! ∆t ; Use the results to estimate the needed data D (spatial-temporal averaging); Use the macro solver to evolve U; Scale separation is exploited so that the micro model is solved in small spatial-temporal domains. ∆t t macro D U, ∇U, · · · One difficulty in HMM t micro δτ Observe the large gap between the microscale simulations; the micro solver needs to be reinitialized at each macro time step. HMM (and other multiscale methods) requires going back and forth between the macro and micro states of the system. Method Macro to micro Micro to macro Systematic up-scaling HMM Equation-free Interpolation Reconstruction Lifting Restriction (projection) Compression Restriction A seamless coupling scheme { ∆! t = ∆t/M E, Ren, Vanden-Eijnden, J. Comput. Phys. 2009 ∆t t macro { { { τ micro M δτ M δτ M δτ The macro and micro dynamics run continuously on different clocks; the data are exchanged at each time step; Reinitialization of the micro solver is not needed; The micro dynamics is effectively evolved on the time step ∆! t ; this gives the saving factor (from the consideration of time scales alone): Cs = ∆! t/δτ The seamless algorithm Given {U n , un } : U n = U (n∆! t), un = u(nδτ ) solve the following for the solution at the next time step: un+1 = Sδτ (un ; U n ) micro solver Dn+1 = D(un+1 ) data estimation U n+1 ! = S∆! t U ; D How to choose ∆! t ? n n+1 " macro solver Accuracy and stability requirements; Relaxation time of the micro dynamics. where M > τε /δτ ∆! t = ∆t/M ∆! t is smaller than that required for accurately resolving the macro dynamics; this is to give the micro dynamics sufficient time to adapt to the macro state. Some earlier and related work Some aspects of the idea were used before: Car-Parrinello molecular dynamics (1985) Fiber bundle dynamics (E, Lu 2007) Multiscale chaotic systems (Fatkullin, Vanden-Eijnden 2004) Free energy calculations (Maragliano, Vanden-Eijnden 2006) Macroscale behavior of complex fluids (Ren, 2007) Example: SDE with multiple time scales { dx = f (x, y)dt ! 1 1 dw dy = − (y − ϕ(x)) dt + ε ε w(t) : a Wiener process; ε!1 The limiting equation as ε → 0 is : ẋ = F (x) F (x) = lim ε→0 ! f (x, y)µεx (dy) µεx (dy) is the invariant measure of the fast variable y with x fixed. The seamless algorithm for the SDE { dx = f (x, y)dt ! 1 1 dw dy = − (y − ϕ(x)) dt + ε ε The seamless algorithm: xn = x(n∆! t), y n ! δτ n δτ n n+1 n n y =y − (y − ϕ(x )) + ξ ε ε Dn+1 = y n+1 ! n n+1 " n+1 n ! x = x + ∆ tf x ,D = y(nδτ ) micro solver data estimation macro solver Error estimate xh : the numerical solution (fluctuating). x̄ : the solution to the limiting equation: Accuracy of the seemless algorithm: ∆! t = ∆t/M !" # $k # $l % ε∆t δτ ∆t E |xh − x̄| ≤ C + + M δτ ε M The first term is an estimate of the statistical error. Accuracy of HMM (with time averaging): E |xh − x̄| ≤ C !" ε∆t + M δτ # δτ ε $k + ∆tl % Implicit averaging: In the seamless algorithm, the data computed from the micro dynamics is implicitly averaged over time. Where the first error term come from? The seamless algorithm can be considered as a standard discretization of the modified equation with time step ∆! t : { dx = f (x, y)dt 1 dy = − ! (y − ϕ(x)) dt + ε ε! = ε∆! t/δτ ! 1 dw ! ε Denote the exact solution to the modified equation by xε! , then where |xh − x̄| ≤ |x̄ − xε! | + |xε! − xh | √ E |x̄ − xε! | ∼ O( ε! ) (E, Liu, Vanden-Eijnden, 2005) Application to complex fluids Assume that the macro model is of the form: ρ(∂t U + (U · ∇)U ) + ∇P = ∇ · τd ∇·U =0 Macro solver: projection method (Chorin); Data to be estimated: τd = τd (∇U ) Micro model: constrained molecular dynamics. The assumed functional dependence of τd is used as constraints in molecular dynamics. Macro solver: Projection method Projection method is a fractional step method: ρ ! " U −U + ∇ · (U n ⊗ U n ) = ∇ · τdn ∆t ∗ n U n+1 − U ∗ ρ + ∇P n+1 = 0 ∆t Staggered grid in space: ∆P n+1 = ρ ∇ · U∗ ∆t Computing stress from MD MD is constrained by the local rate of strain: An = ∇U n Microscale model: Molecular dynamics ! q̇i = pi /mi ṗi = fi , i = 1, 2, · · · N Conservation of momentum in terms of the micro variables: ∂τ m + ∇ · σ = 0 m is the momentum density: m(x, τ ) = σ is the momentum flux: σ(x, τ ) = ! i ! j pj (τ )δ(x − qj (τ )) m−1 i (pi ⊗ pi ) δ(x − qi ) " 1 ! 1 + (qij ⊗ fij ) δ(λqi + (1 − λ)qj − x)dλ 2 0 j!=i Imposing velocity gradient in MD Constant rate-of-strain molecular dynamics: q̇i = pi /mi ṗi = fi , i = 1, · · · , N Ẋ = AX, A = ∇U X : vertices of the MD box. The MD box deforms according to the rate of strain; Generalized periodic boundary condition is imposed on the deforming box. Thermostat is needed to control the temperature. Constant rate-of-strain MD in 1d In 1d, this is equivalent to the LeesEdwards boundary condition for imposing a simple shear flow: A = ∇U = ! 0 0 γ̇ 0 " Lees-Edwards boundary condition A 2d example 2 1.5 ! 1 0.5 0 !0.5 !1 0 A= 5 10 t 15 20 ! 0.05 0.02 0.03 −0.05 " The seamless algorithm Initialization: Start with some initial velocity field U 0; discretize the macro model on the staggered grid; initialize a MD system at each grid point where the stress is needed; set n = 0 . Compute the velocity gradient ∇U n at each grid point; Evolve each MD system for one micro time step δτ ; Evolve the MD box by δτ according to ∇U n. Compute the stress for the MD results; Evolve the macro model by one macro time step ∆! t to obtain U n+1. Set n := n + 1, and go to step 1. Numerical examples Two examples: Channel flow driven by a pressure gradient; Driven cavity flow. Channel flow driven by a pressure gradient z=L f z y x z=0 Macro model: ρ∂t u = ∂z τ + f (t), 0 < z < L A benchmark problem: Lennard-Jones fluid z=L f z y x z=0 Lennard-Jones potential: !" # $ " # 12 6 σ σ VLJ (r) = 4ε − r r Numerical results: Lennard-Jones fluid *0 50 2+ 20 30 J u 40 1+ 20 10 10 + 0 0 0.2 0.4 0.6 0.8 1 0 0 0.2 0.4 z/L Red curves: ρ∂t u = µ∂z2 u + f (t) Blue curves: solution of multiscale method ∆! t = 500/40, δτ = 0.005 0.6 f 0.8 1 !* ()10 Polymer fluids z=L z f y x z=0 Bead-spring model for the polymers; the spring force is modeled by the FENE potential: VF EN E (r) = 1 2 kr 0 2 ∞ $ ln 1 − % r r0 &2 ' if r < r0 if r ≥ r0 Channel flow: Polymer fluid 60 1.5 40 30 1 0.5 J u 40 log(J) 50 !3.4 !3.2 20 20 !3 log(f) !2.8 10 0 0 0.2 0.4 0.6 0.8 1 0 0 0.5 ∆t δt = 0.002, 2 !3 x 10 M = 200 tM ∆t/M x x x ∆t tm tM Blue curves Red curves M δt 1.5 f z/L ∆t = 500, 1 δt M δt tm A 2d example: driven cavity flow U Macro model: ρ(∂t U + (U · ∇)U ) + ∇P = ∇ · τd ∇·U =0 Driven cavity flow: Lennard-Jones fluid 11 0.8 0.8 0.8 0.6 0.6 z/L z/L 1 0.4 0.4 0.4 0.2 0.2 0.2 0 0 0.2 0.4 x/L 0.6 0.8 Atomistic-Continuum τd is computed from MD. τd = τd (∇U ) 1 00 00 0.2 0.2 0.4 0.4 x/L x/L 0.6 0.6 0.8 0.8 11 Navier-Stokes ! τd = µ ∇U + (∇U ) T " Driven cavity flow: Lennard-Jones fluid 0.2 0"6 1 0 0"4 0.8 0 0.6 u + z/L !0.2 0"2 0.4 !0.2 !0.4 0 0.2 0 0 0.2 0.4 0.6 0.8 1 !0.6 !0"2 x/L !0.4 0 0.5 0"# 1 $ 1.5 $"# t* 2 4 x&'$0 10 Driven cavity flow: Polymer fluid 1 0.8 0.8 0.6 0.6 z/L z/L 1 0.4 0.4 0.2 0.2 0 0 0.2 0.4 x/L ∆! t = 0.5 0.6 0.8 1 0 0 0.2 0.4 0.6 x/L ∆! t = 0.25 0.8 1 Domain-decomposition type of multiscale methods Ren, J. Comput. Phys. 2007 Ωc Continuum Ωp ! ρ(∂t u + (u · ∇)u) = µ∆u − ∇p region ∇·u=0 ! q̇i = pi /mi ṗi = fi Ωc ∩ Ωp = Ωo : overlapping region. The two models are coupled by exchanging BCs; commonly used BCs include: velocity exchange and (momentum) flux exchange. Two distinct features Compared to classical DD-type of methods, the multiscale methods have two distinct features: The particle region and the continuum region have disparate size ( lp ! lc ); Different physical methods are used in different domains; the boundary condition computed from the particle model contains large statistical errors. How the statistical error affects the stability of the multiscale methods? A benchmark problem Simple fluids in a channel: z y x C!region P!region C!region Four possible coupling schemes: velocity-velocity flux-velocity velocity-flux flux-flux The system is at static; the exact solution is u = 0 . Numerical scheme δt { δt t continuum t atomistic Tc The boundary conditions in the two models are updated for every time period Tc . When Tc > tM , where tM is the hydrodynamic relaxation time, the coupling scheme reduces to the Schwartz alternation scheme for steady state problems. Numerical study ( large Tc) Error of the numerical solution vs. time: velocity-velocity ||u||2 0.01 0 0 0.02 ||u||2 20 50 100 150 t / Tc flux-velocity 0 0 50 100 t / Tc 10 1.5 0.01 150 200 velocity-flux 0 1 200 ||u||2 ||u||2 0.02 1 2 t / Tc 3 4 flux-flux 0.5 0 0 50 100 t / Tc 150 200 Analytical study (large Tc) en (z) = ! n " κn−i ξi i=1 # g(z) en : error at the n-th step ξi : statistical error introduced in the BC κ : the amplification factor velocity-velocity κ ≈ 1 − lo /lp κ ≈ lp /ls flux-velocity velocity-flux κ ≈ ls /lp κ=1 flux-flux lo : size of the overlapping region; ls : the system size. stable stable unstable unstable (weakly) lp : size of the particle region; Amplification factor vs Tc kvv , kfv 1 vel-vel 0.5 0 0 flux-vel 200 kvf , kff 1.1 Tc 600 800 1000 flux-flux 1 vel-flux 0.9 0.8 10 400 30 50 70 90 Tc vel-vel and flux-vel schemes are stable; vel-flux is stable for small T c, and unstable for large T c; flux-flux scheme is weakly unstable. Summary: Presented a seamless multiscale method. The method does not require going back and forth between the macro and micro models; No need for the reinitialization of the micro solver; It has the ability of implicit averaging. The method was applied to study type B problems (i.e. problems for which the micro models are used to supply the constitutive relations), e.g. complex fluids. The method can also be applied type A problems, for which the micro models are used to help resolving local singularities, defects, boundary conditions, etc. References A general strategy for designing seamless multiscale methods, J. Comput. Phys. 2009 (in press) Seamless multiscale modeling of complex fluids using fiber bundle dynamics, Commun. Math. Sci. 5, 1027 (2007) Heterogeneous multiscale method for the modeling of complex fluids and micro fluidics, J. Comput. Phys. 204, 1 (2005) Analytical and numerical study of coupled atomistic-continuum methods for fluids, J. Comput. Phys. 227, 1353 (2007)