Ejemplo n.º 1
0
    def setup(self):
        n_height_main = self.options['n_height_main']
        n_height_off = self.options['n_height_off']
        n_full_main = get_nfull(n_height_main)
        n_full_off = get_nfull(n_height_off)

        self.add_input('main_d_full', np.zeros(n_full_main), units='m')
        self.add_input('main_z_nodes', np.zeros(n_full_main), units='m')
        self.add_input('offset_d_full', np.zeros(n_full_off), units='m')
        self.add_input('offset_z_nodes', np.zeros(n_full_off), units='m')
        self.add_input('offset_freeboard', 0.0, units='m')
        self.add_input('offset_draft', 0.0, units='m')
        self.add_input('fairlead_location', 0.0)
        self.add_input('fairlead_offset_from_shell', 0.0, units='m')
        self.add_input('radius_to_offset_column', 0.0, units='m')
        self.add_input('number_of_offset_columns', 0)
        self.add_input('tower_d_base', 0.0, units='m')
        self.add_input('hsig_wave', 0.0, units='m')
        self.add_input('max_survival_heel', 0.0, units='deg')

        self.add_output('fairlead', 0.0, units='m')
        self.add_output('fairlead_radius', 0.0, units='m')
        self.add_output('main_offset_spacing', 0.0)
        self.add_output('tower_transition_buffer', 0.0, units='m')
        self.add_output('offset_freeboard_heel_margin', 0.0, units='m')
        self.add_output('offset_draft_heel_margin', 0.0, units='m')
        self.add_output('wave_height_fairlead_ratio', 0.0)

        # Derivatives
        self.declare_partials('*', '*', method='fd', form='central', step=1e-6)
Ejemplo n.º 2
0
    def setup(self):
        n_height_main = self.options["n_height_main"]
        n_height_off = self.options["n_height_off"]
        n_full_main = get_nfull(n_height_main)
        n_full_off = get_nfull(n_height_off)

        self.add_input("main_d_full", np.zeros(n_full_main), units="m")
        self.add_input("main_z_nodes", np.zeros(n_full_main), units="m")
        self.add_input("offset_d_full", np.zeros(n_full_off), units="m")
        self.add_input("offset_z_nodes", np.zeros(n_full_off), units="m")
        self.add_input("offset_freeboard", 0.0, units="m")
        self.add_input("offset_draft", 0.0, units="m")
        self.add_input("fairlead_location", 0.0)
        self.add_input("fairlead_offset_from_shell", 0.0, units="m")
        self.add_input("radius_to_offset_column", 0.0, units="m")
        self.add_input("number_of_offset_columns", 0)
        self.add_input("tower_d_base", 0.0, units="m")
        self.add_input("hsig_wave", 0.0, units="m")
        self.add_input("max_survival_heel", 0.0, units="deg")

        self.add_output("fairlead", 0.0, units="m")
        self.add_output("fairlead_radius", 0.0, units="m")
        self.add_output("main_offset_spacing", 0.0)
        self.add_output("tower_transition_buffer", 0.0, units="m")
        self.add_output("offset_freeboard_heel_margin", 0.0, units="m")
        self.add_output("offset_draft_heel_margin", 0.0, units="m")
        self.add_output("wave_height_fairlead_ratio", 0.0)

        # Derivatives
        self.declare_partials("*", "*", method="fd", form="central", step=1e-6)
Ejemplo n.º 3
0
from __future__ import print_function

import copy
import numpy as np
import numpy.testing as npt
import unittest
import time
import wisdem.floatingse.loading as sP
import matplotlib.pyplot as plt
from mpl_toolkits.mplot3d import Axes3D
from wisdem.commonse.vertical_cylinder import get_nfull
from wisdem.commonse import gravity as g

NSECTIONS = 5
NHEIGHT = NSECTIONS + 1
NPTS = get_nfull(NHEIGHT)

