Skip to content

Add a compact-support core regularization function for OLAF particle methods - #3457

Merged
andrew-platt merged 13 commits into
OpenFAST:devfrom
luwang00:f/OLAF
Sep 25, 2026
Merged

andrew-platt merged 13 commits into
OpenFAST:devfrom
luwang00:f/OLAF

Conversation

@luwang00

@luwang00 luwang00 commented Sep 9, 2026 •

Copy link
Copy Markdown
Contributor

This PR is ready to be merged. All prerequisites are met:

Feature or improvement description
This PR adds a compact-support C2 core regularization function to speed up OLAF runs after the fix to core-regularization floor in PR #3430. Based on a preliminary test, the computing time nearly halved with the new compact-support core function compared to the exponential core function with the example from @RBergua shown in PR #3430.

See aerodyn-olaf doc changes for details on the compact-support regularization function.

This PR also adds a new input RegFunctionPart on line 26 of the OLAF input file that allows the user to select a regularization function for the vortex particles separate from the regularization function for the segments controlled by RegFunction on the line above. Currently, the choices for RegFunctionPart are 0 for no regularization, 1 for exponential core function (also the default option), and 2 for the new compact-support core.

The compact-support core regularization appears to have very limited impact on the rotor loads. The ad_BAR_OLAF test modified to use RegFunctionPart=2 passed without issue with the existing reference solution generated with RegFunctionPart=1.

Wake with exponential core RegFunctionPart=1:
image

Wake with compact core RegFunctionPart=2:
image

Comparison of time-averaged normalized streamwise wake velocity:
image
The wake deficit is generally consistent between the two regularization functions with more difference observed further downstream at 8D.

Related issue, if one exists
The changes aim to partially negate the increased computing time after PR #3430.

Impacted areas of the software
OLAF, openfast_io, r-test

Generative AI usage
Co-authored-by: Microsoft Copilot [email protected]
Co-authored-by: Anthropic Claude [email protected]

Test results, if applicable
No change to existing r-test results because all OLAF cases use the old exponential regularization. Should introduce a new test that uses the compact particle regularization with RegFunctionPart=2. r-test merging is still required because of the new OLAF input.

  • Add new OLAF r-test with RegFunctionPart=2.
  • r-test branch merging required

luwang00 and others added 5 commits September 1, 2026 17:09
Item 1: true finite-support compact-C2 particle regularization kernel with
kernel-aware treecode near-core floor.
- FVW_BiotSavart.f90: PART_REG_C2=1.6 param; PartRegFloorFactor(RegFunction);
  rewrite idRegCompact case in ui_part_nograd_11 as (1-rho^2)^2 blob with the
  1.6 core-equivalence factor baked into the kernel (RegParam/seeding unchanged).
- FVW_VortexTools.f90: particle tree near-core floor uses PartRegFloorFactor;
  segment tree floor unchanged.

Item 2: make idRegCompact selectable via a new RegFunctionPart input so the
particle kernel can be A/B tested against the exponential kernel.
- FVW_Registry.txt / FVW_Types.f90: new RegFunctionPart field in Param and
  InputFile types (Types regenerated).
- FVW_IO.f90: read RegFunctionPart (default Exponential) plus validation.
- FVW.f90: copy RegFunctionPart into parameters.
- FVW_Subs.f90: route RegFunctionPart through SegmentsToPartWrap and the
  particle-velocity call sites, replacing the previously forced idRegExp.

Default RegFunctionPart=Exponential preserves existing behavior. Core spreading
is unchanged (it acts upstream on filament cores).

Co-authored-by: Copilot <[email protected]>
Co-authored-by: Claude Opus <[email protected]>
# Conflicts:
#	modules/aerodyn/src/FVW_Subs.f90
#	reg_tests/r-test
@luwang00
luwang00 marked this pull request as draft September 9, 2026 16:18
@luwang00 luwang00 added the ai assisted AI written with strong human guidance. label Sep 9, 2026
@luwang00 luwang00 added this to the v5.1.0 milestone Sep 9, 2026
Clarify the existing regularization functions apply to vortex segments, and add a Particle regularization functions section covering the segment-to-particle conversion, the regularized point-vortex kernel, and the exponential and compact-support functions (RegFunctionPart). Also document the RegFunctionPart input in the OLAF input file reference.

Co-authored-by: Copilot <[email protected]>

Co-authored-by: Claude Opus <[email protected]>
@luwang00
luwang00 marked this pull request as ready for review September 10, 2026 00:29
@luwang00
luwang00 requested a lite review from Copilot September 10, 2026 00:29

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.

🟡 Changes recommended

The openfast_io OLAF reader/writer changes are not robust to older OLAF input variants (risk of silent mis-parse/KeyError), and the particle tree floor-factor helper can impose unnecessary direct-evaluation work for RegFunctionPart=0, plus the PR prerequisite api_change.rst entry is still missing.

