-
Notifications
You must be signed in to change notification settings - Fork 25
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
Coupled transient heat transfer and hydrogen transport models #948
base: fenicsx
Are you sure you want to change the base?
Conversation
Codecov ReportAll modified and coverable lines are covered by tests ✅
Additional details and impacted files@@ Coverage Diff @@
## fenicsx #948 +/- ##
===========================================
+ Coverage 96.02% 96.13% +0.11%
===========================================
Files 45 46 +1
Lines 2490 2564 +74
===========================================
+ Hits 2391 2465 +74
Misses 99 99 ☔ View full report in Codecov by Sentry. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
first pass on my side
from festim.problem_change_of_var import HydrogenTransportProblemDiscontinuousChangeVar | ||
|
||
|
||
class CoupledtTransientHeatTransferHydrogenTransport: |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
class CoupledtTransientHeatTransferHydrogenTransport: | |
class CoupledTransientHeatTransferHydrogenTransport: |
exact_mobile_intial_cond = lambda x: 2 * x[0] ** 2 | ||
exact_trapped_intial_cond = lambda x: 4 * x[0] ** 2 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
exact_mobile_intial_cond = lambda x: 2 * x[0] ** 2 | |
exact_trapped_intial_cond = lambda x: 4 * x[0] ** 2 | |
exact_mobile_intial_cond = lambda x: exact_mobile_solution(x, t=0) | |
exact_trapped_intial_cond = lambda x: exact_trapped_solution(x, t=0) |
trapped_computed = test_trapped.post_processing_solution | ||
|
||
exact_T = lambda x: 3 * x[0] ** 2 + 10 * final_time | ||
exact_mobile = lambda x: 2 * x[0] ** 2 + 15 * final_time |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
exact_mobile = lambda x: 2 * x[0] ** 2 + 15 * final_time | |
exact_mobile = lambda x: exact_mobile_solution(x, t=final_time) |
same for the two others
L2_error_mobile = error_L2(mobile_computed, exact_mobile) | ||
L2_error_trapped = error_L2(trapped_computed, exact_trapped) | ||
|
||
# TEST ensure L2 error below 2e07 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
# TEST ensure L2 error below 2e07 | |
# TEST ensure L2 error below 2e-7 |
test_coupled_problem.initialise() | ||
test_coupled_problem.run() | ||
|
||
assert np.isclose(test_coupled_problem.hydrogen_problem.u.x.array[-1], 65) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Could we test the whole function by computing a global error?
Proposed changes
fix for #945
With this update, users can run coupled transient heat transfer and hydrogen transport simulations
This PR introduces a new class:
CoupledHeatTransferHydrogenTransport
which takes arguments of aheat_problem
and ahydrogen_problem
.An example of how these changes would be used:
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...