Sunday, July 15, 2012

EVA: Solve Cahn-Hilliard equations with the dynamic boundary condition


Purpose
  • The package "Eva" simulates the 2-D isotropic Cahn-Hilliard equation with the dynamic boundary condition. A Legendre-Fourier method was used for the spatial discretization (periodic in $x$ and nonperiodic in $y$), and the first- and second-order energy stabilized methods were used for the temporal discretization.

Specifications
  • Name: Eva.
  • Author: Feng Chen.
  • Finishing date: 07/15/2012.
  • Languages: Fortran 90.
  • Required libraries: BLAS, LAPACK.

Simple Example
  • Equation: \begin{equation} \begin{aligned} & \phi_t= M \Delta \mu, && \quad \text{in } \Omega, \\ & \mu = \frac{\phi(\phi^2 -1)}{\epsilon} - \epsilon\Delta \phi, && \quad \text{in } \Omega, \\ & \partial_{\boldsymbol{n}} \mu = 0 , && \quad \text{on } \partial \Omega, \\ & \phi_t =-\nu (\epsilon \partial_{\boldsymbol{n}} \phi + \gamma'(\phi)) ,&& \quad\text{on } \partial\Omega, \end{aligned} \end{equation} where \begin{equation} \gamma(\phi)=-\frac{\sqrt{2}}{3} \cos \theta \sin \big( \frac{\pi}{2} \phi \big), \end{equation}
  • Parameters: \begin{equation} \label{label} \begin{aligned} & \Omega = (0,1)\times (0,1), \quad M = 0.03, \quad \epsilon=0.02, \quad \nu=500, \quad \theta_{\pm} = \pm 77.6\pi/180, \\ & n_x=128, \quad n_y=128, \quad \delta t = 0.001,\quad T=0.8,\quad s_1 = 1.5, \quad s_2 = 0.125. \end{aligned} \end{equation}
  • Exact solution and input functions: \begin{equation} \phi(x,y,0) = \text{two separated semi-circles on the bottom boundary} \end{equation} with radius $0.2$. It is evolved through the second-order scheme.

Quick Start
  • Compiling and running:
    cd ./Eva
    make library
    gfortran Eva_Main.cu -llibrary -llapack -lblas
    ./a.out
    
  • Output:
     
    The top row is from the homogeneous Neumann boundary condition, while the bottom from the dynamic boundary condition.
    
    
    
  • CPU: Intel(R) Xeon(R) CPU X5550 @2.67GHz.
  • OS: CentOS release 6.4 (Final).
  • Compiler: gfortran 4.5.1.

References
Code Highlights
    
    !! solve for phi and mu at each time step
    call IonPhotonSpace_Transform_D2_Many(2, EvaSI, EvaSP, &
        EW%up(:,:,:,co), EW%us, IonPhotonP2S)
    call IonQuarkSpace_Solve(EvaSI, EvaSQ(co), EW%fd, EW%us) 
    call IonPhotonSpace_Transform_D2_Many(2, EvaSI, EvaSP, &
        EW%us, EW%up(:,:,:,co), IonPhotonS2P)           
    
    

No comments:

Post a Comment