kawin 0.4.0 (1-10-2026)

Posted January 10, 2026 by  ‐ 2 min read

This is a major refactor that decouples the models from the model parameters. It also introduces a general mesh object for diffusion models.

Changes

  • Parameter API
    • Parameters for the precipitate and diffusion models are decoupled from the model themselves. What this means is that parameters can be defined beforehand and inserted into the model. Parameter are intended to keep constant throughout the model lifetime so that they can be re-used in new models.
      • This also allows for functions such as nucleation rate and the homogenization average function to be called outside their respective models
    • Parameters such as ShapeFactor, NucleationBarrierParameters and StrainEnergy are refactored to follow a mediator-like pattern
      • For example, ShapeFactor will have a “description” class to describe functions for a sphere, needle, etc. This also allows custom descriptions to be made and used to test out new theories.
    • Plotting functions are taken outside the model, where the intended API is to do plotTerm(model)

  • Surrogates
    • The surrogate module has been simplify to act more as a wrapper around the respective thermodynamics object rather than a completely separate object. This enables the surrogate model to handle multiple phases and any untrained models will revert back to the underlying thermodynamics function.

  • Diffusion model changes
    • Interstital support
      • Interdiffusivity calculation account for non-volume counting interstitials
      • Flux calculations in homogenization model account for non-volume counting interstitials
      • Diffusion models track composition in terms of u-fraction
      • Option to treat the interstitial sublattice as a vacancy-poor phase. This allows for computing interstitial mobility in phases such as carbides, nitrides, etc without numerical issues due to the low vacancy fraction
        • Note that this requires the mobility models to be assessed against this assumption
    • Generalized mesh
      • Diffusion models take in a mesh to store the composition profile on
      • Currently supported meshes are finite volume schemes in 1D cartesian, 1D cylindrical, 1D spherical and 2D cartisian coordinate systems
      • Support for Dirichlet, Neumann and periodic boundary conditions

  • Precipitation model changes
    • Strength model is refactored to follow the new parameter API and plotting changes, where strength contributions can be defined individually and added to the strength model. This also enabled custom strength contributions to be created and used.
    • Grain growth is also refactored to follow the new parameter API and plotting changes