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 579 volume fractions #726

Merged
merged 12 commits into from
Nov 13, 2019

Conversation

valentinsulzer
Copy link
Member

Description

Add tortuosity submodels, and add active/inactive material volume fractions

Fixes #579
Fixes #648

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.

  • 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

@valentinsulzer valentinsulzer changed the base branch from master to issue-699-remove-autograd November 13, 2019 00:51
@codecov
Copy link

codecov bot commented Nov 13, 2019

Codecov Report

❗ No coverage uploaded for pull request base (issue-699-remove-autograd@1ae2106). Click here to learn what that means.
The diff coverage is 100%.

Impacted file tree graph

@@                     Coverage Diff                      @@
##             issue-699-remove-autograd     #726   +/-   ##
============================================================
  Coverage                             ?   98.15%           
============================================================
  Files                                ?      175           
  Lines                                ?     9264           
  Branches                             ?        0           
============================================================
  Hits                                 ?     9093           
  Misses                               ?      171           
  Partials                             ?        0
Impacted Files Coverage Δ
...amm/models/submodels/tortuosity/base_tortuosity.py 100% <100%> (ø)
...bamm/models/full_battery_models/lithium_ion/dfn.py 100% <100%> (ø)
...m/models/full_battery_models/base_battery_model.py 99.62% <100%> (ø)
pybamm/models/submodels/tortuosity/__init__.py 100% <100%> (ø)
pybamm/models/submodels/base_submodel.py 100% <100%> (ø)
...ybamm/models/full_battery_models/lead_acid/loqs.py 100% <100%> (ø)
...odels/submodels/tortuosity/bruggeman_tortuosity.py 100% <100%> (ø)
...ybamm/models/full_battery_models/lead_acid/full.py 100% <100%> (ø)
pybamm/parameters/geometric_parameters.py 100% <100%> (ø)
...bamm/parameters/standard_parameters_lithium_ion.py 100% <100%> (ø)
... and 21 more

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 1ae2106...c200a41. 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.

This looks great tino cheers

Copy link
Contributor

@rtimms rtimms left a comment

Choose a reason for hiding this comment

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

thanks @tinosulzer looks great! just a comment on naming... I think tortuosity is defined so that e.g. D_eff = (eps/tau)D where eps is the porosity and tau is the tortuosity. Maybe the naming is ok or there is some other standard name for the correction factor for the effective properties?

Copy link
Sponsor Member

@brosaplanella brosaplanella left a comment

Choose a reason for hiding this comment

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

Thanks @tinosulzer, it looks great! Apart from the two minor comments below, I agree with Robert about the tortuosity definition. Personally, I prefer the mathematical definition you used because if we ever include anisotropy and allow that factor to be a tensor then the tortuosity would require to invert the tensor, which is not ideal. In addition, when you homogenise, the factor/tensor appears multiplying. So I would suggest leaving the mathematical expressions as they are but calling them something else to not confuse people. I don't know if there is an agreed term in the literature, I can ask James LeHoux from Southampton who did a quite thorough literature review on the topic.


eps_n, eps_s, eps_p = eps.orphans
tor = pybamm.Concatenation(
eps_n ** param.b_n, eps_s ** param.b_s, eps_p ** param.b_p
Copy link
Sponsor Member

Choose a reason for hiding this comment

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

If I understand it correctly, here all the parameters param.b_j are the same for electrode and electrolyte in a given part. I think that is not necessarily true because the geometry that defines the tortuosity is quite different between the electrode and electrolyte. Would it be possible to pass each b_j as an argument when you call a Bruggeman tortuosity model?

Copy link
Member Author

Choose a reason for hiding this comment

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

Would it just be a case of having a different parameter for electrolyte and solid?

Copy link
Sponsor Member

Choose a reason for hiding this comment

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

Yes. Also, they could be different for different transport phenomena in the same domain. Right now it is not a problem as we only need one number for electrode and one for electrolyte, but later on we might need more.

@@ -277,6 +277,11 @@ def U_p_dimensional(sto, T):
pybamm.FullBroadcast(epsilon_s, ["separator"], "current collector"),
pybamm.FullBroadcast(epsilon_p, ["positive electrode"], "current collector"),
)
epsilon_s_n = pybamm.Parameter("Negative electrode active material volume fraction")
epsilon_s_p = pybamm.Parameter("Positive electrode active material volume fraction")
epsilon_binder_n = 1 - epsilon_n - epsilon_s_n
Copy link
Sponsor Member

Choose a reason for hiding this comment

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

Minor point: it might be more accurate to call it epsilon_inactive_n.

@TomTranter
Copy link
Contributor

Tortuosity is a mess in terms of a consistent definition in the literature. This paper explains a common misinterpretation and distinguishes between tortuosity being the ratio of the diffusion path length and domain length and tortuosity factor being this ratio squared. http://www.sciencedirect.com/science/article/pii/0009250989850535
There are a bunch of alternatives to Bruggeman which was derived for sphere packs explored here
https://www.sciencedirect.com/science/article/pii/S0009250907003144
And also I have published a few papers on tortuosity. One was extracted from experimental data using a transient diffusion method and you have to be careful as Fick's second law has a porosity terms on both sides of the equation so effective diffusivity is dependent on tortuosity alone. http://linkinghub.elsevier.com/retrieve/pii/S0017931016328174 and also I wrote a python package to calculate the tortuosity from a tomography image called pytrax that uses random walks. The definition of tortuosity used here is the ratio of the mean square displacement with time. It is 1 in open space and proportional to 1/tortuosity in porous media https://doi.org/10.1016/j.softx.2019.100277 The theory for that is well explained in this ref https://www.jstage.jst.go.jp/article/jagh1987/43/1/43_13/_article

@valentinsulzer
Copy link
Member Author

Thanks Tom for the info. It sounds like there are lots of different options and it would be interesting to implement a few and compare their impact on the DFN (at the low C-rates we have been considering so far electrolyte diffusion is a higher order effect, but it could play a big role if we start to consider higher C rates).
For this particular issue I'm just going to focus on getting the framework in place to allow adding more submodels. What would you suggest calling these submodels (and corresponding variables) instead of "tortuosity"? Maybe "effective transport factor"?

@TomTranter
Copy link
Contributor

TomTranter commented Nov 13, 2019 via email

@valentinsulzer valentinsulzer merged commit 13a8621 into issue-699-remove-autograd Nov 13, 2019
@valentinsulzer valentinsulzer deleted the issue-579-volume-fractions branch November 13, 2019 21:54
@valentinsulzer valentinsulzer restored the issue-579-volume-fractions branch November 13, 2019 21:56
@valentinsulzer valentinsulzer deleted the issue-579-volume-fractions branch November 13, 2019 21:56
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.

None yet

5 participants