examples.phase.missOrientation package

Submodules

examples.phase.missOrientation.circle module

In this example, a phase equation is solved in one dimension with a misorientation between two solid domains. The phase equation is given by:

\tau_{\phi} \frac{\partial \phi}{\partial t}
= \alpha^2 \nabla^2 \phi + \phi ( 1 - \phi ) m_1 ( \phi , T)
- 2 s \phi | \nabla \theta | - \epsilon^2 \phi | \nabla \theta |^2

where

m_1(\phi, T) = \phi - \frac{1}{2} - T \phi ( 1 - \phi )

The initial conditions are:

\phi &= 1 \qquad \forall x \\
\theta &= \begin{cases}
1 & \text{for $(x - L / 2)^2 + (y - L / 2)^2 > (L / 4)^2$} \\
0 & \text{for $(x - L / 2)^2 + (y - L / 2)^2 \le (L / 4)^2$}
\end{cases} \\
T &= 1 \qquad \forall x

and boundary conditions \phi = 1 for x = 0 and x = L.

Here the phase equation is solved with an explicit technique.

The solution is allowed to evolve for steps = 100 time steps.

>>> from builtins import range
>>> for step in range(steps):
...     phaseEq.solve(phase, dt = timeStepDuration)

The solution is compared with test data. The test data was created with a FORTRAN code written by Ryo Kobayashi for phase field modeling. The following code opens the file circle.gz extracts the data and compares it with the phase variable.

>>> import os
>>> from future.utils import text_to_native_str
>>> testData = numerix.loadtxt(os.path.splitext(__file__)[0] + text_to_native_str('.gz'))
>>> print(phase.allclose(testData))
1

examples.phase.missOrientation.mesh1D module

In this example a phase equation is solved in 1 dimension with a misorientation present. The phase equation is given by:

\tau_{\phi} \frac{\partial \phi}{\partial t}
= \alpha^2 \nabla^2 \phi + \phi ( 1 - \phi ) m_1 ( \phi , T)
- 2 s \phi | \nabla \theta | - \epsilon^2 \phi | \nabla \theta |^2

where

m_1(\phi, T) = \phi - \frac{1}{2} - T \phi ( 1 - \phi )

The initial conditions are:

\phi &= 1 \qquad \text{for $0 \le x \le L$} \\
\theta &= \begin{cases}
1 & \text{for $0 \le x \le L/2$} \\
0 & \text{for $L/2 < x \le L$}
\end{cases} \\
T &= 1 \qquad \text{for $0 \le x \le L$}

and boundary conditions \phi = 1 for x = 0 and x = L.

Here the phase equation is solved with an explicit technique.

The solution is allowed to evolve for steps = 100 time steps.

>>> from builtins import range
>>> for step in range(steps):
...     phaseEq.solve(phase, dt = timeStepDuration)

The solution is compared with test data. The test data was created with a FORTRAN code written by Ryo Kobayashi for phase field modeling. The following code opens the file mesh1D.gz extracts the data and compares it with the theta variable.

>>> import os
>>> from future.utils import text_to_native_str
>>> testData = numerix.loadtxt(os.path.splitext(__file__)[0] + text_to_native_str('.gz'))
>>> print(phase.allclose(testData))
1

examples.phase.missOrientation.modCircle module

In this example a phase equation is solved in one dimension with a misorientation present. The phase equation is given by:

\tau_{\phi} \frac{\partial \phi}{\partial t}
= \alpha^2 \nabla^2 \phi + \phi ( 1 - \phi ) m_1 ( \phi , T)
- 2 s \phi | \nabla \theta | - \epsilon^2 \phi | \nabla \theta |^2

where

m_1(\phi, T) = \phi - \frac{1}{2} - T \phi ( 1 - \phi )

The initial conditions are:

\phi &= 1 \qquad \forall x  \\
\theta &= \begin{cases}
2 \pi / 3 & \text{for $(x - L / 2)^2 + (y - L / 2)^2 > (L / 4)^2$} \\
-2 \pi / 3 & \text{for $(x - L / 2)^2 + (y - L / 2)^2 \le (L / 4)^2$}
\end{cases} \\
T &= 1 \qquad \forall x

and boundary conditions \phi = 1 for x = 0 and x = L.

Here the phase equation is solved with an explicit technique.

The solution is allowed to evolve for steps = 100 time steps.

>>> from builtins import range
>>> for step in range(steps):
...     phaseEq.solve(phase, dt = timeStepDuration)

The solution is compared with test data. The test data was created with a FORTRAN code written by Ryo Kobayashi for phase field modeling. The following code opens the file modCircle.gz extracts the data and compares it with the phase variable.

>>> import os
>>> from future.utils import text_to_native_str
>>> testData = numerix.loadtxt(os.path.splitext(__file__)[0] + text_to_native_str('.gz'))
>>> print(phase.allclose(testData))
1

examples.phase.missOrientation.test module

Last updated on Jun 27, 2023. Created using Sphinx 6.2.1.