Skip to content

Conversation

@lsirkis
Copy link

@lsirkis lsirkis commented Jun 3, 2025

Overview
The proposed changes will integrate FAModel into Ard for mooring resizing.

Details

  • The method buildFAModel() was developed in the DetailedMooringDesign class to initialize an FAModel project from various input options
  • buildFAModel() is called in the setup() method to initialize
  • The FAModel project object is stored as a property of the DetailedMooringDesign class, under the name FAM (can be altered)
  • In compute() method, the repositionArray() method of the FAModel object is called to update platform, mooring, and anchor positions based on x,y, and phi platform inputs. This method also resizes mooring lines and resets anchor positions to match bathymetry its new position. Platform x,y locations are converted to m from km before being passed to FAModel.repositionArray() to ensure unit accuracy.
  • Currently, the FAM.repositionArray() returned values (mooring and anchor costs) are not stored in a variable in the DetailedMooringDesign.compute() method, but when the desired variable name/location is determined this information will be stored.
  • Anchor x,y locations are also pulled out of the FAModel object and converted to km to match Ard units

cfrontin and others added 22 commits May 12, 2025 10:26
* liberate python 3.13

* actually liberate python

* update testing

* version number inequality fix

* walkback python for backdated wisdem

* propogate to tests
… compute

- buildFAModel() will initialize a floating array model from either an ontology file or a set of inputs
- saves property called FAM to store FAModel project object
- call FAM.repositionArray() in compute function
- buildFAModel is now part of the detailedMooringDesign class
- for the ontology option, buildFAModel duplicates turbine 1 to reach desired number of turbines
- repositionArray requires turbine positions in m, convert for that
- created outputs dictionary to store anchor positions in km
- analysis_demo example is updated with ontology filename stored for working example
-for now, passing settings through [modeling_options][mooring_setup]
-"mooring_info" passes just the mooring and anchor sections of the ontology
-edits to Leah's automatic adding of platforms, moorings, anchors to resolve errors
-updated analysis_demo example for working example without ontology file
-- Added adjuster_settings dictionary to analysis_demo in mooring_setup dictionary
-- Adjusted buildFAModel() to take in adjuster_settings and add to ontology file option as well as add to mooring objects with the FAModel project.addMooring()
-- streamline a few things in buildFAModel()
-- remove cables from example ontology file
-- streamline a few things in buildFAModel method
@lsirkis lsirkis marked this pull request as ready for review June 4, 2025 15:31
@lsirkis lsirkis marked this pull request as draft June 4, 2025 15:31
Copy link
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 integrates the FAModel library into Ard for detailed mooring resizing and positioning.

  • Added sample soil and bathymetry input files for offshore mooring examples
  • Extended analysis_demo.py to configure mooring_setup with the new adjuster
  • Updated DetailedMooringDesign: added buildFAModel, initialized self.FAM, performed unit conversions, and repositioned moorings & anchors in compute()

Reviewed Changes

Copilot reviewed 5 out of 5 changed files in this pull request and generated no comments.

File Description
examples/offshore-detailed/soil_sample.txt Added a template soil input file
examples/offshore-detailed/bathymetry200m_sample.txt Added a template bathymetry input file
examples/offshore-detailed/analysis_demo.py Imported adjustMooring and added mooring_setup config
ard/offshore/mooring_design_detailed.py Introduced buildFAModel, FAM initialization, reposition logic, and unit conversions
Comments suppressed due to low confidence (4)

ard/offshore/mooring_design_detailed.py:130

  • [nitpick] The attribute name FAM is uppercase, which deviates from Python snake_case conventions; consider renaming it to fa_model or fam_model for consistency.
self.FAM = self.buildFAModel(**self.options['modeling_options']['mooring_setup'])

ard/offshore/mooring_design_detailed.py:127

  • [nitpick] The new mooring_setup path and buildFAModel logic are not covered by existing tests; please add unit tests to verify correct model initialization and repositioning behavior.
if 'mooring_setup' not in self.options['modeling_options']:

ard/offshore/mooring_design_detailed.py:190

  • The code uses np.array but there is no import numpy as np at the top of the file; please add the import to avoid a NameError.
self.FAM.repositionArray(np.array([[x_turbines[i],y_turbines[i]] for i in range(len(x_turbines))]),

ard/offshore/mooring_design_detailed.py:208

  • Reassigning outputs to a new dict shadows the OpenMDAO outputs object and prevents values from being recorded; remove this reassignment and write directly to the provided outputs parameter.
outputs = {}

@cfrontin
Copy link
Collaborator

cfrontin commented Jun 6, 2025

ok, let's start by applying this diff

diff --git a/pyproject.toml b/pyproject.toml
index d3b36b2..5518d64 100644
--- a/pyproject.toml
+++ b/pyproject.toml
@@ -43,6 +43,8 @@ dependencies = [
   "jax",
   "optiwindnet",
   "highspy",
+  "moorpy @ git+https://github.com/NREL/MoorPy.git@dev",
+  "famodel @ git+https://github.com/FloatingArrayDesign/FAModel.git@main",
 ]
 [project.optional-dependencies]
 dev = [

I think that should get everything installed and allow the tests to be meaningful.

@lsirkis can you apply this diff to your branch and push?

-- add dependencies for MoorPy dev branch and FAModel
from famodel.helpers import adjustMooring

class TestMooringDesignDetailed:
def setup_method(self):
Copy link
Collaborator

Choose a reason for hiding this comment

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

here's come context on how the test classes work: for each method of the class that begins with test_, a new test will be run. each test is run in a sandbox: it won't communicate with the scope outside that feature, with one major exception: before each test is run, setup_method will be re-run. it sets up the sandbox that a test is run in. so here, you've got this setup step happening but for the most part the objects created aren't being used in the tests so far.

Copy link
Collaborator

Choose a reason for hiding this comment

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

JUST KIDDING, you are definitely using these. REDACT REDACT REDACT


self.D_rotor = 240.0

# set turbine layout (3x3 grid 5D spacing)
Copy link
Collaborator

Choose a reason for hiding this comment

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

mismatch on spacing diameter count

jaredthomas68 and others added 27 commits June 18, 2025 15:46
* (prep to) liberate python 3.13 (NLRWindSystems#69)

* liberate python 3.13

* actually liberate python

* update testing

* version number inequality fix

* walkback python for backdated wisdem

* propogate to tests

* remove comments
* (prep to) liberate python 3.13 (NLRWindSystems#69)

* liberate python 3.13

* actually liberate python

* update testing

* version number inequality fix

* walkback python for backdated wisdem

* propogate to tests

* remove comments

* constraint testing added

* black reformatting

* added updated pyrite

* system test added but not complete for mooring packing

* add forgotten file

* Black reformat

* switch to using OM derivative checks, clean up

* black reformat

* Update test/system/ard/geometry/test_constraints.py

Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>

* Update test/system/ard/geometry/test_constraints.py

Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>

* Update test/system/ard/offshore/test_mooring_packing.py

Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>

* Update test/system/ard/offshore/test_mooring_packing.py

Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>

* Update test/system/ard/geometry/test_constraints.py

Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>

* tidy comments

* fix the problem discovered by the not problem that jared pointed out hahahaha

* barely avoided ragequitting due to black reformat

---------

Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
@cfrontin cfrontin merged commit 0beb28e into NLRWindSystems:offshore-development Jul 21, 2025
6 checks passed
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.

Detailed mooring design implementation

4 participants