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

Issue 546 convection #635

Merged
merged 81 commits into from
Apr 9, 2020
Merged
Show file tree
Hide file tree
Changes from 77 commits
Commits
Show all changes
81 commits
Select commit Hold shift + click to select a range
eaa88b7
#546 adding transient convection model
valentinsulzer Jul 31, 2019
7f181a7
#546 adding more variables
valentinsulzer Jul 31, 2019
def2758
#546 split convection into through-cell and transverse
valentinsulzer Jul 31, 2019
f959d28
#546 merge
valentinsulzer Aug 1, 2019
186ddaa
#546 leading-order convection working
valentinsulzer Aug 1, 2019
b6702fb
#546 composite convection
valentinsulzer Aug 1, 2019
1f53999
#546 all convections working well
valentinsulzer Aug 1, 2019
94e1604
#546 testing parameters
valentinsulzer Aug 1, 2019
054e665
Merge branch 'issue-546-models' into issue-546-convection
valentinsulzer Aug 1, 2019
e12a777
#546 reformatting FOQS
valentinsulzer Aug 1, 2019
49560c0
#546 merge models branch
valentinsulzer Aug 2, 2019
cbbf76d
Merge branch 'master' into issue-546-convection
valentinsulzer Aug 2, 2019
6f717ad
#546 fix typo in parameter file
valentinsulzer Aug 2, 2019
fd0dc47
comparing comsol for lead acid
valentinsulzer Aug 3, 2019
c4b559e
#546 add new composite model
valentinsulzer Aug 3, 2019
905676f
#546 add dVdz term to full and leading order models
valentinsulzer Aug 3, 2019
4b319d0
#546 add quite conductive model
valentinsulzer Aug 3, 2019
fbe4cb3
progress on 1d
valentinsulzer Aug 3, 2019
f680369
#546 starting 2d results
valentinsulzer Aug 4, 2019
d877644
#546 some 2D results
valentinsulzer Aug 4, 2019
8d3729a
#546 more 2d results
valentinsulzer Aug 4, 2019
9e1b4d7
#546 add x-z plots
valentinsulzer Aug 4, 2019
3524990
#546 fix quite composite averaged model
valentinsulzer Aug 5, 2019
cf3f676
#546 some cleaning up
valentinsulzer Aug 5, 2019
8371073
#546 polish quite conductive results
valentinsulzer Aug 5, 2019
4ea5e0b
#546 timing
valentinsulzer Aug 5, 2019
fd8f520
merge
valentinsulzer Aug 5, 2019
a44567a
#546 more 2d results (poorly conducting and quite conducting done)
valentinsulzer Aug 5, 2019
e879013
#546 merge comsol branch
valentinsulzer Aug 5, 2019
ff8cd40
#546 computing errors
valentinsulzer Aug 6, 2019
4daa698
#546 comparing comsol
valentinsulzer Aug 6, 2019
ec58527
#546 more resolution on RMSE plot
valentinsulzer Aug 6, 2019
1e92c30
#546 voltage comparison with comsol working (a bit meh)
valentinsulzer Aug 6, 2019
4ed7595
Merge branch 'issue-546-convection' of https://github.com/pybamm-team…
valentinsulzer Aug 6, 2019
8bce025
#546 time models
valentinsulzer Aug 6, 2019
92fa7bf
#546 prettier plot
valentinsulzer Aug 6, 2019
6ec973e
#546 more plotting ....
valentinsulzer Aug 6, 2019
2ea7384
merge
valentinsulzer Aug 6, 2019
d3541b1
#546 redoing plots
valentinsulzer Aug 7, 2019
8a28352
#546 A_e algebraic
valentinsulzer Aug 8, 2019
7d9e43a
#546 small edits
valentinsulzer Aug 8, 2019
71150b5
#546 more plots
valentinsulzer Sep 6, 2019
9cc48db
Merge branch 'issue-546-convection' of https://github.com/pybamm-team…
valentinsulzer Sep 6, 2019
004ae59
#546 editing README
valentinsulzer Sep 12, 2019
0aa7dd4
#546 merge master
valentinsulzer Sep 12, 2019
7475fa3
#546 update readme
valentinsulzer Sep 12, 2019
3039961
#546 renaming and labelling changes
valentinsulzer Sep 12, 2019
2ca4ab7
#546 cleaning up
valentinsulzer Sep 12, 2019
ca19833
#546 merge master
valentinsulzer Sep 13, 2019
b057a35
Merge branch 'issue-546-convection' of https://github.com/pybamm-team…
valentinsulzer Sep 24, 2019
3f5db34
#546 merge master
valentinsulzer Sep 24, 2019
73b1d76
#546 more merges
valentinsulzer Sep 25, 2019
c1ec330
#546 make discretised delta function dense
valentinsulzer Sep 25, 2019
107e627
#546 fix delta function
valentinsulzer Sep 26, 2019
b6188ce
#546 redo charge results with delta function
valentinsulzer Sep 26, 2019
01d3f94
#546 merge master
valentinsulzer Sep 26, 2019
392aa24
#546 merge master
valentinsulzer Dec 11, 2019
171de92
#546 fix import
valentinsulzer Dec 11, 2019
0606b24
#546 fix doc
valentinsulzer Dec 11, 2019
a68470e
#546 remove model
valentinsulzer Dec 12, 2019
6335ad3
#546 fix a few tests
valentinsulzer Dec 12, 2019
710b11e
Merge branch 'master' into issue-546-convection
valentinsulzer Dec 12, 2019
c1d9c62
#546 still fixing tests
valentinsulzer Dec 12, 2019
464e86c
move thesis results to separate repository
valentinsulzer Dec 12, 2019
755857e
#546 merge master
valentinsulzer Dec 13, 2019
3855d0e
#546 merge master
valentinsulzer Feb 5, 2020
d71cd6b
#546 merge develop
valentinsulzer Mar 28, 2020
6500ac9
#546 merge #923
valentinsulzer Mar 28, 2020
20b9815
#546 fix tests locally
valentinsulzer Mar 29, 2020
50c4f8c
#546 fix integration tests
valentinsulzer Mar 29, 2020
6f454f2
#546 merge develop
valentinsulzer Mar 30, 2020
90e15d5
Merge branch 'issue-923-reformat-electrolyte' into issue-546-convection
valentinsulzer Mar 31, 2020
9508f6b
Merge branch 'issue-923-reformat-electrolyte' into issue-546-convection
valentinsulzer Apr 5, 2020
8da375b
Merge branch 'develop' into issue-546-convection
valentinsulzer Apr 6, 2020
ce41f00
#546 remove macinnes_tplus
valentinsulzer Apr 6, 2020
85bc1fa
#546 remove levenshtein
valentinsulzer Apr 6, 2020
3bf83df
#546 changelog
valentinsulzer Apr 6, 2020
1302684
#546 rob comments
valentinsulzer Apr 8, 2020
1fcbd4e
#546 fix tests, clean up convection
valentinsulzer Apr 9, 2020
91a3a7b
#546 merge develop
valentinsulzer Apr 9, 2020
db1ba9d
#546 remove thermal cc
valentinsulzer Apr 9, 2020
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
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@
## Bug fixes

- Reformatted electrolyte submodels ([#927](https://github.com/pybamm-team/PyBaMM/pull/927))
- Reformatted convection submodels ([#635](https://github.com/pybamm-team/PyBaMM/pull/635))

# [v0.2.1](https://github.com/pybamm-team/PyBaMM/tree/v0.2.1) - 2020-03-31

Expand Down
5 changes: 2 additions & 3 deletions docs/source/models/submodels/convection/base_convection.rst
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
Base Model
===========
Base Convection
===============

.. autoclass:: pybamm.convection.BaseModel
:members:

This file was deleted.

5 changes: 0 additions & 5 deletions docs/source/models/submodels/convection/full_convection.rst

This file was deleted.

11 changes: 6 additions & 5 deletions docs/source/models/submodels/convection/index.rst
Original file line number Diff line number Diff line change
@@ -1,12 +1,13 @@
Convection
==========

The convection submodels are split up into "through-cell", which is the x-direction
problem in the electrode domains, and "transverse", which is the z-direction problem in the
separator domain

.. toctree::
:maxdepth: 1

base_convection
no_convection
leading_convection
composite_convection
full_convection

through_cell/index
transverse/index

This file was deleted.

5 changes: 0 additions & 5 deletions docs/source/models/submodels/convection/no_convection.rst

This file was deleted.

Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
Base Model
===========

.. autoclass:: pybamm.convection.through_cell.BaseThroughCellModel
:members:
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
Leading-Order Through-cell Model
================================

.. autoclass:: pybamm.convection.through_cell.Explicit
:members:
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
Full Through-cell Model
=======================

.. autoclass:: pybamm.convection.through_cell.Full
:members:
10 changes: 10 additions & 0 deletions docs/source/models/submodels/convection/through_cell/index.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
Through-cell Convection
=======================

.. toctree::
:maxdepth: 1

base_through_cell_convection
no_convection
explicit_convection
full_convection
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
No Convection
=============

.. autoclass:: pybamm.convection.through_cell.NoConvection
:members:
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
Base Model
===========

.. autoclass:: pybamm.convection.transverse.BaseTransverseModel
:members:
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
Full Transverse Convection
==========================

.. autoclass:: pybamm.convection.transverse.Full
:members:
10 changes: 10 additions & 0 deletions docs/source/models/submodels/convection/transverse/index.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
Transverse Convection
=====================

.. toctree::
:maxdepth: 1

base_transverse_convection
no_convection
uniform_convection
full_convection
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
No Transverse Convection
========================

.. autoclass:: pybamm.convection.transverse.NoConvection
:members:
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
Uniform Transverse Model
========================

.. autoclass:: pybamm.convection.transverse.Uniform
:members:
2 changes: 1 addition & 1 deletion examples/notebooks/change-input-current.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -335,4 +335,4 @@
},
"nbformat": 4,
"nbformat_minor": 2
}
}
2 changes: 1 addition & 1 deletion examples/notebooks/change-settings.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -287,7 +287,7 @@
},
{
"cell_type": "code",
"execution_count": 6,
"execution_count": 7,
"metadata": {},
"outputs": [
{
Expand Down
17 changes: 17 additions & 0 deletions examples/notebooks/compare-comsol-discharge-curve.ipynb

Large diffs are not rendered by default.

8 changes: 7 additions & 1 deletion examples/notebooks/models/SPM.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -582,7 +582,13 @@
"\t- Positive electrode interfacial current density [A.m-2]\n",
"\t- X-averaged positive electrode interfacial current density [A.m-2]\n",
"\t- Positive electrode interfacial current density per volume [A.m-3]\n",
"\t- X-averaged positive electrode interfacial current density per volume [A.m-3]\n",
"\t- X-averaged positive electrode interfacial current density per volume [A.m-3]\n"
]
},
{
"name": "stdout",
"output_type": "stream",
"text": [
"\t- X-averaged positive electrode total interfacial current density\n",
"\t- X-averaged positive electrode total interfacial current density [A.m-2]\n",
"\t- X-averaged positive electrode total interfacial current density per volume [A.m-3]\n",
Expand Down
29 changes: 28 additions & 1 deletion examples/notebooks/models/lead-acid.ipynb

Large diffs are not rendered by default.

Original file line number Diff line number Diff line change
Expand Up @@ -207,4 +207,4 @@
},
"nbformat": 4,
"nbformat_minor": 2
}
}
54 changes: 31 additions & 23 deletions examples/notebooks/using-submodels.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,26 @@
"cell_type": "code",
"execution_count": 2,
"metadata": {},
"outputs": [],
"outputs": [
{
"ename": "DomainError",
"evalue": "Primary broadcast from current collector domain must be to electrode\n or separator",
"output_type": "error",
"traceback": [
"\u001b[0;31m---------------------------------------------------------------------------\u001b[0m",
"\u001b[0;31mDomainError\u001b[0m Traceback (most recent call last)",
"\u001b[0;32m<ipython-input-2-64212570b990>\u001b[0m in \u001b[0;36m<module>\u001b[0;34m\u001b[0m\n\u001b[0;32m----> 1\u001b[0;31m \u001b[0mmodel\u001b[0m \u001b[0;34m=\u001b[0m \u001b[0mpybamm\u001b[0m\u001b[0;34m.\u001b[0m\u001b[0mlithium_ion\u001b[0m\u001b[0;34m.\u001b[0m\u001b[0mSPM\u001b[0m\u001b[0;34m(\u001b[0m\u001b[0;34m)\u001b[0m\u001b[0;34m\u001b[0m\u001b[0;34m\u001b[0m\u001b[0m\n\u001b[0m",
"\u001b[0;32m~/Documents/Energy_storage/PyBaMM/pybamm/models/full_battery_models/lithium_ion/spm.py\u001b[0m in \u001b[0;36m__init__\u001b[0;34m(self, options, name, build)\u001b[0m\n\u001b[1;32m 46\u001b[0m \u001b[0;34m\u001b[0m\u001b[0m\n\u001b[1;32m 47\u001b[0m \u001b[0;32mif\u001b[0m \u001b[0mbuild\u001b[0m\u001b[0;34m:\u001b[0m\u001b[0;34m\u001b[0m\u001b[0;34m\u001b[0m\u001b[0m\n\u001b[0;32m---> 48\u001b[0;31m \u001b[0mself\u001b[0m\u001b[0;34m.\u001b[0m\u001b[0mbuild_model\u001b[0m\u001b[0;34m(\u001b[0m\u001b[0;34m)\u001b[0m\u001b[0;34m\u001b[0m\u001b[0;34m\u001b[0m\u001b[0m\n\u001b[0m\u001b[1;32m 49\u001b[0m \u001b[0;34m\u001b[0m\u001b[0m\n\u001b[1;32m 50\u001b[0m \u001b[0;32mdef\u001b[0m \u001b[0mset_porosity_submodel\u001b[0m\u001b[0;34m(\u001b[0m\u001b[0mself\u001b[0m\u001b[0;34m)\u001b[0m\u001b[0;34m:\u001b[0m\u001b[0;34m\u001b[0m\u001b[0;34m\u001b[0m\u001b[0m\n",
"\u001b[0;32m~/Documents/Energy_storage/PyBaMM/pybamm/models/full_battery_models/base_battery_model.py\u001b[0m in \u001b[0;36mbuild_model\u001b[0;34m(self)\u001b[0m\n\u001b[1;32m 493\u001b[0m \u001b[0mself\u001b[0m\u001b[0;34m.\u001b[0m\u001b[0mbuild_fundamental_and_external\u001b[0m\u001b[0;34m(\u001b[0m\u001b[0;34m)\u001b[0m\u001b[0;34m\u001b[0m\u001b[0;34m\u001b[0m\u001b[0m\n\u001b[1;32m 494\u001b[0m \u001b[0;34m\u001b[0m\u001b[0m\n\u001b[0;32m--> 495\u001b[0;31m \u001b[0mself\u001b[0m\u001b[0;34m.\u001b[0m\u001b[0mbuild_coupled_variables\u001b[0m\u001b[0;34m(\u001b[0m\u001b[0;34m)\u001b[0m\u001b[0;34m\u001b[0m\u001b[0;34m\u001b[0m\u001b[0m\n\u001b[0m\u001b[1;32m 496\u001b[0m \u001b[0;34m\u001b[0m\u001b[0m\n\u001b[1;32m 497\u001b[0m \u001b[0mself\u001b[0m\u001b[0;34m.\u001b[0m\u001b[0mbuild_model_equations\u001b[0m\u001b[0;34m(\u001b[0m\u001b[0;34m)\u001b[0m\u001b[0;34m\u001b[0m\u001b[0;34m\u001b[0m\u001b[0m\n",
"\u001b[0;32m~/Documents/Energy_storage/PyBaMM/pybamm/models/full_battery_models/base_battery_model.py\u001b[0m in \u001b[0;36mbuild_coupled_variables\u001b[0;34m(self)\u001b[0m\n\u001b[1;32m 425\u001b[0m \u001b[0;32mtry\u001b[0m\u001b[0;34m:\u001b[0m\u001b[0;34m\u001b[0m\u001b[0;34m\u001b[0m\u001b[0m\n\u001b[1;32m 426\u001b[0m self.variables.update(\n\u001b[0;32m--> 427\u001b[0;31m \u001b[0msubmodel\u001b[0m\u001b[0;34m.\u001b[0m\u001b[0mget_coupled_variables\u001b[0m\u001b[0;34m(\u001b[0m\u001b[0mself\u001b[0m\u001b[0;34m.\u001b[0m\u001b[0mvariables\u001b[0m\u001b[0;34m)\u001b[0m\u001b[0;34m\u001b[0m\u001b[0;34m\u001b[0m\u001b[0m\n\u001b[0m\u001b[1;32m 428\u001b[0m )\n\u001b[1;32m 429\u001b[0m \u001b[0msubmodels\u001b[0m\u001b[0;34m.\u001b[0m\u001b[0mremove\u001b[0m\u001b[0;34m(\u001b[0m\u001b[0msubmodel_name\u001b[0m\u001b[0;34m)\u001b[0m\u001b[0;34m\u001b[0m\u001b[0;34m\u001b[0m\u001b[0m\n",
"\u001b[0;32m~/Documents/Energy_storage/PyBaMM/pybamm/models/submodels/particle/fickian/fickian_single_particle.py\u001b[0m in \u001b[0;36mget_coupled_variables\u001b[0;34m(self, variables)\u001b[0m\n\u001b[1;32m 44\u001b[0m T_k_xav = pybamm.PrimaryBroadcast(\n\u001b[1;32m 45\u001b[0m \u001b[0mvariables\u001b[0m\u001b[0;34m[\u001b[0m\u001b[0;34m\"X-averaged \"\u001b[0m \u001b[0;34m+\u001b[0m \u001b[0mself\u001b[0m\u001b[0;34m.\u001b[0m\u001b[0mdomain\u001b[0m\u001b[0;34m.\u001b[0m\u001b[0mlower\u001b[0m\u001b[0;34m(\u001b[0m\u001b[0;34m)\u001b[0m \u001b[0;34m+\u001b[0m \u001b[0;34m\" electrode temperature\"\u001b[0m\u001b[0;34m]\u001b[0m\u001b[0;34m,\u001b[0m\u001b[0;34m\u001b[0m\u001b[0;34m\u001b[0m\u001b[0m\n\u001b[0;32m---> 46\u001b[0;31m \u001b[0;34m[\u001b[0m\u001b[0mself\u001b[0m\u001b[0;34m.\u001b[0m\u001b[0mdomain\u001b[0m\u001b[0;34m.\u001b[0m\u001b[0mlower\u001b[0m\u001b[0;34m(\u001b[0m\u001b[0;34m)\u001b[0m \u001b[0;34m+\u001b[0m \u001b[0;34m\" particle\"\u001b[0m\u001b[0;34m]\u001b[0m\u001b[0;34m,\u001b[0m\u001b[0;34m\u001b[0m\u001b[0;34m\u001b[0m\u001b[0m\n\u001b[0m\u001b[1;32m 47\u001b[0m )\n\u001b[1;32m 48\u001b[0m \u001b[0mN_s_xav\u001b[0m \u001b[0;34m=\u001b[0m \u001b[0mself\u001b[0m\u001b[0;34m.\u001b[0m\u001b[0m_flux_law\u001b[0m\u001b[0;34m(\u001b[0m\u001b[0mc_s_xav\u001b[0m\u001b[0;34m,\u001b[0m \u001b[0mT_k_xav\u001b[0m\u001b[0;34m)\u001b[0m\u001b[0;34m\u001b[0m\u001b[0;34m\u001b[0m\u001b[0m\n",
"\u001b[0;32m~/Documents/Energy_storage/PyBaMM/pybamm/expression_tree/broadcasts.py\u001b[0m in \u001b[0;36m__init__\u001b[0;34m(self, child, broadcast_domain, name)\u001b[0m\n\u001b[1;32m 85\u001b[0m \u001b[0;34m\u001b[0m\u001b[0m\n\u001b[1;32m 86\u001b[0m \u001b[0;32mdef\u001b[0m \u001b[0m__init__\u001b[0m\u001b[0;34m(\u001b[0m\u001b[0mself\u001b[0m\u001b[0;34m,\u001b[0m \u001b[0mchild\u001b[0m\u001b[0;34m,\u001b[0m \u001b[0mbroadcast_domain\u001b[0m\u001b[0;34m,\u001b[0m \u001b[0mname\u001b[0m\u001b[0;34m=\u001b[0m\u001b[0;32mNone\u001b[0m\u001b[0;34m)\u001b[0m\u001b[0;34m:\u001b[0m\u001b[0;34m\u001b[0m\u001b[0;34m\u001b[0m\u001b[0m\n\u001b[0;32m---> 87\u001b[0;31m \u001b[0msuper\u001b[0m\u001b[0;34m(\u001b[0m\u001b[0;34m)\u001b[0m\u001b[0;34m.\u001b[0m\u001b[0m__init__\u001b[0m\u001b[0;34m(\u001b[0m\u001b[0mchild\u001b[0m\u001b[0;34m,\u001b[0m \u001b[0mbroadcast_domain\u001b[0m\u001b[0;34m,\u001b[0m \u001b[0mbroadcast_type\u001b[0m\u001b[0;34m=\u001b[0m\u001b[0;34m\"primary\"\u001b[0m\u001b[0;34m,\u001b[0m \u001b[0mname\u001b[0m\u001b[0;34m=\u001b[0m\u001b[0mname\u001b[0m\u001b[0;34m)\u001b[0m\u001b[0;34m\u001b[0m\u001b[0;34m\u001b[0m\u001b[0m\n\u001b[0m\u001b[1;32m 88\u001b[0m \u001b[0;34m\u001b[0m\u001b[0m\n\u001b[1;32m 89\u001b[0m def check_and_set_domains(\n",
"\u001b[0;32m~/Documents/Energy_storage/PyBaMM/pybamm/expression_tree/broadcasts.py\u001b[0m in \u001b[0;36m__init__\u001b[0;34m(self, child, broadcast_domain, broadcast_auxiliary_domains, broadcast_type, name)\u001b[0m\n\u001b[1;32m 53\u001b[0m \u001b[0;31m# perform some basic checks and set attributes\u001b[0m\u001b[0;34m\u001b[0m\u001b[0;34m\u001b[0m\u001b[0;34m\u001b[0m\u001b[0m\n\u001b[1;32m 54\u001b[0m domain, auxiliary_domains = self.check_and_set_domains(\n\u001b[0;32m---> 55\u001b[0;31m \u001b[0mchild\u001b[0m\u001b[0;34m,\u001b[0m \u001b[0mbroadcast_type\u001b[0m\u001b[0;34m,\u001b[0m \u001b[0mbroadcast_domain\u001b[0m\u001b[0;34m,\u001b[0m \u001b[0mbroadcast_auxiliary_domains\u001b[0m\u001b[0;34m\u001b[0m\u001b[0;34m\u001b[0m\u001b[0m\n\u001b[0m\u001b[1;32m 56\u001b[0m )\n\u001b[1;32m 57\u001b[0m \u001b[0mself\u001b[0m\u001b[0;34m.\u001b[0m\u001b[0mbroadcast_type\u001b[0m \u001b[0;34m=\u001b[0m \u001b[0mbroadcast_type\u001b[0m\u001b[0;34m\u001b[0m\u001b[0;34m\u001b[0m\u001b[0m\n",
"\u001b[0;32m~/Documents/Energy_storage/PyBaMM/pybamm/expression_tree/broadcasts.py\u001b[0m in \u001b[0;36mcheck_and_set_domains\u001b[0;34m(self, child, broadcast_type, broadcast_domain, broadcast_auxiliary_domains)\u001b[0m\n\u001b[1;32m 102\u001b[0m raise pybamm.DomainError(\n\u001b[1;32m 103\u001b[0m \"\"\"Primary broadcast from current collector domain must be to electrode\n\u001b[0;32m--> 104\u001b[0;31m or separator\"\"\"\n\u001b[0m\u001b[1;32m 105\u001b[0m )\n\u001b[1;32m 106\u001b[0m elif child.domain[0] in [\n",
"\u001b[0;31mDomainError\u001b[0m: Primary broadcast from current collector domain must be to electrode\n or separator"
]
}
],
"source": [
"model = pybamm.lithium_ion.SPM()"
]
Expand All @@ -54,7 +73,7 @@
},
{
"cell_type": "code",
"execution_count": 3,
"execution_count": null,
"metadata": {},
"outputs": [
{
Expand Down Expand Up @@ -93,7 +112,7 @@
},
{
"cell_type": "code",
"execution_count": 4,
"execution_count": null,
"metadata": {},
"outputs": [],
"source": [
Expand All @@ -109,7 +128,7 @@
},
{
"cell_type": "code",
"execution_count": 5,
"execution_count": null,
"metadata": {},
"outputs": [],
"source": [
Expand All @@ -125,7 +144,7 @@
},
{
"cell_type": "code",
"execution_count": 6,
"execution_count": null,
"metadata": {},
"outputs": [
{
Expand Down Expand Up @@ -164,20 +183,9 @@
},
{
"cell_type": "code",
"execution_count": 7,
"execution_count": null,
"metadata": {},
"outputs": [
{
"data": {
"text/plain": [
"{}"
]
},
"execution_count": 7,
"metadata": {},
"output_type": "execute_result"
}
],
"outputs": [],
"source": [
"model.rhs"
]
Expand All @@ -191,7 +199,7 @@
},
{
"cell_type": "code",
"execution_count": 8,
"execution_count": null,
"metadata": {},
"outputs": [],
"source": [
Expand All @@ -207,7 +215,7 @@
},
{
"cell_type": "code",
"execution_count": 9,
"execution_count": null,
"metadata": {},
"outputs": [
{
Expand Down Expand Up @@ -236,7 +244,7 @@
},
{
"cell_type": "code",
"execution_count": 10,
"execution_count": null,
"metadata": {},
"outputs": [
{
Expand Down Expand Up @@ -294,7 +302,7 @@
},
{
"cell_type": "code",
"execution_count": 11,
"execution_count": null,
"metadata": {},
"outputs": [],
"source": [
Expand All @@ -312,7 +320,7 @@
},
{
"cell_type": "code",
"execution_count": 12,
"execution_count": null,
"metadata": {},
"outputs": [],
"source": [
Expand Down
11 changes: 10 additions & 1 deletion pybamm/expression_tree/unary_operators.py
Original file line number Diff line number Diff line change
Expand Up @@ -663,7 +663,7 @@ def __init__(self, child, side, domain):
auxiliary_domains = {"secondary": child.domain}
else:
auxiliary_domains = {}
super().__init__("delta function", child, domain, auxiliary_domains)
super().__init__("delta_function", child, domain, auxiliary_domains)

def set_id(self):
""" See :meth:`pybamm.Symbol.set_id()` """
Expand All @@ -685,6 +685,15 @@ def _unary_new_copy(self, child):
""" See :meth:`UnaryOperator._unary_new_copy()`. """
return self.__class__(child, self.side, self.domain)

def evaluate_for_shape(self):
"""
See :meth:`pybamm.Symbol.evaluate_for_shape_using_domain()`
"""
child_eval = self.children[0].evaluate_for_shape()
vec = pybamm.evaluate_for_shape_using_domain(self.domain)

return np.outer(child_eval, vec).reshape(-1, 1)


class BoundaryOperator(SpatialOperator):
"""A node in the expression tree which gets the boundary value of a variable.
Expand Down
Loading