Useful Tools in BattMo â
Before we dive into how to set up and run simulations, it's helpful to get familiar with some of the built-in tools provided by BattMo. These utilities can save time and improve your workflow, and we'll be using most of them throughout the tutorials.
using BattMo
Saving Default Parameter Sets Locally â
BattMo includes several default parameter sets that you can use as a starting point. If you want to explore or customize them, you can easily save them to your local disk using:
path = pwd()
folder_name = "default_parameter_sets"
generate_default_parameter_files(path, folder_name)
đ JSON files successfully written! Path:
/home/runner/work/BattMo.jl/BattMo.jl/docs/build/tutorials/default_parameter_sets
This will create a folder in your current working directory containing the default parameter files.
Viewing Parameter Set Information â
To quickly inspect which default parameter sets are included with BattMo and what each contains, you can use:
print_default_input_sets_info()
====================================================================================================
đ Overview of Available Default Sets
====================================================================================================
đ cell_parameters: Chen2020, Xu2015
đ cycling_protocols: CCCV, CCCharge, CCCycling, CCDischarge, user_defined_current_function
đ model_settings: P2D, P4D_cylindrical, P4D_pouch
đ simulation_settings: P2D, P4D_cylindrical, P4D_pouch
====================================================================================================
đ Detailed Descriptions
====================================================================================================
đ cell_parameters
----------------------------------------------------------------------------------------------------
Chen2020
đš Cell name: LG INR 21700 M50
đš Cell case: Cylindrical
đš Source: ]8;;https://doi.org/10.1149/1945-7111/ab9050\visit]8;;\
đš Suitable for:
âĸ CurrentCollectors: Generic
âĸ SEIModel: Bolay
âĸ RampUp: Sinusoidal
âĸ TransportInSolid: FullDiffusion
âĸ ModelFramework: P2D
đš Description: Parameter set of a cylindrical 21700 commercial cell (LGM50), for an electrochemical pseudo-two-dimensional (P2D) model, after calibration. SEI parameters are from Bolay2022: https://doi.org/10.1016/j.powera.2022.100083 .
Xu2015
đš Cell name: LP2770120
đš Cell case: Pouch
đš Source: ]8;;https://doi.org/10.1016/j.energy.2014.11.073\visit]8;;\
đš Suitable for:
âĸ CurrentCollectors: Generic
âĸ RampUp: Sinusoidal
âĸ TransportInSolid: FullDiffusion
âĸ ModelFramework: P2D, P4D Pouch
đš Description: Parameter set of a commercial Type LP2770120 prismatic LiFePO4/graphite cell, for an electrochemical pseudo-two-dimensional (P2D) model.
đ cycling_protocols
----------------------------------------------------------------------------------------------------
CCCV
đš Description: Parameter set for a constant current constant voltage cyling protocol.
CCCharge
đš Description: Parameter set for a constant current charging protocol.
CCCycling
đš Description: Parameter set for a constant current cycling protocol.
CCDischarge
đš Description: Parameter set for a constant current discharging protocol.
user_defined_current_function
đš Description: Parameter set that shows an example of how to include a user defined function in the cycling protocol parameters.
đ model_settings
----------------------------------------------------------------------------------------------------
P2D
đš Description: Default model settings for a P2D simulation including a current ramp up, excluding current collectors and SEI effects.
P4D_cylindrical
đš Description: Default model settings for a P4D cylindrical cell with a current ramp up.
P4D_pouch
đš Description: Default model settings for a P4D pouch simulation including a current ramp up, current collectors.
đ simulation_settings
----------------------------------------------------------------------------------------------------
P2D
đš Suitable for:
âĸ SEIModel: Bolay
âĸ RampUp: Sinusoidal
âĸ TransportInSolid: FullDiffusion
âĸ ModelFramework: P2D
đš Description: Default simulation settings for a P2D simulation including a current ramp up, excluding current collectors and SEI effects.
P4D_cylindrical
P4D_pouch
đš Suitable for:
âĸ SEIModel: Bolay
âĸ RampUp: Sinusoidal
âĸ TransportInSolid: FullDiffusion
âĸ CurrentCollector: Generic
âĸ ModelFramework: P2D, P4D Pouch
đš Description: Default simulation settings for a P4D pouch simulation including a current ramp up, current collectors.
Inspecting Individual Parameters â
If you're unsure how a specific parameter should be defined or what it represents, you can print detailed information about it. For example:
parameter_name = "OpenCircuitPotential"
print_parameter_info(parameter_name)
================================================================================
âšī¸ Parameter Information
================================================================================
đš Name: OpenCircuitPotential
đš Description: The open-circuit potential of the active material under a given intercalant stoichimetry and temperature.
đš Type: String, Dict{String, Vector}, Real
đš Unit: V
đš Documentation: ]8;;https://battmoteam.github.io/BattMo.jl/dev/manuals/user_guide/simulation_dependent_input\visit]8;;\
đš Ontology link: ]8;;https://w3id.org/emmo/domain/electrochemistry#electrochemistry_9c657fdc_b9d3_4964_907c_f9a6e8c5f52b\visit]8;;\
Another example
parameter_name = "ModelFramework"
print_parameter_info(parameter_name)
â No parameters found matching: ModelFramework
This is especially useful when building or editing custom parameter sets.
Listing Available Submodels â
BattMo supports a modular submodel architecture. To view all available submodels you can integrate into your simulation, run:
print_submodels_info()
================================================================================
âšī¸ Submodels Information
================================================================================
Parameter Options Documentation
--------------------------------------------------------------------------------
CurrentCollectors Generic -
SEIModel Bolay ]8;;https://battmoteam.github.io/BattMo.jl/dev/manuals/user_guide/sei_model\visit]8;;\
RampUp Sinusoidal ]8;;https://battmoteam.github.io/BattMo.jl/dev/manuals/user_guide/ramp_up\visit]8;;\
TransportInSolid FullDiffusion -
ModelFramework P2D, P4D Pouch, P4D Cylindrical]8;;https://battmoteam.github.io/BattMo.jl/dev/manuals/user_guide/pxd_model\visit]8;;\
Write a parameter set object to a JSON file â
You can use the following function to save your ParameterSet object to a JSON file:
file_path = "path_to_json_file/file.json"
parameter_set = CellParameters(Dict("NegativeElectrode" => Dict("ElectrodeCoating" => Dict("Thickness" => 100e-6))))
write_to_json_file(file_path, parameter_set)
An error occurred while writing to the file: SystemError("opening file \"path_to_json_file/file.json\"", 2, nothing)
Example on GitHub â
If you would like to run this example yourself, it can be downloaded from the BattMo.jl GitHub repository as a script.
This page was generated using Literate.jl.