Skip to content

feat: integrated soil-pile interaction on the WindIO monopile path (#118)#136

Merged
SMI-Lab-Inha merged 4 commits into
masterfrom
feat/windio-soil-foundation
Jul 10, 2026
Merged

feat: integrated soil-pile interaction on the WindIO monopile path (#118)#136
SMI-Lab-Inha merged 4 commits into
masterfrom
feat/windio-soil-foundation

Conversation

@SMI-Lab-Inha

Copy link
Copy Markdown
Owner

Integrates the soil-pile interaction requested in #118 into the WindIO monopile path, so a soft-monopile model builds in one call instead of the manual BMI-poking the issue showed.

What

Tower.from_windio_with_monopile gains:

# auto-build the foundation from the ontology's pile geometry + soil props
Tower.from_windio_with_monopile(yaml, water_depth=30.0, soil_E=140e6, soil_nu=0.4)

# or pass a pre-built foundation
soil = MudlineFoundation.from_windio(yaml, soil_E=140e6, water_depth=30.0)
Tower.from_windio_with_monopile(yaml, water_depth=30.0, soil=soil)

When soil / soil_E is given, the rigid mudline clamp is replaced by the coupled-spring foundation and the model switches to a soft monopile (hub_conn=3), which lowers the coupled 1st frequency relative to the rigid clamp.

New MudlineFoundation.from_windio(yaml, soil_E=...) extracts the pile diameter (at the mudline), embedded length (-water_depth to the pile base) and EI (at the mudline) from the ontology's monopile component, then defers to the validated from_soil_properties. So only the soil is specified; the pile geometry that the issue's example had to poke out of sec_props is read from the yaml.

Design

  • Reuses the existing, validated MudlineFoundation (Shadlou / Randolph, WindIO monopile: optional soil springs (soil_eq) for from_windio_with_monopile #97, v1.15.0) and attach_mudline_foundation — no new soil numerics.
  • hub_conn=3 carries only the lumped mudline mooring_K; distr_k stays empty. The check_model floating-readiness gates stay silent (they gate on hub_conn=2), verified under warnings-as-errors.
  • This is the lumped mudline-spring integration (the issue's "OR an integrated soil_eq flag" branch, which the reporter leaned toward). Fully distributed Winkler distr_k springs remain a separate higher-fidelity follow-up.
  • All additive / non-breaking (new keyword-only params, default None).

Tests

tests/test_windio_soil_foundation.py (6): soil lowers the frequency vs the rigid clamp; soil_E auto-build equals the explicit foundation; hub_conn flips to 3; no spurious check warnings; soil + soil_E mutually exclusive; and the clear errors when the mudline is unknown or the pile does not extend below it.

Full suite 1012 passed, ruff + mypy (3.11/3.12) clean.

)

Tower.from_windio_with_monopile gains a `soil` keyword (a pre-built
MudlineFoundation) and a `soil_E`/`soil_nu`/`soil_profile`/`pile_behaviour`
/`soil_formula` auto-build path. When given, the rigid mudline clamp is
replaced by the coupled-spring soil foundation and the model switches to a
soft monopile (hub_conn=3), lowering the coupled frequency relative to the
rigid clamp.

New MudlineFoundation.from_windio(yaml, soil_E=...) classmethod extracts the
pile diameter, embedded length and EI at the mudline from the ontology's
monopile component, so only the soil is specified. The wiring reuses the
validated MudlineFoundation (#97) and attach_mudline_foundation, removing
the manual _bmi.support / hub_conn poking the feature request showed.
hub_conn=3 carries only the lumped mudline mooring_K; the check_model
floating gates stay silent (they gate on hub_conn=2). Fully distributed
Winkler distr_k springs remain a separate higher-fidelity follow-up.
@SMI-Lab-Inha

Copy link
Copy Markdown
Owner Author

@codex review

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: 653322c2ae

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

Comment on lines +619 to +623
foundation = MudlineFoundation.from_windio(
yaml_path,
soil_E=soil_E,
soil_nu=soil_nu,
soil_profile=soil_profile, # type: ignore[arg-type]

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

P2 Badge Honor geometry overrides when auto-building soil springs

When callers combine the new soil_E auto-build path with existing section overrides such as E=... or thickness_interp="piecewise_constant", the beam is built above with those overrides, but this call re-reads the monopile through MudlineFoundation.from_windio using the raw YAML/default linear thickness. The resulting pile_EI in the mudline springs can therefore differ from the actual monopile stiffness in the same model, corrupting the coupled frequencies for material or wall-schedule sensitivity runs.

Useful? React with 👍 / 👎.

…ings

When soil_E auto-build was combined with the material override (E=...) or a
non-default thickness_interp, the beam used them but MudlineFoundation.from_windio
re-read the monopile raw, so the mudline-spring pile_EI could differ from the
beam's actual monopile stiffness. Thread E and thickness_interp through
from_windio (E=None keeps the ontology value) and forward them from
from_windio_with_monopile, so the springs stay consistent with the beam under
a material or wall-schedule sensitivity run. A flexible-pile test pins that the
E override changes the foundation.
@SMI-Lab-Inha

Copy link
Copy Markdown
Owner Author

@codex review

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: 0bd355018e

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

Comment on lines +633 to +634
if foundation is not None:
obj.attach_mudline_foundation(foundation)

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

P2 Badge Reject auto-RNA with soil-flexible bases

When callers combine lumped_rna_cal=True with soil or soil_E, this branch switches the model to hub_conn=3 after read_windio_rna has produced a clamped-base tip-mass record. The single-tower path explicitly rejects auto-RNA for hub_conn=3, and read_windio_rna documents that the returned inertia is consumed only by the clamped-base path because nondim_tip_mass interprets cm_offset/cm_axial differently for hub_conn 3. This lets WindIO soil models silently solve with misplaced/double-counted RNA rotary inertia unless the combination is rejected or an explicit tip_mass is required.

Useful? React with 👍 / 👎.

Comment thread src/pybmodes/foundation.py Outdated
)
z_phys = mp.z_base + mp.station_grid * (mp.z_top - mp.z_base)
pile_diameter = float(np.interp(mudline, z_phys, mp.outer_diameter))
wall = float(np.interp(mudline, z_phys, mp.wall_thickness))

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

P2 Badge Honor piecewise-constant wall thickness at the mudline

For thickness_interp="piecewise_constant" and a mudline between WindIO stations, this linear interpolation gives a blended wall thickness for pile_EI, while the beam path inserts the mudline section with _interp(..., thickness_interp) and therefore uses the lower-station step value. The auto-built foundation can then use different mudline EI than the monopile section it is attached to, changing the coupled-spring stiffnesses for stepped wall schedules.

Useful? React with 👍 / 👎.

@SMI-Lab-Inha

Copy link
Copy Markdown
Owner Author

This is already fixed in the current head (0bd3550). The auto-build call now threads both overrides into the foundation so the mudline springs match the beam:

  • MudlineFoundation.from_windio gained E and thickness_interp parameters. E=None keeps the ontology modulus; a value overrides it for pile_EI. thickness_interp is passed to the monopile read so the wall thickness at the mudline uses the same interpolation as the beam.
  • from_windio_with_monopile forwards its own E and thickness_interp to that call (tower.py, the E=E, thickness_interp=thickness_interp lines in the from_windio invocation).

So a material or wall-schedule sensitivity run now uses the same monopile stiffness in the beam and in the springs. rho, nu and outfitting_factor are deliberately not passed since they do not enter pile_EI. tests/test_windio_soil_foundation.py::test_soil_auto_build_honors_E_override pins it on a flexible pile (where EI drives the springs), asserting the foundation changes when E is overridden.

@SMI-Lab-Inha

Copy link
Copy Markdown
Owner Author

@codex review

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: 0bd355018e

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

thickness_interp=thickness_interp,
)
if foundation is not None:
obj.attach_mudline_foundation(foundation)

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

P1 Badge Reject auto-RNA when enabling soil springs

When callers pass lumped_rna_cal=True together with soil or soil_E, this new branch still attaches the foundation and flips the model to hub_conn=3 after read_windio_rna has populated tip_mass. The WindIO RNA lump is explicitly clamped-base-only: nondim_tip_mass treats cm_axial differently for hub_conn in (2, 3), so the already tower-top-shifted auto-RNA inertia is reinterpreted and the soft-monopile frequencies are wrong. Please reject this combination, or require an explicit tip_mass, before enabling the soil foundation.

Useful? React with 👍 / 👎.

Comment thread src/pybmodes/foundation.py Outdated
)
z_phys = mp.z_base + mp.station_grid * (mp.z_top - mp.z_base)
pile_diameter = float(np.interp(mudline, z_phys, mp.outer_diameter))
wall = float(np.interp(mudline, z_phys, mp.wall_thickness))

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

P2 Badge Honor piecewise wall interpolation at the mudline

With thickness_interp="piecewise_constant" and a mudline between wall stations, this always linearly blends mp.wall_thickness. The monopile beam path inserts the mudline section using the selected interpolation mode, so the auto-built pile_EI can be based on a different wall thickness from the actual beam base and produce inconsistent soil springs. Use the same piecewise/linear interpolation when evaluating the wall at mudline.

Useful? React with 👍 / 👎.

… mudline

Two Codex findings on the soil integration:

- lumped_rna_cal + soil/soil_E is now rejected. The auto-RNA tip mass is
  built in the clamped-base (hub_conn=1) convention, which a soft monopile
  (hub_conn=3) interprets differently and would misplace the rotary inertia;
  mirrors the single-tower from_windio guard. Pass an explicit tip_mass for
  a soil-flexible base.
- MudlineFoundation.from_windio honours thickness_interp when reading the
  wall at the mudline: for piecewise_constant it takes the lower-station
  step value rather than a linear blend, matching the beam reduction so
  pile_EI is consistent on a tapered/stepped wall schedule.
@SMI-Lab-Inha

Copy link
Copy Markdown
Owner Author

@codex review

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: b857356ca7

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

"pass either soil (a MudlineFoundation) or soil_E (auto-build "
"from the ontology), not both."
)
foundation = soil

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

P2 Badge Require mudline depth when attaching explicit soil

When a caller passes a pre-built soil for a WindIO file that includes an embedded monopile but lacks or omits water_depth, read_windio_monopile_tower builds mt with the monopile toe as the beam base because it only truncates when a depth is available. This branch then attaches the foundation to that base, so the coupled springs act at the pile tip rather than the mudline and the embedded pile is also modeled as a free beam; the soil_E path avoids this by requiring a resolved water depth. Please require/resolve the mudline depth for the explicit-soil path too, or otherwise ensure the beam was truncated to the mudline before attaching.

Useful? React with 👍 / 👎.

The soil springs act at the mudline, so the beam must be truncated there.
read_windio_monopile_tower only truncates when a water depth resolves; the
soil_E path already requires one, but an explicit soil= foundation attached
to a file with an embedded monopile and no water_depth left the beam clamped
at the pile toe (embedded pile as a free beam, springs at the toe). Require
a resolved water depth for the explicit-soil path too.
@SMI-Lab-Inha

Copy link
Copy Markdown
Owner Author

@codex review

@chatgpt-codex-connector

Copy link
Copy Markdown

Codex Review: Didn't find any major issues. Nice work!

Reviewed commit: 6400599cf6

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

@SMI-Lab-Inha SMI-Lab-Inha merged commit e2b5b9c into master Jul 10, 2026
6 checks passed
@SMI-Lab-Inha SMI-Lab-Inha deleted the feat/windio-soil-foundation branch July 10, 2026 11:54
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