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

Average surface and volume derived quantities in Cylindrical and Spherical #820

Merged
merged 31 commits into from
Jan 14, 2025

Conversation

jhdark
Copy link
Collaborator

@jhdark jhdark commented Jul 26, 2024

Proposed changes

With these new exports, users can take results from 1/2D simulations and extrapolate them for cylindrical and spherical cases.

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

Copy link

codecov bot commented Jul 26, 2024

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 99.27%. Comparing base (8d6857b) to head (10fc3b0).
Report is 37 commits behind head on main.

Additional details and impacted files
@@            Coverage Diff             @@
##             main     #820      +/-   ##
==========================================
- Coverage   99.27%   99.27%   -0.01%     
==========================================
  Files          60       60              
  Lines        2753     2744       -9     
==========================================
- Hits         2733     2724       -9     
  Misses         20       20              

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

@RemDelaporteMathurin RemDelaporteMathurin added the enhancement New feature or request label Jul 29, 2024
@jhdark jhdark marked this pull request as ready for review August 5, 2024 14:05
Copy link
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.

Here are a few comments.

On a side note, this makes me think we should try and test for cases where the surface varies in both $r$ and $z$. Like this:

image

Comment on lines 140 to 142
# dV_z = r dr dtheta , assuming axisymmetry dV_z = theta r dr
# dV_r = r dz dtheta , assuming axisymmetry dV_r = theta r dz
# in both cases the expression with self.dx is the same
Copy link
Collaborator

Choose a reason for hiding this comment

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

Not true for spherical, please adapt

festim/exports/derived_quantities/average_surface.py Outdated Show resolved Hide resolved

my_export = AverageVolumeSpherical("solute", 1)
V = f.FunctionSpace(mesh_fenics, "P", 1)
c_fun = lambda r: c_left + (c_right - c_left) / (r1 - r0) * r
Copy link
Collaborator

Choose a reason for hiding this comment

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

Just noting that $c$ is not equal to $c_\mathrm{right}$ with this expression (replace $r$ by $r1$)

Copy link
Collaborator

Choose a reason for hiding this comment

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

I don't understand why this tests passes, please consider the above comment

jhdark and others added 2 commits January 10, 2025 14:41
Co-authored-by: Rémi Delaporte-Mathurin <40028739+RemDelaporteMathurin@users.noreply.github.com>
@jhdark jhdark merged commit 95cfdd2 into festim-dev:main Jan 14, 2025
6 checks passed
@jhdark jhdark deleted the cyl_and_sph_avg_quantities branch January 14, 2025 16:39
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants