diff --git a/ard/collection/optiwindnet_wrap.py b/ard/collection/optiwindnet_wrap.py index 277b7937..f589a0f6 100644 --- a/ard/collection/optiwindnet_wrap.py +++ b/ard/collection/optiwindnet_wrap.py @@ -246,14 +246,10 @@ def compute_partials(self, inputs, J, discrete_inputs=None): # re-load the key variables back as locals XY_turbines = np.vstack([inputs["x_turbines"], inputs["y_turbines"]]).T XY_substations = np.vstack([inputs["x_substations"], inputs["y_substations"]]).T - # print(self.graph) + H = self.graph edges = H.edges() - # J["length_cables", "x_turbines"] = 0.0 - # J["length_cables", "y_turbines"] = 0.0 - # J["length_cables", "x_substations"] = 0.0 - # J["length_cables", "y_substations"] = 0.0 J["total_length_cables", "x_turbines"] = 0.0 J["total_length_cables", "y_turbines"] = 0.0 J["total_length_cables", "x_substations"] = 0.0 @@ -276,17 +272,9 @@ def compute_partials(self, inputs, J, discrete_inputs=None): dLdx0, dLdy0, dLdx1, dLdy1 = distance_function_deriv(x0, y0, x1, y1) if e0 >= 0: - # J["length_cables", "x_turbines"][idx_edge, e0] -= dLdx0 - # J["length_cables", "y_turbines"][idx_edge, e0] -= dLdy0 J["total_length_cables", "x_turbines"][0, e0] -= dLdx0 J["total_length_cables", "y_turbines"][0, e0] -= dLdy0 else: - # J["length_cables", "x_substations"][ - # idx_edge, self.N_substations + e0 - # ] -= dLdx0 - # J["length_cables", "y_substations"][ - # idx_edge, self.N_substations + e0 - # ] -= dLdy0 J["total_length_cables", "x_substations"][ 0, self.N_substations + e0 ] -= dLdx0 @@ -294,17 +282,9 @@ def compute_partials(self, inputs, J, discrete_inputs=None): 0, self.N_substations + e0 ] -= dLdy0 if e1 >= 0: - # J["length_cables", "x_turbines"][idx_edge, e1] -= dLdx1 - # J["length_cables", "y_turbines"][idx_edge, e1] -= dLdy1 J["total_length_cables", "x_turbines"][0, e1] -= dLdx1 J["total_length_cables", "y_turbines"][0, e1] -= dLdy1 else: - # J["length_cables", "x_substations"][ - # idx_edge, self.N_substations + e1 - # ] -= dLdx1 - # J["length_cables", "y_substations"][ - # idx_edge, self.N_substations + e1 - # ] -= dLdy1 J["total_length_cables", "x_substations"][ 0, self.N_substations + e1 ] -= dLdx1 diff --git a/ard/farm_aero/placeholder.py b/ard/farm_aero/placeholder.py index b8780618..5884d515 100644 --- a/ard/farm_aero/placeholder.py +++ b/ard/farm_aero/placeholder.py @@ -47,10 +47,6 @@ class PlaceholderBatchPower(templates.BatchFarmPowerTemplate): def initialize(self): super().initialize() # run super class script first! - def setup(self): - """Setup of OM component.""" - super().setup() # run super class script first! - def setup(self): super().setup() @@ -158,7 +154,7 @@ def setup(self): super().setup() # run super class script first! def setup_partials(self): - super().setup_partials() + self.declare_partials("*", "*", method="exact") def compute(self, inputs, outputs): @@ -181,6 +177,3 @@ def compute(self, inputs, outputs): * np.ones((self.N_turbines, self.N_wind_conditions)) ) outputs["thrust_turbines"] = np.zeros((self.N_turbines, self.N_wind_conditions)) - - def setup_partials(self): - self.declare_partials("*", "*", method="exact") diff --git a/ard/offshore/__init__.py b/ard/offshore/__init__.py index 9acbace8..d5c965d4 100644 --- a/ard/offshore/__init__.py +++ b/ard/offshore/__init__.py @@ -1,3 +1,3 @@ from . import mooring_constraint from . import mooring_design_constant_depth -from . import mooring_design_detailed +from . import mooring_design_detailed \ No newline at end of file diff --git a/ard/offshore/mooring_design_detailed.py b/ard/offshore/mooring_design_detailed.py index f35232ba..2b1a280d 100644 --- a/ard/offshore/mooring_design_detailed.py +++ b/ard/offshore/mooring_design_detailed.py @@ -7,7 +7,6 @@ import ard from ard.geographic.geomorphology import BathymetryGridData - class DetailedMooringDesign(om.ExplicitComponent): """ A class to create a detailed mooring design for a floating offshore wind farm. diff --git a/pyproject.toml b/pyproject.toml index 6f43b50f..d3b36b2d 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -34,8 +34,7 @@ classifiers = [ ] dependencies = [ "numpy", - # "floris>=4.3", - "floris @ git+https://github.com/nrel/floris.git@develop#egg=floris", + "floris>=4.3", "wisdem==3.18.1", "NLopt", "marmot-agents",