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(ϕ2−1)2,ω=1ϵf′(ϕ)−ϵΔϕ,γ(n)=1+αcos(4θ)=1+α(4d∑i=1n4i−3).
- Initial conditions:
ϕ0=tanh(√x2+y2−rϵ),ω0=f′(ϕ0).
- Parameters:
Ω=(−1,1)2,T=0.15,r=0.5,ϵ=0.02,β=5×10−4,α=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
- Feng Chen and Jie Shen. Efficient energy stable schemes with spectral discretization in space for anisotropic Cahn-Hilliard systems, Communications in Computational Physics, Volume 13, Number 5, 1189-1208, (2013).
- Feng Chen and Jie Shen. Efficient spectral-Galerkin methods for systems of coupled second-order equations and their applications, Journal of Computational Physics, Volume 231, Issue 15, 5016-5028, (2012).
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