Your Perfect Assignment is Just a Click Away
We Write Custom Academic Papers

100% Original, Plagiarism Free, Customized to your instructions!

glass
pen
clip
papers
heaphones

DISCUSSION: SPINODAL DECOMPOSITION

DISCUSSION: SPINODAL DECOMPOSITION

FINAL PROJECT – SPINODAL DECOMPOSITION Due: Friday, August 13, 2021, 11:59 PM

Formatting Reminder: The submitted work MUST follow the naming convention listed below.

• “LastName UID project report.pdf”

• “LastName UID project code.zip”

• “LastName UID project main.m”

Submit two separate files to the CCLE course website: (1) a pdf of your written report and (2) a .zip file containing all of the MATLAB files written for the assignment.

Remember to use good coding practices by keeping your code organized, choosing suit- able variable names, and commenting where applicable. Any of your MATLAB .m files should contain a few comment lines at the top to provide the name of the script, a brief description of the function of the script, and your name and UID. Any submission that does not follow the above-mentioned format will receive SEVERE point deductions!

Final Project Prompt

In engineering applications, materials used are rarely of a singular composition. More often than not, alloys are employed in order to utilize thermal-mechanical strength in com- bination that one element cannot. An example of alloying used in everyday application would be stainless steel, which consist of carbon, iron, and chromium. Such an alloy has the mechanical strength of carbon, thermal conductivity of steel, and oxidation/corrosion resistance of chromium. Alloying of materials can be simulated using a theory of mixture known as the Phase Field model. For this project, we will employ Phase Field modeling to a Spinodal Alloying Decomposition as the mixture evolves over time 1.

Figure 1: An example Spinodal decomposition evolution over time.

1

Phase Field Theory

In Phase Field, the boundary between two mixture (known as the Phase Boundary) is modeled closely, in order the simulate its evolution and growth. Let us define the phase order parameter as ?. Initially, two distinct material phases are mixed via a random distri- bution. Here, one material would be categorized as one phase (? = 1) while then other an entirely different phase (? = ?1). It is easy to see that the phase order can be a function of position and time, i.e. ? = ?(x,y,t).

The free energy functional associated with the phase boundary is defined as Eq. 1.

F [?(x,y,t)] =

? [ 1

4

( a? (b?)2

)2 + ?

2 |??|2

] (1)

where a and b are phase potential coefficients and ? is an phase boundary penalty con- stant. If we apply physical intuition, e.g. ? is the measure of particle number and F is the energy f particular configuration of ?, then the variation in F with respect to ? can be defined as the chemical potential of the system (Eq 2).

?F

?? = µ (2)

Applying Fick’s Law of material Flux ( ~J) and diffusion coefficient (D), ~J = ?D?µ and mass conservation, ??

?t + ?· ~J = 0, one arrives at the expression of phase change over

time (Eq. 3). ??

?t = D?2µ (3)

Finally, substituting in the chemical potential, the expression of phase evolution can be derived (Eq. 4).

??

?t = D?2

[( b4?3 ?ab2?

) ???2?

] (4)

This is known as the Cahn-Hillard evolution equation.

Note: The symbol ?2? stands for the Laplacian of ?. In 2D it can be rewritten as d 2? dx2

+ d 2? dy2

.

2

Laplacian Approximation

Given a discretized field for variable U in two-dimensional space. Let the two dimensional x and y axes be indexed via “i” and “j”, respectively. The spacing (h) is uniform in both directions. Then the Laplacian of field U can be approximated in first order either using a 5-point stencil approximation equation (Eq. 5) or a 9-point stencil approximation equation (Eq. 6). Although the error in approximation is on similar order, the 9-point stencil does introduce additional accuracy by accounting for corner cells rather than directly connected cells.

Standard Five Point Stencil Approximation:

?2U = 1

h2

[ Ui?1,j + Ui+1,j + Ui,j?1 + Ui,j+1 ? 4Ui,j

] (5)

Skewed Nine Point Stencil Approximation:

?2U = 1

6h2

[ Ui?1,j?1 + 4Ui?1,j + Ui?1,j+1 + 4Ui,j?1 + …

4Ui,j+1 + Ui+1,j?1 + 4Ui+1,j + Ui+1,j+1 ? 20Ui,j ] (6)

(a) (b)

Figure 2: (a) Five point grid stencil, (b) Nine point grid stencil.

3

Trial Parameters

You are tasked to simulate the evolution of a Spinodal Decomposition over time using both 5-point stencil and 9-point stencil applied to the Cahn-Hillard equation derived (Eq. 4) with periodic boundary conditions using the following sets of parameters.

a b ? D

0.1 1 1 3

Each simulation should be 20 seconds total, with a field of uniformly random initial dis- tribution at unit material phases (? = 1 for material A, ? = ?1 for material B). The grid should be 150 × 100 with a grid spacing h = 1.

For each trial, print a plot of the field distribution using imagesc at every 5 second inter- vals (e.g. t = 0, 5, 10, 15, 20), and show them in your report. Make sure to include a colorbar.

Required Function Develop a function called:

function v = Laplacian_2D(u,h,stencil)

where you would approximate the Laplacian of the input matrix u with uniform grid spacing h, using the specified stencil value (either 5 or 9). The input and output values for the functions are:

u – Discretized input matrix u, must be 2 dimensional h – Discretized uniform grid spacing for matrix u stencil – Stencil identifier for approximation method (5-point or 9-point stencil) v – Discretized input matrix v as the solution of the Laplacian, must be 2 dimensional

4

Main Project Specifications

1. Five Point Stencils

Apply five-point stencil (Eq. 5) with periodic boundary conditions to Cahn-Hillard equation (Eq. 4), and using First-Order Runge-Kutta (Forward Euler) to update time-step (?t = 1e-3s). Discuss the effects of changing a, b, ?, D, or ?t.

2. Nine Point Stencils

Apply nine-point stencil (Eq. 6) with periodic boundary conditions to Cahn-Hillard equation (Eq. 4), and using First-Order Runge-Kutta (Forward Euler) to update time-step (?t = 1e-4s). Discuss the effects of changing a, b, ?, D, or ?t; in addition, compare results to part 1 and discuss the differences, make sure to use the same initial distribution per trial.

3. Animation of Time Evolution Using the approximation method in each previous method, generate a video of each phase field evolution over time by adhering to the following specifications.

Initial Time (t0) 0 Total Time (tf) 20 seconds Frames per Second (fps) 30 frames per second

Note: Make sure ALL your plots contain the necessary title colorbar. The total time output for the simulation should be 20 seconds in your report, with plots at t = 0, 5, 10, 15, and 20 s. Please only submit two 20 second videos to your zip file. Do not submit the any other videos due CCLE’s upload restrictions.

5

Extra Credit

• Apply nine-point stencil (Eq. 6) with periodic boundary conditions to Cahn-Hillard equation (Eq. 4), and using Fourth-Order Runge-Kutta to update time-step (?t = 1e-4s). Discuss the effects of changing a, b, ?, D, or ?t; in addition, compare results to part 1 and discuss the differences, make sure to use the same initial distribution per trial. (5%)

• Create a video of the time-evolution for the 9-point stencil 4th order Runge-Kutta Cahn Hillard following the same specification as stated above. This would mean you will submit three videos in your zip file. (5%)

Order Solution Now