Issue 692 external temperature matrix#728
Conversation
…er with plotting remain
…temperature-matrix
Codecov Report
@@ Coverage Diff @@
## master #728 +/- ##
==========================================
+ Coverage 98.27% 98.35% +0.07%
==========================================
Files 175 175
Lines 9351 9599 +248
==========================================
+ Hits 9190 9441 +251
+ Misses 161 158 -3
Continue to review full report at Codecov.
|
valentinsulzer
left a comment
There was a problem hiding this comment.
Thanks Scott, looks great. I wonder if it might be a bit neater to set external models by doing e.g. options = {"thermal": "external"} instead of the extra list, but not a very strongly held opinion.
Could you also edit the set_temperature_spm_1plus1D results file with this new format, and add a corresponding example for 1D?
rtimms
left a comment
There was a problem hiding this comment.
thanks @Scottmar93 looks great! like how you retain all the features/derived variables of the submodel that you set externally. can the script results/2plus1D/set_temperature_spm_1plus1D.py be updated to use this functionality? then i think the submodel x_lumped_1D_set_temperature can be removed. Need to keep the set potential model for now until we have implemented potentiostatic.
rtimms
left a comment
There was a problem hiding this comment.
looks great, thanks @Scottmar93 !
Description
Added a more general method for interfacing with external variables. Can choose any submodel to be external and then one needs to just pass the variable that would have been solved for by the submodel if it wasn't made external to the solver at each time step. This only works for stepping.
Works for solvers except Casadi (tino knows how to get this working though).
I have also added a couple of helper methods to Simulation that make it easy to pass and extract arrays corresponding to variables to/from pybamm.
Fixes #692
Type of change
Please add a line in the relevant section of CHANGELOG.md to document the change (include PR #) - note reverse order of PR #s.
Key checklist:
$ flake8$ python run-tests.py --unit$ cd docsand then$ make clean; make htmlYou can run all three at once, using
$ python run-tests.py --quick.Further checks: