Skip to content

Actuator sector moving refinement and sampling - #2011

Open
tonyinme wants to merge 20 commits into
kynema:mainfrom
tonyinme:actuator-sector-refinement
Open

Actuator sector moving refinement and sampling#2011
tonyinme wants to merge 20 commits into
kynema:mainfrom
tonyinme:actuator-sector-refinement

Conversation

@tonyinme

@tonyinme tonyinme commented Jul 31, 2026

Copy link
Copy Markdown
Contributor

Summary

This capability allows a refinement box and/or sampling planes to move and track an actuator sector or drone.

Pull request type

Please check the type of change introduced:

  • Bugfix
  • Feature
  • Code style update (formatting, renaming)
  • Refactoring (no functional changes, no api changes)
  • Build related changes
  • Documentation content changes
  • Other (please describe):

Checklist

The following is included:

  • new unit-test(s)
  • new regression test(s)
  • documentation for new capability

This PR was tested by running:

  • the unit tests
    • on GPU
    • on CPU
  • the regression tests
    • on GPU
    • on CPU

Additional background

This PR builds on #2001

Issue Number:

@tonyinme

Copy link
Copy Markdown
Contributor Author

@ndevelder , here is the latest version of the actuator sector code.

@tonyinme
tonyinme force-pushed the actuator-sector-refinement branch from 8e6567f to 8e73c40 Compare August 11, 2026 19:06
@tonyinme
tonyinme force-pushed the actuator-sector-refinement branch from d2dd8f2 to 394ff8d Compare August 12, 2026 18:22
@tonyinme

Copy link
Copy Markdown
Contributor Author

This PR is ready for review.
This follows the drone implementation in #2001 and adds refinement and sampling that move with the drone.

@tonyinme
tonyinme marked this pull request as ready for review August 12, 2026 21:33
@mbkuhn

mbkuhn commented Aug 19, 2026

Copy link
Copy Markdown
Contributor

I made a PR to your branch to help with the conflicts. Let me know if anything is unclear.
tonyinme#1

@tonyinme

Copy link
Copy Markdown
Contributor Author

Thanks @mbkuhn , I merged the PR and it is now included in the repo.
I have also changed the option so that you (maintainers) can make changes directly.
That makes this process easier than making local PRs to my branch.

@tonyinme

Copy link
Copy Markdown
Contributor Author

@mbkuhn , this is in working order.
However, there is an issue with the moving volume sampler.
When running large simulations on an HPC, it samples a lot of zeros in many places (might be an issue with mpi syncing or something like that).
I was wondering if you could ask the AI agent to review the PR and see if it suggests an improvement in that area?

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Pull request overview

Adds actuator-following AMR refinement and sampling for moving actuator sectors and drones.

Changes:

  • Exposes actuator geometry and rigid reference frames.
  • Adds moving plane/volume samplers and particle rebuilding after regridding.
  • Adds refinement criteria, documentation, unit tests, and a regression test.

Reviewed changes

Copilot reviewed 28 out of 28 changed files in this pull request and generated 3 comments.

Show a summary per file
File Description
unit_tests/wind_energy/actuator/test_drone.cpp Tests moving drone sampling and regridding.
unit_tests/wind_energy/actuator/test_actuator_sector.cpp Tests sector geometry and refinement.
test/test_files/act_drone_refinement/act_drone_refinement.inp Adds drone refinement regression case.
test/CMakeLists.txt Registers the regression test.
src/wind_energy/actuator/sector/actuator_sector_ops.H Declares sector geometry/frame operations.
src/wind_energy/actuator/sector/actuator_sector_ops.cpp Implements sector geometry/frame operations.
src/wind_energy/actuator/motion/RigidTransform.H Defines rigid coordinate transforms.
src/wind_energy/actuator/motion/RigidBodyMotion.H Exposes rigid-body poses.
src/wind_energy/actuator/motion/RigidBodyMotion.cpp Implements pose generation.
src/wind_energy/actuator/drone/drone_ops.H Declares drone geometry/frame operations.
src/wind_energy/actuator/drone/drone_ops.cpp Implements drone geometry/frame operations.
src/wind_energy/actuator/ActuatorModel.H Extends the actuator model interface.
src/wind_energy/actuator/actuator_types.H Defines refinement geometry data.
src/wind_energy/actuator/actuator_ops.H Adds default geometry/frame operations.
src/utilities/tagging/CMakeLists.txt Builds actuator refinement support.
src/utilities/tagging/ActuatorRefinement.H Declares actuator-following refinement.
src/utilities/tagging/ActuatorRefinement.cpp Implements cylindrical rotor tagging.
src/utilities/sampling/VolumeSampler.H Exposes volume geometry to subclasses.
src/utilities/sampling/Sampling.H Tracks pending particle rebuilding.
src/utilities/sampling/Sampling.cpp Rebuilds sampling particles after movement/regridding.
src/utilities/sampling/PlaneSampler.H Exposes plane geometry to subclasses.
src/utilities/sampling/MovingVolumeSampler.H Declares actuator-attached volume sampling.
src/utilities/sampling/MovingVolumeSampler.cpp Implements moving volume sampling.
src/utilities/sampling/MovingPlaneSampler.H Declares actuator-attached plane sampling.
src/utilities/sampling/MovingPlaneSampler.cpp Implements moving plane sampling.
src/utilities/sampling/CMakeLists.txt Builds the moving samplers.
docs/sphinx/user/inputs_tagging.rst Documents actuator refinement inputs.
docs/sphinx/user/inputs_Sampling.rst Documents moving sampler inputs.

💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.

Comment on lines +241 to +243
if (axial <= forward && axial >= -backward &&
radial_sq <= radius_sq) {
tag(i, j, k) = amrex::TagBox::SET;

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

I can handle this one in this PR or with a follow-on; don't worry about it

m_axis1 = std::move(axis1);
m_axis2 = std::move(axis2);
m_offset_vector = std::move(offset_vector);
PlaneSampler::check_bounds();

.. input_param:: sampling.MovingPlaneSampler.actuator_label

**type:** String, optional
@mbkuhn

mbkuhn commented Aug 21, 2026

Copy link
Copy Markdown
Contributor

It seems like the copilot review did not turn up much insight. Can you tell whether the volume sampling issue has to do with the ghost cells or not? You could try running on a single processor and a box size that takes up the whole domain. You could also see if the problem happens on any field or only on derived fields.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants