-
-
Notifications
You must be signed in to change notification settings - Fork 738
Made y, z optional arguments for FunctionParameters that depend on space #4883
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
base: main
Are you sure you want to change the base?
Changes from 3 commits
82cc7c4
cc50eff
89a7fe3
6b3e4de
34a7012
e9a1ef1
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -18,7 +18,7 @@ | |
| # load parameter values and process model and geometry | ||
|
|
||
|
|
||
| def ambient_temperature(y, z, t): | ||
| def ambient_temperature(t, y=None, z=None): | ||
|
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Ideally this should work if the user just defines
Member
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. yes I was about to ask that, thanks for clarifying, I'll make the changes accordingly
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. great, thanks! |
||
| return 300 + t * 100 / 3600 | ||
|
|
||
|
|
||
|
|
||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -40,22 +40,20 @@ def _set_parameters(self): | |
| # Initial temperature | ||
| self.T_init = pybamm.Parameter("Initial temperature [K]") | ||
|
|
||
| def T_amb(self, y, z, t): | ||
| def T_amb(self, t, y=None, z=None): | ||
|
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. we should raise a warning here that the order of the arguments has changed
Member
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I've added that |
||
| """Ambient temperature [K]""" | ||
| return pybamm.FunctionParameter( | ||
| "Ambient temperature [K]", | ||
| { | ||
| "Distance across electrode width [m]": y, | ||
| "Distance across electrode height [m]": z, | ||
| "Time [s]": t, | ||
| }, | ||
| ) | ||
| inputs = {"Time [s]": t} | ||
| if y is not None: | ||
| inputs["Distance across electrode width [m]"] = y | ||
| if z is not None: | ||
| inputs["Distance across electrode height [m]"] = z | ||
| return pybamm.FunctionParameter("Ambient temperature [K]", inputs) | ||
|
|
||
| def T_amb_av(self, t): | ||
| """YZ-averaged ambient temperature [K]""" | ||
| y = pybamm.standard_spatial_vars.y | ||
| z = pybamm.standard_spatial_vars.z | ||
| return pybamm.yz_average(self.T_amb(y, z, t)) | ||
| return pybamm.yz_average(self.T_amb(t, y, z)) | ||
|
|
||
| def h_edge(self, y, z): | ||
| """Cell edge heat transfer coefficient [W.m-2.K-1]""" | ||
|
|
||
Uh oh!
There was an error while loading. Please reload this page.