• Home
  • Features
  • Pricing
  • Docs
  • Announcements
  • Sign In

WISDEM / WEIS / 20625698074

31 Dec 2025 07:21PM UTC coverage: 58.335% (+0.2%) from 58.139%
20625698074

Pull #447

github

dzalkind
Fix more numpy openmdao float casts
Pull Request #447: Rectangular update

608 of 898 new or added lines in 11 files covered. (67.71%)

38 existing lines in 4 files now uncovered.

8315 of 14254 relevant lines covered (58.33%)

0.58 hits per line

Source File
Press 'n' to go to next uncovered line, 'b' for previous

88.48
/weis/glue_code/glue_code.py
1
import numpy as np
1✔
2
import os
1✔
3
import openmdao.api as om
1✔
4
from wisdem.glue_code.glue_code import WindPark as wisdemPark
1✔
5
#from wisdem.glue_code.gc_WT_DataStruc import WindTurbineOntologyOpenMDAO
6
#from wisdem.ccblade.ccblade_component import CCBladeTwist
7
#from wisdem.commonse.turbine_class import TurbineClass
8
from wisdem.drivetrainse.drivetrain import DrivetrainSE
1✔
9
from wisdem.commonse.cylinder_member import CylinderPostFrame
1✔
10
#from wisdem.nrelcsm.nrel_csm_cost_2015 import Turbine_CostsSE_2015
11
#from wisdem.orbit.api.wisdem.fixed import Orbit
12
#from wisdem.landbosse.landbosse_omdao.landbosse import LandBOSSE
13
from wisdem.plant_financese.plant_finance import PlantFinance
1✔
14
from wisdem.commonse.turbine_constraints  import TurbineConstraints
1✔
15
from weis.aeroelasticse.openmdao_openfast import FASTLoadCases
1✔
16
#from weis.control.dac import RunXFOIL
17
from wisdem.rotorse.rotor_power import NoStallConstraint
1✔
18
from weis.control.tune_rosco import ServoSE_ROSCO, ROSCO_Turbine
1✔
19
#from wisdem.rotorse.rotor_elasticity import RotorElasticity
20
from weis.aeroelasticse.utils import RotorLoadsDeflStrainsWEIS
1✔
21
from wisdem.glue_code.gc_RunTools import Convergence_Trends_Opt
1✔
22
from weis.glue_code.gc_RunTools import Outputs_2_Screen
1✔
23
from weis.frequency.raft_wrapper import RAFT_WEIS
1✔
24
from weis.control.tmd import TMD_group
1✔
25
from wisdem.commonse.cylinder_member import get_nfull
1✔
26

27

28
weis_dir = os.path.realpath(os.path.join(os.path.dirname(__file__),"../../"))
1✔
29

30
class WindPark(om.Group):
1✔
31
    # Openmdao group to run the analysis of the wind turbine
32

33
    def initialize(self):
1✔
34
        self.options.declare("modeling_options")
1✔
35
        self.options.declare("opt_options")
1✔
36

37
    def setup(self):
1✔
38
        modeling_options = self.options['modeling_options']
1✔
39
        opt_options      = self.options['opt_options']
1✔
40
        rosco_options    = modeling_options['ROSCO']
1✔
41

42
        #self.linear_solver = lbgs = om.LinearBlockGS()
43
        #self.nonlinear_solver = nlbgs = om.NonlinearBlockGS()
44
        #nlbgs.options["maxiter"] = 2
45
        #nlbgs.options["atol"] = nlbgs.options["atol"] = 1e-2
46

47
        '''
1✔
48
        dac_ivc = om.IndepVarComp()
49
        n_te_flaps = modeling_options["WISDEM"]["RotorSE"]["n_te_flaps"]
50
        dac_ivc.add_output("te_flap_ext",   val = np.ones(n_te_flaps))
51
        dac_ivc.add_output("te_flap_start", val=np.zeros(n_te_flaps),               desc="1D array of the start positions along blade span of the trailing edge flap(s). Only values between 0 and 1 are meaningful.")
52
        dac_ivc.add_output("te_flap_end",   val=np.zeros(n_te_flaps),               desc="1D array of the end positions along blade span of the trailing edge flap(s). Only values between 0 and 1 are meaningful.")
53
        dac_ivc.add_output("chord_start",   val=np.zeros(n_te_flaps),               desc="1D array of the positions along chord where the trailing edge flap(s) start. Only values between 0 and 1 are meaningful.")
54
        dac_ivc.add_output("delta_max_pos", val=np.zeros(n_te_flaps), units="rad",  desc="1D array of the max angle of the trailing edge flaps.")
55
        dac_ivc.add_output("delta_max_neg", val=np.zeros(n_te_flaps), units="rad",  desc="1D array of the min angle of the trailing edge flaps.")
56
        self.add_subsystem("dac_ivc",dac_ivc)
57
        '''
58

59
        tune_rosco_ivc = om.IndepVarComp()
1✔
60
        if modeling_options["ROSCO"]["linmodel_tuning"]["type"] == "robust":
1✔
61
            n_PC = 1
×
62
        else:
63
            n_PC = len(modeling_options["ROSCO"]["U_pc"])
1✔
64
        tune_rosco_ivc.add_output("omega_pc",         val=np.zeros(n_PC), units="rad/s",     desc="Pitch controller natural frequency")
1✔
65
        tune_rosco_ivc.add_output("zeta_pc",          val=np.zeros(n_PC),                    desc="Pitch controller damping ratio")
1✔
66
        tune_rosco_ivc.add_output("omega_vs",         val=0.0, units="rad/s",     desc="Generator torque controller natural frequency")
1✔
67
        tune_rosco_ivc.add_output("zeta_vs",          val=0.0,                    desc="Generator torque controller damping ratio")
1✔
68
        tune_rosco_ivc.add_output("flp_kp_norm",      val=0.0,                    desc="Flap controller normalized gain")
1✔
69
        tune_rosco_ivc.add_output("flp_tau",          val=0.0, units="s",         desc="Flap controller integral gain time constant")
1✔
70
        tune_rosco_ivc.add_output("IPC_Kp1p",         val=0.0, units="s",         desc="Individual pitch controller 1p proportional gain")
1✔
71
        tune_rosco_ivc.add_output("IPC_Ki1p",         val=0.0,                    desc="Individual pitch controller 1p integral gain")
1✔
72
        tune_rosco_ivc.add_output("stability_margin", val=0.0,                    desc="Stability margin for robust tuning")
1✔
73
        tune_rosco_ivc.add_output("omega_pc_max",     val=0.0,                    desc="Maximum allowable omega for robust tuning")
1✔
74
        # optional inputs - not connected right now!!
75
        optional_inputs = [
1✔
76
            'max_pitch',
77
            'min_pitch',
78
            'vs_minspd',
79
            'ss_vsgain',
80
            'ss_pcgain',
81
            'ps_percent',
82
        ]
83
        for param in optional_inputs:
1✔
84
            if param in rosco_options:
1✔
85
                tune_rosco_ivc.add_output(param, val=0.0, desc='Optional input for ROSCO tuning')
1✔
86

87

88
        tune_rosco_ivc.add_output('sd_maxpit',        val=0.0, units='rad',       desc='Maximum blade pitch angle to initiate shutdown [rad], {default = bld pitch at v_max}')
1✔
89
        tune_rosco_ivc.add_output('sd_cornerfreq',    val=0.0, units='rad/s',     desc='Cutoff Frequency for first order low-pass filter for blade pitch angle [rad/s], {default = 0.41888 ~ time constant of 15s}')
1✔
90
        tune_rosco_ivc.add_output('Kp_flap',          val=0.0, units='s',         desc='Proportional term of the PI controller for the trailing-edge flaps')
1✔
91
        tune_rosco_ivc.add_output('Ki_flap',          val=0.0,                    desc='Integral term of the PI controller for the trailing-edge flaps')
1✔
92
        tune_rosco_ivc.add_output('twr_freq',         val=3.2, units='rps',     desc='Tower natural frequency')
1✔
93
        tune_rosco_ivc.add_output('ptfm_freq',        val=0.2, units='rad/s',     desc='Platform natural frequency')
1✔
94
        tune_rosco_ivc.add_output('Kp_float',         val=0.0, units='s',         desc='Floating feedback gain')
1✔
95

96
        self.add_subsystem("tune_rosco_ivc",tune_rosco_ivc)
1✔
97

98
        # Analysis components
99
        self.add_subsystem("wisdem",   wisdemPark(modeling_options = modeling_options, opt_options = opt_options), promotes=["*"])
1✔
100

101
        '''
1✔
102
        # XFOIL
103
        self.add_subsystem("xf",        RunXFOIL(modeling_options = modeling_options, opt_options = opt_options)) # Recompute polars with xfoil (for flaps)
104
        # Connections to run xfoil for te flaps
105
        if not modeling_options["OpenFAST"]["from_openfast"]:
106
            self.connect("blade.pa.chord_param",                  "xf.chord")
107
            self.connect("blade.outer_shape.s",               "xf.s")
108
            self.connect("blade.interp_airfoils.coord_xy_interp", "xf.coord_xy_interp")
109
            self.connect("airfoils.aoa",                          "xf.aoa")
110
            self.connect("blade.high_level_blade_props.r_blade",  "xf.r")
111
            self.connect("dac_ivc.te_flap_end",                   "xf.span_end")
112
            self.connect("dac_ivc.te_flap_ext",                   "xf.span_ext")
113
            self.connect("dac_ivc.chord_start",                   "xf.chord_start")
114
            self.connect("dac_ivc.delta_max_pos",                 "xf.delta_max_pos")
115
            self.connect("dac_ivc.delta_max_neg",                 "xf.delta_max_neg")
116
            self.connect("env.speed_sound_air",                   "xf.speed_sound_air")
117
            self.connect("env.rho_air",                           "xf.rho_air")
118
            self.connect("env.mu_air",                            "xf.mu_air")
119
            self.connect("control.rated_TSR",                     "xf.rated_TSR")
120
            if modeling_options["flags"]["control"]:
121
                self.connect("control.max_TS",                        "xf.max_TS")
122
            self.connect("af_3d.cl_corrected", "xf.cl_interp")
123
            self.connect("af_3d.cd_corrected", "xf.cd_interp")
124
            self.connect("af_3d.cm_corrected", "xf.cm_interp")
125
        '''
126

127
        # ROSCO can be used at all levels
128
        if modeling_options["ROSCO"]["flag"]:
1✔
129
            if modeling_options["OpenFAST"]["from_openfast"]:  # not using WISDEM turbine info
1✔
130
                self.add_subsystem("rosco_turbine",          ROSCO_Turbine(modeling_options = modeling_options)) # ROSCO tuning
1✔
131

132
            self.add_subsystem("sse_tune",          ServoSE_ROSCO(modeling_options = modeling_options, opt_options = opt_options)) # ROSCO tuning
1✔
133

134
            if not modeling_options["OpenFAST"]["from_openfast"]:     #from WISDEM models
1✔
135
                self.connect("rotorse.rp.powercurve.rated_V",         ["sse_tune.tune_rosco.v_rated"])
1✔
136
                #self.connect("rotorse.rp.gust.V_gust",                ["freq_rotor.aero_gust.V_load", "freq_rotor.aero_hub_loads.V_load"])
137
                self.connect("rotorse.rp.powercurve.rated_Omega",     "sse_tune.tune_rosco.rated_rotor_speed")
