Skip to content

Issue 548 variable bc - #624

Merged
rtimms merged 51 commits into
masterfrom
issue-548-variableBC
Oct 31, 2019
Merged

Issue 548 variable bc#624
rtimms merged 51 commits into
masterfrom
issue-548-variableBC

Conversation

@TomTranter

@TomTranter TomTranter commented Sep 18, 2019

Copy link
Copy Markdown
Contributor

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

codecov Bot commented Sep 18, 2019

Copy link
Copy Markdown

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
Copy Markdown
Member

does this also have changes from another branch?

@valentinsulzer valentinsulzer left a comment

Copy link
Copy Markdown
Member

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 :)

)
if options[
"current collector"
] == "single particle potenetial pair" and not isinstance(

Copy link
Copy Markdown
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
Copy Markdown
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
Copy Markdown
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
Copy Markdown
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
Copy Markdown
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