Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

B/no openfast #48

Merged
merged 5 commits into from
Dec 22, 2020
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 6 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -40,10 +40,14 @@ The core WEIS modules are:

## Installation

Installation with [Anaconda](https://www.anaconda.com) is the recommended approach because of the ability to create self-contained environments suitable for testing and analysis. WEIS requires [Anaconda 64-bit](https://www.anaconda.com/distribution/).
On laptop and personal computers, installation with [Anaconda](https://www.anaconda.com) is the recommended approach because of the ability to create self-contained environments suitable for testing and analysis. WEIS requires [Anaconda 64-bit](https://www.anaconda.com/distribution/).

The installation instructions below use the environment name, "weis-env," but any name is acceptable.

0. On the DOE HPC system eagle, make sure to start from a clean setup and type
module purge
module load conda

1. Setup and activate the Anaconda environment from a prompt (Anaconda3 Power Shell on Windows or Terminal.app on Mac)

conda config --add channels conda-forge
Expand All @@ -69,8 +73,7 @@ The installation instructions below use the environment name, "weis-env," but an
git clone https://github.com/WISDEM/WEIS.git
cd WEIS
git checkout branch_name # (Only if you want to switch git branch, say develop)
module purge
module load conda comp-intel intel-mpi mkl
module load comp-intel intel-mpi mkl
module unload gcc
python setup.py develop

Expand Down
6 changes: 0 additions & 6 deletions examples/02_control_opt/modeling_options.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -55,12 +55,6 @@ Level3: # Options for WEIS fidelity level 3 = nonlinear time domain
flag: True

openfast:
analysis_settings:
Analysis_Level: 2 # Flag to set the call to OpenFAST. 1 - generate OpenFAST model, 2 - generate and run OpenFAST model
update_hub_nacelle: False
update_tower: False
generate_af_coords: False
debug_level: 2 # Flag to set the debug level, do not change
file_management:
FAST_namingOut: IEA15 # Name of the OpenFAST output files
FAST_runDirectory: temp/IEA15 # Path to folder with the OpenFAST output files
Expand Down
6 changes: 0 additions & 6 deletions examples/03_NREL5MW_OC3_spar/modeling_options.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -55,12 +55,6 @@ Level3: # Options for WEIS fidelity level 3 = nonlinear time domain
flag: True

openfast:
analysis_settings:
Analysis_Level: 2 # Flag to set the call to OpenFAST. 1 - generate OpenFAST model, 2 - generate and run OpenFAST model
update_hub_nacelle: False
update_tower: False
generate_af_coords: False
debug_level: 2 # Flag to set the debug level, do not change
file_management:
FAST_namingOut: NREL5MW_OC3_spar # Name of the OpenFAST output files
FAST_runDirectory: temp/NREL5MW_OC3_spar # Path to folder with the OpenFAST output files
Expand Down
6 changes: 0 additions & 6 deletions examples/05_IEA-3.4-130-RWT/modeling_options.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -53,12 +53,6 @@ Level3: # Options for WEIS fidelity level 3 = nonlinear time domain
flag: True

openfast:
analysis_settings:
Analysis_Level: 2 # Flag to set the call to OpenFAST. 1 - generate OpenFAST model, 2 - generate and run OpenFAST model
update_hub_nacelle: False
update_tower: False
generate_af_coords: False
debug_level: 2 # Flag to set the debug level, do not change
file_management:
FAST_namingOut: IEA34 # Name of the OpenFAST output files
FAST_runDirectory: temp/iea34 # Path to folder with the OpenFAST output files
Expand Down
6 changes: 0 additions & 6 deletions examples/06_IEA-15-240-RWT/modeling_options.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -61,12 +61,6 @@ Level3: # Options for WEIS fidelity level 3 = nonlinear time domain
flag: True

openfast:
analysis_settings:
Analysis_Level: 2 # Flag to set the call to OpenFAST. 1 - generate OpenFAST model, 2 - generate and run OpenFAST model
update_hub_nacelle: False
update_tower: False
generate_af_coords: False
debug_level: 2 # Flag to set the debug level, do not change
file_management:
FAST_namingOut: IEA15 # Name of the OpenFAST output files
FAST_runDirectory: temp/IEA15 # Path to folder with the OpenFAST output files
Expand Down
1 change: 1 addition & 0 deletions weis/aeroelasticse/CaseGen_IEC.py
Original file line number Diff line number Diff line change
Expand Up @@ -296,6 +296,7 @@ def execute(self, case_inputs={}):
case_inputs_i[("InflowWind","WindType")] = {'vals':WindFile_type_out, 'group':1}
case_inputs_i[("InflowWind","Filename_Uni")] = {'vals':WindFile_out, 'group':1}
case_inputs_i[("InflowWind","FileName_BTS")] = {'vals':WindFile_out, 'group':1}
case_inputs_i[("InflowWind","RefLength")] = {'vals':[self.D], 'group':0}

if len(self.dlc_inputs['Yaw'][i]) > 0:
case_inputs_i[("ElastoDyn","NacYaw")] = {'vals':self.dlc_inputs['Yaw'][i], 'group':2}
Expand Down
8 changes: 0 additions & 8 deletions weis/aeroelasticse/openmdao_openfast.py
Original file line number Diff line number Diff line change
Expand Up @@ -1023,14 +1023,6 @@ def DLC_creation_powercurve(self, inputs, discrete_inputs, fst_vt):
case_inputs[("ElastoDyn","BlPitch2")] = case_inputs[("ElastoDyn","BlPitch1")]
case_inputs[("ElastoDyn","BlPitch3")] = case_inputs[("ElastoDyn","BlPitch1")]

# User defined simulation settings
if ("InflowWind","WindType") in case_inputs:
print('WARNING: You have defined ("InflowWind","WindType"} in the openfast settings.'
'This will overwrite the default powercurve settings')
if ("InflowWind","HWindSpeed") in case_inputs:
print('WARNING: You have defined ("InflowWind","HWindSpeed"} in the openfast settings.'
'This will overwrite the default powercurve settings')

case_list, case_name = CaseGen_General(case_inputs, self.FAST_runDirectory, self.FAST_namingOut + '_powercurve')

dlc_list = [0.]*len(case_name)
Expand Down
36 changes: 20 additions & 16 deletions weis/aeroelasticse/pyIECWind.py
Original file line number Diff line number Diff line change
Expand Up @@ -106,6 +106,7 @@ def EOG(self, V_hub_in):
shear_vert = np.zeros_like(t)+alpha
shear_vert_lin = np.zeros_like(t)
V_gust = np.zeros_like(t)
upflow = np.zeros_like(t)

V_gust = min([ 1.35*(V_e1 - V_hub), 3.3*(sigma_1/(1+0.1*(self.D/self.Sigma_1))) ])

Expand All @@ -120,7 +121,7 @@ def EOG(self, V_hub_in):
self.fname_out = []
self.fname_type = []
fname = self.case_name + '_EOG_U%2.1f.wnd'%V_hub_in
data = np.column_stack((t, V, V_dir, V_vert, shear_horz, shear_vert, shear_vert_lin, V_gust_t))
data = np.column_stack((t, V, V_dir, V_vert, shear_horz, shear_vert, shear_vert_lin, V_gust_t, upflow))
hd = []
hd.append('! Extreme operating guest\n')
hd = self.heading_common(hd)
Expand Down Expand Up @@ -155,8 +156,9 @@ def EDC(self, V_hub_in):
shear_vert = np.zeros_like(t)+alpha
shear_vert_lin = np.zeros_like(t)
V_gust = np.zeros_like(t)
upflow = np.zeros_like(t)

# Transcient
# Transient
Theta_e = 4.*np.arctan(sigma_1/(V_hub*(1.+0.01*(self.D/self.Sigma_1))))*180./np.pi
if Theta_e > 180.:
Theta_e = 180.
Expand All @@ -177,7 +179,7 @@ def EDC(self, V_hub_in):
if self.dir_change.lower() == 'both' or self.dir_change.lower() == '+':
## Vert
fname = self.case_name + '_EDC_P_U%2.1f.wnd'%V_hub_in
data = np.column_stack((t, V, Theta_p, V_vert, shear_horz, shear_vert, shear_vert_lin, V_gust))
data = np.column_stack((t, V, Theta_p, V_vert, shear_horz, shear_vert, shear_vert_lin, V_gust, upflow))
hd = []
hd.append('! Exteme Vertical Wind Shear, positive\n')
hd = self.heading_common(hd)
Expand All @@ -190,7 +192,7 @@ def EDC(self, V_hub_in):
if self.dir_change.lower() == 'both' or self.dir_change.lower() == '-':
## Vert
fname = self.case_name + '_EDC_N_U%2.1f.wnd'%V_hub_in
data = np.column_stack((t, V, Theta_n, V_vert, shear_horz, shear_vert, shear_vert_lin, V_gust))
data = np.column_stack((t, V, Theta_n, V_vert, shear_horz, shear_vert, shear_vert_lin, V_gust, upflow))
hd = []
hd.append('! Exteme Vertical Wind Shear, negative\n')
hd = self.heading_common(hd)
Expand Down Expand Up @@ -224,8 +226,9 @@ def ECD(self, V_hub_in):
shear_vert = np.zeros_like(t)+alpha
shear_vert_lin = np.zeros_like(t)
V_gust = np.zeros_like(t)
upflow = np.zeros_like(t)

# Transcient
# Transient
if V_hub < 4:
Theta_cg = 180
else:
Expand All @@ -250,7 +253,7 @@ def ECD(self, V_hub_in):
if self.dir_change.lower() == 'both' or self.dir_change.lower() == '+':
## Vert
fname = self.case_name + '_ECD_P_U%2.1f.wnd'%V_hub_in
data = np.column_stack((t, V, Theta_p, V_vert, shear_horz, shear_vert, shear_vert_lin, V_gust))
data = np.column_stack((t, V, Theta_p, V_vert, shear_horz, shear_vert, shear_vert_lin, V_gust, upflow))
hd = []
hd.append('! Exteme coherent gust with direction change, positive\n')
hd = self.heading_common(hd)
Expand All @@ -263,7 +266,7 @@ def ECD(self, V_hub_in):
if self.dir_change.lower() == 'both' or self.dir_change.lower() == '-':
## Vert
fname = self.case_name + '_ECD_N_U%2.1f.wnd'%V_hub_in
data = np.column_stack((t, V, Theta_n, V_vert, shear_horz, shear_vert, shear_vert_lin, V_gust))
data = np.column_stack((t, V, Theta_n, V_vert, shear_horz, shear_vert, shear_vert_lin, V_gust, upflow))
hd = []
hd.append('! Exteme coherent gust with direction change, negative\n')
hd = self.heading_common(hd)
Expand Down Expand Up @@ -297,8 +300,9 @@ def EWS(self, V_hub_in):
# shear_horz = np.zeros_like(t)
shear_vert = np.zeros_like(t)+alpha
V_gust = np.zeros_like(t)
upflow = np.zeros_like(t)

# Transcient
# Transient
shear_lin_p = np.zeros_like(t)
shear_lin_n = np.zeros_like(t)

Expand All @@ -313,7 +317,7 @@ def EWS(self, V_hub_in):
if self.shear_orient.lower() == 'both' or self.shear_orient.lower() == 'v':
## Vert
fname = self.case_name + '_EWS_V_P_U%2.1f.wnd'%V_hub_in
data = np.column_stack((t, V, V_dir, V_vert, np.zeros_like(t), shear_vert, shear_lin_p, V_gust))
data = np.column_stack((t, V, V_dir, V_vert, np.zeros_like(t), shear_vert, shear_lin_p, V_gust, upflow))
hd = []
hd.append('! Exteme Vertical Wind Shear, positive\n')
hd = self.heading_common(hd)
Expand All @@ -325,7 +329,7 @@ def EWS(self, V_hub_in):
if self.shear_orient.lower() == 'both' or self.shear_orient.lower() == 'h':
# Horz
fname = self.case_name + '_EWS_H_P_U%2.1f.wnd'%V_hub_in
data = np.column_stack((t, V, V_dir, V_vert, shear_lin_p, shear_vert, np.zeros_like(t), V_gust))
data = np.column_stack((t, V, V_dir, V_vert, shear_lin_p, shear_vert, np.zeros_like(t), V_gust, upflow))
hd = []
hd.append('! Exteme Horizontal Wind Shear, positive\n')
hd = self.heading_common(hd)
Expand All @@ -338,7 +342,7 @@ def EWS(self, V_hub_in):
if self.shear_orient.lower() == 'both' or self.shear_orient.lower() == 'v':
## Vert
fname = self.case_name + '_EWS_V_N_U%2.1f.wnd'%V_hub_in
data = np.column_stack((t, V, V_dir, V_vert, np.zeros_like(t), shear_vert, shear_lin_n, V_gust))
data = np.column_stack((t, V, V_dir, V_vert, np.zeros_like(t), shear_vert, shear_lin_n, V_gust, upflow))
hd = []
hd.append('! Exteme Vertical Wind Shear, negative\n')
hd = self.heading_common(hd)
Expand All @@ -350,7 +354,7 @@ def EWS(self, V_hub_in):
if self.shear_orient.lower() == 'both' or self.shear_orient.lower() == 'h':
# Horz
fname = self.case_name + '_EWS_H_N_U%2.1f.wnd'%V_hub_in
data = np.column_stack((t, V, V_dir, V_vert, shear_lin_n, shear_vert, np.zeros_like(t), V_gust))
data = np.column_stack((t, V, V_dir, V_vert, shear_lin_n, shear_vert, np.zeros_like(t), V_gust, upflow))
hd = []
hd.append('! Exteme Horizontal Wind Shear, negative\n')
hd = self.heading_common(hd)
Expand Down Expand Up @@ -380,16 +384,16 @@ def write_wnd(self, fname, data, hd):
if not os.path.isdir(self.outdir):
os.makedirs(self.outdir)

# Move transcient event to user definted time
# Move transient event to user defined time
data[:,0] += self.TStart
data = np.vstack((data[0,:], data, data[-1,:]))
data[0,0] = self.T0
data[-1,0] = self.TF

# Headers
hd1 = ['Time', 'Wind', 'Wind', 'Vertical', 'Horiz.', 'Pwr. Law', 'Lin. Vert.', 'Gust']
hd2 = ['', 'Speed', 'Dir', 'Speed', 'Shear', 'Vert. Shr', 'Shear', 'Speed']
hd3 = ['(s)', '(m/s)', '(deg)', '(m/s)', '(-)', '(-)', '(-)', '(m/s)', ]
hd1 = ['Time', 'Wind', 'Wind', 'Vertical', 'Horiz.', 'Pwr. Law', 'Lin. Vert.', 'Gust', 'Upflow']
hd2 = ['', 'Speed', 'Dir', 'Speed', 'Shear', 'Vert. Shr', 'Shear', 'Speed', 'Angle']
hd3 = ['(s)', '(m/s)', '(deg)', '(m/s)', '(-)', '(-)', '(-)', '(m/s)', '(deg)']

self.fpath = os.path.join(self.outdir, fname)
fid = open(self.fpath, 'w')
Expand Down
33 changes: 0 additions & 33 deletions weis/aeroelasticse/rotor_loads_defl_strainsWEIS.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
from openmdao.api import Group
from wisdem.ccblade.ccblade_component import CCBladeLoads, AeroHubLoads
from wisdem.rotorse.rotor_structure import BladeCurvature, TotalLoads, RunFrame3DD, TipDeflection, DesignConstraints


Expand All @@ -8,54 +7,22 @@ class RotorLoadsDeflStrainsWEIS(Group):
def initialize(self):
self.options.declare('modeling_options')
self.options.declare('opt_options')
self.options.declare('freq_run')
def setup(self):
modeling_options = self.options['modeling_options']
opt_options = self.options['opt_options']
freq_run = self.options['freq_run']

# Load blade with rated conditions and compute aerodynamic forces
promoteListAeroLoads = ['r', 'theta', 'chord', 'Rtip', 'Rhub', 'hub_height', 'precone', 'tilt', 'airfoils_aoa', 'airfoils_Re', 'airfoils_cl', 'airfoils_cd', 'airfoils_cm', 'nBlades', 'rho', 'mu', 'Omega_load','pitch_load']
# self.add_subsystem('aero_rated', CCBladeLoads(modeling_options = modeling_options), promotes=promoteListAeroLoads)

if not (modeling_options['Level2']['flag'] == True or modeling_options['Level3']['flag'] == True) or modeling_options['openfast']['analysis_settings']['Analysis_Level'] == 1 or freq_run:
self.add_subsystem('aero_gust', CCBladeLoads(modeling_options = modeling_options), promotes=promoteListAeroLoads)
# self.add_subsystem('aero_storm_1yr', CCBladeLoads(modeling_options = modeling_options), promotes=promoteListAeroLoads)
# self.add_subsystem('aero_storm_50yr', CCBladeLoads(modeling_options = modeling_options), promotes=promoteListAeroLoads)
# Add centrifugal and gravity loading to aero loading
promotes=['tilt','theta','rhoA','z','totalCone','z_az']
self.add_subsystem('curvature', BladeCurvature(modeling_options = modeling_options), promotes=['r','precone','precurve','presweep','3d_curv','x_az','y_az','z_az'])
promoteListTotalLoads = ['r', 'theta', 'tilt', 'rhoA', '3d_curv', 'z_az']
self.add_subsystem('tot_loads_gust', TotalLoads(modeling_options = modeling_options), promotes=promoteListTotalLoads)
# self.add_subsystem('tot_loads_rated', TotalLoads(modeling_options = modeling_options), promotes=promoteListTotalLoads)
# self.add_subsystem('tot_loads_storm_1yr', TotalLoads(modeling_options = modeling_options), promotes=promoteListTotalLoads)
# self.add_subsystem('tot_loads_storm_50yr', TotalLoads(modeling_options = modeling_options), promotes=promoteListTotalLoads)
promoteListFrame3DD = ['x_az','y_az','z_az','theta','r','A','EA','EIxx','EIyy','EIxy','GJ','rhoA','rhoJ','x_ec','y_ec','xu_strain_spar','xl_strain_spar','yu_strain_spar','yl_strain_spar','xu_strain_te','xl_strain_te','yu_strain_te','yl_strain_te']
self.add_subsystem('frame', RunFrame3DD(modeling_options = modeling_options), promotes=promoteListFrame3DD)
self.add_subsystem('tip_pos', TipDeflection(), promotes=['tilt','pitch_load'])
if not (modeling_options['Level2']['flag'] == True or modeling_options['Level3']['flag'] == True) or modeling_options['openfast']['analysis_settings']['Analysis_Level'] == 1 or freq_run:
self.add_subsystem('aero_hub_loads', AeroHubLoads(modeling_options = modeling_options), promotes = promoteListAeroLoads)
self.add_subsystem('constr', DesignConstraints(modeling_options = modeling_options, opt_options = opt_options))

# if modeling_options['rotorse']['FatigueMode'] > 0:
# promoteListFatigue = ['r', 'gamma_f', 'gamma_m', 'E', 'Xt', 'Xc', 'x_tc', 'y_tc', 'EIxx', 'EIyy', 'pitch_axis', 'chord', 'layer_name', 'layer_mat', 'definition_layer', 'sc_ss_mats','sc_ps_mats','te_ss_mats','te_ps_mats','rthick']
# self.add_subsystem('fatigue', BladeFatigue(modeling_options = modeling_options, opt_options = opt_options), promotes=promoteListFatigue)

# Aero loads to total loads
if not (modeling_options['Level2']['flag'] == True or modeling_options['Level3']['flag'] == True) or modeling_options['openfast']['analysis_settings']['Analysis_Level'] == 1 or freq_run:
self.connect('aero_gust.loads_Px', 'tot_loads_gust.aeroloads_Px')
self.connect('aero_gust.loads_Py', 'tot_loads_gust.aeroloads_Py')
self.connect('aero_gust.loads_Pz', 'tot_loads_gust.aeroloads_Pz')
# self.connect('aero_rated.loads_Px', 'tot_loads_rated.aeroloads_Px')
# self.connect('aero_rated.loads_Py', 'tot_loads_rated.aeroloads_Py')
# self.connect('aero_rated.loads_Pz', 'tot_loads_rated.aeroloads_Pz')
# self.connect('aero_storm_1yr.loads_Px', 'tot_loads_storm_1yr.aeroloads_Px')
# self.connect('aero_storm_1yr.loads_Py', 'tot_loads_storm_1yr.aeroloads_Py')
# self.connect('aero_storm_1yr.loads_Pz', 'tot_loads_storm_1yr.aeroloads_Pz')
# self.connect('aero_storm_50yr.loads_Px', 'tot_loads_storm_50yr.aeroloads_Px')
# self.connect('aero_storm_50yr.loads_Py', 'tot_loads_storm_50yr.aeroloads_Py')
# self.connect('aero_storm_50yr.loads_Pz', 'tot_loads_storm_50yr.aeroloads_Pz')

# Total loads to strains
self.connect('tot_loads_gust.Px_af', 'frame.Px_af')
self.connect('tot_loads_gust.Py_af', 'frame.Py_af')
Expand Down
Loading