1✔
138
                #self.connect("rotorse.rp.powercurve.rated_pitch",     ["freq_rotor.pitch_load", "freq_rotor.tot_loads_gust.aeroloads_pitch"])
139
                self.connect("rotorse.rp.powercurve.rated_Q",          "sse_tune.tune_rosco.rated_torque")
1✔
140

141
                self.connect("blade.high_level_blade_props.r_blade",  "sse_tune.r")
1✔
142
                self.connect("blade.high_level_blade_props.Rtip", "sse_tune.Rtip")
1✔
143
                self.connect("hub.radius",                     "sse_tune.Rhub")
1✔
144
                self.connect("high_level_tower_props.hub_height", "sse_tune.hub_height")
1✔
145
                self.connect("hub.cone",                       "sse_tune.precone")
1✔
146
                self.connect("drivetrain.uptilt",                 "sse_tune.tilt")
1✔
147
                self.connect("airfoils.aoa",                   "sse_tune.airfoils_aoa")
1✔
148
                self.connect("airfoils.Re",                    "sse_tune.airfoils_Re")
1✔
149
                self.connect("af_3d.cl_corrected",             "sse_tune.airfoils_cl")
1✔
150
                self.connect("af_3d.cd_corrected",             "sse_tune.airfoils_cd")
1✔
151
                self.connect("af_3d.cm_corrected",             "sse_tune.airfoils_cm")
1✔
152
                self.connect("configuration.n_blades",         "sse_tune.nBlades")
1✔
153
                self.connect("env.rho_air",                    "sse_tune.rho")
1✔
154
                self.connect("env.mu_air",                     "sse_tune.mu")
1✔
155
                self.connect("blade.pa.chord_param",           "sse_tune.chord")
1✔
156
                self.connect("blade.pa.twist_param",           "sse_tune.theta")
1✔
157

158
                self.connect("control.V_in" ,                   "sse_tune.v_min")
1✔
159
                self.connect("control.V_out" ,                  "sse_tune.v_max")
1✔
160
                self.connect("blade.high_level_blade_props.prebend", "sse_tune.precurve")
1✔
161
                self.connect("blade.high_level_blade_props.prebendTip", "sse_tune.precurveTip")
1✔
162
                self.connect("blade.high_level_blade_props.presweep", "sse_tune.presweep")
1✔
163
                self.connect("blade.high_level_blade_props.presweepTip", "sse_tune.presweepTip")
1✔
164
                #self.connect("xf.flap_angles",                  "sse_tune.airfoils_UserProp")
165
                self.connect("control.minOmega",                "sse_tune.omega_min")
1✔
166
                self.connect("control.rated_TSR",               "sse_tune.tsr_operational")
1✔
167
                self.connect("configuration.rated_power",       "sse_tune.rated_power")
1✔
168

169
                self.connect("drivetrain.gear_ratio",              "sse_tune.tune_rosco.gear_ratio")
1✔
170
                self.connect("blade.high_level_blade_props.Rtip", "sse_tune.tune_rosco.R")
1✔
171
                self.connect("rotorse.I_all_blades",            "sse_tune.tune_rosco.rotor_inertia", src_indices=[0])
1✔
172
                self.connect("rotorse.rs.frame.flap_mode_freqs","sse_tune.tune_rosco.flap_freq", src_indices=[0])
1✔
173
                self.connect("rotorse.rs.frame.edge_mode_freqs","sse_tune.tune_rosco.edge_freq", src_indices=[0])
1✔
174
                self.connect("rotorse.rp.powercurve.rated_efficiency", "sse_tune.tune_rosco.generator_efficiency")
1✔
175
                self.connect("tower_grid.height",               "sse_tune.tune_rosco.TowerHt")
1✔
176
                self.connect("drivetrain.gearbox_efficiency",      "sse_tune.tune_rosco.gearbox_efficiency")
1✔
177
                self.connect("control.max_pitch_rate" ,         "sse_tune.tune_rosco.max_pitch_rate")
1✔
178
                self.connect("control.max_torque_rate" ,        "sse_tune.tune_rosco.max_torque_rate")
1✔
179

180
            else:       # reading openfast model using ROSCO toolbox via rosco_turbine
181
                self.connect("rosco_turbine.v_rated"            ,   ["sse_tune.tune_rosco.v_rated"])
1✔
182
                self.connect("rosco_turbine.rated_rotor_speed"  ,   "sse_tune.tune_rosco.rated_rotor_speed")
1✔
183
                self.connect("rosco_turbine.rated_torque"       ,   "sse_tune.tune_rosco.rated_torque")
1✔
184
                self.connect("rosco_turbine.rotor_inertia",         "sse_tune.tune_rosco.rotor_inertia", src_indices=[0])
1✔
185
                self.connect("rosco_turbine.flap_freq",             "sse_tune.tune_rosco.flap_freq", src_indices=[0])
1✔
186
                self.connect("rosco_turbine.edge_freq",             "sse_tune.tune_rosco.edge_freq", src_indices=[0])
1✔
187
                self.connect("rosco_turbine.generator_efficiency",  "sse_tune.tune_rosco.generator_efficiency")
1✔
188
                self.connect("rosco_turbine.rho",                   "sse_tune.rho")
1✔
189
                self.connect("rosco_turbine.R",                     "sse_tune.tune_rosco.R")
1✔
190
                self.connect("rosco_turbine.rated_power",           "sse_tune.rated_power")
1✔
191
                self.connect("rosco_turbine.v_min" ,                "sse_tune.v_min")
1✔
192
                self.connect("rosco_turbine.v_max" ,                "sse_tune.v_max")
1✔
193
                self.connect("rosco_turbine.max_pitch_rate" ,       "sse_tune.tune_rosco.max_pitch_rate")
1✔
194
                self.connect("rosco_turbine.max_torque_rate" ,      "sse_tune.tune_rosco.max_torque_rate")
1✔
195
                self.connect("rosco_turbine.omega_min",             "sse_tune.omega_min")
1✔
196
                self.connect("rosco_turbine.tsr_operational",       "sse_tune.tsr_operational")
1✔
197

198
                # Performance tables
199
                self.connect("rosco_turbine.Cp_table",        "sse_tune.tune_rosco.Cp_table")
1✔
200
                self.connect("rosco_turbine.Ct_table",        "sse_tune.tune_rosco.Ct_table")
1✔
201
                self.connect("rosco_turbine.Cq_table",        "sse_tune.tune_rosco.Cq_table")
1✔
202
                self.connect("rosco_turbine.pitch_vector",    "sse_tune.tune_rosco.pitch_vector")
1✔
203
                self.connect("rosco_turbine.tsr_vector",      "sse_tune.tune_rosco.tsr_vector")
1✔
204
                self.connect("rosco_turbine.U_vector",        "sse_tune.tune_rosco.U_vector")
1✔
205

206
                self.connect("rosco_turbine.gear_ratio",              "sse_tune.tune_rosco.gear_ratio")
1✔
207
                self.connect("rosco_turbine.gearbox_efficiency",      "sse_tune.tune_rosco.gearbox_efficiency")
1✔
208

209
                self.connect("rosco_turbine.TowerHt",               "sse_tune.tune_rosco.TowerHt")
1✔
210

211

212
            # ROSCO Independent Vars
213
            
214
            # optional parameters
215
            optional_inputs = [
1✔
216
                'max_pitch',
217
                'min_pitch',
218
                'vs_minspd',
219
                'ss_vsgain',
220
                'ss_pcgain',
221
                'ps_percent',
222
                ]
223
            for param in optional_inputs:
1✔
224
                if param in rosco_options:
1✔
225
                    self.connect(f'tune_rosco_ivc.{param}', f'sse_tune.tune_rosco.{param}')
1✔
226

227
            # required parameters
228
            self.connect('tune_rosco_ivc.omega_pc',         'sse_tune.tune_rosco.omega_pc')
1✔
229
            self.connect('tune_rosco_ivc.zeta_pc',          'sse_tune.tune_rosco.zeta_pc')
1✔
230
            self.connect('tune_rosco_ivc.omega_vs',         'sse_tune.tune_rosco.omega_vs')
1✔
231
            self.connect('tune_rosco_ivc.zeta_vs',          'sse_tune.tune_rosco.zeta_vs')
1✔
232
            self.connect('tune_rosco_ivc.IPC_Kp1p',         'sse_tune.tune_rosco.IPC_Kp1p')
1✔
233
            self.connect('tune_rosco_ivc.IPC_Ki1p',         'sse_tune.tune_rosco.IPC_Ki1p')
1✔
234
            self.connect('tune_rosco_ivc.stability_margin', 'sse_tune.tune_rosco.stability_margin')
1✔
235
            self.connect('tune_rosco_ivc.omega_pc_max', 'sse_tune.tune_rosco.omega_pc_max')
1✔
236

237
            # Someday, if we want to get ptfm_freq from Level 1, we"d switch that here
238
            self.connect("tune_rosco_ivc.ptfm_freq",        "sse_tune.tune_rosco.ptfm_freq")
1✔
239

240
            self.connect("tune_rosco_ivc.Kp_float",         "sse_tune.tune_rosco.Kp_float")
1✔
241
            #self.connect("dac_ivc.delta_max_pos",           "sse_tune.tune_rosco.delta_max_pos") # DAC removed
242
            if modeling_options["ROSCO"]["Flp_Mode"] > 0:
1✔
243
                self.connect("tune_rosco_ivc.flp_kp_norm",    "sse_tune.tune_rosco.flp_kp_norm")
×
244
                self.connect("tune_rosco_ivc.flp_tau",     "sse_tune.tune_rosco.flp_tau")
×
245

246
        if modeling_options["RAFT"]["flag"]:
1✔
247
            self.add_subsystem("raft", RAFT_WEIS(modeling_options = modeling_options, analysis_options=opt_options))
1✔
248

249
            n_span = modeling_options["WISDEM"]["RotorSE"]["n_span"]
1✔
250
            self.connect("configuration.turb_class",        "raft.turbulence_class")
1✔
251
            self.connect("configuration.ws_class" ,         "raft.turbine_class")
1✔
252
            self.connect("configuration.rotor_orientation", "raft.rotor_orientation")
1✔
253

254
            self.connect("high_level_tower_props.hub_height", "raft.turbine_hHub")
1✔
255
            self.connect("drivetrain.overhang", "raft.turbine_overhang")
1✔
256
            self.connect("drivetrain.distance_tt_hub", "raft.drive_height")
1✔
257
            self.connect("env.water_depth", "raft.mooring_water_depth")
1✔
258
            self.connect("env.rho_water", "raft.rho_water")
1✔
259
            self.connect("env.rho_air", "raft.rho_air")
1✔
260
            self.connect("env.mu_air", "raft.mu_air")
1✔
261
            self.connect("env.shear_exp", "raft.shear_exp")
1✔
262
            self.connect("sse_tune.tune_rosco.PC_GS_angles",    "raft.rotor_PC_GS_angles")
1✔
263
            self.connect("sse_tune.tune_rosco.PC_GS_Kp",        "raft.rotor_PC_GS_Kp")
1✔
264
            self.connect("sse_tune.tune_rosco.PC_GS_Ki",        "raft.rotor_PC_GS_Ki")
1✔
265
            self.connect("sse_tune.tune_rosco.Fl_Kp",           "raft.Fl_Kp")