Once you've addressed the issues Copilot identified, you can request another Copilot review.

Pull request overview

This PR extends AeroDyn/OLAF to support a separate particle regularization function (RegFunctionPart) and introduces a new compact-support C2 particle core to improve OLAF performance for particle-based velocity methods (direct and tree-accelerated), with corresponding documentation updates.

Changes:

  • Add RegFunctionPart input plumbing across OLAF IO/types and openfast_io read/write paths.
  • Implement a compact-support particle regularization kernel and align the particle tree’s near-core direct-evaluation floor with kernel support.
  • Update OLAF user documentation and example input file to describe and demonstrate the new particle regularization options.
File summaries
File Description
openfast_io/openfast_io/FAST_writer.py Writes new RegFunctionPart line into OLAF input files and clarifies RegFunction as segment regularization.
openfast_io/openfast_io/FAST_reader.py Reads new RegFunctionPart from OLAF input files into fst_vt.
modules/aerodyn/src/FVW.f90 Propagates RegFunctionPart from input-file data into runtime parameters.
modules/aerodyn/src/FVW_VortexTools.f90 Tracks maxRegParam per tree node and uses kernel-aware distance floors for particle tree direct evaluation.
modules/aerodyn/src/FVW_Types.f90 Adds RegFunctionPart to parameter/input-file derived types and pack/unpack/copy routines.
modules/aerodyn/src/FVW_Subs.f90 Uses RegFunctionPart for particle conversion and refactors velocity-method logic to select case.
modules/aerodyn/src/FVW_Registry.txt Registers RegFunctionPart so it flows through the registry/type generation system.
modules/aerodyn/src/FVW_IO.f90 Reads/validates RegFunctionPart from OLAF input with a default.
modules/aerodyn/src/FVW_BiotSavart.f90 Adds compact-support particle kernel, exp fast-path cutoff, and PartRegFloorFactor helper.
modules/aerodyn/src/AeroDyn.f90 OpenMP scoping fix/comment for TwrInflArray loop variables.
docs/source/user/aerodyn-olaf/OLAFTheory.rst Documents particle regularization functions, including compact-support kernel details.
docs/source/user/aerodyn-olaf/InputFiles.rst Documents new RegFunctionPart input and behavior/performance implications.
docs/source/user/aerodyn-olaf/ExampleFiles/ExampleFile--OLAF.dat Adds RegFunctionPart to the OLAF example input file.
Review details
  • Files reviewed: 14/14 changed files
  • Comments generated: 4
  • Review effort level: Lite

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

Comment thread openfast_io/openfast_io/FAST_reader.py
Comment thread openfast_io/openfast_io/FAST_writer.py
Comment thread docs/source/user/aerodyn-olaf/InputFiles.rst
Comment thread modules/aerodyn/src/FVW_BiotSavart.f90
PartRegFloorFactor now returns 0 for idRegNone since the singular point-vortex kernel has no core region; accuracy is governed solely by the Barnes-Hut opening criterion. Avoids inflating the direct-evaluation region unnecessarily.

Co-authored-by: Copilot <[email protected]>

Co-authored-by: Claude Opus <[email protected]>
luwang00 and others added 5 commits September 25, 2026 10:02
The `sec:RegularizationFunctionPart` and `sec:corerad` hyperlink targets
each abutted the preceding paragraph, so docutils absorbed them into that
paragraph instead of registering them. This silently broke six :numref:
references: two to the new particle-regularization section
(InputFiles.rst:193, OLAFTheory.rst:501) and four to the pre-existing
sec:corerad label (InputFiles.rst:207, InputFiles.rst:224,
OLAFTheory.rst:528, OLAFTheory.rst:777).

Verified by parsing the file before and after: both labels are absent
from the document name index before the change and registered as targets
after it.

Co-Authored-By: Claude Opus 5 (1M context) <[email protected]>
The api_change table already lists the new RegFunctionPart input, but not
the behavior change that comes with decoupling the particle kernel from
RegFunction. The default RegFunctionPart=1 reproduces the previous
exponential particle kernel for any RegFunction greater than 0, so those
decks are unaffected. Decks with RegFunction=0 previously got an
unregularized particle kernel and now get the exponential one unless
RegFunctionPart=0 is also set; and with RegFunctionPart=0 the
particle-tree far-field cutoff is no longer padded by the particle core
radius, so VelocityMethod=2 results still shift.

Co-Authored-By: Claude Opus 5 (1M context) <[email protected]>
@andrew-platt
andrew-platt merged commit 386378c into OpenFAST:dev Sep 25, 2026
14 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

ai assisted AI written with strong human guidance. Module: OLAF Type: Enhancement

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants