Skip to content

[GSOC 2025] 3D FVM #5009

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

Draft
wants to merge 9 commits into
base: develop
Choose a base branch
from
Draft

[GSOC 2025] 3D FVM #5009

wants to merge 9 commits into from

Conversation

Rishab87
Copy link
Contributor

@Rishab87 Rishab87 commented May 9, 2025

Description

This PR will add a support for 3D FVM, 3D meshing along with a mesh generator with support for prismatic, spirally wound and cylindrical geometry

Its far away from done, drafting it for the reviews.

Fixes # (issue)

Type of change

Please add a line in the relevant section of CHANGELOG.md to document the change (include PR #)

Important checks:

Please confirm the following before marking the PR as ready for review:

  • No style issues: nox -s pre-commit
  • All tests pass: nox -s tests
  • The documentation builds: nox -s doctests
  • Code is commented for hard-to-understand areas
  • Tests added that prove fix is effective or that feature works

pyproject.toml Outdated
@@ -42,6 +42,7 @@ dependencies = [
"posthog",
"pyyaml",
"platformdirs",
"pygmsh>=7.1.11"
Copy link
Contributor

Choose a reason for hiding this comment

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

Since this is GPLv3, is there a different package that can be used instead?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

How about PyMesh, can we use that? It has MIT license I think.

Copy link
Contributor

Choose a reason for hiding this comment

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

looks like pymesh hasn't been updated in a long time. we already use scikit-fem for 2D finite elements and meshing -- do they support 3d?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

yeah they do, migrating to sickit-fem then

Copy link
Contributor

@rtimms rtimms left a comment

Choose a reason for hiding this comment

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

Looking good so far. Next steps are:

  1. Add an example of solving the 3D heat eqn in a jelly and prismatic domain, with different boundary conditions and a prescribed heat souce
  2. Add tests for the 3d finite volume methods (make sure things are discredited as expected, check simple problems are solved correctly). To help with this you can use the "method of manufactured solutions".

Once the mesh and method are tested for simple general equations we can start on the battery-specific parts of the project in a separate PR

@@ -234,7 +242,7 @@ def __init__(self, extra_options):
self.possible_options = {
"calculate discharge energy": ["false", "true"],
"calculate heat source for isothermal models": ["false", "true"],
"cell geometry": ["arbitrary", "pouch"],
"cell geometry": ["arbitrary", "pouch", "3D"],
Copy link
Contributor

Choose a reason for hiding this comment

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

I think here we should directly specify form factors rather than "3D", but that can come later once we have some built in geometries (pouch, jelly, prismatic)

@@ -224,6 +224,14 @@ class BatteryModelOptions(pybamm.FuzzyDict):
the respective porosity change) over the x-axis in Single Particle
Models, can be "false" or "true". Default is "false" for SPMe and
"true" for SPM.
* "geometry options" : dict
Copy link
Contributor

Choose a reason for hiding this comment

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

These should be specified separately from the model (certainly mesh size, the others might be infered from cell geometry)

from pybamm.models.submodels.thermal.base_thermal import BaseThermal


class FullThreeDimensional(BaseThermal):
Copy link
Contributor

Choose a reason for hiding this comment

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

can this be removed for now until everything else is set up and working?

@Rishab87 Rishab87 changed the title [GSOC 2025] Adding 3D Thermal Model with Two Way Coupling [GSOC 2025] 3D FVM May 27, 2025
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.

3 participants