This repository contains the models for composite latent energy storage (LTES) from the article:
E.K. Luckins, F. Brosa Planella, Homogenized models for composite phase-change materials, Proceedings of the Royal Society A 481 (2025) 20250660.
To reproduce the results from the article, run the examples in the scripts directory:
comsol_model.mphis the COMSOL model to implement the full model. Requires COMSOL v6.2 to run. Exporting the results defined in the model produces thecell_data_sharp.csvandcell_data_mush.csvfiles.process_COMSOL_data.pyprocesses the exported data from COMSOL and saves it in thedatadirectory in the relevant format.plot_COMSOL_data.pyandcompare_temperature_profiles.pyplots the processed data from COMSOL against the reduced models in PyBaMM, producing the figures in the article (saved in thefiguresdirectory).compute_melting_times.pyruns the reduced models at different values of kappa and computes the melting times. They are saved as csv in thedatadirectory.plot_melting_times.pyplots the melting times against kappa using the data computed by the previous script, producing the figures in the article (saved in thefiguresdirectory).
The package is not yet available on PyPI so it needs to be installed from the source code. These instructions assume that you have a compatible Python version installed (between 3.9 and 3.12).
First clone the repository, either from the command line or using a Git client:
git clone git@github.com:mmsg-warwick/composite-LTES.gitIf you do not have nox installed, install it with
python3 -m pip install noxThen, navigate to the repository you just cloned and run
nox -s devThis will create a virtual environment called venv in your current directory and install the package in editable mode with all the development dependencies. To activate the virtual environment, run
source env/bin/activateYou can now run the examples in the examples directory.
If needed, you can deactivate your virtual environment with
deactivateFirst clone the repository, either from the command line or using a Git client:
git clone git@github.com:mmsg-warwick/composite-LTES.gitIf you do not have nox installed, install it with
python3 -m pip install noxThen, navigate to the repository you just cloned and run
nox -s devThis will create a virtual environment called venv in your current directory and install the package in editable mode with all the development dependencies. To activate the virtual environment, run
venv\Scripts\activate.batif you are using Command Prompt, or
venv\Scripts\Activate.ps1if you are using PowerShell.
You can now run the examples in the examples directory.
If needed, you can deactivate your virtual environment with
deactivate