pde_opt.numerics.equations.cahn_hilliard
This module contains various Cahn-Hilliard equation classes.
Classes
|
Cahn–Hilliard equation in 2D with periodic boundary conditions. |
|
Cahn–Hilliard equation with smoothed boundary method for arbitrary geometries. |
|
Cahn–Hilliard equation in 3D with periodic boundary conditions. |
- class pde_opt.numerics.equations.cahn_hilliard.CahnHilliard2DPeriodic(domain: Domain, kappa: float, mu: Callable | equinox.Module, D: Callable | equinox.Module, derivs: str = 'fd')[source]
Cahn–Hilliard equation in 2D with periodic boundary conditions.
The Cahn-Hilliard equation describes phase separation and coarsening dynamics. The equation is:
\[\frac{\partial u}{\partial t} = \nabla \cdot (D(u) \nabla \mu)\]where u is the concentration, D(u) is the mobility, and μ is the chemical potential. The chemical potential is given by:
\[\mu = \mu_h(u) - \kappa \nabla^2 u\]- kappa: float
Gradient energy coefficient
- mu: Callable | equinox.Module
Function for the chemical potential
- D: Callable | equinox.Module
Function for the mobility
- derivs: str = 'fd'
Type of derivative computation
- fft = None
- ifft = None
- fourier_symbol = None
- class pde_opt.numerics.equations.cahn_hilliard.CahnHilliard3DPeriodic(domain: Domain, kappa: float, mu: Callable | equinox.Module, D: Callable | equinox.Module, derivs: str = 'fd')[source]
Cahn–Hilliard equation in 3D with periodic boundary conditions.
The Cahn-Hilliard equation describes phase separation and coarsening dynamics. The equation is:
\[\frac{\partial u}{\partial t} = \nabla \cdot (D(u) \nabla \mu)\]where u is the concentration, D(u) is the mobility, and μ is the chemical potential. The chemical potential is given by:
\[\mu = \mu_h(u) - \kappa \nabla^2 u\]- kappa: float
Gradient energy coefficient
- mu: Callable | equinox.Module
Function for the chemical potential
- D: Callable | equinox.Module
Function for the mobility
- derivs: str = 'fd'
Type of derivative computation
- fft = None
- ifft = None
- fourier_symbol = None
- class pde_opt.numerics.equations.cahn_hilliard.CahnHilliard2DSmoothedBoundary(domain: Domain, kappa: float, f: Callable | equinox.Module, mu: Callable | equinox.Module, D: Callable | equinox.Module, theta: Callable | equinox.Module, flux: Callable | equinox.Module, derivs: str = 'fd')[source]
Cahn–Hilliard equation with smoothed boundary method for arbitrary geometries.
This class implements the Cahn-Hilliard equation using the smoothed boundary method, which allows for complex domain geometries through a smooth level-set function ψ.
The equation is:
\[\frac{\partial u}{\partial t} = \frac{1}{\psi} \nabla \cdot (\psi D(u) \nabla \mu) + \frac{|\nabla \psi|}{\psi} J_n\]where the chemical potential includes boundary effects:
\[\mu = \mu_h(u) - \frac{\kappa}{\psi} \nabla \cdot (\psi \nabla u) - \sqrt{\kappa} \frac{|\nabla \psi|}{\psi} \sqrt{2f} \cos(\theta)\]- __init__(domain: Domain, kappa: float, f: Callable | equinox.Module, mu: Callable | equinox.Module, D: Callable | equinox.Module, theta: Callable | equinox.Module, flux: Callable | equinox.Module, derivs: str = 'fd') None
- kappa: float
Gradient energy coefficient
- f: Callable | equinox.Module
Function for the free energy density
- mu: Callable | equinox.Module
Function for the chemical potential
- D: Callable | equinox.Module
Function for the mobility
- theta: Callable | equinox.Module
Function for the contact angle
- flux: Callable | equinox.Module
Function for the normal flux
- derivs: str = 'fd'
Type of derivative computation