Repository navigation
IBM: curvature and body-acceleration terms in the ghost pressure of slip and moving walls - #2209
Open
sbryngelson wants to merge 7 commits into
Open
sbryngelson wants to merge 7 commits into
sbryngelson wants to merge 7 commits into
Conversation
The wall-normal momentum balance dp/dn = -rho (a_w . n) + rho sum_i kappa_i u_i^2 gets its centripetal term from the image-point velocity relative to the wall, so a slip wall is no longer mirrored with the zero-gradient pressure. kappa is known for a circle, a sphere and the curved side of a cylinder, and zero for any other shape. The wall-velocity expression is shared by the ghost velocity and the pressure. The chemistry branch that keeps the image-point composition now takes the temperature from the ghost pressure it fills the density with.
…rescribed-motion body patch_ib%accel and %angular_accel hold (vel - step_vel)/dt and (angular_vel - step_angular_vel)/dt at the first Runge-Kutta stage. The ghost pressure adds alpha x r_w and, for moving_ibm = 1, the translational acceleration (two-way bodies keep force/mass), so every moving body takes the wall-normal momentum balance, including prescribed-kinematics bodies, whose hinge rotation was carved out because the centroid acceleration was missing. A body of constant velocity has zero acceleration and an unchanged ghost state.
Adds a slip circle in a 100 m/s cross flow, whose ghost pressure carries the curvature term, and documents the wall-normal momentum balance of the ghost pressure at slip and moving walls.
Twelve goldens move: ten slip circle and sphere tests (2D and 3D, inviscid and viscous, one and two fluids, model_eqns = 2 and 3), whose ghost pressure now carries the curvature term (changes of order rho u^2, up to 1.5e-6 absolute at u = 1e-3), and the two prescribed-kinematics pitch ramps, whose ghost pressure now carries the acceleration of the wall point. One golden is new, for the slip circle in a cross flow. Generated on NVIDIA (nvfortran 25.11, OpenACC); cylinder, cuboid, airfoil, STL and no-slip goldens are unchanged.
Lines of Code
|
|
Claude Code Review Head SHA: 22d8112 Files changed:
Findings:
|
Codecov Report❌ Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## master #2209 +/- ##
==========================================
+ Coverage 63.71% 65.16% +1.45%
==========================================
Files 90 110 +20
Lines 24569 29571 +5002
Branches 3584 4478 +894
==========================================
+ Hits 15653 19270 +3617
- Misses 6135 6743 +608
- Partials 2781 3558 +777 ☔ View full report in Codecov by Harness. 🚀 New features to boost your workflow:
|
Member
Author
|
Thanks. Taking the four findings in order.
|
This branch has not been deployed
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Four commits on
origin/master9649d50 (after #2199): the curvature term, the acceleration term, a test and docs commit, and a golden commit (twelve regenerated goldens, one new).Summary
The ghost pressure of an immersed boundary comes from the wall-normal momentum balance, dp/dn = -rho (a_w . n) + rho sum_i kappa_i u_i^2, n out of the body (#2169 added the centripetal term of a spinning wall). Two terms were missing:
s_compute_ghost_point_pressuretakes the image-point velocity, forms its tangential part relative to the wall and adds rho kappa u_t^2. kappa is known for circles and spheres (geometry 2, 8: 1/R) and for the curved side of a cylinder (geometry 10: 1/R, none along its axis); every other shape has kappa = 0 and keeps today's condition. No-slip walls are unchanged (their fluid is held at the wall velocity).patch_ib%acceland%angular_accelhold (vel - step_vel)/dt and the angular counterpart at the first Runge-Kutta stage. The ghost pressure adds the translational acceleration (two-way bodies keep force/mass) and alpha x r_w to the existing omega x (omega x r_w). The carve-out that kept the image-point pressure for prescribed bodies of any kind (the centroid acceleration of a hinged body was missing) is removed, so every moving body takes the balance. A body of constant velocity has zero acceleration and an unchanged ghost state (bitwise).The wall velocity expression is now one function,
f_wall_velocity, shared by the ghost velocity (no-slip and slip) and the pressure. The chemistry branch that keeps the image-point composition took its temperature from the image-point pressure and the ghost density; it now uses the ghost pressure, so T_ghost = T_IP (identical wherever the pressure is not modified, i.e. every fixed no-slip wall).Verification
NVIDIA A100, nvfortran 25.11,
--gpu acc, 1 rank; "master" is 9649d50, "this PR" is the branch. Inviscid gamma = 1.4, WENO5, HLLC, SSP-RK3, adaptive CFL 0.5, extrapolation boundaries.Exact steady vortex around a fixed slip circle
u_theta = M c0 R / r with isentropic Bernoulli pressure and density from the stagnation state (p0 = 1e5 Pa, rho0 = 1.2 kg/m3), tangent to the wall, so an exact steady Euler solution; the domain is +-3 R, the run is 0.4 (half width)/c0 from the exact field. Error is the rms over the cells in the first wall-distance band of (p - p_exact) / (0.5 rho0 (M c0)^2), (u_theta - u_theta,exact) / (M c0) and u_r / (M c0) (zero in the exact solution). 10 / 20 / 40 cells/R; observed orders between pairs. "TSC" is
ib_ip_interp = 2.At 40 cells/R the first-cell pressure error falls 2.9x (M 0.3) and 3.0x (M 0.6) with the default image point and 9.6x and 12.9x with TSC; the spurious flow through the wall falls 3.1x and 3.6x, and 15.8x and 38.7x with TSC. The pressure order stays near 1 to 1.5. The tangential velocity error does not improve; at 40 cells/R it is 1.2x (default) and 1.7x (TSC) larger at M 0.3, and 1.2x and 1.9x larger at M 0.6. A slip ghost copies the image point's tangential velocity, which is first order where it varies with distance (here du_t/dn = -u_t/R), and the old pressure error had partly masked that. It is not addressed here (see the follow-up below).
The same vortex around a z-axis cylinder (
geometry = 10, turned 90 degrees about y, 25 periodic cells in z) reproduces the 2D circle: first-cell pressure error 3.28e-2 (circle) and 3.28e-2 (cylinder) at 10 cells/R and 1.58e-2 and 1.62e-2 at 20, against 7.68e-2 and 3.40e-2 on master. The sphere branch (same kappa as the circle) has no exact-solution test.Accelerating prescribed cylinder (added mass)
A D = 1 circle with
moving_ibm = 1,vel(1) = a t(a = 1e-3 c^2/D), in inviscid gas at rest (rho = 1, c = 1), slip wall, domain +-6 D. Incompressible potential flow gives the surface pressure p = p0 + rho a R^2 cos(theta)/r (net force -rho pi R^2 a). Error is the rms of (p - p_exact) / (rho a R) in wall-distance bands at t = 4 D/c, with the centroid taken from the saved IB state.The acceleration term lowers the near-wall pressure error by 14%, 10% and 5% in the first band (the curvature term alone changes it by less than 2%: u is small here). The gain is small and shrinks with resolution, and the error does not converge: it stalls at about 3 to 5% of the signal between 32 and 64 cells/D, a floor that comes from something else in this test (acoustic tail of the impulsive start in a +-6 D box, the compressibility correction, and the discrete body position), which I did not separate. A viscous no-slip variant (Re 1000) is dominated by the boundary layer (error 0.24 to 0.31 in both builds, no change with the term) and says nothing about it.
Not conclusive
examples/2D_mibm_shock_cylinderwith the grid set to 250 / 500 / 1000 cells across the 4 x 4 domain, t = 1.5): the cylinder's x centroid at the end is 0.5564 / 0.5570 / 0.5613 on master and 0.5592 / 0.5581 / 0.5618 with this PR. The difference between builds is below the grid error. All fields finite. No external reference values were used.Tests and goldens
IBM -> Slip Circle -> Cross Flow(a slip circle in 100 m/s gas at 1e5 Pa). The acceleration term is exercised by the existingIBM -> Prescribed Kinematics -> Pitch Ramptests (analytic prescribed velocities cannot be given to the test harness, which builds one generic binary).model_eqns2 and 3), with a change of order rho u^2 (at most 1.5e-6 absolute at u = 1e-3), and the two Pitch Ramp tests. In the Pitch Ramp the plate starts to turn impulsively in a gas at p of order 0.1, where the wall-point acceleration is large against the pressure, so the state near the plate changes at order one: 168 of 15625 cells change by more than 0.1 in total energy (the largest by 0.87, density 0.50 to 0.84 at that cell), all in a band within about three cells of the plate. Cylinder, cuboid, airfoil, STL, no-slip and all other goldens are unchanged. Generated on NVIDIA and checked on AMD. The acceleration is also not evaluated at step 0 (therestep_velis the unset initial velocity, so a prescribed velocity that is nonzero at t = 0 would read as v/dt); the two 3D Pitch Ramp goldens include that guard, which moves the total energy by at most 1.2e-3 absolute (5e-4 of its largest value) against the version without it (the order-one numbers above are against master).IBMlabel plus the eleven IB examples in the test list, without chemistry (--no-chemistry):ib_slip_ccstPR (these 92 tests plus its one), so it exercises this PR's code with the option off; the branch of this PR alone was not built on AMD.ibm_reacting_surface,ibm_burning_grain,ibm_flameholder,ibm_lumped_wall) pass unchanged on NVIDIA.Limitations
This PR was made with Claude Code (AI).