opt = {}
opt['gamma_f'] = 1.35
opt['gamma_m'] = 1.1
opt['gamma_n'] = 1.0
opt['gamma_b'] = 1.1
opt['gamma_fatigue'] = 1.755

opt['frame3dd'] = {}
opt['frame3dd']['shear'] = True
opt['frame3dd']['geom'] = False
opt['frame3dd']['dx'] = -1
opt['frame3dd']['nM'] = 6
opt['frame3dd']['Mmethod'] = 1
opt['frame3dd']['lump'] = 0
Ejemplo n.º 4
0
    def setup(self):
        n_height_main = self.options['n_height_main']
        n_height_off = self.options['n_height_off']
        n_height_tow = self.options['n_height_tow']
        n_full_main = get_nfull(n_height_main)
        n_full_off = get_nfull(n_height_off)
        n_full_tow = get_nfull(n_height_tow)

        self.add_input('rho_water', 0.0, units='kg/m**3')
        self.add_input('wave_period_range_low', 2.0, units='s')
        self.add_input('wave_period_range_high', 20.0, units='s')
        self.add_input('operational_heel', 0.0, units='deg')
        self.add_input('mooring_mass', 0.0, units='kg')
        self.add_input('mooring_moments_of_inertia',
                       np.zeros(6),
                       units='kg*m**2')
        self.add_input('mooring_neutral_load',
                       np.zeros((NLINES_MAX, 3)),
                       units='N')
        self.add_input('mooring_surge_restoring_force', 0.0, units='N')
        self.add_input('mooring_pitch_restoring_force',
                       np.zeros((NLINES_MAX, 3)),
                       units='N')
        self.add_input('mooring_cost', 0.0, units='USD')
        self.add_input('mooring_stiffness', np.zeros((6, 6)), units='N/m')
        self.add_input('fairlead', 1.0, units='m')
        self.add_input('fairlead_radius', 0.0, units='m')
        self.add_input('number_of_offset_columns', 0)
        self.add_input('radius_to_offset_column', 0.0, units='m')

        self.add_input('main_Iwaterplane', 0.0, units='m**4')
        self.add_input('main_Awaterplane', 0.0, units='m**2')
        self.add_input('main_cost', 0.0, units='USD')
        self.add_input('main_mass', np.zeros(n_full_main - 1), units='kg')
        self.add_input('main_freeboard', 0.0, units='m')
        self.add_input('main_center_of_buoyancy', 0.0, units='m')
        self.add_input('main_center_of_mass', 0.0, units='m')
        self.add_input('main_moments_of_inertia', np.zeros(6), units='kg*m**2')
        self.add_input('main_added_mass', np.zeros(6), units='kg')

        self.add_input('offset_Iwaterplane', 0.0, units='m**4')
        self.add_input('offset_Awaterplane', 0.0, units='m**2')
        self.add_input('offset_cost', 0.0, units='USD')
        self.add_input('offset_mass', np.zeros(n_full_off - 1), units='kg')
        self.add_input('offset_center_of_buoyancy', 0.0, units='m')
        self.add_input('offset_center_of_mass', 0.0, units='m')
        self.add_input('offset_moments_of_inertia',
                       np.zeros(6),
                       units='kg*m**2')
        self.add_input('offset_added_mass', np.zeros(6), units='kg')

        self.add_input('tower_mass', 0.0, units='kg')
        self.add_input('tower_shell_cost', 0.0, units='USD')
        self.add_input('tower_I_base', np.zeros(6), units='kg*m**2')
        self.add_input('tower_z_full', np.zeros(n_full_tow), units='m')
        self.add_input('rna_mass', 0.0, units='kg')
        self.add_input('rna_cg', np.zeros(3), units='m')
        self.add_input('rna_I', np.zeros(6), units='kg*m**2')

        self.add_input('water_ballast_zpts_vector',
                       np.zeros(n_full_main),
                       units='m')
        self.add_input('water_ballast_radius_vector',
                       np.zeros(n_full_main),
                       units='m')

        self.add_input('structural_mass', 0.0, units='kg')
        self.add_input('structure_center_of_mass', np.zeros(3), units='m')
        self.add_input('structural_frequencies', np.zeros(NFREQ), units='Hz')
        self.add_input('z_center_of_buoyancy', 0.0, units='m')
        self.add_input('total_displacement', 0.0, units='m**3')
        self.add_input('total_force', np.zeros(3), units='N')
        self.add_input('total_moment', np.zeros(3), units='N*m')
        self.add_input('pontoon_cost', 0.0, units='USD')

        self.add_output('substructure_moments_of_inertia',
                        np.zeros(6),
                        units='kg*m**2')
        self.add_output('total_mass', 0.0, units='kg')
        self.add_output('total_cost', 0.0, units='USD')
        self.add_output('metacentric_height', 0.0, units='m')
        self.add_output('buoyancy_to_gravity', 0.0)
        self.add_output('offset_force_ratio', 0.0)
        self.add_output('heel_moment_ratio', 0.0)
        self.add_output('Iwaterplane_system', 0.0, units='m**4')
        self.add_output('center_of_mass', np.zeros(3), units='m')
        self.add_output('variable_ballast_mass', 0.0, units='kg')
        self.add_output('variable_ballast_center_of_mass', 0.0, units='m')
        self.add_output('variable_ballast_moments_of_inertia',
                        np.zeros(6),
                        units='kg*m**2')
        self.add_output('variable_ballast_height', 0.0, units='m')
        self.add_output('variable_ballast_height_ratio', 0.0)
        self.add_output('mass_matrix', np.zeros(6), units='kg')
        self.add_output('added_mass_matrix', np.zeros(6), units='kg')
        self.add_output('hydrostatic_stiffness', np.zeros(6), units='N/m')
        self.add_output('rigid_body_periods', np.zeros(6), units='s')
        self.add_output('period_margin_low', np.zeros(6))
        self.add_output('period_margin_high', np.zeros(6))
        self.add_output('modal_margin_low', np.zeros(NFREQ))
        self.add_output('modal_margin_high', np.zeros(NFREQ))

        self.declare_partials('*', '*', method='fd', form='central', step=1e-6)
