📖 Documentation: https://solveclosure.readthedocs.io/en/stable/
Solves the closure problem for the dual-continuum model published by Paten et. al. See the following two articles for more information:
https://doi.org/10.1149/1945-7111/ae335f https://doi.org/10.1149/1945-7111/ae3527
solveclosure is available on GNU/Linux. It is recommended to install solveclosure into a virtual environement.
pip install solveclosureThe simplest form of script to run solveclosure:
import solveclosure
img_path = "electrode_image.tif" # the path to your electrode image, electrolyte labelled as 0, active material 1, CBD 2, and separator 3 (optional).
label_map_path = "label_map.tif" # the path to a label map of active material particles (beginning at 1).
case_dir = "case_dir/" # an empty directory where OpenFOAM cases will be built.
load_of_cmd = "source /usr/lib/openfoam/openfoam2412/etc/bashrc" # the command specific for your system to load an OpenFOAM terminal.
voxel = 1e-7 # the electrode image voxel size in meters.
D_s = 4e-14 # the diffusivity of active material in m2.s-1.
solveclosure.solve_closure(
case_dir,
img_path,
label_map_path,
voxel,
cbd_surf_por=0.5, # the surface porosity of CBD (label 2)
dimensionless=False, # solve the dimensional problem, using D_s
D_s=D_s,
load_of_cmd=load_of_cmd, # optional: if omitted, solveclosure searches for an OpenFOAM installation
)solveclosure is installed with small example images, and solveclosure.example_path gives their location:
import solveclosure
solveclosure.solve_closure(
"two_squares_case",
solveclosure.example_path("two_squares.tif"),
solveclosure.example_path("two_squares_label_map.tif"),
1e-7,
)Example scripts are in the examples folder, and are described, with their expected results, on the Examples page of the documentation.