-
Notifications
You must be signed in to change notification settings - Fork 128
Analytic mibm velocities and airfoil centroid #1111
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
base: master
Are you sure you want to change the base?
Changes from all commits
89a0ac5
ef446f5
2f9b1be
d54bc5b
697b5a0
6ed8350
7bd28cd
f40422a
541e727
cb7b845
54c9421
37f2730
8b00a82
6817228
f6c961e
a815445
e94637d
675d974
8363059
cbdb29f
aa68ade
928ccd0
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -2,7 +2,6 @@ | |
| import json | ||
| import math | ||
|
|
||
|
|
||
| eps = 1e-6 | ||
| time_end = 1.0 | ||
| time_save = time_end / 100.0 | ||
|
|
||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -2,7 +2,6 @@ | |
| import json | ||
| import math | ||
|
|
||
|
|
||
| mu = 1.0e-4 | ||
| lambd = 1.0 | ||
| time_end = 15.0 | ||
|
|
||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -2,7 +2,6 @@ | |
| import json | ||
| import math | ||
|
|
||
|
|
||
| mu = 1.0e-3 | ||
| time_end = 1.0 | ||
| time_save = time_end / 100.0 | ||
|
|
||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -6,3 +6,8 @@ | |
| #:def analytical() | ||
|
|
||
| #:enddef | ||
|
|
||
| ! For moving immersed boundaries in simulation | ||
| #:def mib_analytical() | ||
|
|
||
| #:enddef | ||
| Original file line number | Diff line number | Diff line change | ||||
|---|---|---|---|---|---|---|
|
|
@@ -279,6 +279,7 @@ contains | |||||
| do i = 0, m | ||||||
| xy_local = [x_cc(i) - center(1), y_cc(j) - center(2), 0._wp] ! get coordinate frame centered on IB | ||||||
| xy_local = matmul(inverse_rotation, xy_local) ! rotate the frame into the IB's coordinates | ||||||
| xy_local = xy_local - patch_ib(patch_id)%centroid_offset ! airfoils are a patch that require a centroid offset | ||||||
danieljvickers marked this conversation as resolved.
Show resolved
Hide resolved
|
||||||
| if (xy_local(1) >= 0._wp .and. xy_local(1) <= ca_in) then | ||||||
| xa = xy_local(1)/ca_in | ||||||
|
|
@@ -433,6 +434,7 @@ contains | |||||
| do i = 0, m | ||||||
| xyz_local = [x_cc(i) - center(1), y_cc(j) - center(2), z_cc(l) - center(3)] ! get coordinate frame centered on IB | ||||||
| xyz_local = matmul(inverse_rotation, xyz_local) ! rotate the frame into the IB's coordinates | ||||||
| xyz_local = xyz_local - patch_ib(patch_id)%centroid_offset ! airfoils are a patch that require a centroid offset | ||||||
|
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Suggestion: The 3D airfoil routine subtracts Severity Level: Critical 🚨- ❌ 3D airfoil marker placement incorrect in s_ib_3D_airfoil.
- ⚠️ 3D pitching/rotating airfoil simulations show wrong geometry.
Suggested change
Steps of Reproduction ✅1. Prepare a 3D case with an airfoil patch (patch_ib(... )%geometry == 11) so
s_apply_ib_patches calls s_ib_3D_airfoil during marker generation.
2. Set patch_ib(patch_id)%centroid_offset to a non-zero vector and set non-zero rotation
angles so rotation_matrix_inverse is non-trivial; run to the IB marker generation step.
3. In s_ib_3D_airfoil the code computes xyz_local and applies inverse_rotation at
src/common/m_ib_patches.fpp:435-436, then subtracts patch_ib(patch_id)%centroid_offset at
line 437 without rotating that offset into the local frame.
4. As a result the z/y/x cell-inclusion tests (for example the z_min/z_max check at the
surrounding block) and the later assignments to ib_markers_sf(i,j,l) are done with an
inconsistent offset and the 3D airfoil appears shifted. Reproduces when centroid_offset ≠
0 and rotation ≠ identity.Prompt for AI Agent 🤖This is a comment left during a code review.
**Path:** src/common/m_ib_patches.fpp
**Line:** 437:437
**Comment:**
*Logic Error: The 3D airfoil routine subtracts `patch_ib(patch_id)%centroid_offset` from `xyz_local` after applying `inverse_rotation`; if `centroid_offset` is expressed in the global/model frame this subtraction is done in the wrong basis. Rotate the centroid offset into the IB/local frame with the same `inverse_rotation` before subtracting to ensure the offset is applied consistently in the same coordinate system.
Validate the correctness of the flagged issue. If correct, How can I resolve this? If you propose a fix, implement it and please make it concise. |
||||||
|
|
||||||
| if (xyz_local(3) >= z_min .and. xyz_local(3) <= z_max) then | ||||||
|
|
||||||
|
|
||||||
Uh oh!
There was an error while loading. Please reload this page.