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

Added abstraction layer for boundary condition application and stepper initialization, and the capability to add profiles to boundary conditions #86

Merged
merged 1 commit into from
Dec 5, 2024

Conversation

mehdiataei
Copy link
Contributor

@mehdiataei mehdiataei commented Oct 31, 2024

Contributing Guidelines

Description

  • Added abstraction layer for boundary condition efficient encoding/decoding of auxiliary data
  • Added the capability to add profiles to boundary conditions
  • Allows mesh boundary masker to be called in JAX as well.
  • Added abstraction layer to initialize fields and BCs inside stepper (Optionally called)
  • Fixes Non-uniform boundary velocity profile #74

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

@mehdiataei mehdiataei marked this pull request as ready for review October 31, 2024 16:56
@mehdiataei mehdiataei changed the title Profile inlet Added abstraction layer for boundary condition and the capability to add profiles to boundary conditions Oct 31, 2024
@mehdiataei mehdiataei force-pushed the profile_inlet branch 6 times, most recently from f0f81c3 to d07713d Compare November 4, 2024 01:39
Copy link
Collaborator

@hsalehipour hsalehipour left a comment

Choose a reason for hiding this comment

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

Thanks for the PR. This is very helpful. I have made some comments which I think will improve this work.

examples/cfd/flow_past_sphere_3d.py Show resolved Hide resolved
examples/cfd/flow_past_sphere_3d.py Outdated Show resolved Hide resolved
examples/cfd/windtunnel_3d.py Show resolved Hide resolved
xlb/operator/boundary_condition/bc_zouhe.py Outdated Show resolved Hide resolved
xlb/operator/boundary_condition/bc_zouhe.py Outdated Show resolved Hide resolved
examples/cfd/windtunnel_3d.py Outdated Show resolved Hide resolved
examples/cfd/flow_past_sphere_3d.py Outdated Show resolved Hide resolved
examples/cfd/lid_driven_cavity_2d.py Outdated Show resolved Hide resolved
@mehdiataei
Copy link
Contributor Author

Thanks for the PR. This is very helpful. I have made some comments which I think will improve this work.

Thanks for the comments. I'll take a look.

@autodesk-chorus
Copy link

Chorus detected one or more security issues with this pull request. See the Checks tab for more details.

As a reminder, please follow the secure code review process as part of the Secure Coding Non-Negotiable requirement.

@mehdiataei mehdiataei changed the title Added abstraction layer for boundary condition and the capability to add profiles to boundary conditions Added abstraction layer for boundary condition aux data and implementaiton, and the capability to add profiles to boundary conditions Nov 28, 2024
@mehdiataei mehdiataei force-pushed the profile_inlet branch 3 times, most recently from c954e93 to 49cb066 Compare November 28, 2024 22:47
@mehdiataei mehdiataei requested review from hsalehipour and removed request for massimim November 28, 2024 22:51
Copy link
Collaborator

@hsalehipour hsalehipour left a comment

Choose a reason for hiding this comment

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

Thanks for the improved PR. I have left lots of commetns (major revisions). Please apply the changes and ping me again to review. I am happy to add these changes directly myself if you prefer. Thank you.

examples/cfd/flow_past_sphere_3d.py Outdated Show resolved Hide resolved
examples/cfd/flow_past_sphere_3d.py Show resolved Hide resolved
examples/cfd/flow_past_sphere_3d.py Outdated Show resolved Hide resolved
examples/cfd/flow_past_sphere_3d.py Show resolved Hide resolved
examples/cfd/lid_driven_cavity_2d.py Show resolved Hide resolved
xlb/operator/boundary_condition/bc_zouhe.py Outdated Show resolved Hide resolved
xlb/operator/boundary_condition/bc_zouhe.py Show resolved Hide resolved
xlb/operator/boundary_condition/bc_regularized.py Outdated Show resolved Hide resolved
@mehdiataei mehdiataei changed the title Added abstraction layer for boundary condition aux data and implementaiton, and the capability to add profiles to boundary conditions Added abstraction layer for boundary condition application and stepper initialization, and the capability to add profiles to boundary conditions. Nov 30, 2024
@mehdiataei mehdiataei force-pushed the profile_inlet branch 2 times, most recently from 530e82d to 53f626c Compare November 30, 2024 01:35
@mehdiataei mehdiataei changed the title Added abstraction layer for boundary condition application and stepper initialization, and the capability to add profiles to boundary conditions. Added abstraction layer for boundary condition application and stepper initialization, and the capability to add profiles to boundary conditions Nov 30, 2024
@mehdiataei mehdiataei force-pushed the profile_inlet branch 4 times, most recently from b8f5ba2 to c7b2237 Compare December 4, 2024 00:10
@mehdiataei mehdiataei force-pushed the profile_inlet branch 2 times, most recently from c4db4ab to ce1006c Compare December 5, 2024 08:58
@hsalehipour hsalehipour self-requested a review December 5, 2024 14:58
Copy link
Collaborator

@hsalehipour hsalehipour left a comment

Choose a reason for hiding this comment

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

please see all my comments. They are all minor. Let's close this today after these minor changes.

xlb/helper/nse_solver.py Outdated Show resolved Hide resolved
@@ -222,6 +218,15 @@ def functional_velocity(
# Find normal vector
normals = get_normal_vectors(missing_mask)

# Find the value of u from the missing directions
for l in range(wp.static(_q)):
Copy link
Collaborator

Choose a reason for hiding this comment

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

please remove wp.static inside range. There are two occasions in the file.

@@ -253,6 +258,13 @@ def functional_pressure(
# Find normal vector
normals = get_normal_vectors(missing_mask)

# Find the value of rho from the missing directions
for q in range(wp.static(_q)):
Copy link
Collaborator

Choose a reason for hiding this comment

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

and here

xlb/operator/boundary_condition/bc_zouhe.py Outdated Show resolved Hide resolved
examples/cfd/windtunnel_3d.py Outdated Show resolved Hide resolved
examples/cfd/windtunnel_3d.py Outdated Show resolved Hide resolved
examples/cfd/windtunnel_3d.py Outdated Show resolved Hide resolved
examples/cfd/turbulent_channel_3d.py Outdated Show resolved Hide resolved
examples/cfd/turbulent_channel_3d.py Outdated Show resolved Hide resolved
@mehdiataei mehdiataei force-pushed the profile_inlet branch 2 times, most recently from 98a2e19 to 00eebf7 Compare December 5, 2024 20:33
@hsalehipour hsalehipour self-requested a review December 5, 2024 21:30
Copy link
Collaborator

@hsalehipour hsalehipour left a comment

Choose a reason for hiding this comment

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

Please just change BGK to KBC in turbulent channel flow and then go ahead and merge.

…r initialization, and the capability to add profiles to boundary conditions
@mehdiataei mehdiataei merged commit f7bed81 into Autodesk:main Dec 5, 2024
10 checks passed
@github-actions github-actions bot locked and limited conversation to collaborators Dec 5, 2024
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Non-uniform boundary velocity profile
2 participants