Skip to content

Commit

Permalink
bug fix in vizFileGen and changes to handle Jul 2024 Kestrel updates (#…
Browse files Browse the repository at this point in the history
…306)

* bug fix in vizFileGen and fixes to handle Jul 2024 Kestrel updates

* change type settings and default channels

* match type with WEIS level

* minor update on type setting - dlc

---------

Co-authored-by: Sora Ryu <sryu@x1000c0s0b0n0.hsn.cm.kestrel.hpc.nrel.gov>
Co-authored-by: Sora Ryu <sryu@kl2.head.cm.kestrel.hpc.nrel.gov>
  • Loading branch information
3 people authored Aug 27, 2024
1 parent 1767daf commit 03b0c1f
Show file tree
Hide file tree
Showing 3 changed files with 30 additions and 26 deletions.
16 changes: 8 additions & 8 deletions share/kestrel_install.sh
Original file line number Diff line number Diff line change
Expand Up @@ -6,23 +6,23 @@
# ./kestrel_install.sh -h

# Flags and variables; Set as required for install
weisBranch="develop"
weisBranch="main"
weisRepoOverride=""
weisDirName="weis"

openfastBranch="main"
openfastRepoOverride=""
openfastDirName="openfast"

roscoBranch="develop"
roscoBranch="main"
roscoRepoOverride=""
roscoDirName="rosco"

wisdemBranch="develop"
wisdemBranch="master"
wisdemRepoOverride=""
wisdemDirName="wisdem"

raftBranch="dev"
raftBranch="main"
raftRepoOverride=""
raftDirName="raft"

