Skip to content

Added highly stable BCs to handle curved stationary and moving boundaries. #129

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

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

hsalehipour
Copy link
Collaborator

Contributing Guidelines

Description

Added new hybrid methods to handle curved stationary and moving boundaries that proves to be highly stable at extremely high Reynolds numbers. This PR also adds 3 methods of voxelizing mesh files which may also return distance to the mesh. The mesh distance is used in hybridBC class and can be toggled on/off by the user when creating the BC objects.

Other notatble changes include:

  • Added neumaier summation to zero and first moment to avoid rounding error accumulation
  • Added some useful utility functions.
  • renamed the preparation step of Outflow Extrap BC to be more descriptive and different from auxiliary wording

Type of change

  • Bug fix (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)
  • Documentation update

How Has This Been Tested?

  • All pytest tests pass

Linting and Code Formatting

Make sure the code follows the project's linting and formatting standards. This project uses Ruff for linting.

To run Ruff, execute the following command from the root of the repository:

ruff check .
  • Ruff passes

@hsalehipour hsalehipour requested a review from mehdiataei May 27, 2025 18:28
@mehdiataei
Copy link
Contributor

mehdiataei commented May 27, 2025

Thanks for the PR. @hsalehipour Salehipour I have started looking at the code. Before I put detailed comments, let's start with a couple of things that I think look structurally odd:

  1. It’s unclear why we need to pass f0 and f1 to mesh_boundary_masker. This could limit the function’s generality for other cases (e.g., thermal problems or single/multiple population scenarios in the future). The file is also getting quite large and difficult to follow. I suggest inheriting from the class and creating a separate version tailored to this hybridBC. A single boundary condition shouldn’t fundamentally alter how a basic masking operation is performed. If this kind of functionality is required, it should be encapsulated in its own class. I recommend creating a new class and adding the other kernels related to this specific BC there.

  2. # Currently we support three methods based on (a) aabb method (b) ray casting and (c) winding number.

Do we really need all of these? Can you retain only the most robust one for this BC? I understand these were implemented during BC development, but I don’t think we need to keep them all unless there’s a clear justification and example illustrating the necessity of each. Otherwise, it just makes the library more confusing for users.

@mehdiataei
Copy link
Contributor

@hsalehipour Notes from our conversation:

It would be nice to receive a single "distances" buffer instead of f_1, f_0 (but with the same cardinality) and use that in the kernels. In practice this will be one of the buffers such as f_1, but the function itself is not only useful for two pop examples.

@hsalehipour hsalehipour force-pushed the hybridBC_merge_main branch from a800fb0 to 26d1411 Compare May 30, 2025 22:24
@hsalehipour
Copy link
Collaborator Author

Considering all these comments, I improved the mesh masker substantially. Please take another look

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.

2 participants