Skip to content
This repository was archived by the owner on Nov 27, 2023. It is now read-only.

Commit f57124e

Browse files
committed
CaseGen: update of example script
1 parent 29474cd commit f57124e

File tree

1 file changed

+22
-7
lines changed

1 file changed

+22
-7
lines changed

pyFAST/case_generation/examples/Example_Parametric.py

+22-7
Original file line numberDiff line numberDiff line change
@@ -22,16 +22,27 @@
2222
import pyFAST.case_generation.case_gen as case_gen
2323
import pyFAST.case_generation.runner as runner
2424
import pyFAST.input_output.postpro as postpro
25+
from pyFAST.input_output.fast_input_file import FASTInputFile
2526

2627
# Get current directory so this script can be called from any location
2728
scriptDir=os.path.dirname(__file__)
2829

2930
# --- Parameters for this script
30-
FAST_EXE = os.path.join(scriptDir, '../../../data/NREL5MW/openfast3.2.1_x64s.exe') # Location of a FAST exe (and dll)
31+
FAST_EXE = os.path.join(scriptDir, '../../../data/openfast.exe') # Location of a FAST exe (and dll)
3132
ref_dir = os.path.join(scriptDir, '../../../data/NREL5MW/') # Folder where the fast input files are located (will be copied)
3233
main_file = 'Main_Onshore.fst' # Main file in ref_dir, used as a template
3334
work_dir = '_NREL5MW_Parametric/' # Output folder (will be created)
3435

36+
37+
# --- Reading some reference files/tables to be able to modify tables
38+
# BDBld_ref = FASTInputFile('BeamDyn_Blade_ref.dat')
39+
# print(BDBld_ref.keys())
40+
# BP_ref = BDBld_ref['BeamProperties']
41+
#
42+
# HD_ref = FASTInputFile('HD_ref.dat')
43+
# print(HD_ref.keys())
44+
# SmplProp_ref = HD_ref['SmplProp']
45+
3546
# --- Defining the parametric study (list of dictionnaries with keys as FAST parameters)
3647
WS = [4 , 5 , 10 , 12 , 14 , 16]
3748
RPM = [2.5 , 7.5 , 11.3 , 12.1 , 12.1, 12.1]
@@ -45,7 +56,7 @@
4556
for i,(wsp,rpm,pitch) in enumerate(zip(WS,RPM,PITCH)): # NOTE: same length of WS and RPM otherwise do multiple for loops
4657
p=BaseDict.copy()
4758

48-
# --- Changing typical parameters (operating ocnditions)
59+
# --- Changing typical parameters (operating ocnditions)
4960
p['EDFile|RotSpeed'] = rpm
5061
p['EDFile|BlPitch(1)'] = pitch
5162
p['EDFile|BlPitch(2)'] = pitch
@@ -60,11 +71,15 @@
6071
# p['EDFile|BldFile(1)|AdjBlMs'] =1.1
6172
# p['EDFile|BldFile(2)|AdjBlMs'] =1.1
6273
# p['EDFile|BldFile(3)|AdjBlMs'] =1.1
63-
# Changing BeamDyn properties
64-
# BP_ref = fBD['BeamProperties']
65-
# BP = BP_ref.copy()
66-
# BP['K']= BP['K']*i
67-
# p['BDBldFile(1)|BldFile|BeamProperties'] =BP
74+
# Changing BeamDyn properties
75+
# BP = BP_ref.copy() # Make a copy to be safe
76+
# BP['K']= BP['K']*i # Modify stiffness
77+
# p['BDBldFile(1)|BldFile|BeamProperties'] = BP # Use the updated stiffness for this case
78+
# Changing HydroDyn properties
79+
# SmplProp = SmplProp_ref.copy() # Make a copy to be safe
80+
# SmplProp[0,0] = Cd[i] # Change Cd value
81+
# p['HDFile|SmplProp'] = SmplProp # Use the updated table for this case,s
82+
6883
PARAMS.append(p)
6984

7085
# --- Generating all files in a workdir

0 commit comments

Comments
 (0)