Expand Down Expand Up @@ -248,7 +248,7 @@ load_modules() {

module purge

for mod in conda mamba git cmake craype-x86-spr intel-oneapi-compilers intel-oneapi-mpi intel-oneapi-mkl fftw/3.3.10-intel-oneapi-mpi-intel hdf5/1.14.1-2-intel-oneapi-mpi-intel netcdf-c/4.9.2-intel-oneapi-mpi-intel petsc/3.20.4-intel-oneapi-mpi-intel
for mod in conda mamba git cmake craype-x86-spr intel-oneapi-compilers intel-oneapi-mpi intel-oneapi-mkl fftw/3.3.10-intel-oneapi-mpi-intel hdf5/1.14.1-2-intel-oneapi-mpi-intel netcdf-c/4.9.2-intel-oneapi-mpi-intel petsc/3.20.4-intel-oneapi-mpi-intel PrgEnv-intel
do
echo "Loading $mod....."
module load $mod
Expand All @@ -258,9 +258,9 @@ load_modules() {
module unload gcc

# Set compiler environment variables
export CC=icc
export CXX=icpc
export FC=ifort
# export CC=icc
# export CXX=icpc
# export FC=ifort

fi
}
Expand Down
2 changes: 1 addition & 1 deletion weis/visualization/appServer/app/pages/visualize_opt.py
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@

def read_opt_vars_per_type(input_dict):
opt_options = {}
opt_type_reference = {1: 'RAFT', 2: 'OpenFAST'} # TODO: Expand other types of optimizations
opt_type_reference = {1: 'RAFT', 3: 'OpenFAST'} # TODO: Expand other types of optimizations

opt_options['root_file_path'] = '/'.join(input_dict['userOptions']['output_folder'].split('/')[:-1]) # Remove the last output folder name for future path join
opt_options['log_file_path'] = os.path.join(opt_options['root_file_path'], '/'.join(k for k in next(find_file_path_from_tree(input_dict['outputDirStructure'], input_dict['userOptions']['sql_recorder_file'])) if k not in ['dirs', 'files']))
Expand Down
38 changes: 21 additions & 17 deletions weis/visualization/appServer/share/vizFileGen.py
Original file line number Diff line number Diff line change
Expand Up @@ -31,20 +31,21 @@ def userOptions(self):
# Add the user options to the vizInput file
self.vizInput['userOptions'] = {}
# Run type
self.vizInput['userOptions']['optimization'] = {}
self.vizInput['userOptions']['optimization']['status'] = self.opt_options['driver']['optimization']['flag']

if self.fname_modeling_options['driver']['Level1']['Flag']:
self.vizInput['userOptions']['optimization']['type'] = 1
if self.modeling_options['Level1']['flag']:
self.vizInput['userOptions']['optimization']['type'] = 1 # RAFT

elif self.fname_modeling_options['driver']['Level2']['Flag']:
self.vizInput['userOptions']['optimization']['type'] = 2 # not currently supported.
elif self.modeling_options['Level2']['flag']:
self.vizInput['userOptions']['optimization']['type'] = 2 # not currently supported.
warnings.warn("Current WEIS run configuration is not supported by WEIS_Viz")

elif self.fname_modeling_options['driver']['Level3']['Flag']:
self.vizInput['userOptions']['optimization']['type'] = 3
elif self.modeling_options['Level3']['flag']:
self.vizInput['userOptions']['optimization']['type'] = 3 # OpenFAST, Control

else:
self.vizInput['userOptions']['optimization']['type'] = 0
self.vizInput['userOptions']['optimization']['type'] = 0 # not currently supported.
warnings.warn("Current WEIS run configuration is not supported by WEIS_Viz")


Expand All @@ -61,7 +62,7 @@ def userOptions(self):

def setDefaultUserPreferencs(self):

# Set the default user preferences based on the comment above
# Set the default user preferences
self.vizInput['userPreferences'] = {}
self.vizInput['userPreferences']['openfast'] = {}
self.vizInput['userPreferences']['openfast']['file_path'] = {}
Expand All @@ -73,18 +74,21 @@ def setDefaultUserPreferencs(self):

self.vizInput['userPreferences']['openfast']['graph'] = {}
self.vizInput['userPreferences']['openfast']['graph']['xaxis'] = 'Time'
self.vizInput['userPreferences']['openfast']['graph']['yaxis'] = ['Wind1VelX', 'Wind1VelY', 'Wind1VelZ']
self.vizInput['userPreferences']['openfast']['graph']['yaxis'] = ['Wind1VelX', 'GenPwr', 'BldPitch1', 'GenSpeed', 'PtfmPitch']

self.vizInput['userPreferences']['optimization'] = {}
self.vizInput['userPreferences']['optimization']['convergence'] = {}
self.vizInput['userPreferences']['optimization']['convergence']['channels'] = ['raft.pitch_period', 'floatingse.constr_draft_heel_margin', 'floating.jointdv_0', 'floating.memgrp1.outer_diameter_in']
self.vizInput['userPreferences']['optimization']['dlc'] = {}
self.vizInput['userPreferences']['optimization']['dlc']['xaxis'] = 'Wind1VelX'
self.vizInput['userPreferences']['optimization']['dlc']['xaxis_stat'] = 'mean'
self.vizInput['userPreferences']['optimization']['dlc']['yaxis'] = ['Wind1VelY', 'Wind1VelZ']
self.vizInput['userPreferences']['optimization']['dlc']['yaxis_stat'] = 'max'
self.vizInput['userPreferences']['optimization']['timeseries'] = {}
self.vizInput['userPreferences']['optimization']['timeseries']['channels'] = ['Wind1VelX', 'Wind1VelY', 'Wind1VelZ']
self.vizInput['userPreferences']['optimization']['convergence']['channels'] = ['floating.jointdv_0', 'floating.jointdv_1', 'floating.memgrp1.outer_diameter_in', 'raft.Max_PtfmPitch', 'floatingse.system_structural_mass']

# Only for OpenFAST Optimization type
if self.vizInput['userOptions']['optimization']['type'] == 3:
self.vizInput['userPreferences']['optimization']['dlc'] = {}
self.vizInput['userPreferences']['optimization']['dlc']['xaxis'] = 'Wind1VelX'
self.vizInput['userPreferences']['optimization']['dlc']['xaxis_stat'] = 'mean'
self.vizInput['userPreferences']['optimization']['dlc']['yaxis'] = ['Wind1VelY', 'GenSpeed', 'PtfmPitch']
self.vizInput['userPreferences']['optimization']['dlc']['yaxis_stat'] = 'max'
self.vizInput['userPreferences']['optimization']['timeseries'] = {}
self.vizInput['userPreferences']['optimization']['timeseries']['channels'] = ['Wind1VelX', 'GenPwr', 'BldPitch1', 'GenSpeed', 'PtfmPitch']

self.vizInput['userPreferences']['wisdem'] = {}
self.vizInput['userPreferences']['wisdem']['blade'] = {}
Expand Down

0 comments on commit 03b0c1f

Please sign in to comment.