festim-dev / FESTIM

Coupled hydrogen/tritium transport and heat transfer modelling using FEniCS
https://festim.readthedocs.io/en/stable/
Apache License 2.0
78 stars 16 forks source link

IC improvements for Heat Transfer #774

Closed RemDelaporteMathurin closed 1 month ago

RemDelaporteMathurin commented 1 month ago

Proposed changes

Currently when running a transient Heat Transfer problem, an initial condition is required. The process is a bit cumbersome as if users just want to initialise the temperature to say 300 K then they have to

This PR simplifies the process. Now users can simply give a float, int or sympy Expression as the initial_condition argument. If users want to give a initial condition from XDMF then the process is unchanged.

Moreover, this adds an error when transient heat transfer sims are run without giving an IC.

Documentation was also updated as the confusion was first reported here.

Types of changes

What types of changes does your code introduce to FESTIM?

Checklist

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...

codecov[bot] commented 1 month ago

Codecov Report

All modified and coverable lines are covered by tests :white_check_mark:

Project coverage is 99.51%. Comparing base (217dc15) to head (82509da).

Additional details and impacted files ```diff @@ Coverage Diff @@ ## main #774 +/- ## ======================================= Coverage 99.51% 99.51% ======================================= Files 58 58 Lines 2478 2488 +10 ======================================= + Hits 2466 2476 +10 Misses 12 12 ```

:umbrella: View full report in Codecov by Sentry.
:loudspeaker: Have feedback on the report? Share it here.

KulaginVladimir commented 1 month ago

@RemDelaporteMathurin Looks good to me. I also got a bit tired of using InitialCondition with a constant initial temperature.

Just two unnecessary moments