-
-
Notifications
You must be signed in to change notification settings - Fork 606
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
#872 added ambient temperature #873
Conversation
Codecov Report
@@ Coverage Diff @@
## develop #873 +/- ##
========================================
Coverage 97.70% 97.70%
========================================
Files 201 201
Lines 10415 10433 +18
========================================
+ Hits 10176 10194 +18
Misses 239 239 Continue to review full report at Codecov.
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is a nice feature, thanks! Just a couple of comments re the stuff in 2D. I think we could improve the documentation for how to write the source terms in finite elements. It is a bit hacky at the moment, and could be reviewed in the future.
@@ -33,6 +35,10 @@ def get_fundamental_variables(self): | |||
T_cp = T_x_av | |||
|
|||
variables = self._get_standard_fundamental_variables(T, T_cn, T_cp) | |||
variables.update( |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
could this be moved to base_thermal
to avoid repeating in each of the separate base classes?
pybamm.laplacian(T_av) | ||
+ self.param.B * pybamm.source(Q_av, T_av) | ||
+ cooling_coeff * pybamm.source(T_av, T_av) | ||
pybamm.laplacian(T_av - T_amb) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I don't think there should be a T_amb inside the laplacian
+ self.param.B * pybamm.source(Q_av, T_av) | ||
+ cooling_coeff * pybamm.source(T_av, T_av) | ||
pybamm.laplacian(T_av - T_amb) | ||
+ self.param.B * pybamm.source(Q_av, T_av - T_amb) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
the second argument in pybamm.source
is just the variable for which this is the equation for and the first argument is the source term in the equation (so that boundary conditions are handled correctly in finite elements). sorry, I don't think that is particularly well documented. As a result this should just be pybamm.source(Q_av, T_av)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
same for laplacian in other files
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
ohh i see, thanks for the clarification
+ cooling_coeff * pybamm.source(T_av, T_av) | ||
pybamm.laplacian(T_av - T_amb) | ||
+ self.param.B * pybamm.source(Q_av, T_av - T_amb) | ||
+ cooling_coeff * pybamm.source(T_av, T_av - T_amb) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
similar to above this should be pybamm.source T_av-T_amb,T_av)
- (self.param.h / self.param.delta) | ||
* pybamm.source(T_av, T_av, boundary=True) | ||
* pybamm.source(T_av - T_amb, T_av - T_amb, boundary=True) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
pybamm.source T_av-T_amb,T_av, boundary=True)
pybamm.laplacian(T_av - T_amb) | ||
+ self.param.B * Q_av | ||
+ cooling_coeff * (T_av - T_amb) | ||
) | ||
/ self.param.C_th | ||
} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
just thought - for the model x-lumped with 1D current collectors I think you also need to change the boundary conditions to T-T_amb
as well. the colling in the rhs should just be from the large faces of the cell, and the boundary conditions are cooling around the remaining edges (y,z). it shouldn't actually make that much differences as the cooling from those sides is small by comparison. I think the details of these model are a bit opaque -- I'll make a separate issue to simplify the thermal models and make the cooling and boundary conditions more explicit
is there an implicit assumption that the dimensionless ambient temp is zero at t=t0? i.e. you start at the reference temperature? if so, maybe there could be a check for this? |
Should we keep T_init separate from T_amb(0)? For example, it could be used to simulate a case where an EV exits an air-conditioned garage to a different temperature outside or other rapid temperature change. Can you clarify what sort of check you're imagining? |
ah yeah I hadn’t thought of that use case. Yeah I agree to keep T_init and T_amb(0) separate. I had in my head that the battery would start at the ambient temperature, but I see now that isn’t the case, so no need to check. Thanks! |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
great, thanks!
@@ -0,0 +1,52 @@ | |||
# | |||
# Example showing how to load and solve the DFN |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
the title could be updated to explain this is showing the ambient temperature feature
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'll merge this PR and make that change before merging #868
Description
Added ambient temperature
Fixes #872
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. If necessary, also add to the list of breaking changes.
Key checklist:
$ flake8
$ python run-tests.py --unit
$ cd docs
and then$ make clean; make html
You can run all three at once, using
$ python run-tests.py --quick
.Further checks: