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 802 porosity #809

Merged
merged 2 commits into from
Feb 12, 2020
Merged

Issue 802 porosity #809

merged 2 commits into from
Feb 12, 2020

Conversation

valentinsulzer
Copy link
Member

Description

Allow porosity to vary in space

Fixes #802

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.

  • New feature (non-breaking change which adds functionality)
  • Optimization (back-end change that speeds up the code)
  • Bug fix (non-breaking change which fixes an issue)

Key checklist:

  • No style issues: $ flake8
  • All tests pass: $ python run-tests.py --unit
  • The documentation builds: $ cd docs and then $ make clean; make html

You can run all three at once, using $ python run-tests.py --quick.

Further checks:

  • Code is commented, particularly in hard-to-understand areas
  • Tests added that prove fix is effective or that feature works

@codecov
Copy link

codecov bot commented Feb 7, 2020

Codecov Report

Merging #809 into master will not change coverage.
The diff coverage is 100%.

Impacted file tree graph

@@           Coverage Diff           @@
##           master     #809   +/-   ##
=======================================
  Coverage   98.14%   98.14%           
=======================================
  Files         179      179           
  Lines        9919     9919           
=======================================
  Hits         9735     9735           
  Misses        184      184
Impacted Files Coverage Δ
...amm/models/submodels/porosity/constant_porosity.py 100% <100%> (ø) ⬆️
...odels/full_battery_models/lithium_ion/basic_dfn.py 100% <100%> (ø) ⬆️
...bamm/parameters/standard_parameters_lithium_ion.py 100% <100%> (ø) ⬆️
pybamm/expression_tree/concatenations.py 97.98% <100%> (+0.02%) ⬆️

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 8f417cb...e07b0c4. Read the comment docs.

Copy link
Contributor

@Scottmar93 Scottmar93 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good

eps_s = pybamm.PrimaryBroadcast(param.epsilon_s, "separator")
eps_p = pybamm.PrimaryBroadcast(param.epsilon_p, "positive electrode")
eps_n = pybamm.PrimaryBroadcast(
pybamm.Parameter("Negative electrode porosity"), "negative electrode"
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Sort of feel we should be defining these parameters inside the standard parameter file? Maybe that conflicts with the spatially dependent ones though...

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I agree with Scott. It would be good to pass it as a function or dataset, as with other parameters.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

yeah, the problem is that param.epsilon_s now has domain "separator" and secondary domain "current collector", and so we would need to add "current collector" as a secondary domain to everything to avoid shape errors (tbh this should probably be automatic), and adding current collector to everything is unnecessarily complicated for this model

@valentinsulzer valentinsulzer merged commit bd3b2ef into master Feb 12, 2020
@valentinsulzer valentinsulzer deleted the issue-802-porosity branch February 12, 2020 17:57
@valentinsulzer valentinsulzer restored the issue-802-porosity branch February 12, 2020 17:58
@valentinsulzer valentinsulzer deleted the issue-802-porosity branch February 12, 2020 17:58
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Allow porosity to vary as function of x
3 participants