Skip to content
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

#1070 add length scales #1071

Merged
merged 2 commits into from
Jun 23, 2020
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 2 additions & 1 deletion CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,8 @@

## Bug fixes

- Allowed for pybamm functions exp, sin, cos, sqrt to be used in expression trees that
- Add length scales to `EffectiveResistance` models ([#1071](https://github.com/pybamm-team/PyBaMM/pull/1071))
- Allowed for pybamm functions exp, sin, cos, sqrt to be used in expression trees that
are converted to casadi format ([#1067](https://github.com/pybamm-team/PyBaMM/pull/1067)
- Fix a bug where variables that depend on y and z were transposed in `QuickPlot` ([#1055](https://github.com/pybamm-team/PyBaMM/pull/1055))

Expand Down
46 changes: 24 additions & 22 deletions examples/notebooks/models/pouch-cell-model.ipynb

Large diffs are not rendered by default.

Original file line number Diff line number Diff line change
Expand Up @@ -40,6 +40,12 @@ def __init__(
self.options = options
self.param = pybamm.standard_parameters_lithium_ion

# Set default length scales
self.length_scales = {
"current collector y": self.param.L_y,
"current collector z": self.param.L_z,
}

self.variables = self.get_fundamental_variables()
self.set_algebraic(self.variables)
self.set_boundary_conditions(self.variables)
Expand Down Expand Up @@ -313,6 +319,12 @@ def __init__(self):
self.name = "Effective resistance in current collector model (2D)"
self.param = pybamm.standard_parameters_lithium_ion

# Set default length scales
self.length_scales = {
"current collector y": self.param.L_y,
"current collector z": self.param.L_z,
}

# Get necessary parameters
param = self.param
l_cn = param.l_cn
Expand Down
3 changes: 2 additions & 1 deletion pybamm/parameters/standard_parameters_lead_acid.py
Original file line number Diff line number Diff line change
Expand Up @@ -442,7 +442,8 @@ def j0_p_Ox_dimensional(c_e, T):
rho_cp = pybamm.thermal_parameters.rho_cp

rho_k = pybamm.thermal_parameters.rho_k
rho = rho_n * l_n + rho_s * l_s + rho_p * l_p
# effective volumetric heat capacity
rho = (rho_cn * l_cn + rho_n * l_n + rho_s * l_s + rho_p * l_p + rho_cp * l_cp) / l

lambda_cn = pybamm.thermal_parameters.lambda_cn
lambda_n = pybamm.thermal_parameters.lambda_n
Expand Down
3 changes: 2 additions & 1 deletion pybamm/parameters/standard_parameters_lithium_ion.py
Original file line number Diff line number Diff line change
Expand Up @@ -387,7 +387,8 @@ def chi(c_e):
rho_cp = pybamm.thermal_parameters.rho_cp

rho_k = pybamm.thermal_parameters.rho_k
rho = rho_n * l_n + rho_s * l_s + rho_p * l_p
# effective volumetric heat capacity
rho = (rho_cn * l_cn + rho_n * l_n + rho_s * l_s + rho_p * l_p + rho_cp * l_cp) / l

lambda_cn = pybamm.thermal_parameters.lambda_cn
lambda_n = pybamm.thermal_parameters.lambda_n
Expand Down