1✔
266
            self.connect("sse_tune.tune_rosco.VS_Kp",           "raft.rotor_TC_VS_Kp")
1✔
267
            self.connect("sse_tune.tune_rosco.VS_Ki",           "raft.rotor_TC_VS_Ki")
1✔
268
            self.connect("control.V_in",                    "raft.V_cutin")
1✔
269
            self.connect("control.V_out",                   "raft.V_cutout")
1✔
270

271
            if modeling_options["flags"]["drivetrain"]:
1✔
272
                self.connect("drivese.rna_mass", "raft.turbine_mRNA")
1✔
273
                self.connect("drivese.rna_I_TT", "raft.rna_I_TT")
1✔
274
                self.connect("drivese.rna_cm", "raft.rna_cm")
1✔
275
                self.connect("drivese.base_F", "raft.turbine_Fthrust", src_indices=[0], flat_src_indices=True) # TODO: Multiple DLCs
1✔
276
            else:
277
                self.connect("drivese.above_yaw_mass", "raft.turbine_mRNA")
×
278
                self.connect("drivese.above_yaw_I_TT", "raft.rna_I_TT")
×
279
                self.connect("drivese.above_yaw_cm", "raft.rna_cm")
×
280

281
            if modeling_options["flags"]["blade"]:
1✔
282
                self.connect("rotorse.I_all_blades",     "raft.rotor_inertia", src_indices=[0])
1✔
283
                self.connect("rotorse.rp.powercurve.rated_V",       "raft.Vrated")
1✔
284
                self.connect("rotorse.rp.powercurve.rated_Omega",     "raft.rated_rotor_speed")
1✔
285
                self.connect("configuration.n_blades", "raft.nBlades")
1✔
286
                self.connect("hub.cone", "raft.precone")
1✔
287
                self.connect("drivetrain.uptilt", "raft.tilt")
1✔
288
                self.connect("drivetrain.gear_ratio", "raft.gear_ratio")
1✔
289
                self.connect("blade.high_level_blade_props.r_blade",  "raft.blade_r")
1✔
290
                self.connect("blade.high_level_blade_props.Rtip", "raft.blade_Rtip")
1✔
291
                self.connect("hub.radius", "raft.hub_radius")
1✔
292
                self.connect("blade.pa.chord_param", "raft.blade_chord")
1✔
293
                self.connect("blade.pa.twist_param", "raft.blade_theta")
1✔
294
                self.connect("blade.high_level_blade_props.prebend", "raft.blade_precurve")
1✔
295
                self.connect("blade.high_level_blade_props.prebendTip", "raft.blade_precurveTip")
1✔
296
                self.connect("blade.high_level_blade_props.presweep", "raft.blade_presweep")
1✔
297
                self.connect("blade.high_level_blade_props.presweepTip", "raft.blade_presweepTip")
1✔
298
                self.connect("airfoils.rthick_master", "raft.airfoils_r_thick")
1✔
299
                self.connect("blade.opt_var.af_position", "raft.airfoils_position")
1✔
300
                self.connect("airfoils.aoa", "raft.airfoils_aoa")
1✔
301
                self.connect("airfoils.cl", "raft.airfoils_cl")
1✔
302
                self.connect("airfoils.cd", "raft.airfoils_cd")
1✔
303
                self.connect("airfoils.cm", "raft.airfoils_cm")
1✔
304
                self.connect("high_level_tower_props.hub_height", "raft.wind_reference_height")
1✔
305
                self.connect("rotorse.rp.powercurve.V", "raft.rotor_powercurve_v")
1✔
306
                self.connect("rotorse.rp.powercurve.Omega", "raft.rotor_powercurve_omega_rpm")
1✔
307
                self.connect("rotorse.rp.powercurve.pitch", "raft.rotor_powercurve_pitch")
1✔
308

309
            if modeling_options["flags"]["tower"]:
1✔
310
                self.connect("tower.layer_thickness", "raft.tower_layer_thickness")
1✔
311
                self.connect("tower_grid.s", "raft.turbine_tower_stations")
1✔
312
                self.connect("tower.diameter", "raft.turbine_tower_d")
1✔
313
                self.connect("towerse.member.rho", "raft.tower_rho")
1✔
314
                self.connect("towerse.tower_section_height", "raft.tower_section_height")
1✔
315
                self.connect("towerse.member.tor_stff", "raft.tower_torsional_stiffness")
1✔
316
                self.connect("towerse.z_param",        "raft.wind.z")
1✔
317
                self.connect("rotorse.rp.gust.V_gust", "raft.Uref")
1✔
318
                self.connect("high_level_tower_props.hub_height", "raft.zref")
1✔
319
                self.connect("high_level_tower_props.tower_ref_axis", "raft.turbine_tower_rA", src_indices=om.slicer[0,:])
1✔
320
                self.connect("high_level_tower_props.tower_ref_axis", "raft.turbine_tower_rB", src_indices=om.slicer[-1,:])
1✔
321

322
            if modeling_options["flags"]["floating"]:
1✔
323
                self.connect("floatingse.member_variable_height", "raft.member_variable_height")
1✔
324

325
                for k, kname in enumerate(modeling_options["floating"]["members"]["name"]):
1✔
326
                    idx = modeling_options["floating"]["members"]["name2idx"][kname]
1✔
327
                    self.connect(f"floating.memgrid{idx}.layer_thickness", f"raft.member{k}:layer_thickness")
1✔
328
                    self.connect(f"floatingse.member{k}_{kname}.height", f"raft.member{k}:height")
1✔
329
                    self.connect(f"floatingse.member{k}_{kname}.rho", f"raft.member{k}:rho")
1✔
330
                    self.connect(f"floating.memgrp{idx}.s", f"raft.platform_member{k+1}_stations")
1✔
331
                    self.connect(f"floating.memgrp{idx}.ring_stiffener_web_height", f"raft.member{k}:ring_stiffener_web_height")
1✔
332
                    self.connect(f"floating.memgrp{idx}.ring_stiffener_web_thickness", f"raft.member{k}:ring_stiffener_web_thickness")
1✔
333
                    self.connect(f"floating.memgrp{idx}.ring_stiffener_flange_width", f"raft.member{k}:ring_stiffener_flange_width")
1✔
334
                    self.connect(f"floating.memgrp{idx}.ring_stiffener_flange_thickness", f"raft.member{k}:ring_stiffener_flange_thickness")
1✔
335
                    self.connect(f"floating.memgrp{idx}.ring_stiffener_spacing", f"raft.member{k}:ring_stiffener_spacing")
1✔
336
                    self.connect(f"floating.memgrp{idx}.bulkhead_grid", f"raft.platform_member{k+1}_cap_stations")
1✔
337
                    self.connect(f"floating.memgrp{idx}.bulkhead_thickness", f"raft.platform_member{k+1}_cap_t")
1✔
338
                    self.connect(f"floating.member{k}_{kname}:joint1", f"raft.platform_member{k+1}_rA")
1✔
339
                    self.connect(f"floating.member{k}_{kname}:joint2", f"raft.platform_member{k+1}_rB")
1✔
340
                    self.connect(f"floating.member{k}_{kname}:s_ghost1", f"raft.platform_member{k+1}_s_ghostA")
1✔
341
                    self.connect(f"floating.member{k}_{kname}:s_ghost2", f"raft.platform_member{k+1}_s_ghostB")
1✔
342
                    self.connect(f"floating.memgrp{idx}.ballast_grid", f"raft.member{k}:ballast_grid")
1✔
343
                    self.connect(f"floatingse.member{k}_{kname}.ballast_height", f"raft.member{k}:ballast_height")
1✔
344
                    self.connect(f"floatingse.member{k}_{kname}.ballast_density", f"raft.member{k}:ballast_density")
1✔
345

346
                    if modeling_options["floating"]["members"]["outer_shape"][k] == "circular":
1✔
347
                        self.connect(f"floatingse.member{k}_{kname}.outer_diameter", f"raft.member{k}:outer_diameter")
1✔
348
                        self.connect(f"floating.memgrid{idx}.ca_usr_grid", f"raft.member{k}:Ca")
1✔
349
                        self.connect(f"floating.memgrid{idx}.cd_usr_grid", f"raft.member{k}:Cd")
1✔
350
                    elif modeling_options["floating"]["members"]["outer_shape"][k] == "rectangular":
×
351
                        self.connect(f"floatingse.member{k}_{kname}.side_length_a", f"raft.member{k}:side_length_a")
×
352
                        self.connect(f"floatingse.member{k}_{kname}.side_length_b", f"raft.member{k}:side_length_b")
×
353
                        self.connect(f"floating.memgrid{idx}.ca_usr_grid", f"raft.member{k}:Ca")
×
354
                        self.connect(f"floating.memgrid{idx}.cd_usr_grid", f"raft.member{k}:Cd")
×
355
                        self.connect(f"floating.memgrid{idx}.cay_usr_grid", f"raft.member{k}:Cay")
×
356
                        self.connect(f"floating.memgrid{idx}.cdy_usr_grid", f"raft.member{k}:Cdy")
×
357

358
                # Rigid bodies
359
                for k in range(modeling_options['floating']['rigid_bodies']['n_bodies']):
1✔
NEW
360
                    self.connect(f"floating.rigid_body_{k}_node",f"raft.rigid_body_{k}_node")
×
NEW
361
                    self.connect(f"floating.rigid_body_{k}_mass",f"raft.rigid_body_{k}_mass")
×
NEW
362
                    self.connect(f"floating.rigid_body_{k}_inertia",f"raft.rigid_body_{k}_inertia")
×
363

364
                self.connect("mooring.mooring_nodes", "raft.mooring_nodes")
1✔
365
                self.connect("mooring.unstretched_length", "raft.unstretched_length")
1✔
366
                for var in ["diameter","mass_density","stiffness","breaking_load","cost_rate",
1✔
367
                            "transverse_added_mass","tangential_added_mass","transverse_drag","tangential_drag"]:
368
                    self.connect(f"mooring.line_{var}", f"raft.line_{var}")
1✔
369

370
        # TMD connections to openmdao_openfast
371
        if modeling_options["flags"]["TMDs"]:
1✔
372
            self.add_subsystem("TMDs",  TMD_group(modeling_options = modeling_options, opt_options = opt_options))
×
373

374
            self.connect("TMDs.mass",               "aeroelastic.TMD_mass")
×
375
            self.connect("TMDs.stiffness",          "aeroelastic.TMD_stiffness")
×
376
            self.connect("TMDs.damping",            "aeroelastic.TMD_damping")
×
377

378
        if modeling_options["OpenFAST"]["flag"] or modeling_options["OpenFAST_Linear"]["flag"]:
1✔
379
            self.add_subsystem("aeroelastic",       FASTLoadCases(modeling_options = modeling_options, opt_options = opt_options))
1✔
380
            self.add_subsystem("stall_check_of",    NoStallConstraint(modeling_options = modeling_options))
1✔
381

382
            if modeling_options["flags"]["blade"]:
1✔
383
                self.add_subsystem("rlds_post",      RotorLoadsDeflStrainsWEIS(modeling_options = modeling_options, opt_options = opt_options))
1✔
384

385
                # Connections from blade struct parametrization to rotor load anlysis
386
                spars_tereinf = modeling_options["WISDEM"]["RotorSE"]["spars_tereinf"]
1✔
387
                self.connect("blade.opt_var.s_opt_layer_%d"%spars_tereinf[0], "rotorse.rs.constr.s_opt_spar_cap_ss")
