-
-
Notifications
You must be signed in to change notification settings - Fork 529
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
#692 added an get_external_variables method to submodels
- Loading branch information
1 parent
fb69f96
commit eb0685e
Showing
5 changed files
with
100 additions
and
0 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
Empty file.
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 |
---|---|---|
@@ -0,0 +1,32 @@ | ||
# | ||
# A class for full external thermal models | ||
# | ||
import pybamm | ||
|
||
from ..base_thermal import BaseThermal | ||
|
||
|
||
class Full(BaseThermal): | ||
"""Class to link full external thermal submodels. | ||
Parameters | ||
---------- | ||
param : parameter class | ||
The parameters to use for this submodel | ||
**Extends:** :class:`pybamm.thermal.BaseModel` | ||
""" | ||
|
||
def __init__(self, param): | ||
super().__init__(param) | ||
|
||
def get_external_variables(self): | ||
T = pybamm.standard_variables.T | ||
T_cn = pybamm.BoundaryValue(T, "left") | ||
T_cp = pybamm.BoundaryValue(T, "right") | ||
|
||
variables = self._get_standard_fundamental_variables(T, T_cn, T_cp) | ||
external_variables = [T] | ||
|
||
return variables, external_variables |
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 |
---|---|---|
@@ -0,0 +1,39 @@ | ||
# | ||
# A class for external lumped thermal models | ||
# | ||
import pybamm | ||
|
||
from ..base_thermal import BaseThermal | ||
|
||
|
||
class Full(BaseThermal): | ||
"""Class to link external lumped thermal submodels. | ||
Parameters | ||
---------- | ||
param : parameter class | ||
The parameters to use for this submodel | ||
**Extends:** :class:`pybamm.thermal.BaseModel` | ||
""" | ||
|
||
def __init__(self, param): | ||
super().__init__(param) | ||
|
||
def get_external_variables(self): | ||
T_x_av = pybamm.standard_variables.T_av | ||
T_n = pybamm.PrimaryBroadcast(T_x_av, "negative electrode") | ||
T_s = pybamm.PrimaryBroadcast(T_x_av, "separator") | ||
T_p = pybamm.PrimaryBroadcast(T_x_av, "positive electrode") | ||
T = pybamm.Concatenation(T_n, T_s, T_p) | ||
|
||
T_cn = T_x_av | ||
T_cp = T_x_av | ||
|
||
variables = self._get_standard_fundamental_variables(T, T_cn, T_cp) | ||
variables = self._get_standard_fundamental_variables(T, T_cn, T_cp) | ||
|
||
external_variables = [T_x_av] | ||
|
||
return variables, external_variables |