Ejemplo n.º 5
0
    def setup(self):
        n_height_main = self.options["n_height_main"]
        n_height_off = self.options["n_height_off"]
        n_height_tow = self.options["n_height_tow"]
        n_full_main = get_nfull(n_height_main)
        n_full_off = get_nfull(n_height_off)
        n_full_tow = get_nfull(n_height_tow)

        self.add_input("rho_water", 0.0, units="kg/m**3")
        self.add_input("wave_period_range_low", 2.0, units="s")
        self.add_input("wave_period_range_high", 20.0, units="s")
        self.add_input("operational_heel", 0.0, units="deg")
        self.add_input("mooring_mass", 0.0, units="kg")
        self.add_input("mooring_moments_of_inertia",
                       np.zeros(6),
                       units="kg*m**2")
        self.add_input("mooring_neutral_load",
                       np.zeros((NLINES_MAX, 3)),
                       units="N")
        self.add_input("mooring_surge_restoring_force", 0.0, units="N")
        self.add_input("mooring_pitch_restoring_force",
                       np.zeros((NLINES_MAX, 3)),
                       units="N")
        self.add_input("mooring_cost", 0.0, units="USD")
        self.add_input("mooring_stiffness", np.zeros((6, 6)), units="N/m")
        self.add_input("fairlead", 1.0, units="m")
        self.add_input("fairlead_radius", 0.0, units="m")
        self.add_input("number_of_offset_columns", 0)
        self.add_input("radius_to_offset_column", 0.0, units="m")

        self.add_input("main_Iwaterplane", 0.0, units="m**4")
        self.add_input("main_Awaterplane", 0.0, units="m**2")
        self.add_input("main_cost", 0.0, units="USD")
        self.add_input("main_mass", np.zeros(n_full_main - 1), units="kg")
        self.add_input("main_freeboard", 0.0, units="m")
        self.add_input("main_center_of_buoyancy", 0.0, units="m")
        self.add_input("main_center_of_mass", 0.0, units="m")
        self.add_input("main_moments_of_inertia", np.zeros(6), units="kg*m**2")
        self.add_input("main_added_mass", np.zeros(6), units="kg")

        self.add_input("offset_Iwaterplane", 0.0, units="m**4")
        self.add_input("offset_Awaterplane", 0.0, units="m**2")
        self.add_input("offset_cost", 0.0, units="USD")
        self.add_input("offset_mass", np.zeros(n_full_off - 1), units="kg")
        self.add_input("offset_center_of_buoyancy", 0.0, units="m")
        self.add_input("offset_center_of_mass", 0.0, units="m")
        self.add_input("offset_moments_of_inertia",
                       np.zeros(6),
                       units="kg*m**2")
        self.add_input("offset_added_mass", np.zeros(6), units="kg")

        self.add_input("tower_mass", 0.0, units="kg")
        self.add_input("tower_shell_cost", 0.0, units="USD")
        self.add_input("tower_I_base", np.zeros(6), units="kg*m**2")
        self.add_input("tower_z_full", np.zeros(n_full_tow), units="m")
        self.add_input("rna_mass", 0.0, units="kg")
        self.add_input("rna_cg", np.zeros(3), units="m")
        self.add_input("rna_I", np.zeros(6), units="kg*m**2")

        self.add_input("water_ballast_zpts_vector",
                       np.zeros(n_full_main),
                       units="m")
        self.add_input("water_ballast_radius_vector",
                       np.zeros(n_full_main),
                       units="m")

        self.add_input("structural_mass", 0.0, units="kg")
        self.add_input("structure_center_of_mass", np.zeros(3), units="m")
        self.add_input("structural_frequencies", np.zeros(NFREQ), units="Hz")
        self.add_input("z_center_of_buoyancy", 0.0, units="m")
        self.add_input("total_displacement", 0.0, units="m**3")
        self.add_input("total_force", np.zeros(3), units="N")
        self.add_input("total_moment", np.zeros(3), units="N*m")
        self.add_input("pontoon_cost", 0.0, units="USD")

        self.add_output("substructure_moments_of_inertia",
                        np.zeros(6),
                        units="kg*m**2")
        self.add_output("total_mass", 0.0, units="kg")
        self.add_output("total_cost", 0.0, units="USD")
        self.add_output("metacentric_height", 0.0, units="m")
        self.add_output("buoyancy_to_gravity", 0.0)
        self.add_output("offset_force_ratio", 0.0)
        self.add_output("heel_moment_ratio", 0.0)
        self.add_output("Iwaterplane_system", 0.0, units="m**4")
        self.add_output("center_of_mass", np.zeros(3), units="m")
        self.add_output("variable_ballast_mass", 0.0, units="kg")
        self.add_output("variable_ballast_center_of_mass", 0.0, units="m")
        self.add_output("variable_ballast_moments_of_inertia",
                        np.zeros(6),
                        units="kg*m**2")
        self.add_output("variable_ballast_height", 0.0, units="m")
        self.add_output("variable_ballast_height_ratio", 0.0)
        self.add_output("mass_matrix", np.zeros(6), units="kg")
        self.add_output("added_mass_matrix", np.zeros(6), units="kg")
        self.add_output("hydrostatic_stiffness", np.zeros(6), units="N/m")
        self.add_output("rigid_body_periods", np.zeros(6), units="s")
        self.add_output("period_margin_low", np.zeros(6))
        self.add_output("period_margin_high", np.zeros(6))
        self.add_output("modal_margin_low", np.zeros(NFREQ))
        self.add_output("modal_margin_high", np.zeros(NFREQ))

        self.declare_partials("*", "*", method="fd", form="central", step=1e-6)