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 548 variable bc #624

Merged
merged 51 commits into from
Oct 31, 2019
Merged

Issue 548 variable bc #624

merged 51 commits into from
Oct 31, 2019

Conversation

TomTranter
Copy link
Contributor

@TomTranter TomTranter commented Sep 18, 2019

Description

Changes to enable 1 plus 1d and updating state vector between time steps for coupling to pnm

Fixes #548

Type of change

Please delete options that are not relevant.

  • New feature (non-breaking change which adds functionality)

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
  • Any dependent changes have been merged and published in downstream modules

@codecov
Copy link

codecov bot commented Sep 18, 2019

Codecov Report

Merging #624 into master will increase coverage by 0.01%.
The diff coverage is 100%.

Impacted file tree graph

@@            Coverage Diff             @@
##           master     #624      +/-   ##
==========================================
+ Coverage    98.5%   98.52%   +0.01%     
==========================================
  Files         173      175       +2     
  Lines        8776     8861      +85     
==========================================
+ Hits         8645     8730      +85     
  Misses        131      131
Impacted Files Coverage Δ
...rrent_collector/quite_conductive_potential_pair.py 100% <ø> (ø) ⬆️
...mm/models/submodels/electrode/ohm/composite_ohm.py 100% <ø> (ø) ⬆️
...dels/submodels/current_collector/potential_pair.py 100% <ø> (ø) ⬆️
...dels/current_collector/composite_potential_pair.py 100% <ø> (ø) ⬆️
pybamm/models/submodels/thermal/base_thermal.py 95.58% <ø> (ø) ⬆️
...ls/thermal/x_lumped/x_lumped_1D_set_temperature.py 100% <100%> (ø)
...amm/models/submodels/current_collector/__init__.py 100% <100%> (ø) ⬆️
...bamm/models/submodels/electrode/ohm/leading_ohm.py 96.96% <100%> (ø) ⬆️
...m/models/full_battery_models/base_battery_model.py 99.62% <100%> (+0.02%) ⬆️
...ybamm/models/submodels/electrode/base_electrode.py 97.5% <100%> (-0.07%) ⬇️
... and 7 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 3676ad0...bb99874. Read the comment docs.

@valentinsulzer
Copy link
Member

does this also have changes from another branch?

Copy link
Member

@valentinsulzer valentinsulzer 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. Setting d/dt = 0 is a bit ugly and possibly susceptible to drift but done is better than working for now :)

@@ -230,6 +237,25 @@ def options(self, extra_options):
raise pybamm.OptionError(
"thermal effects not implemented for lead-acid models"
)
if options[
"current collector"
] == "single particle potenetial pair" and not isinstance(
Copy link
Member

Choose a reason for hiding this comment

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

Suggested change
] == "single particle potenetial pair" and not isinstance(
] == "single particle potential pair" and not isinstance(

Copy link
Member

Choose a reason for hiding this comment

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

not sure why this didn't fail any tests

+ delta_phi_s_p_av
- delta_phi_s_n_av
)
self.algebraic = {i_boundary_cc: v_boundary_cc - local_voltage_expression}
Copy link
Member

Choose a reason for hiding this comment

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

shouldn't local_voltage_expression already be in the variables dict (so you don't have to redefine it, introducing potential for a different definition here and in the SPMe class)?

phi_s_cn: pybamm.Scalar(0),
phi_s_cp: param.U_p(param.c_p_init, param.T_ref)
- param.U_n(param.c_n_init, param.T_ref),
i_boundary_cc: applied_current / param.l_y / param.l_z,
Copy link
Member

Choose a reason for hiding this comment

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

is this the right initial condition for a 1+1D model

solution1.t,
solution1.y,
mesh=mesh,
)
Copy link
Member

Choose a reason for hiding this comment

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

you could use the helper function "post_process_variables" here

@rtimms rtimms merged commit 3a94d94 into master Oct 31, 2019
@rtimms rtimms deleted the issue-548-variableBC branch October 31, 2019 09:19
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.

variable as BC
3 participants