Skip to content

Change for sliding plane when relative frame is used - #2311

Merged
pcarruscag merged 28 commits into
su2code:developfrom
FabianYan2010:Feature_SlidingPlane_RelFrame
Sep 13, 2026
Merged

Change for sliding plane when relative frame is used#2311
pcarruscag merged 28 commits into
su2code:developfrom
FabianYan2010:Feature_SlidingPlane_RelFrame

Conversation

@FabianYan2010

@FabianYan2010 FabianYan2010 commented Jun 25, 2024

Copy link
Copy Markdown

Proposed Changes

In some cases we use relative frame for rotor zone to perform URANS, e.g., in aeroelasticity analysis, we want the grid movement comes only from blade deformation. The problem is that the sliding plane in SU2 works only for absolute frame. In relative frame, the grid is not rotating, so the interpolation at sliding interface is not changed as time step is marching. The proposed changes rotate the sliding interface in accordance with physical time steps to perform interpolation. This function is activated only for relative frame. The grid itself is not rotating.
Currently, this is only implemented in CNearestneighbor class, other interpolation method should be changed as well in the near future.

Related Work

Resolve any issues (bug fix or feature request), note any related PRs, or mention interactions with the work of others, if any.

PR Checklist

Put an X by all that apply. You can fill this out after submitting the PR. If you have any questions, don't hesitate to ask! We want to help. These are a guide for you to know what the reviewers will be looking for in your contribution.

  • I am submitting my contribution to the develop branch.
  • My contribution generates no new compiler warnings (try with --warnlevel=3 when using meson).
  • My contribution is commented and consistent with SU2 style (https://su2code.github.io/docs_v7/Style-Guide/).
  • I used the pre-commit hook to prevent dirty commits and used pre-commit run --all to format old commits.
  • I have added a test case that demonstrates my contribution, if necessary.
  • I have updated appropriate documentation (Tutorials, Docs Page, config_template.cpp), if necessary.

Comment thread SU2_CFD/src/interfaces/cfd/CSlidingInterface.cpp Fixed
Comment thread SU2_CFD/src/interfaces/cfd/CSlidingInterface.cpp Fixed
Comment thread SU2_CFD/src/interfaces/cfd/CSlidingInterface.cpp Fixed
Comment thread SU2_CFD/src/interfaces/cfd/CSlidingInterface.cpp Fixed
Comment thread SU2_CFD/src/interfaces/cfd/CSlidingInterface.cpp Fixed
Comment thread SU2_CFD/src/interfaces/cfd/CSlidingInterface.cpp Fixed
Comment thread TestCases/turbomachinery/axial_stage_full_annulus_unsteady/rotor_FA_Unsteady.cfg Outdated

@pcarruscag pcarruscag left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can you make this a config option as I mentioned before?
The large solution files need to be in the TestCases repo instead of together with the code.

@pcarruscag pcarruscag changed the title Change for sliding plane when relative frame is used [WIP] Change for sliding plane when relative frame is used Aug 11, 2024
@pcarruscag pcarruscag changed the title [WIP] Change for sliding plane when relative frame is used Change for sliding plane when relative frame is used Sep 12, 2026
…-sliding-plane

# Conflicts:
#	Common/include/CConfig.hpp
#	Common/src/CConfig.cpp
#	SU2_CFD/src/drivers/CMultizoneDriver.cpp
#	SU2_CFD/src/interfaces/CInterface.cpp
pcarruscag added a commit to su2code/TestCases that referenced this pull request Sep 12, 2026
…test

These were present in the original contribution's branch history
(su2code/SU2#2311, commit 3f5d63d) but dropped before the PR's final
state, leaving the test case without a mesh or restart to run from.
Recovered from that history to complete the companion data for the
inlet_distortion_relative_frame case.

Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
@pcarruscag

Copy link
Copy Markdown
Member

Rebased this branch onto current develop and applied a few fixes found during review:

Bug fixes

  • The donor-velocity rotation in CInterface::BroadcastData was gated only on donor_config->GetBoolRelFrame_SlidingPlane(), while the coordinate rotation in CNearestNeighbor::SetTransferCoeff uses donor OR target. Made the velocity gate match (OR), otherwise a config that only sets the flag on the target zone gets correctly-matched coordinates but unrotated velocities.
  • GetDonor_Velocity_RotatingFrame's target-side branch read TimeIter from donor_config instead of target_config.
  • The per-target-vertex rotation matrix (and rotated target coordinate) in CNearestNeighbor::SetTransferCoeff was being recomputed inside the innermost per-donor-candidate loop; hoisted it out since it's invariant across all donor candidates for a given target vertex/zone pair. This matters because this feature makes the interpolation recompute every time step.
  • CMultizoneDriver now only treats a ROTATING_FRAME zone as needing a per-timestep transfer-coefficient refresh when RELATIVE_FRAME_SLIDINGPLANE is actually enabled, so existing ROTATING_FRAME + sliding-interface setups that don't use this feature don't pay a new per-timestep cost.
  • Fixed copy-pasted Doxygen comments (target_config/target_geometry were both labeled "the donor mesh") and cleaned up trailing whitespace.

Test case / data files

  • TestCases/sliding_interface/inlet_distortion_relative_frame/'s .dat mesh/solution/profile files were committed directly into this repo, but TestCases/.gitignore reserves that pattern for the sibling su2code/TestCases data repo (same as every other sliding_interface/* case, e.g. rotating_cylinders.su2). Moved them there: Add inlet distortion data for relative-frame sliding-plane test case TestCases#204 (also recovered the mesh files and initial restart solutions, which existed in this branch's history — commit 3f5d63d — but had been dropped before the PR's current state, so the case couldn't actually run at all as submitted).
  • Also found the inlet-profile filenames didn't match RESTART_ITER=1 (SU2's existing multizone/unsteady file-naming convention expects Inlet_Distortion_<zone>_00001.dat for RESTART_ITER=1, not _00000) — fixed by renaming in the TestCases PR.
  • Wired the case into parallel_regression.py/serial_regression.py (with a reduced TIME_ITER=5 for CI, following the existing uniform_flow pattern) using test_vals from an actual local run with the fixes applied.

