Skip to content

Conversation

markojovo
Copy link

I updated boundaries.py to allow for a fourth boundary type (immersed). This takes in a mask that is applied to the simulation grid, enforcing a constant value on the mask (default 0.0 for "no-slip").

I added a couple of helper functions in boundaries.py for simulating channel flow with a simple shape in the middle (circle or square) -- I'm still figuring out what a good API for defining the mask shapes would be.

I also added another notebook demo for demonstrating this, it was mostly copied from the original channel flow demo notebook.
It passed all the tests in boundaries_test.py

I also made a small update to visualization.py to allow for rotations in the output gif

Please let me know what you think or if you have any thoughts, and especially if there's anything glaring or obvious. Or if there's some cleanliness or visualization issues you think I should take care of.

I've also submitted my Contributor License Agreement to Google as an individual contributor

Cheers
Marko

@scaomath
Copy link

Hey @markojovo , inspired by your PR, I isolated your changes and implemented the immersed bc here.

I think it is a better practice to add a new class instead of adding masks into the ConstantBoundaryConditions class. Also note in order that this bc works for common CFD toy examples, you have to modify other things by quite a bit, especially non-homogeneous bcs. Currently how to impose boundary conditions in Jax-CFD is quite problematic for non-homogeneous cases.

Here are the simulation results of the von Karman vortex street: https://github.com/scaomath/torch-cfd/blob/main/examples/von_Karman_vortex_rk4_fvm.ipynb

velocity_channel

vorticity_channel

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