Fix SED crashes: VTK segfault and zero-inertia NaN propagation - #3408
Closed
andrew-platt wants to merge 2 commits into
Closed
Fix SED crashes: VTK segfault and zero-inertia NaN propagation#3408andrew-platt wants to merge 2 commits into
andrew-platt wants to merge 2 commits into
Conversation
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>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Feature or improvement description
Fixes two crashes when using Simplified ElastoDyn (CompElast=3):
VTK segfault during initialization — When VTK output is enabled (
WrVTK > 0),SetVTKParametersunconditionally accessedInit%OutData_ED(1)which is never allocated for SED. Fixed by guarding the call site withallocated()and adding SED-specific paths for blade length, hub radius, tower mesh, and blade surfaces insideSetVTKParameters.NaN propagation from zero drivetrain inertia — When
GenDOF=TruewithRotIner=0andGenIner=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 SEDmodules/simple-elastodyn/src/SED.f90— Input validation for drivetrain inertiaAdditional 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.