1✔
388
                self.connect("blade.opt_var.s_opt_layer_%d"%spars_tereinf[1], "rotorse.rs.constr.s_opt_spar_cap_ps")
1✔
389

390

391
                # Connections to the stall check
392
                self.connect("blade.outer_shape.s",        "stall_check_of.s")
1✔
393
                self.connect("airfoils.aoa",                   "stall_check_of.airfoils_aoa")
1✔
394
                self.connect("af_3d.cl_corrected",             "stall_check_of.airfoils_cl")
1✔
395
                self.connect("af_3d.cd_corrected",             "stall_check_of.airfoils_cd")
1✔
396
                self.connect("af_3d.cm_corrected",             "stall_check_of.airfoils_cm")
1✔
397
                self.connect("aeroelastic.max_aoa",            "stall_check_of.aoa_along_span")
1✔
398

399
            if modeling_options["flags"]["drivetrain"]:
1✔
400
                self.add_subsystem("drivese_post",   DrivetrainSE(modeling_options=modeling_options))
1✔
401

402
            # TODO: FIX NDLC HERE
403
            if modeling_options["flags"]["tower"]:
1✔
404
                # This is needed for some reason because TowerSE isn"t already called?  Should probably re-use that
405
                n_height = modeling_options["WISDEM"]["TowerSE"]["n_height"]
1✔
406
                n_refine = modeling_options["WISDEM"]["TowerSE"]["n_refine"]
1✔
407
                n_full = get_nfull(n_height, nref=n_refine)
1✔
408
                self.add_subsystem("towerse_post",   CylinderPostFrame(modeling_options=modeling_options["WISDEM"]["TowerSE"], n_dlc=1, n_full = n_full))
1✔
409

410
            if modeling_options["flags"]["monopile"]:
1✔
411
                n_height = modeling_options["WISDEM"]["FixedBottomSE"]["n_height"]
×
412
                n_refine = modeling_options["WISDEM"]["FixedBottomSE"]["n_refine"]
×
413
                n_full = get_nfull(n_height, nref=n_refine)
×
414

415
                self.add_subsystem("fixedse_post",   CylinderPostFrame(modeling_options=modeling_options["WISDEM"]["FixedBottomSE"], n_dlc=1, n_full = n_full))
×
416

417
            if not modeling_options["OpenFAST"]["from_openfast"]:
1✔
418
                self.add_subsystem("tcons_post",     TurbineConstraints(modeling_options = modeling_options))
1✔
419
                self.add_subsystem("financese_post", PlantFinance(verbosity=modeling_options["General"]["verbosity"]))
1✔
420

421
            # Post-processing
422
            self.add_subsystem("outputs_2_screen_weis",  Outputs_2_Screen(modeling_options = modeling_options, opt_options = opt_options))
1✔
423
            if opt_options["opt_flag"]:
1✔
424
                self.add_subsystem("conv_plots_weis",    Convergence_Trends_Opt(opt_options = opt_options))
1✔
425

426
            #if modeling_options["ROSCO"]["Flp_Mode"]:
427
            #    # Connections to blade
428
            #    self.connect("dac_ivc.te_flap_end",             "blade.outer_shape.span_end")
429
            #    self.connect("dac_ivc.te_flap_ext",             "blade.outer_shape.span_ext")
430

431

432

433
            if modeling_options["ROSCO"]["flag"]==False:
1✔
434
                raise Exception("ERROR: WISDEM does not support openfast without the tuning of ROSCO")
×
435

436
            # Configuration parameters needed if model comes from openfast
437
            self.connect("control.V_in",                    "aeroelastic.V_cutin")
1✔
438
            self.connect("control.V_out",                   "aeroelastic.V_cutout")
1✔
439
            self.connect("env.shear_exp",                   "aeroelastic.shearExp")
1✔
440

441
            # Connections to aeroelasticse
442
            self.connect("configuration.turb_class",        "aeroelastic.turbulence_class")
1✔
443
            self.connect("configuration.ws_class" ,         "aeroelastic.turbine_class")
1✔
444
            self.connect("configuration.lifetime",          "aeroelastic.lifetime")
1✔
445

446
            if not modeling_options["OpenFAST"]["from_openfast"]:
1✔
447
                self.connect("blade.high_level_blade_props.blade_ref_axis", "aeroelastic.ref_axis_blade")
1✔
448
                self.connect("configuration.rotor_orientation", "aeroelastic.rotor_orientation")
1✔
449
                self.connect("blade.high_level_blade_props.r_blade",  "aeroelastic.r")
1✔
450
                self.connect("blade.pa.section_offset_y_param", "aeroelastic.le_location")
1✔
451
                self.connect("blade.pa.chord_param",            "aeroelastic.chord")
1✔
452
                self.connect("blade.pa.twist_param",            "aeroelastic.theta")
1✔
453
                self.connect("blade.interp_airfoils.coord_xy_interp", "aeroelastic.coord_xy_interp")
1✔
454
                self.connect("env.rho_air",                     "aeroelastic.rho")
1✔
455
                self.connect("env.speed_sound_air",             "aeroelastic.speed_sound_air")
1✔
456
                self.connect("env.mu_air",                      "aeroelastic.mu")
1✔
457
                self.connect("env.water_depth",                 "aeroelastic.water_depth")
1✔
458
                self.connect("env.rho_water",                   "aeroelastic.rho_water")
1✔
459
                self.connect("env.mu_water",                    "aeroelastic.mu_water")
1✔
460
                self.connect("env.Hsig_wave",                    "aeroelastic.Hsig_wave")     # TODO: these depend on wind speed
1✔
461
                self.connect("env.Tsig_wave",                    "aeroelastic.Tsig_wave")
1✔
462
                #self.connect("env.beta_wave",                    "aeroelastic.beta_wave") # TODO: NEED ONTOLOGY INPUT HERE
463
                self.connect("blade.high_level_blade_props.Rtip", "aeroelastic.Rtip")
1✔
464
                self.connect("hub.radius",                      "aeroelastic.Rhub")
1✔
465
                self.connect("hub.cone",                        "aeroelastic.cone")
1✔
466
                self.connect("drivese.hub_system_mass",         "aeroelastic.hub_system_mass")
1✔
467
                self.connect("drivese.hub_system_I",            "aeroelastic.hub_system_I")
1✔
468
                # TODO: Create these outputs in DriveSE: hub_system_cm needs 3-dim, not s-coord.  Need adder for rna-yaw_mass?
469
                #self.connect("drivese_post.hub_system_cm",                    "aeroelastic.hub_system_cm")
470
                self.connect("drivese.above_yaw_mass",          "aeroelastic.above_yaw_mass")
1✔
471
                self.connect("drivese.yaw_mass",                "aeroelastic.yaw_mass")
1✔
472
                self.connect("drivese.above_yaw_I_TT",          "aeroelastic.nacelle_I_TT")
1✔
473
                self.connect("drivese.above_yaw_cm",            "aeroelastic.nacelle_cm")
1✔
474
                self.connect("drivese.generator_rotor_I",       "aeroelastic.GenIner", src_indices=[0])
1✔
475
                self.connect("drivetrain.gear_ratio",              "aeroelastic.gearbox_ratio")
1✔
476
                self.connect("rotorse.rp.powercurve.rated_efficiency",  "aeroelastic.generator_efficiency")
1✔
477
                self.connect("control.max_pitch_rate" ,         "aeroelastic.max_pitch_rate")
1✔
478
                self.connect("drivetrain.gearbox_efficiency",      "aeroelastic.gearbox_efficiency")
1✔
479
                self.connect("drivetrain.uptilt",                  "aeroelastic.tilt")
1✔
480
                self.connect("drivetrain.overhang",                "aeroelastic.overhang")
1✔
481
                self.connect("drivetrain.distance_tt_hub",         "aeroelastic.distance_tt_hub")
1✔
482
                self.connect("drivese.drivetrain_spring_constant", "aeroelastic.drivetrain_spring_constant")
1✔
483
                self.connect("drivese.drivetrain_damping_coefficient", "aeroelastic.drivetrain_damping_coefficient")
1✔
484

485
                self.connect("high_level_tower_props.hub_height", "aeroelastic.hub_height")
1✔
486
                if modeling_options["flags"]["tower"]:
1✔
487
                    self.connect('towerse.total_mass_den',                'aeroelastic.mass_den')
1✔
488
                    self.connect("towerse.member.foreaft_stff",            "aeroelastic.foreaft_stff")
1✔
489
                    self.connect("towerse.member.sideside_stff",           "aeroelastic.sideside_stff")
1✔
490
                    self.connect("towerse.member.tor_stff",                "aeroelastic.tor_stff")
1✔
491
                    self.connect("towerse.tower_outer_diameter",    "aeroelastic.tower_outer_diameter")
1✔
492
                    self.connect("towerse.z_param",                 "aeroelastic.tower_z")
1✔
493
                    self.connect("towerse.z_full",                  "aeroelastic.tower_z_full")
1✔
494
                    self.connect("tower.cd",                        "aeroelastic.tower_cd")
1✔
495
                    self.connect("tower_grid.height",               "aeroelastic.tower_height")
1✔
496
                    self.connect("tower_grid.foundation_height",    "aeroelastic.tower_base_height")
1✔
497
                    self.connect("towerse.tower_I_base",            "aeroelastic.tower_I_base")
1✔
498
                    if modeling_options["flags"]["monopile"] or modeling_options["flags"]["jacket"]:
1✔
499
                        self.connect("fixedse.torsion_freqs",      "aeroelastic.tor_freq", src_indices=[0])
×
500
                        self.connect("fixedse.tower_fore_aft_modes",     "aeroelastic.fore_aft_modes")
×
501
                        self.connect("fixedse.tower_side_side_modes",    "aeroelastic.side_side_modes")
×
502
                        self.connect("fixedse.f1",         "sse_tune.tune_rosco.twr_freq")
×
503

504
                    elif modeling_options["flags"]["floating"]:
1✔
505
                        self.connect("floatingse.torsion_freqs",      "aeroelastic.tor_freq", src_indices=[0])
1✔
506
                        self.connect("floatingse.fore_aft_modes",     "aeroelastic.fore_aft_modes")
1✔
507
                        self.connect("floatingse.side_side_modes",    "aeroelastic.side_side_modes")
1✔
508
                        self.connect("floatingse.f1",         "sse_tune.tune_rosco.twr_freq")
1✔
509
                    else:
510
                        self.connect("towerse.tower.torsion_freqs",      "aeroelastic.tor_freq", src_indices=[0])
1✔
511
                        self.connect("towerse.tower.fore_aft_modes",     "aeroelastic.fore_aft_modes")
1✔
512
                        self.connect("towerse.tower.side_side_modes",    "aeroelastic.side_side_modes")
1✔
513
                        self.connect("towerse.tower.f1",         "sse_tune.tune_rosco.twr_freq")
1✔
514

515
                if modeling_options["flags"]["monopile"]:
1✔
516
                    self.connect("monopile.transition_piece_mass",  "aeroelastic.transition_piece_mass")
×
517
                    self.connect("fixedse.transition_piece_I",      "aeroelastic.transition_piece_I", src_indices=[0,1,2])
×
518
                    self.connect("monopile.gravity_foundation_mass", "aeroelastic.gravity_foundation_mass")
×
519
                    self.connect("fixedse.gravity_foundation_I",    "aeroelastic.gravity_foundation_I", src_indices=[0,1,2])
×
520
                    self.connect("fixedse.z_param",                 "aeroelastic.monopile_z")
×
521
                    self.connect("fixedse.z_full",                  "aeroelastic.monopile_z_full")
×
522
                    self.connect("fixedse.monopile_outer_diameter",    "aeroelastic.monopile_outer_diameter")
×
523
                    self.connect("fixedse.monopile_wall_thickness",    "aeroelastic.monopile_wall_thickness")
×
524
                    self.connect("fixedse.member.E",                       "aeroelastic.monopile_E")
×
525
                    self.connect("fixedse.member.G",                       "aeroelastic.monopile_G")
×
526
                    self.connect("fixedse.member.rho",                     "aeroelastic.monopile_rho")
×
527

528
                elif modeling_options["flags"]["floating"]:
1✔
529
                    self.connect("floatingse.platform_nodes", "aeroelastic.platform_nodes")
1✔
530
                    self.connect("floatingse.platform_elem_n1", "aeroelastic.platform_elem_n1")
1✔
531
                    self.connect("floatingse.platform_elem_n2", "aeroelastic.platform_elem_n2")
1✔
532
                    self.connect("floatingse.platform_elem_D", "aeroelastic.platform_elem_D")
1✔
533
                    self.connect("floatingse.platform_elem_t", "aeroelastic.platform_elem_t")
1✔
534
                    self.connect("floatingse.platform_elem_rho", "aeroelastic.platform_elem_rho")
1✔
535
                    self.connect("floatingse.platform_elem_E", "aeroelastic.platform_elem_E")
1✔
536
                    self.connect("floatingse.platform_elem_G", "aeroelastic.platform_elem_G")
1✔
537
                    if modeling_options["RAFT"]["flag"]:
1✔
538
                        ptfm_data_source = "raft"
1✔
539
                    else:
UNCOV
540
                        ptfm_data_source = "floatingse"
×
541
                    self.connect(f"{ptfm_data_source}.platform_mass", "aeroelastic.platform_mass")
1✔
542
                    self.connect(f"{ptfm_data_source}.platform_total_center_of_mass", "aeroelastic.platform_total_center_of_mass")
1✔
543
                    self.connect(f"{ptfm_data_source}.platform_I_total", "aeroelastic.platform_I_total")
1✔
544
                    self.connect(f"{ptfm_data_source}.platform_displacement", "aeroelastic.platform_displacement")
1✔
545
                    self.connect("floating.transition_node", "aeroelastic.transition_node")
1✔
546

547
                    for k, kname in enumerate(modeling_options["floating"]["members"]["name"]):
1✔
548
                        idx = modeling_options["floating"]["members"]["name2idx"][kname]
1✔
549
                        self.connect(f"floating.memgrp{idx}.s", f"aeroelastic.member{k}_{kname}:s")
1✔
550
                        self.connect(f"floatingse.member{k}_{kname}.wall_thickness", f"aeroelastic.member{k}_{kname}:wall_thickness")
1✔
551
                        self.connect(f"floatingse.member{k}_{kname}.rho", f"aeroelastic.member{k}_{kname}:rho")
1✔
552
                        self.connect(f"floatingse.member{k}_{kname}.E", f"aeroelastic.member{k}_{kname}:E")
1✔
553
                        self.connect(f"floatingse.member{k}_{kname}.G", f"aeroelastic.member{k}_{kname}:G")
1✔
554
                        self.connect(f"floatingse.member{k}_{kname}.ballast_z_cg", f"aeroelastic.member{k}_{kname}:ballast_z_cg")
1✔
555
                        self.connect(f"floatingse.member{k}_{kname}.ballast_mass", f"aeroelastic.member{k}_{kname}:ballast_mass")
1✔
556
                        self.connect(f"floatingse.member{k}_{kname}.ballast_I_base", f"aeroelastic.member{k}_{kname}:ballast_I_base")
1✔
557
                        self.connect(f"floatingse.member{k}_{kname}:variable_ballast_cg", f"aeroelastic.member{k}_{kname}:variable_ballast_cg")
1✔
558
                        self.connect(f"floatingse.member{k}_{kname}:variable_ballast_mass", f"aeroelastic.member{k}_{kname}:variable_ballast_mass")
1✔
559
                        self.connect(f"floatingse.member{k}_{kname}:variable_ballast_I", f"aeroelastic.member{k}_{kname}:variable_ballast_I")
1✔
560
                        self.connect(f"floatingse.member{k}_{kname}.bulkhead_mass", f"aeroelastic.member{k}_{kname}:bulkhead_mass")
1✔
561
                        self.connect(f"floatingse.member{k}_{kname}.bulkhead_z_cg", f"aeroelastic.member{k}_{kname}:bulkhead_z_cg")
1✔
562
                        self.connect(f"floatingse.member{k}_{kname}.bulkhead_I_base", f"aeroelastic.member{k}_{kname}:bulkhead_I_base")
1✔
563

564
                        # Member coefficients
565
                        if modeling_options['floating']['members']['outer_shape'][k] == "circular":
1✔
566
                            self.connect(f"floatingse.member{k}_{kname}.outer_diameter", f"aeroelastic.member{k}_{kname}:outer_diameter")
1✔
567
                            self.connect(f"floating.memgrid{idx}.ca_usr_grid", f"aeroelastic.member{k}_{kname}:Ca")
1✔
568
                            self.connect(f"floating.memgrid{idx}.cd_usr_grid", f"aeroelastic.member{k}_{kname}:Cd")
1✔
569
                        elif modeling_options['floating']['members']['outer_shape'][k] == "rectangular":
×
570
                            self.connect(f"floatingse.member{k}_{kname}.side_length_a", f"aeroelastic.member{k}_{kname}:side_length_a")
×
571
                            self.connect(f"floatingse.member{k}_{kname}.side_length_b", f"aeroelastic.member{k}_{kname}:side_length_b")
×
572
                            self.connect(f"floating.memgrid{idx}.ca_usr_grid", f"aeroelastic.member{k}_{kname}:Ca")
×
573
                            self.connect(f"floating.memgrid{idx}.cd_usr_grid", f"aeroelastic.member{k}_{kname}:Cd")
×
574
                            self.connect(f"floating.memgrid{idx}.cay_usr_grid", f"aeroelastic.member{k}_{kname}:Cay")
×
575
                            self.connect(f"floating.memgrid{idx}.cdy_usr_grid", f"aeroelastic.member{k}_{kname}:Cdy")
×
576

577

578
                        for var in ["joint1", "joint2", "s_ghost1", "s_ghost2"]:
1✔
579
                            self.connect(f"floating.member{k}_{kname}:{var}", f"aeroelastic.member{k}_{kname}:{var}")
1✔
580
                    
581
                    if modeling_options["flags"]["tower"]:
1✔
582
                        self.connect("floating.transition_piece_mass",  "aeroelastic.transition_piece_mass")
1✔
583
                        self.connect("floatingse.transition_piece_I",      "aeroelastic.transition_piece_I", src_indices=[0,1,2])
1✔
584

585
                self.connect("airfoils.aoa", "aeroelastic.airfoils_aoa")
1✔
586
                self.connect("airfoils.Re", "aeroelastic.airfoils_Re")
1✔
587
                self.connect("af_3d.cl_corrected", "aeroelastic.airfoils_cl")
1✔
588
                self.connect("af_3d.cd_corrected", "aeroelastic.airfoils_cd")
1✔
589
                self.connect("af_3d.cm_corrected", "aeroelastic.airfoils_cm")
1✔
590
                self.connect("blade.interp_airfoils.rthick_interp", "aeroelastic.rthick")
1✔
591
                self.connect("blade.interp_airfoils.ac_interp", "aeroelastic.ac")
1✔
592
                self.connect("rotorse.EIxx", "aeroelastic.blade:EIxx")
1✔
593
                self.connect("rotorse.EIyy", "aeroelastic.blade:EIyy")
1✔
594
                self.connect("rotorse.rhoA", "aeroelastic.blade:rhoA")
1✔
595
                self.connect("rotorse.re.K", "aeroelastic.blade:K")
1✔
596
                self.connect("rotorse.re.I", "aeroelastic.blade:I")
1✔
597
                self.connect("rotorse.rs.frame.flap_mode_shapes", "aeroelastic.blade:flap_mode_shapes")
1✔
598
                self.connect("rotorse.rs.frame.edge_mode_shapes", "aeroelastic.blade:edge_mode_shapes")
1✔
599
                self.connect('rotorse.rp.powercurve.V', 'aeroelastic.U_init')
1✔
600
                self.connect('rotorse.rp.powercurve.Omega', 'aeroelastic.Omega_init')
1✔
601
                self.connect('rotorse.rp.powercurve.pitch', 'aeroelastic.pitch_init')
1✔
602
                self.connect('rotorse.rp.powercurve.V_R25', 'aeroelastic.V_R25')
1✔
603
                self.connect('rotorse.rp.powercurve.rated_V', 'aeroelastic.Vrated')
1✔
604
                self.connect('rotorse.rp.powercurve.Ct_aero', 'aeroelastic.Ct_aero_init')
1✔
605
                self.connect("rotorse.rp.gust.V_gust", "aeroelastic.Vgust")
1✔
606
                self.connect("rotorse.wt_class.V_extreme1", "aeroelastic.V_extreme1")
1✔
607
                self.connect("rotorse.wt_class.V_extreme50", "aeroelastic.V_extreme50")
1✔
608
                self.connect("rotorse.wt_class.V_mean", "aeroelastic.V_mean_iec")
1✔
609
                self.connect("configuration.rated_power", "aeroelastic.control_ratedPower")
1✔
610
                self.connect("control.max_TS", "aeroelastic.control_maxTS")
1✔
611
                self.connect("control.maxOmega", "aeroelastic.control_maxOmega")
1✔
612
                self.connect("sse_tune.aeroperf_tables.pitch_vector","aeroelastic.pitch_vector")
1✔
613
                self.connect("sse_tune.aeroperf_tables.tsr_vector", "aeroelastic.tsr_vector")
1✔
614
                self.connect("sse_tune.aeroperf_tables.U_vector", "aeroelastic.U_vector")
1✔
615
                self.connect("sse_tune.aeroperf_tables.Cp", "aeroelastic.Cp_aero_table")
1✔
616
                self.connect("sse_tune.aeroperf_tables.Ct", "aeroelastic.Ct_aero_table")
1✔
617
                self.connect("sse_tune.aeroperf_tables.Cq", "aeroelastic.Cq_aero_table")
1✔
618
                #self.connect("xf.flap_angles", "aeroelastic.airfoils_UserProp")
619

620
                if modeling_options["flags"]["mooring"]:
1✔
621
                    self.connect("mooring.line_diameter", "aeroelastic.line_diameter")
1✔
622
                    self.connect("mooring.line_mass_density", "aeroelastic.line_mass_density")
1✔
623
                    self.connect("mooring.line_stiffness", "aeroelastic.line_stiffness")
1✔
624
                    self.connect("mooring.line_transverse_added_mass", "aeroelastic.line_transverse_added_mass")
1✔
625
                    self.connect("mooring.line_tangential_added_mass", "aeroelastic.line_tangential_added_mass")
1✔
626
                    self.connect("mooring.line_transverse_drag", "aeroelastic.line_transverse_drag")
1✔
627
                    self.connect("mooring.line_tangential_drag", "aeroelastic.line_tangential_drag")