Still needed before this can pass CI as-is: su2code/TestCases#204 needs to merge first (or regression.yml's -c develop temporarily pointed at that branch) since the new regression entry's mesh/solution/profile data lives there, not in this repo.

🤖 Generated with Claude Code

- Gate the donor-velocity rotation on either zone's
  RELATIVE_FRAME_SLIDINGPLANE flag, matching the OR already used for
  the coordinate rotation in CNearestNeighbor::SetTransferCoeff (was
  donor-only, so a config that only enabled the flag on the target
  zone silently transferred correct coordinates but unrotated
  velocities).
- Fix a donor/target mix-up in GetDonor_Velocity_RotatingFrame: the
  target-side branch read TimeIter from donor_config instead of
  target_config.
- Hoist the per-target-vertex rotation matrix and rotated coordinate
  construction in CNearestNeighbor::SetTransferCoeff out of the inner
  per-donor-candidate loop; it was being recomputed (including
  trig calls) for every donor candidate instead of once per target
  vertex.
- Only mark a ROTATING_FRAME zone as needing a per-timestep interface
  transfer-coefficient refresh in CMultizoneDriver when
  RELATIVE_FRAME_SLIDINGPLANE is actually enabled, so existing
  ROTATING_FRAME + sliding-interface setups that don't use this
  feature don't pay a new per-timestep recompute cost.
- Fix copy-pasted Doxygen comments that labeled target_config/
  target_geometry as "the donor mesh", and clean up trailing
  whitespace in the new code.
- Move the inlet_distortion_relative_frame test case's mesh/solution/
  profile data out of TestCases/ (which the SU2 repo's own
  TestCases/.gitignore says is for the sibling su2code/TestCases
  data repo, see su2code/TestCases#204) and wire the case into
  parallel_regression.py/serial_regression.py with test_vals from an
  actual run, so it gets CI coverage.

Note: this PR's own CI will fail on the new regression entry until
su2code/TestCases#204 merges (or is otherwise pulled in), since the
mesh/solution/profile data for inlet_distortion_relative_frame lives
there, not in this repo. Pushing this branch to a fork also requires
the 'workflow' OAuth scope on the pushing token, since the merge with
develop touches .github/workflows/*.

Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
@pcarruscag
pcarruscag force-pushed the Feature_SlidingPlane_RelFrame branch from e36f4ab to cd0b6ff Compare September 12, 2026 20:14
pcarruscag and others added 3 commits September 12, 2026 14:04
Merge conflict resolution had kept the PR's
(prefixed_motion[iZone] || prefixed_motion[jZone]) condition instead
of develop's original prefixed_motion[iZone]-only check, silently
changing when transfer coefficients get recomputed for every
existing prefixed-motion sliding-interface case (e.g. channel_3D,
RIGID_MOTION), not just the new relative-frame feature -- causing a
numerical regression against stored test_vals.

Both zones in the new inlet_distortion_relative_frame test case set
GRID_MOVEMENT=ROTATING_FRAME with RELATIVE_FRAME_SLIDINGPLANE=YES, so
prefixed_motion is true for both and the single-sided check still
triggers the recompute in both directions for that case.

Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
Too heavy for a regression test (3D RANS SST, 68k+30k point meshes,
~90MB of mesh/solution/profile data) for what it exercises being a
simple duct/cylinder geometry. Removes the cfg files, the
parallel_regression.py/serial_regression.py entries, and the
regression.yml Testcases-branch pointer added to support it -- the
companion su2code/TestCases#204 PR is no longer needed either.

The feature itself (source changes in CNearestNeighbor,
CSlidingInterface, CInterface, CMultizoneDriver) is unaffected; a
lighter regression case can be built later on top of an existing
sliding-interface test (e.g. sliding_interface/uniform_flow) instead.

Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>

@pcarruscag pcarruscag left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I removed the test because it was too large, almost 1 minute.

@pcarruscag
pcarruscag merged commit 2c35816 into su2code:develop Sep 13, 2026
38 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants