Skip to content

Time dependent temperature#620

Merged
RemDelaporteMathurin merged 29 commits into
festim-dev:fenicsxfrom
jhdark:temperature_as_callable
Nov 1, 2023
Merged

Time dependent temperature#620
RemDelaporteMathurin merged 29 commits into
festim-dev:fenicsxfrom
jhdark:temperature_as_callable

Conversation

@jhdark
Copy link
Copy Markdown
Collaborator

@jhdark jhdark commented Oct 30, 2023

Proposed changes

This update would allow users to define temperature using a callable meaning the temperature can be a function of space or time. When a time_dependent temperature function is given, an attribute temperature_time_dependent is then True, which will then update the temperature function at each time step.

Usage:

my_model.temperature = lambda t: 1.0 + t

or

def temperature_function(t):
    return 1.0 + t


my_model.temperature = temperature_function

Types of changes

What types of changes does your code introduce to FESTIM?

  • Bugfix (non-breaking change which fixes an issue)
  • New feature (non-breaking change which adds functionality)
  • Breaking change (fix or feature that would cause existing functionality to not work as expected)
  • Code refactoring
  • Documentation Update (if none of the other choices apply)
  • New tests

Checklist

  • Black formatted
  • Unit tests pass locally with my changes
  • I have added tests that prove my fix is effective or that my feature works
  • I have added necessary documentation (if appropriate)

Further comments

If this is a relatively large or complex change, kick off the discussion by explaining why you chose the solution you did and what alternatives you considered, etc...

@jhdark jhdark added enhancement New feature or request fenicsx Issue that is related to the fenicsx support labels Oct 30, 2023
@codecov
Copy link
Copy Markdown

codecov Bot commented Oct 30, 2023

Codecov Report

Attention: 1 lines in your changes are missing coverage. Please review.

Comparison is base (2af2937) 98.18% compared to head (b92b827) 98.19%.

Additional details and impacted files
@@           Coverage Diff            @@
##           fenicsx     #620   +/-   ##
========================================
  Coverage    98.18%   98.19%           
========================================
  Files           16       16           
  Lines          552      610   +58     
========================================
+ Hits           542      599   +57     
- Misses          10       11    +1     
Files Coverage Δ
festim/hydrogen_transport_problem.py 99.20% <98.36%> (-0.28%) ⬇️

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

Copy link
Copy Markdown
Collaborator

@RemDelaporteMathurin RemDelaporteMathurin left a comment

Choose a reason for hiding this comment

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

Looks great. First round of comments to improve things

Comment thread festim/hydrogen_transport_problem.py Outdated
Comment thread festim/hydrogen_transport_problem.py Outdated
Comment thread festim/hydrogen_transport_problem.py
Comment thread festim/hydrogen_transport_problem.py Outdated
Comment thread festim/hydrogen_transport_problem.py Outdated
Comment thread festim/hydrogen_transport_problem.py Outdated
Comment thread test/test_temperature.py Outdated
Comment thread test/test_temperature.py Outdated
Comment thread test/test_temperature.py Outdated
Comment thread test/test_temperature.py Outdated
@RemDelaporteMathurin RemDelaporteMathurin changed the title Temperature as callable Time dependent Oct 30, 2023
@RemDelaporteMathurin RemDelaporteMathurin changed the title Time dependent Time dependent temperature Oct 31, 2023
This was referenced Oct 31, 2023
Comment thread festim/hydrogen_transport_problem.py Outdated
Comment thread festim/hydrogen_transport_problem.py Outdated
Comment thread festim/hydrogen_transport_problem.py
Comment thread festim/hydrogen_transport_problem.py
Comment thread festim/hydrogen_transport_problem.py Outdated
Comment thread festim/hydrogen_transport_problem.py Outdated
Comment thread festim/hydrogen_transport_problem.py
Comment thread festim/hydrogen_transport_problem.py Outdated
Comment thread test/test_temperature.py Outdated
Comment thread test/test_temperature.py Outdated
Copy link
Copy Markdown
Collaborator

@RemDelaporteMathurin RemDelaporteMathurin left a comment

Choose a reason for hiding this comment

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

Happy to merge this!

Comment thread test/test_h_transport_problem.py Outdated
Comment thread test/test_h_transport_problem.py Outdated
jhdark and others added 2 commits November 1, 2023 16:18
Co-authored-by: Rémi Delaporte-Mathurin <40028739+RemDelaporteMathurin@users.noreply.github.com>
@RemDelaporteMathurin RemDelaporteMathurin merged commit 1dbe47d into festim-dev:fenicsx Nov 1, 2023
@jhdark jhdark deleted the temperature_as_callable branch November 14, 2023 18:18
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

enhancement New feature or request fenicsx Issue that is related to the fenicsx support

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants