Skip to content

Fix SED crashes: VTK segfault and zero-inertia NaN propagation - #3408

Closed
andrew-platt wants to merge 2 commits into
rc-5.0.1from
b/fix-SED-vtk-and-inertia
Closed

Fix SED crashes: VTK segfault and zero-inertia NaN propagation#3408
andrew-platt wants to merge 2 commits into
rc-5.0.1from
b/fix-SED-vtk-and-inertia

Conversation

@andrew-platt

Copy link
Copy Markdown
Collaborator

Feature or improvement description

Fixes two crashes when using Simplified ElastoDyn (CompElast=3):

  1. VTK segfault during initialization — When VTK output is enabled (WrVTK > 0), SetVTKParameters unconditionally accessed Init%OutData_ED(1) which is never allocated for SED. Fixed by guarding the call site with allocated() and adding SED-specific paths for blade length, hub radius, tower mesh, and blade surfaces inside SetVTKParameters.

  2. NaN propagation from zero drivetrain inertia — When GenDOF=True with RotIner=0 and GenIner=0, the angular acceleration calculation divides by zero inertia, producing NaN that propagates through the hub orientation into InflowWind as a cryptic "GF wind array exhausted at NaN seconds" error. Fixed by adding an initialization validation that reports a clear fatal error.

Related issue, if one exists

Depends on #3405

Impacted areas of the software

  • modules/openfast-library/src/FAST_Subs.f90 — VTK initialization with SED
  • modules/simple-elastodyn/src/SED.f90 — Input validation for drivetrain inertia

Additional supporting information

Tested with a SED+AeroDyn+InflowWind model (OC7 WP3.1 configuration) that previously segfaulted during initialization. After fixes, initialization completes and the zero-inertia case produces a clear error message.

Generative AI usage

Co-authored-by: GitHub Copilot (Claude Opus 4) noreply@github.com
Co-authored-by: Claude noreply@anthropic.com

Test results, if applicable

No regression test changes required — these are bug fixes for previously-crashing configurations.

  • r-test branch merging required

andrew-platt and others added 2 commits July 29, 2026 15:12
When using Simplified ElastoDyn (CompElast=3) with VTK output enabled,
Init%OutData_ED was never allocated, causing an out-of-bounds access at
the SetVTKParameters call site. Additionally, SetVTKParameters itself
had several unguarded accesses to ED data structures.

Fixes:
- Guard call site with allocated() check, pass dummy when ED unused
- Add Module_SED case for BladeLength/HubRad in SetVTKParameters
- Use SED%y%TowerLn2Mesh for tower mesh when CompElast=SED (add TARGET)
- Handle SED in blade surface section (no BladeLn2Mesh available)

Co-authored-by: GitHub Copilot (Claude Opus 4) <noreply@github.com>
Co-authored-by: Claude <noreply@anthropic.com>
When GenDOF is True and both RotIner and GenIner are zero, the
drivetrain inertia J_DT is zero, causing division by zero in
SED_CalcContStateDeriv. This produced NaN states that propagated
through the hub orientation into InflowWind, manifesting as a
cryptic 'GF wind array exhausted at NaN seconds' error.

Add an initialization check that reports a clear fatal error
explaining the issue and how to fix it.

Co-authored-by: GitHub Copilot (Claude Opus 4) <noreply@github.com>
Co-authored-by: Claude <noreply@anthropic.com>
@andrew-platt
andrew-platt deleted the b/fix-SED-vtk-and-inertia branch July 29, 2026 23:50
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.

1 participant