Processing math: 100%

Thursday, November 10, 2011

SNOW: Robust simulation of strongly anisotropic Cahn-Hilliard systems


Purpose
  • The package "Snow" solves the strongly anisotropic Cahn-Hilliard system (regularized by the nonlinear Willmore functional) on a 2-D square domain. It uses a Legendre-Galerkin method for systems of coupled elliptic equations in space and a first-order energy stabilized finite difference scheme in time.

Specifications
  • Name: Snow.
  • Author: Feng Chen.
  • Finishing date: 11/10/2011.
  • Languages: Fortran 90, MATLAB.
  • Required libraries: BLAS, LAPACK.

Simple Example
  • Equation: {ϕt=1ϵΔμ,in Ω,μ=δEδϕ,in Ω,ω=1ϵf(ϕ)ϵΔϕ,in Ω,ϕn=μn=ωn=0,on Ω,
    where E(ϕ)=Ω(F+β2G)dΩ,F(ϕ)=γ(n)ϵ(f(ϕ)+ϵ22|ϕ|2),G(ϕ)=ω2,f(ϕ)=14(ϕ21)2,ω=1ϵf(ϕ)ϵΔϕ,γ(n)=1+αcos(4θ)=1+α(4di=1n4i3).
  • Initial conditions: ϕ0=tanh(x2+y2rϵ),ω0=f(ϕ0).
  • Parameters: Ω=(1,1)2,T=0.15,r=0.5,ϵ=0.02,β=5×104,α=0.3.

Quick Start
  • Compiling and running:
    cd ./Lion
    make library
    ifort tst_Snow.f90 -llibrary -llapack -lblas
    ./a.out
    matlab plot_Snow.m
    
  • Graphics: The left panel shows the evolution of the anisotropic dynamics in Ω, and the right one shows the decreasing energy against time steps.

References
Code Highlights
    
    !! Assign initial conditions
    do i = 0, nx
     do j = 0, ny
      ! quadrature points
      x = (zx(i)*(x2-x1) + (x2+x1))/2d0
      y = (zy(j)*(y2-y1) + (y2+y1))/2d0
      select case (SnowAnisoCase) 
       case (1)  ! one circle
        phi(i,j) = tanh((sqrt(x*x+y*y)-r)/SnowEps)
       case (2)  ! two circles
        phi(i,j) = tanh((sqrt((x+1d0/2d0)**2+                   &
                              (y-1d0/2d0)**2)-1d0/4d0)/SnowEps) &
                 + tanh((sqrt((x-1d0/5d0)**2+                   &
                              (y+1d0/5d0)**2)-1d0/2d0)/SnowEps)
        phi(i,j) = phi(i,j) - 1d0
      end select 
     end do
    end do     
    omega =- (phi*phi*phi-phi)/SnowEps      
    
    

No comments:

Post a Comment