# 4.3.3. pde.pdes.cahn_hilliard module¶

A Cahn-Hilliard equation

class CahnHilliardPDE(interface_width: float = 1, bc_c: Union[Dict[str, Union[Dict, str, BCBase]], Dict, str, BCBase, Tuple[Union[Dict, str, BCBase], Union[Dict, str, BCBase]], Sequence[Union[Dict[str, Union[Dict, str, BCBase]], Dict, str, BCBase, Tuple[Union[Dict, str, BCBase], Union[Dict, str, BCBase]]]]] = 'auto_periodic_neumann', bc_mu: Union[Dict[str, Union[Dict, str, BCBase]], Dict, str, BCBase, Tuple[Union[Dict, str, BCBase], Union[Dict, str, BCBase]], Sequence[Union[Dict[str, Union[Dict, str, BCBase]], Dict, str, BCBase, Tuple[Union[Dict, str, BCBase], Union[Dict, str, BCBase]]]]] = 'auto_periodic_neumann')[source]

Bases: PDEBase

A simple Cahn-Hilliard equation

The mathematical definition is

$\partial_t c = \nabla^2 \left(c^3 - c - \gamma \nabla^2 c\right)$

where $$c$$ is a scalar field taking values on the interval $$[-1, 1]$$ and $$\gamma$$ sets the interfacial width.

Parameters
• interface_width (float) – The width of the interface between the separated phases. This defines a characteristic length in the simulation. The grid needs to resolve this length of a stable simulation.

• bc_c – The boundary conditions applied to the field. Boundary conditions are generally given as a list with one condition for each axis. For periodic axis, only periodic boundary conditions are allowed (indicated by ‘periodic’ and ‘anti-periodic’). For non-periodic axes, different boundary conditions can be specified for the lower and upper end (using a tuple of two conditions). For instance, Dirichlet conditions enforcing a value NUM (specified by {‘value’: NUM}) and Neumann conditions enforcing the value DERIV for the derivative in the normal direction (specified by {‘derivative’: DERIV}) are supported. Note that the special value ‘natural’ imposes periodic boundary conditions for periodic axis and a vanishing derivative otherwise. More information can be found in the boundaries documentation.

• bc_mu – The boundary conditions applied to the chemical potential associated with the scalar field $$c$$. Supports the same options as bc_c.

evolution_rate(state: ScalarField, t: float = 0) [source]

evaluate the right hand side of the PDE

Parameters
• state (ScalarField) – The scalar field describing the concentration distribution

• t (float) – The current time point

Returns

Scalar field describing the evolution rate of the PDE

Return type

ScalarField

explicit_time_dependence: Optional[bool] = False

Flag indicating whether the right hand side of the PDE has an explicit time dependence.

Type

bool

property expression: str

the expression of the right hand side of this PDE

Type

str