1✔
628
                    self.connect("mooring.mooring_nodes", "aeroelastic.nodes_location_full")
1✔
629
                    self.connect("mooring.nodes_mass", "aeroelastic.nodes_mass")
1✔
630
                    self.connect("mooring.nodes_volume", "aeroelastic.nodes_volume")
1✔
631
                    self.connect("mooring.nodes_added_mass", "aeroelastic.nodes_added_mass")
1✔
632
                    self.connect("mooring.nodes_drag_area", "aeroelastic.nodes_drag_area")
1✔
633
                    self.connect("mooring.unstretched_length", "aeroelastic.unstretched_length")
1✔
634
                    self.connect("mooring.node_names", "aeroelastic.node_names")
1✔
635

636
                # For fatigue
637
                if modeling_options["flags"]["blade"]:
1✔
638
                    self.connect("blade.fatigue.sparU_sigma_ult", "aeroelastic.blade_sparU_ultstress")
1✔
639
                    self.connect("blade.fatigue.sparU_wohlerexp", "aeroelastic.blade_sparU_wohlerexp")
1✔
640
                    self.connect("blade.fatigue.sparU_wohlerA", "aeroelastic.blade_sparU_wohlerA")
1✔
641
                    self.connect("blade.fatigue.sparL_sigma_ult", "aeroelastic.blade_sparL_ultstress")
1✔
642
                    self.connect("blade.fatigue.sparL_wohlerexp", "aeroelastic.blade_sparL_wohlerexp")
1✔
643
                    self.connect("blade.fatigue.sparL_wohlerA", "aeroelastic.blade_sparL_wohlerA")
1✔
644
                    self.connect("blade.fatigue.teU_sigma_ult", "aeroelastic.blade_teU_ultstress")
1✔
645
                    self.connect("blade.fatigue.teU_wohlerexp", "aeroelastic.blade_teU_wohlerexp")
1✔
646
                    self.connect("blade.fatigue.teU_wohlerA", "aeroelastic.blade_teU_wohlerA")
1✔
647
                    self.connect("blade.fatigue.teL_sigma_ult", "aeroelastic.blade_teL_ultstress")
1✔
648
                    self.connect("blade.fatigue.teL_wohlerexp", "aeroelastic.blade_teL_wohlerexp")
1✔
649
                    self.connect("blade.fatigue.teL_wohlerA", "aeroelastic.blade_teL_wohlerA")
1✔
650
                    self.connect("rotorse.rs.strains.axial_root_sparU_load2stress", "aeroelastic.blade_root_sparU_load2stress")
1✔
651
                    self.connect("rotorse.rs.strains.axial_root_sparL_load2stress", "aeroelastic.blade_root_sparL_load2stress")
1✔
652
                    self.connect("rotorse.rs.strains.axial_maxc_teU_load2stress", "aeroelastic.blade_maxc_teU_load2stress")
1✔
653
                    self.connect("rotorse.rs.strains.axial_maxc_teL_load2stress", "aeroelastic.blade_maxc_teL_load2stress")
1✔
654
                if modeling_options["flags"]["drivetrain"]:
1✔
655
                    self.connect("drivese.lss_wohler_exp", "aeroelastic.lss_wohlerexp")
1✔
656
                    self.connect("drivese.lss_wohler_A", "aeroelastic.lss_wohlerA")
1✔
657
                    self.connect("drivese.lss_Xt", "aeroelastic.lss_ultstress")
1✔
658
                    self.connect("drivese.lss_axial_load2stress", "aeroelastic.lss_axial_load2stress")
1✔
659
                    self.connect("drivese.lss_shear_load2stress", "aeroelastic.lss_shear_load2stress")
1✔
660
                if modeling_options["flags"]["tower"]:
1✔
661
                    self.connect("towerse.member.wohler_exp", "aeroelastic.tower_wohlerexp")
1✔
662
                    self.connect("towerse.member.wohler_A", "aeroelastic.tower_wohlerA")
1✔
663
                    self.connect("towerse.member.sigma_ult", "aeroelastic.tower_ultstress")
1✔
664
                    self.connect("towerse.member.axial_load2stress", "aeroelastic.tower_axial_load2stress")
1✔
665
                    self.connect("towerse.member.shear_load2stress", "aeroelastic.tower_shear_load2stress")
1✔
666
                if modeling_options["flags"]["monopile"]:
1✔
667
                    self.connect("fixedse.member.wohler_exp", "aeroelastic.monopile_wohlerexp")
×
668
                    self.connect("fixedse.member.wohler_A", "aeroelastic.monopile_wohlerA")
×
669
                    self.connect("fixedse.member.sigma_ult", "aeroelastic.monopile_ultstress")
×
670
                    self.connect("fixedse.member.axial_load2stress", "aeroelastic.monopile_axial_load2stress")
×
671
                    self.connect("fixedse.member.shear_load2stress", "aeroelastic.monopile_shear_load2stress")
×
672

673
                # Connections to rotor load analysis
674
                self.connect("aeroelastic.blade_maxTD_Mx", "rlds_post.m2pa.Mx")
1✔
675
                self.connect("aeroelastic.blade_maxTD_My", "rlds_post.m2pa.My")
1✔
676
                self.connect("aeroelastic.blade_maxTD_Fz", "rlds_post.strains.F3")
1✔
677

678
                self.connect("rotorse.rs.frame.alpha", "rlds_post.alpha")
1✔
679
                self.connect("rotorse.EA", "rlds_post.strains.EA")
1✔
680
                self.connect("rotorse.A", "rlds_post.strains.A")
1✔
681
                self.connect("blade.pa.chord_param",  "rlds_post.strains.chord")
1✔
682
                self.connect("rotorse.rs.frame.EI11", "rlds_post.strains.EI11")
1✔
683
                self.connect("rotorse.rs.frame.EI22", "rlds_post.strains.EI22")
1✔
684
                self.connect("rotorse.xu_spar", "rlds_post.strains.xu_spar")
1✔
685
                self.connect("rotorse.xl_spar", "rlds_post.strains.xl_spar")
1✔
686
                self.connect("rotorse.yu_spar", "rlds_post.strains.yu_spar")
1✔
687
                self.connect("rotorse.yl_spar", "rlds_post.strains.yl_spar")
1✔
688
                self.connect("rotorse.xu_te", "rlds_post.strains.xu_te")
1✔
689
                self.connect("rotorse.xl_te", "rlds_post.strains.xl_te")
1✔
690
                self.connect("rotorse.yu_te", "rlds_post.strains.yu_te")
1✔
691
                self.connect("rotorse.yl_te", "rlds_post.strains.yl_te")
1✔
692
                self.connect("blade.outer_shape.s","rlds_post.constr.s")
1✔
693
                self.connect("blade.structure.d_f", "rlds_post.brs.d_f")
1✔
694
                self.connect("blade.structure.sigma_max", "rlds_post.brs.sigma_max")
1✔
695
                self.connect("blade.pa.chord_param", "rlds_post.brs.rootD", src_indices=[0])
1✔
696
                self.connect("blade.ps.layer_thickness_param", "rlds_post.brs.layer_thickness")
1✔
697
                self.connect("blade.structure.layer_start_nd", "rlds_post.brs.layer_start_nd")
1✔
698
                self.connect("blade.structure.layer_end_nd", "rlds_post.brs.layer_end_nd")
1✔
699

700
                # Connections to DriveSE
701
                if modeling_options["flags"]["drivetrain"]:
1✔
702
                    self.connect("hub.diameter"                    , "drivese_post.hub_diameter")
1✔
703
                    self.connect("hub.hub_in2out_circ"             , "drivese_post.hub_in2out_circ")
1✔
704
                    self.connect("hub.flange_t2shell_t"            , "drivese_post.flange_t2shell_t")
1✔
705
                    self.connect("hub.flange_OD2hub_D"             , "drivese_post.flange_OD2hub_D")
1✔
706
                    self.connect("hub.flange_ID2flange_OD"         , "drivese_post.flange_ID2flange_OD")
1✔
707
                    self.connect("hub.hub_stress_concentration"    , "drivese_post.hub_stress_concentration")
1✔
708
                    self.connect("hub.n_front_brackets"            , "drivese_post.n_front_brackets")
1✔
709
                    self.connect("hub.n_rear_brackets"             , "drivese_post.n_rear_brackets")
1✔
710
                    self.connect("hub.clearance_hub_spinner"       , "drivese_post.clearance_hub_spinner")
1✔
711
                    self.connect("hub.spin_hole_incr"              , "drivese_post.spin_hole_incr")
1✔
712
                    self.connect("hub.pitch_system_scaling_factor" , "drivese_post.pitch_system_scaling_factor")
1✔
713
                    self.connect("rotorse.wt_class.V_extreme50", "drivese.spinner_gust_ws")
1✔
714
                    self.connect("configuration.n_blades",          "drivese_post.n_blades")
1✔
715
                    self.connect("blade.high_level_blade_props.rotor_diameter", "drivese_post.rotor_diameter")
1✔
716
                    self.connect("configuration.upwind",       "drivese_post.upwind")
1✔
717
                    self.connect("control.minOmega" ,          "drivese_post.minimum_rpm")
1✔
718
                    self.connect("rotorse.rp.powercurve.rated_Omega",  "drivese_post.rated_rpm")
1✔
719
                    self.connect("rotorse.rp.powercurve.rated_Q",      "drivese_post.rated_torque")
1✔
720
                    self.connect("configuration.rated_power",  "drivese_post.machine_rating")
1✔
721
                    self.connect("tower.diameter",             "drivese_post.D_top", src_indices=[-1])
1✔
722
                    self.connect("aeroelastic.hub_Fxyz_aero",       "drivese_post.F_aero_hub")
1✔
723
                    self.connect("aeroelastic.hub_Mxyz_aero",       "drivese_post.M_aero_hub")
1✔
724
                    self.connect("aeroelastic.max_RootMyb",     "drivese_post.pitch_system.BRFM")
1✔
725
                    self.connect("blade.pa.chord_param",        "drivese_post.blade_root_diameter", src_indices=[0])
1✔
726
                    self.connect("rotorse.blade_mass",          "drivese_post.blade_mass")
1✔
727
                    self.connect("rotorse.mass_all_blades",     "drivese_post.blades_mass")
1✔
728
                    self.connect("rotorse.I_all_blades",        "drivese_post.blades_I")
1✔
729

730
                    self.connect("drivetrain.distance_hub_mb",           "drivese_post.L_h1")
1✔
731
                    self.connect("drivetrain.distance_mb_mb",            "drivese_post.L_12")
1✔
732
                    self.connect("generator.L_generator",             "drivese_post.L_generator")
1✔
733
                    self.connect("drivetrain.overhang",                  "drivese_post.overhang")
1✔
734
                    self.connect("drivetrain.distance_tt_hub",           "drivese_post.drive_height")
1✔
735
                    self.connect("drivetrain.uptilt",                    "drivese_post.tilt")
1✔
736
                    self.connect("drivetrain.gear_ratio",                "drivese_post.gear_ratio")
1✔
737
                    self.connect("drivetrain.mb1Type",                   "drivese_post.bear1.bearing_type")
1✔
738
                    self.connect("drivetrain.mb2Type",                   "drivese_post.bear2.bearing_type")
1✔
739
                    self.connect("drivetrain.lss_diameter",              "drivese_post.lss_diameter")
