Skip to content

Add cylinder case with IBM inflow/outflow BC#283

Open
kaanolgu wants to merge 6 commits intomainfrom
ko/cylinder-case
Open

Add cylinder case with IBM inflow/outflow BC#283
kaanolgu wants to merge 6 commits intomainfrom
ko/cylinder-case

Conversation

@kaanolgu
Copy link
Collaborator

@kaanolgu kaanolgu commented Mar 3, 2026

Summary

Adds (m_case_cylinder) for simulating flow around a circular cylinder using the solver's built-in Immersed Boundary Method (IBM).

Boundary conditions

  • Inflow (x=0): Dirichlet — u=1, v=0, w=0
  • Outflow (x=L): BC condition on u, Dirichlet zero on v and w
  • y, z: Periodic

The outflow BC discretises du/dt + Uc * du/dx = 0 as:

u_N^{n+1} = u_N^n - (Uc * dt/dx) * (u_N^n - u_{N-1}^n)

The velocity Uc is computed dynamically each timestep as the global maximum of u at nx-1, following the approach used in Xcompact3d's cylinder wake case. This prevents blowup that occurs when using a fixed Uc

The outflow is applied both in boundary_conditions (on U^m) and in pre_correction (on U* before the Poisson solve), which is required for the projection method to maintain consistency.

Initial conditions

Uniform flow u=1, v=0, w=0 with optional localized random noise (controlled via init_noise in the namelist)

Configuration

  • parameter init_noise(3) for per-component noise amplitude. Example input:
&cylinder_nml
init_noise = 0.125 0. 0.
/End

Requires ibm_on = T and BC_x = 'dirichlet', 'dirichlet' in the solver settings (could work without IBM but it won't create data for visuals)

Tested

  • Re = 300, 257×128×32 grid, AB3 time integration, dt = 0.0075, 30k iterations – stable with dynamic Uc.

@kaanolgu kaanolgu added enhancement New feature or request cuda Related to CUDA backend labels Mar 4, 2026
@ia267 ia267 added this to the Cylinder case milestone Mar 4, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

cuda Related to CUDA backend enhancement New feature or request

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants