Add a compact-support core regularization function for OLAF particle methods - #3457
Conversation
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]>
…nput and update r-test pointer
# Conflicts: # modules/aerodyn/src/FVW_Subs.f90 # reg_tests/r-test
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]>
There was a problem hiding this comment.
🟡 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
RegFunctionPartinput 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.
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]>
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]>
This PR is ready to be merged. All prerequisites are met:
rc-5.0.1rc-5.0.1intodev.devinto the PR branch and resolver-testconflicts.api_change.rstfor 5.1.0 release.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-olafdoc changes for details on the compact-support regularization function.This PR also adds a new input
RegFunctionParton 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 byRegFunctionon the line above. Currently, the choices forRegFunctionPartare0for no regularization,1for exponential core function (also thedefaultoption), and2for the new compact-support core.The compact-support core regularization appears to have very limited impact on the rotor loads. The
ad_BAR_OLAFtest modified to useRegFunctionPart=2passed without issue with the existing reference solution generated withRegFunctionPart=1.Wake with exponential core

RegFunctionPart=1:Wake with compact core

RegFunctionPart=2:Comparison of time-averaged normalized streamwise wake velocity:

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.RegFunctionPart=2.