1✔
740
                    self.connect("drivetrain.lss_wall_thickness",        "drivese_post.lss_wall_thickness")
1✔
741
                    if modeling_options["WISDEM"]["DriveSE"]["direct"]:
1✔
742
                        self.connect("drivetrain.nose_diameter",              "drivese_post.bear1.D_shaft", src_indices=[0])
1✔
743
                        self.connect("drivetrain.nose_diameter",              "drivese_post.bear2.D_shaft", src_indices=[-1])
1✔
744
                    else:
745
                        self.connect("drivetrain.lss_diameter",              "drivese_post.bear1.D_shaft", src_indices=[0])
1✔
746
                        self.connect("drivetrain.lss_diameter",              "drivese_post.bear2.D_shaft", src_indices=[-1])
1✔
747
                    self.connect("drivetrain.uptower",                   "drivese_post.uptower")
1✔
748
                    self.connect("drivetrain.brake_mass_user",           "drivese_post.brake_mass_user")
1✔
749
                    self.connect("drivetrain.hvac_mass_coeff",           "drivese_post.hvac_mass_coeff")
1✔
750
                    self.connect("drivetrain.converter_mass_user",       "drivese_post.converter_mass_user")
1✔
751
                    self.connect("drivetrain.transformer_mass_user",     "drivese_post.transformer_mass_user")
1✔
752

753
                    if modeling_options["WISDEM"]["DriveSE"]["direct"]:
1✔
754
                        self.connect("drivetrain.nose_diameter",             "drivese_post.nose_diameter") # only used in direct
1✔
755
                        self.connect("drivetrain.nose_wall_thickness",       "drivese_post.nose_wall_thickness") # only used in direct
1✔
756
                        self.connect("drivetrain.bedplate_wall_thickness",   "drivese_post.bedplate_wall_thickness") # only used in direct
1✔
757
                    else:
758
                        self.connect("drivetrain.hss_length", "drivese_post.L_hss") # only used in geared
1✔
759
                        self.connect("drivetrain.hss_diameter", "drivese_post.hss_diameter") # only used in geared
1✔
760
                        self.connect("drivetrain.hss_wall_thickness", "drivese_post.hss_wall_thickness") # only used in geared
1✔
761
                        self.connect("drivetrain.hss_material", "drivese_post.hss_material")
1✔
762
                        self.connect("drivetrain.planet_numbers", "drivese_post.planet_numbers") # only used in geared
1✔
763
                        self.connect("drivetrain.gear_configuration", "drivese_post.gear_configuration") # only used in geared
1✔
764
                        self.connect("drivetrain.bedplate_flange_width", "drivese_post.bedplate_flange_width") # only used in geared
1✔
765
                        self.connect("drivetrain.bedplate_flange_thickness", "drivese_post.bedplate_flange_thickness") # only used in geared
1✔
766
                        self.connect("drivetrain.bedplate_web_thickness", "drivese_post.bedplate_web_thickness") # only used in geared
1✔
767
                        self.connect("drivetrain.gearbox_mass_user", "drivese_post.gearbox_mass_user")
1✔
768
                        self.connect("drivetrain.gearbox_radius_user", "drivese_post.gearbox_radius_user")
1✔
769
                        self.connect("drivetrain.gearbox_length_user", "drivese_post.gearbox_length_user")
1✔
770

771
                    self.connect("hub.hub_material",                  "drivese_post.hub_material")
1✔
772
                    self.connect("hub.spinner_material",              "drivese_post.spinner_material")
1✔
773
                    self.connect("drivetrain.lss_material",              "drivese_post.lss_material")
1✔
774
                    self.connect("drivetrain.bedplate_material",         "drivese_post.bedplate_material")
1✔
775
                    self.connect("materials.name",                    "drivese_post.material_names")
1✔
776
                    self.connect("materials.E",                       "drivese_post.E_mat")
1✔
777
                    self.connect("materials.G",                       "drivese_post.G_mat")
1✔
778
                    self.connect("materials.rho",                     "drivese_post.rho_mat")
1✔
779
                    self.connect("materials.sigma_y",                 "drivese_post.Xy_mat")
1✔
780
                    self.connect("materials.Xt",                      "drivese_post.Xt_mat")
1✔
781
                    self.connect("materials.wohler_exp",              "drivese_post.wohler_exp_mat")
1✔
782
                    self.connect("materials.wohler_intercept",        "drivese_post.wohler_A_mat")
1✔
783
                    self.connect("materials.unit_cost",               "drivese_post.unit_cost_mat")
1✔
784

785
                    if modeling_options["flags"]["generator"]:
1✔
786

787
                        self.connect("generator.B_r"          , "drivese_post.generator.B_r")
1✔
788
                        self.connect("generator.P_Fe0e"       , "drivese_post.generator.P_Fe0e")
1✔
789
                        self.connect("generator.P_Fe0h"       , "drivese_post.generator.P_Fe0h")
1✔
790
                        self.connect("generator.S_N"          , "drivese_post.generator.S_N")
1✔
791
                        self.connect("generator.alpha_p"      , "drivese_post.generator.alpha_p")
1✔
792
                        self.connect("generator.b_r_tau_r"    , "drivese_post.generator.b_r_tau_r")
1✔
793
                        self.connect("generator.b_ro"         , "drivese_post.generator.b_ro")
1✔
794
                        self.connect("generator.b_s_tau_s"    , "drivese_post.generator.b_s_tau_s")
1✔
795
                        self.connect("generator.b_so"         , "drivese_post.generator.b_so")
1✔
796
                        self.connect("generator.cofi"         , "drivese_post.generator.cofi")
1✔
797
                        self.connect("generator.freq"         , "drivese_post.generator.freq")
1✔
798
                        self.connect("generator.h_i"          , "drivese_post.generator.h_i")
1✔
799
                        self.connect("generator.h_sy0"        , "drivese_post.generator.h_sy0")
1✔
800
                        self.connect("generator.h_w"          , "drivese_post.generator.h_w")
1✔
801
                        self.connect("generator.k_fes"        , "drivese_post.generator.k_fes")
1✔
802
                        self.connect("generator.k_fillr"      , "drivese_post.generator.k_fillr")
1✔
803
                        self.connect("generator.k_fills"      , "drivese_post.generator.k_fills")
1✔
804
                        self.connect("generator.k_s"          , "drivese_post.generator.k_s")
1✔
805
                        self.connect("generator.m"            , "drivese_post.generator.m")
1✔
806
                        self.connect("generator.mu_0"         , "drivese_post.generator.mu_0")
1✔
807
                        self.connect("generator.mu_r"         , "drivese_post.generator.mu_r")
1✔
808
                        self.connect("generator.p"            , "drivese_post.generator.p")
1✔
809
                        self.connect("generator.phi"          , "drivese_post.generator.phi")
1✔
810
                        self.connect("generator.q1"           , "drivese_post.generator.q1")
1✔
811
                        self.connect("generator.q2"           , "drivese_post.generator.q2")
1✔
812
                        self.connect("generator.ratio_mw2pp"  , "drivese_post.generator.ratio_mw2pp")
1✔
813
                        self.connect("generator.resist_Cu"    , "drivese_post.generator.resist_Cu")
1✔
814
                        self.connect("generator.sigma"        , "drivese_post.generator.sigma")
1✔
815
                        self.connect("generator.y_tau_p"      , "drivese_post.generator.y_tau_p")
1✔
816
                        self.connect("generator.y_tau_pr"     , "drivese_post.generator.y_tau_pr")
1✔
817

818
                        self.connect("generator.I_0"          , "drivese_post.generator.I_0")
1✔
819
                        self.connect("generator.d_r"          , "drivese_post.generator.d_r")
1✔
820
                        self.connect("generator.h_m"          , "drivese_post.generator.h_m")
1✔
821
                        self.connect("generator.h_0"          , "drivese_post.generator.h_0")
1✔
822
                        self.connect("generator.h_s"          , "drivese_post.generator.h_s")
1✔
823
                        self.connect("generator.len_s"        , "drivese_post.generator.len_s")
1✔
824
                        self.connect("generator.n_r"          , "drivese_post.generator.n_r")
1✔
825
                        self.connect("generator.rad_ag"       , "drivese_post.generator.rad_ag")
1✔
826
                        self.connect("generator.t_wr"         , "drivese_post.generator.t_wr")
1✔
827

828
                        self.connect("generator.n_s"          , "drivese_post.generator.n_s")
1✔
829
                        self.connect("generator.b_st"         , "drivese_post.generator.b_st")
1✔
830
                        self.connect("generator.d_s"          , "drivese_post.generator.d_s")
1✔
831
                        self.connect("generator.t_ws"         , "drivese_post.generator.t_ws")
1✔
832

833
                        self.connect("generator.rho_Copper"   , "drivese_post.generator.rho_Copper")
1✔
834
                        self.connect("generator.rho_Fe"       , "drivese_post.generator.rho_Fe")
1✔
835
                        self.connect("generator.rho_Fes"      , "drivese_post.generator.rho_Fes")
1✔
836
                        self.connect("generator.rho_PM"       , "drivese_post.generator.rho_PM")
1✔
837

838
                        self.connect("generator.C_Cu"         , "drivese_post.generator.C_Cu")
1✔
839
                        self.connect("generator.C_Fe"         , "drivese_post.generator.C_Fe")
1✔
840
                        self.connect("generator.C_Fes"        , "drivese_post.generator.C_Fes")
1✔
841
                        self.connect("generator.C_PM"         , "drivese_post.generator.C_PM")
1✔
842

843
                        if modeling_options["WISDEM"]["DriveSE"]["generator"]["type"] in ["pmsg_outer"]:
1✔
UNCOV
844
                            self.connect("generator.N_c"          , "drivese_post.generator.N_c")
×
UNCOV
845
                            self.connect("generator.b"            , "drivese_post.generator.b")
×
UNCOV
846
                            self.connect("generator.c"            , "drivese_post.generator.c")
×
UNCOV
847
                            self.connect("generator.E_p"          , "drivese_post.generator.E_p")
×
UNCOV
848
                            self.connect("generator.h_yr"         , "drivese_post.generator.h_yr")
×
UNCOV
849
                            self.connect("generator.h_ys"         , "drivese_post.generator.h_ys")
×
UNCOV
850
                            self.connect("generator.h_sr"         , "drivese_post.generator.h_sr")
×
UNCOV
851
                            self.connect("generator.h_ss"         , "drivese_post.generator.h_ss")
×
UNCOV
852
                            self.connect("generator.t_r"          , "drivese_post.generator.t_r")
×
UNCOV
853
                            self.connect("generator.t_s"          , "drivese_post.generator.t_s")
×
854

UNCOV
855
                            self.connect("generator.u_allow_pcent", "drivese_post.generator.u_allow_pcent")
×
UNCOV
856
                            self.connect("generator.y_allow_pcent", "drivese_post.generator.y_allow_pcent")
×
UNCOV
857
                            self.connect("generator.z_allow_deg"  , "drivese_post.generator.z_allow_deg")
×
UNCOV
858
                            self.connect("generator.B_tmax"       , "drivese_post.generator.B_tmax")
×
UNCOV
859
                            self.connect("rotorse.rp.powercurve.rated_mech", "drivese_post.generator.P_mech")
×
860

861
                        if modeling_options["WISDEM"]["DriveSE"]["generator"]["type"] in ["eesg","pmsg_arms","pmsg_disc"]:
1✔
862
                            self.connect("generator.tau_p"        , "drivese_post.generator.tau_p")
×
863
                            self.connect("generator.h_ys"         , "drivese_post.generator.h_ys")
×
864
                            self.connect("generator.h_yr"         , "drivese_post.generator.h_yr")
×
865
                            self.connect("generator.b_arm"        , "drivese_post.generator.b_arm")
×
866

867
                        elif modeling_options["WISDEM"]["DriveSE"]["generator"]["type"] in ["scig","dfig"]:
1✔
868
                            self.connect("generator.B_symax"      , "drivese_post.generator.B_symax")
1✔
869
                            self.connect("generator.S_Nmax"      , "drivese_post.generator.S_Nmax")
1✔
870

871
                        if modeling_options["WISDEM"]["DriveSE"]["direct"]:
1✔
UNCOV
872
                            self.connect("drivetrain.nose_diameter",             "drivese_post.generator.D_nose", src_indices=[-1])
×
UNCOV
873
                            self.connect("drivetrain.lss_diameter",              "drivese_post.generator.D_shaft", src_indices=[0])
×
874
                        else:
875
                            self.connect("drivetrain.hss_diameter",              "drivese_post.generator.D_shaft", src_indices=[-1])
1✔
876

877
                    else:
878
                        self.connect("generator.generator_mass_user", "drivese_post.generator_mass_user")
1✔
879
                        self.connect("generator.generator_efficiency_user", "drivese_post.generator_efficiency_user")
1✔
880

881
                # Connections to TowerSE
882
                if modeling_options["flags"]["tower"]:
1✔
883
                    tow_params = ["z_full","outer_diameter_full","t_full",
1✔
884
                                  "E_full","G_full","rho_full","sigma_y_full",
885
                                  "section_A", "section_Asx","section_Asy",
886
                                  "section_Ixx", "section_Iyy", "section_J0",
887
                                  "section_rho", "section_E", "section_G", "section_L",
888
                                  ]
889
                    for k in tow_params:
1✔
890
                        self.connect(f"towerse.{k}", f"towerse_post.{k}")
1✔
891
                    self.connect("towerse.env.qdyn", "towerse_post.qdyn")
1✔
892
                    self.connect("tower_grid.height", "towerse_post.bending_height")
1✔
893

894
                    self.connect("aeroelastic.tower_maxMy_Fz", "towerse_post.cylinder_Fz")
1✔
895
                    self.connect("aeroelastic.tower_maxMy_Fx", "towerse_post.cylinder_Vx")
1✔
896
                    self.connect("aeroelastic.tower_maxMy_Fy", "towerse_post.cylinder_Vy")
1✔
897
                    self.connect("aeroelastic.tower_maxMy_Mx", "towerse_post.cylinder_Mxx")
1✔
898
                    self.connect("aeroelastic.tower_maxMy_My", "towerse_post.cylinder_Myy")
1✔
899
                    self.connect("aeroelastic.tower_maxMy_Mz", "towerse_post.cylinder_Mzz")
1✔
900

901
                if modeling_options["flags"]["monopile"]:
1✔
902
                    mono_params = ["z_full","outer_diameter_full","t_full",
×
903
                                   "E_full","G_full","rho_full","sigma_y_full",
904
                                  "section_A", "section_Asx","section_Asy",
905
                                  "section_Ixx", "section_Iyy", "section_J0",
906
                                  "section_rho", "section_E", "section_G",
907
                                  ]
908
                    for k in mono_params:
×
909
                        self.connect(f"fixedse.{k}", f"fixedse_post.{k}")
×
910
                    self.connect("fixedse.env.qdyn", "fixedse_post.qdyn")
×
911
                    self.connect("monopile.height", "fixedse_post.bending_height")
×
912

913
                    self.connect("aeroelastic.monopile_maxMy_Fz", "fixedse_post.cylinder_Fz")
×
914
                    self.connect("aeroelastic.monopile_maxMy_Fx", "fixedse_post.cylinder_Vx")
×
915
                    self.connect("aeroelastic.monopile_maxMy_Fy", "fixedse_post.cylinder_Vy")
×
916
                    self.connect("aeroelastic.monopile_maxMy_Mx", "fixedse_post.cylinder_Mxx")
×
917
                    self.connect("aeroelastic.monopile_maxMy_My", "fixedse_post.cylinder_Myy")
×
918
                    self.connect("aeroelastic.monopile_maxMy_Mz", "fixedse_post.cylinder_Mzz")
×
919

920
                #self.connect("yield_stress",            "tow.sigma_y") # TODO- materials
921
                #self.connect("max_taper_ratio",         "max_taper") # TODO-
922
                #self.connect("min_diameter_thickness_ratio", "min_d_to_t")
923

924
                # Connections to turbine constraints
925
                self.connect("configuration.rotor_orientation", "tcons_post.rotor_orientation")
1✔
926
                self.connect("aeroelastic.max_TipDxc", "tcons_post.tip_deflection")
1✔
927
                self.connect("blade.high_level_blade_props.Rtip", "tcons_post.Rtip")
1✔
928
                self.connect("blade.high_level_blade_props.blade_ref_axis",  "tcons_post.ref_axis_blade")
1✔
929
                self.connect("hub.cone", "tcons_post.precone")
1✔
930
                self.connect("drivetrain.uptilt", "tcons_post.tilt")
1✔
931
                self.connect("drivetrain.overhang", "tcons_post.overhang")
1✔
932
                self.connect("tower.ref_axis", "tcons_post.ref_axis_tower")
1✔
933
                self.connect("tower.diameter", "tcons_post.outer_diameter_full")
1✔
934

935
            else:  # connections from outside WISDEM
936
                self.connect("rosco_turbine.v_rated", "aeroelastic.Vrated")
1✔
937
                self.connect("rosco_turbine.R", "aeroelastic.Rtip")
1✔
938
                self.connect("rosco_turbine.hub_height", "aeroelastic.hub_height")
1✔
939
                self.connect("rosco_turbine.twr_freq", "sse_tune.tune_rosco.twr_freq")
1✔
940

941
            # Inputs to plantfinancese from wt group
942
            if not modeling_options["OpenFAST"]["from_openfast"]:
1✔
943

944
                # Connect computed AEP only if DLC 1.1 or AEP is used, otherwise use rotorse
945
                if modeling_options["DLC_driver"]["n_ws_aep"] > 0:
1✔
946
                    self.connect("aeroelastic.AEP", "financese_post.turbine_aep")
×
947
                else:
948
                    self.connect("rotorse.rp.AEP", "financese_post.turbine_aep")
1✔
949

950
                self.connect("tcc.turbine_cost_kW",     "financese_post.tcc_per_kW")
1✔
951
                if modeling_options["flags"]["bos"]:
1✔
952
                    if modeling_options["flags"]["offshore"]:
1✔
953
                        self.connect("orbit.total_capex_kW",    "financese_post.bos_per_kW")
1✔
954
                    else:
955
                        self.connect("landbosse.bos_capex_kW",  "financese_post.bos_per_kW")
1✔
956
                else:
957
                    self.connect("costs.bos_per_kW", "financese_post.bos_per_kW")
×
958

959
            # Inputs to plantfinancese from input yaml
960
            if modeling_options["flags"]["control"] and not modeling_options["OpenFAST"]["from_openfast"]:
1✔
961
                self.connect("configuration.rated_power",     "financese_post.machine_rating")
1✔
962

963
            if not modeling_options["OpenFAST"]["from_openfast"]:
1✔
964
                self.connect("costs.turbine_number",    "financese_post.turbine_number")
1✔
965
                self.connect("costs.opex_per_kW",       "financese_post.opex_per_kW")
1✔
966
                self.connect("costs.offset_tcc_per_kW", "financese_post.offset_tcc_per_kW")
1✔
967
                self.connect("costs.wake_loss_factor",  "financese_post.wake_loss_factor")
1✔
968
                self.connect("costs.fixed_charge_rate", "financese_post.fixed_charge_rate")
1✔
969

970
            if modeling_options["DLC_driver"]["n_ws_aep"] > 0:
1✔
971
                self.connect("aeroelastic.AEP",     "outputs_2_screen_weis.aep")
1✔
972

973
            # Connections to outputs to screen
974
            if not modeling_options["OpenFAST"]["from_openfast"]:
1✔
975
                self.connect("financese_post.lcoe",          "outputs_2_screen_weis.lcoe")
1✔
976

977
                self.connect("rotorse.blade_mass",  "outputs_2_screen_weis.blade_mass")
1✔
978
                self.connect("aeroelastic.max_TipDxc", "outputs_2_screen_weis.tip_deflection")
1✔
979

980
            if modeling_options["General"]["openfast_configuration"]["model_only"] == False:
1✔
981
                self.connect("aeroelastic.DEL_RootMyb",        "outputs_2_screen_weis.DEL_RootMyb")
1✔
982
                self.connect("aeroelastic.DEL_TwrBsMyt",       "outputs_2_screen_weis.DEL_TwrBsMyt")
1✔
983
                self.connect("aeroelastic.rotor_overspeed",    "outputs_2_screen_weis.rotor_overspeed")
1✔
984
                self.connect("aeroelastic.Std_PtfmPitch",      "outputs_2_screen_weis.Std_PtfmPitch")
1✔
985
                self.connect("aeroelastic.Max_PtfmPitch",      "outputs_2_screen_weis.Max_PtfmPitch")
1✔
986
                self.connect("tune_rosco_ivc.omega_pc",        "outputs_2_screen_weis.omega_pc")
1✔
987
                self.connect("tune_rosco_ivc.zeta_pc",         "outputs_2_screen_weis.zeta_pc")
1✔
988
                self.connect("tune_rosco_ivc.omega_vs",        "outputs_2_screen_weis.omega_vs")
1✔
989
                self.connect("tune_rosco_ivc.zeta_vs",         "outputs_2_screen_weis.zeta_vs")
1✔
990
                self.connect("tune_rosco_ivc.Kp_float",        "outputs_2_screen_weis.Kp_float")
1✔
991
                self.connect("tune_rosco_ivc.ptfm_freq",       "outputs_2_screen_weis.ptfm_freq")
1✔
992
                self.connect("tune_rosco_ivc.flp_kp_norm",       "outputs_2_screen_weis.flp_kp_norm")
1✔
993
                self.connect("tune_rosco_ivc.flp_tau",        "outputs_2_screen_weis.flp_tau")
1✔
994
                self.connect("tune_rosco_ivc.IPC_Kp1p",        "outputs_2_screen_weis.IPC_Kp1p")
1✔
995
                self.connect("tune_rosco_ivc.IPC_Ki1p",        "outputs_2_screen_weis.IPC_Ki1p")
1✔
996
                #if modeling_options["ROSCO"]["Flp_Mode"]:
997
                #    self.connect("dac_ivc.te_flap_end",            "outputs_2_screen_weis.te_flap_end")
998
                if modeling_options["OL2CL"]["flag"]:
1✔
999
                    self.connect("aeroelastic.OL2CL_pitch",      "outputs_2_screen_weis.OL2CL_pitch")
×
STATUS · Troubleshooting · Open an Issue · Sales · Support · CAREERS · ENTERPRISE · START FREE · SCHEDULE DEMO
ANNOUNCEMENTS · TWITTER · TOS & SLA · Supported CI Services · What's a CI service? · Automated Testing

© 2025 Coveralls, Inc