-
-
Notifications
You must be signed in to change notification settings - Fork 566
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
#1219 start script on speeding up solvers
- Loading branch information
1 parent
86769ba
commit 4d0b2bb
Showing
18 changed files
with
474 additions
and
64 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Large diffs are not rendered by default.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,51 +1,29 @@ | ||
import pybamm as pb | ||
|
||
pb.set_logging_level("INFO") | ||
options = {"sei": "ec reaction limited", "sei porosity change": True} | ||
options = { | ||
"sei": "ec reaction limited", | ||
"sei porosity change": True, | ||
"thermal": "x-lumped", | ||
} | ||
param = pb.ParameterValues(chemistry=pb.parameter_sets.Ramadass2004) | ||
param.update( | ||
{ | ||
"Separator density [kg.m-3]": 397, | ||
"Separator specific heat capacity [J.kg-1.K-1]": 700, | ||
"Separator thermal conductivity [W.m-1.K-1]": 0.16, | ||
}, | ||
check_already_exists=False, | ||
) | ||
model = pb.lithium_ion.DFN(options) | ||
experiment = pb.Experiment( | ||
[ | ||
"Charge at 1 C until 4.2 V", | ||
"Hold at 4.2 V until C/10", | ||
"Rest for 5 minutes", | ||
"Discharge at 2 C until 2.8 V", | ||
"Charge at 0.3 C until 4.2 V", | ||
"Rest for 5 minutes", | ||
] | ||
* 2 | ||
+ [ | ||
"Charge at 1 C until 4.2 V", | ||
"Hold at 4.2 V until C/20", | ||
"Rest for 30 minutes", | ||
"Discharge at C/3 until 2.8 V", | ||
"Charge at 1 C until 4.2 V", | ||
"Hold at 4.2 V until C/20", | ||
"Rest for 30 minutes", | ||
"Discharge at 1 C until 2.8 V", | ||
"Charge at 1 C until 4.2 V", | ||
"Hold at 4.2 V until C/20", | ||
"Rest for 30 minutes", | ||
"Discharge at 2 C until 2.8 V", | ||
"Charge at 1 C until 4.2 V", | ||
"Hold at 4.2 V until C/20", | ||
"Rest for 30 minutes", | ||
"Discharge at 3 C until 2.8 V", | ||
"Rest for 5 minutes", | ||
] | ||
* 5 | ||
) | ||
sim = pb.Simulation(model, experiment=experiment, parameter_values=param) | ||
sim.solve(solver=pb.CasadiSolver(mode="safe", dt_max=120)) | ||
sim.plot( | ||
[ | ||
"Current [A]", | ||
"Total current density [A.m-2]", | ||
"Terminal voltage [V]", | ||
"Discharge capacity [A.h]", | ||
"Electrolyte potential [V]", | ||
"Electrolyte concentration [mol.m-3]", | ||
"Total negative electrode sei thickness", | ||
"Negative electrode porosity", | ||
"X-averaged negative electrode porosity", | ||
"Negative electrode sei interfacial current density [A.m-2]", | ||
"X-averaged total negative electrode sei thickness [m]", | ||
] | ||
) | ||
sim.solve(solver=pb.CasadiSolver(mode="safe", dt_max=120)) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.