Skip to content

SoilDyn/SubDyn: reaction loads when REDWIN is used#3319

Merged
andrew-platt merged 7 commits intoOpenFAST:devfrom
RBergua:SoilDyn-SubDyn_reaction_loads
Apr 28, 2026
Merged

SoilDyn/SubDyn: reaction loads when REDWIN is used#3319
andrew-platt merged 7 commits intoOpenFAST:devfrom
RBergua:SoilDyn-SubDyn_reaction_loads

Conversation

@RBergua
Copy link
Copy Markdown
Contributor

@RBergua RBergua commented Apr 27, 2026

This PR is ready to be merged.

Feature or improvement description
The proposed code introduces a new flag (SlDNonLinear) to pass from SoilDyn to SubDyn in order to correctly identify when SoilDyn is computing nonlinear soil reaction forces (REDWIN DLL, CalcOption=3).

The new flag SlDNonLinear is set internally in SoilDyn based on CalcOption, ensuring it is only TRUE when the REDWIN DLL is active. When nonlinear forces are active, SubDyn reaction outputs (ReactSS) are set to NaN to prevent the user from using reaction loads that only have the linear part. Users should instead use the SoilDyn output sensors (e.g., Sld1Fxg, Sld1Fyg) which correctly account for the total soil reaction at each node.

Additionally, the linear soil stiffness transfer from SoilDyn to SubDyn is now better documented in the console (SoilDyn: linear stiffness passed directly to SubDyn as a stiffness matrix).

For reference, in the current code before these changes, SlDNonLinearForcePortionOnly seems to be defined as TRUE whenever SoilDyn is called, regardless of whether nonlinear forces are actually being computed. This seems a bit confusing. See at the bottom the "Future improvements?" part.

Related issue, if one exists
This PR addresses issues #3317 and #3318

Impacted areas of the software
SubDyn reaction load sensor when REDWIN (CalcOption = 3 in SoilDyn) is used.
SoilDyn messages in the console at run time.

Test results, if applicable
This PR impacts the SubDyn outputs ReactFXss, ReactFYss, ReactFZss, ReactMXss, ReactMYss, ReactMZss. However, there are no r-test cases with REDWIN. So, no differences are expected.

For verification purposes, you can find examples of the new messages and results below:
CalcOption = 1 uses a linear stiffness matrix.
image

In this case all sensors (SubDyn and SoilDyn) are available:
image

CalcOption: 3 uses a linear stiffness matrix AND non-linear forces computed by REDWIN.
image

In this case, the reaction loads from SubDyn return NaN. The proper results (including the linear and nonlinear part) are available in SoilDyn.
image

Additional information: some drama compiling OpenFAST...
I tried to compile OpenFAST in Visual Studio Code by means of GCC. Although I could compile without issues, when I executed the code I ended up with the issues reported here: #3301

Then I decided to move to GitHub Actions and compile with Intel Fortran Compiler. @andrew-platt Somehow, when running the deploy.yml, GitHub was not generating from scratch the SubDyn_Types.f90 file based on my updated SubDyn_Registry.txt. I'm not sure if this is a limitation of the deploy.yml approach. To overcome this, I took the updated SubDyn_Types.f90 from my local run in Visual Studio Code and added it to my branch: 67db890.

Future improvements?
When looking at the Calc_StiffDamp and Calc_REDWIN in the SoilDyn.f90 file, the linear and nonlinear loads are computed as expected. However, we can find the condition: if (p%SlDNonLinearForcePortionOnly) then in several places. I do believe this is indeed always TRUE and could be removed. But I'm not sure if there was a reason for it during the development.
image

@RBergua RBergua added Module: SubDyn Module: SoilDyn Soil interaction module (REDWIN DLL coupling) labels Apr 27, 2026
@andrew-platt andrew-platt requested a review from Copilot April 27, 2026 21:29
Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull request overview

This PR fixes misleading SubDyn reaction load outputs when SoilDyn is using REDWIN (nonlinear soil reactions) by propagating a nonlinear-SSI flag from SoilDyn to SubDyn and invalidating SubDyn’s ReactSS outputs in that mode.

Changes:

  • Add a new SlDNonLinear flag to SubDyn init/parameter types (registry + generated types) to indicate nonlinear SoilDyn reactions are active.
  • Pass SlDNonLinear from SoilDyn (via glue code) to SubDyn and set ReactSS outputs to NaN when nonlinear SoilDyn loads are enabled.
  • Update SoilDyn console messaging to clarify stiffness transfer and REDWIN nonlinear load usage.

Reviewed changes

Copilot reviewed 6 out of 6 changed files in this pull request and generated 1 comment.

Show a summary per file
File Description
modules/subdyn/src/SubDyn_Types.f90 Adds SlDNonLinear to SubDyn init/param types and updates copy/pack/unpack.
modules/subdyn/src/SubDyn_Registry.txt Registers SlDNonLinear in InitInput and Parameter types for code generation/serialization.
modules/subdyn/src/SubDyn_Output.f90 Sets ReactSS outputs to NaN when SlDNonLinear is true.
modules/subdyn/src/SubDyn.f90 Copies SlDNonLinear from init input into p for runtime access.
modules/soildyn/src/SoilDyn.f90 Updates console output to better explain linear stiffness transfer and REDWIN nonlinear loads.
modules/openfast-library/src/FAST_Subs.f90 Sets Init%InData_SD%SlDNonLinear based on SoilDyn’s REDWIN interface usage.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment thread modules/subdyn/src/SubDyn_Output.f90 Outdated
@andrew-platt andrew-platt added this to the v5.0.1 milestone Apr 28, 2026
@andrew-platt andrew-platt merged commit e292567 into OpenFAST:dev Apr 28, 2026
13 checks passed
@andrew-platt
Copy link
Copy Markdown
Collaborator

Oops. I meant to put this on rc-5.0.1. Will open a PR to backport it.

@andrew-platt andrew-platt modified the milestones: v5.0.1, v5.1.0 Apr 28, 2026
andrew-platt added a commit that referenced this pull request Apr 29, 2026
…ort3319

Backport #3319 SoilDyn/SubDyn: reaction loads when REDWIN is used
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Module: SoilDyn Soil interaction module (REDWIN DLL coupling) Module: SubDyn

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants