1104 mibm higher order central differencing#1614
Conversation
Claude Code ReviewHead SHA: a13521b Files changed:
Findings[Correctness] 3D radial-vector bug in radial_vector = [x_cc(i), y_cc(j), 0._wp] - [patch_ib(ib_idx)%x_centroid, &
& patch_ib(ib_idx)%y_centroid, 0._wp]
if (num_dims == 3) radial_vector(3) = patch_ib(ib_idx)%z_centroidThe initial array constructor correctly sets if (num_dims == 3) radial_vector(3) = z_cc(k) - patch_ib(ib_idx)%z_centroid[Memory]
if (probe_wrt .or. ib) then
...
@:ALLOCATE(accel_mag(0:m, 0:n, 0:p))
@:ALLOCATE(x_accel(0:m, 0:n, 0:p))
...
end ifBut if (probe_wrt) then
deallocate (accel_mag, x_accel)
...
end ifWhen |
|
Fixed the AI review comment |
…ell. I now get identical results to the python version
|
it certainly seems better, but remind me what we think accounts for the difference between the reference and our result |
|
@sbryngelson This is only on a 900x900 grid. I get much less error as I converge towards larger grid sizes in this case. This is to demonstrate that it matches the python solver that I have been using for analysis. I have separate results in my slides showing the accuracy of the python solver. Rerunning at a much higher resolution will just take a few hours, but I can do that if you want me to include it before merge. |

Description
For a while I have been putting off adding higher-order central difference mostly because I did not see an immediate need. However, it appears that the current viscous force calculation in MFC has some significant errors for low Reynolds cases. Increasing the finite-difference order for the derivatives to 4th order appears to significantly reduce this error back within acceptable tolerances. This branch integrates the IB code with the existing finite-difference coefficients in MFC to be utilized in the force calculation loop. This has added the side-benefit of somewhat reducing the amount of code in the
s_compute_ib_forcessubroutineCloses #1104
Type of change (delete unused ones)
Testing
I did a significant amount of post-processing analysis of the data to determine the best integration method for low-Reynolds cases, which wound up being
Checklist
Check these like this
[x]to indicate which of the below applies.See the developer guide for full coding standards.
GPU changes (expand if you modified
src/simulation/)