Description
Hello, I am interested in using WEIS as a tool to generate and evaluate floating offshore turbine models/controllers based on design parameters (e.g., design parameters for blade shape, parameters for IPC controller), such that I can test design exploration/optimization methods.
As a starting point, I am currently playing with the examples included with WEIS, but some examples do not run properly with the error related to class FASTLoadCases. The examples mostly fail in the functions fast_init and initialize_routines where input files are organized, so I believe the main reasons from mismatching between the input formats. I wonder if something is missing in the official installation procedure, or if I need to use a different branch to resolve the issue. It would be also helpful to know what is the best environment (WSL, Linux, or macOS) in terms of compatibility.
Steps to reproduce issue
The list of the examples I found the issue. I modified modeling_option to have use_exe: False to find where I get the errors, but no additional modification has been made.
- 06_IEA-15-240-RWT/weis_driver_tower_DVs.py
- 09_design_of_experiments/doe_openfast.py
- 11_use_bem/weis_driver.py
- 12_linearization/doe_driver.py
- 14_level2ccd/weis_driver.py
Current behavior
The followings are the errors I got from each example:
- 06_IEA-15-240-RWT/weis_driver_tower_DVs.py
Traceback (most recent call last):
File "/home/penelroid/anaconda3/envs/weis-env/lib/python3.10/site-packages/openmdao/drivers/doe_driver.py", line 223, in _run_case
self._problem().model.run_solve_nonlinear()
File "/home/penelroid/anaconda3/envs/weis-env/lib/python3.10/site-packages/openmdao/core/system.py", line 3994, in run_solve_nonlinear
self._solve_nonlinear()
File "/home/penelroid/anaconda3/envs/weis-env/lib/python3.10/site-packages/openmdao/core/group.py", line 2560, in _solve_nonlinear
self._nonlinear_solver._solve_with_cache_check()
File "/home/penelroid/anaconda3/envs/weis-env/lib/python3.10/site-packages/openmdao/solvers/nonlinear/nonlinear_runonce.py", line 26, in _solve_with_cache_check
self.solve() # don't use caching
File "/home/penelroid/anaconda3/envs/weis-env/lib/python3.10/site-packages/openmdao/solvers/nonlinear/nonlinear_runonce.py", line 45, in solve
self._gs_iter()
File "/home/penelroid/anaconda3/envs/weis-env/lib/python3.10/site-packages/openmdao/solvers/solver.py", line 787, in _gs_iter
subsys._solve_nonlinear()
File "/home/penelroid/anaconda3/envs/weis-env/lib/python3.10/site-packages/openmdao/core/explicitcomponent.py", line 311, in _solve_nonlinear
self._compute_wrapper()
File "/home/penelroid/anaconda3/envs/weis-env/lib/python3.10/site-packages/openmdao/core/explicitcomponent.py", line 269, in _compute_wrapper
with self._call_user_function('compute'):
File "/home/penelroid/anaconda3/envs/weis-env/lib/python3.10/contextlib.py", line 153, in __exit__
self.gen.throw(typ, value, traceback)
File "/home/penelroid/anaconda3/envs/weis-env/lib/python3.10/site-packages/openmdao/core/system.py", line 2281, in _call_user_function
raise err_type(
File "/home/penelroid/anaconda3/envs/weis-env/lib/python3.10/site-packages/openmdao/core/system.py", line 2275, in _call_user_function
yield
File "/home/penelroid/anaconda3/envs/weis-env/lib/python3.10/site-packages/openmdao/core/explicitcomponent.py", line 285, in _compute_wrapper
self.compute(*args)
File "/mnt/c/CoDesignTurbineBlade/weis/aeroelasticse/openmdao_openfast.py", line 605, in compute
summary_stats, extreme_table, DELs, Damage, case_list, case_name, chan_time, dlc_generator = self.run_FAST(inputs, discrete_inputs, fst_vt)
File "/mnt/c/CoDesignTurbineBlade/weis/aeroelasticse/openmdao_openfast.py", line 2051, in run_FAST
summary_stats, extreme_table, DELs, Damage, chan_time = fastBatch.run_serial()
File "/mnt/c/CoDesignTurbineBlade/weis/aeroelasticse/runFAST_pywrapper.py", line 361, in run_serial
_name, _ss, _et, _dl, _dam, _ct = evaluate(c)
File "/mnt/c/CoDesignTurbineBlade/weis/aeroelasticse/runFAST_pywrapper.py", line 480, in evaluate
return fast.execute()
File "/mnt/c/CoDesignTurbineBlade/weis/aeroelasticse/runFAST_pywrapper.py", line 184, in execute
openfastlib.fast_run()
File "/mnt/c/CoDesignTurbineBlade/OpenFAST/glue-codes/python/openfast_library.py", line 226, in fast_run
self.fast_init()
File "/mnt/c/CoDesignTurbineBlade/OpenFAST/glue-codes/python/openfast_library.py", line 140, in fast_init
raise RuntimeError(f"Error {_error_status.value}: {_error_message.value}")
RuntimeError: 'aeroelastic' <class FASTLoadCases>: Error calling compute(), Error 4: b'Error allocating turbine data.'
- 09_design_of_experiments/doe_openfast.py
Traceback (most recent call last):
File "/home/penelroid/anaconda3/envs/weis-env/lib/python3.10/site-packages/openmdao/drivers/doe_driver.py", line 223, in _run_case
self._problem().model.run_solve_nonlinear()
File "/home/penelroid/anaconda3/envs/weis-env/lib/python3.10/site-packages/openmdao/core/system.py", line 3994, in run_solve_nonlinear
self._solve_nonlinear()
File "/home/penelroid/anaconda3/envs/weis-env/lib/python3.10/site-packages/openmdao/core/group.py", line 2560, in _solve_nonlinear
self._nonlinear_solver._solve_with_cache_check()
File "/home/penelroid/anaconda3/envs/weis-env/lib/python3.10/site-packages/openmdao/solvers/nonlinear/nonlinear_runonce.py", line 26, in _solve_with_cache_check
self.solve() # don't use caching
File "/home/penelroid/anaconda3/envs/weis-env/lib/python3.10/site-packages/openmdao/solvers/nonlinear/nonlinear_runonce.py", line 45, in solve
self._gs_iter()
File "/home/penelroid/anaconda3/envs/weis-env/lib/python3.10/site-packages/openmdao/solvers/solver.py", line 787, in _gs_iter
subsys._solve_nonlinear()
File "/home/penelroid/anaconda3/envs/weis-env/lib/python3.10/site-packages/openmdao/core/explicitcomponent.py", line 311, in _solve_nonlinear
self._compute_wrapper()
File "/home/penelroid/anaconda3/envs/weis-env/lib/python3.10/site-packages/openmdao/core/explicitcomponent.py", line 269, in _compute_wrapper
with self._call_user_function('compute'):
File "/home/penelroid/anaconda3/envs/weis-env/lib/python3.10/contextlib.py", line 153, in __exit__
self.gen.throw(typ, value, traceback)
File "/home/penelroid/anaconda3/envs/weis-env/lib/python3.10/site-packages/openmdao/core/system.py", line 2281, in _call_user_function
raise err_type(
File "/home/penelroid/anaconda3/envs/weis-env/lib/python3.10/site-packages/openmdao/core/system.py", line 2275, in _call_user_function
yield
File "/home/penelroid/anaconda3/envs/weis-env/lib/python3.10/site-packages/openmdao/core/explicitcomponent.py", line 285, in _compute_wrapper
self.compute(*args)
File "/mnt/c/CoDesignTurbineBlade/weis/aeroelasticse/openmdao_openfast.py", line 576, in compute
fst_vt = self.update_FAST_model(fst_vt, inputs, discrete_inputs)
File "/mnt/c/CoDesignTurbineBlade/weis/aeroelasticse/openmdao_openfast.py", line 1235, in update_FAST_model
fst_vt['SubDyn']['Rct_SoilFile'] = [""]*fst_vt['SubDyn']['NReact']
KeyError: "'aeroelastic' <class FASTLoadCases>: Error calling compute(), 'NReact'"
- 11_use_bem/weis_driver.py
Traceback (most recent call last):
File "/mnt/c/CoDesignTurbineBlade/examples_test/11_use_bem/weis_driver.py", line 27, in <module>
run()
File "/mnt/c/CoDesignTurbineBlade/examples_test/11_use_bem/weis_driver.py", line 16, in run
wt_opt, modeling_options, opt_options = run_weis(fname_wt_input, fname_modeling_options, fname_analysis_options)
File "/mnt/c/CoDesignTurbineBlade/weis/glue_code/runWEIS.py", line 195, in run_weis
wt_opt.run_model()
File "/home/penelroid/anaconda3/envs/weis-env/lib/python3.10/site-packages/openmdao/core/problem.py", line 811, in run_model
self.model.run_solve_nonlinear()
File "/home/penelroid/anaconda3/envs/weis-env/lib/python3.10/site-packages/openmdao/core/system.py", line 3994, in run_solve_nonlinear
self._solve_nonlinear()
File "/home/penelroid/anaconda3/envs/weis-env/lib/python3.10/site-packages/openmdao/core/group.py", line 2560, in _solve_nonlinear
self._nonlinear_solver._solve_with_cache_check()
File "/home/penelroid/anaconda3/envs/weis-env/lib/python3.10/site-packages/openmdao/solvers/nonlinear/nonlinear_runonce.py", line 26, in _solve_with_cache_check
self.solve() # don't use caching
File "/home/penelroid/anaconda3/envs/weis-env/lib/python3.10/site-packages/openmdao/solvers/nonlinear/nonlinear_runonce.py", line 45, in solve
self._gs_iter()
File "/home/penelroid/anaconda3/envs/weis-env/lib/python3.10/site-packages/openmdao/solvers/solver.py", line 787, in _gs_iter
subsys._solve_nonlinear()
File "/home/penelroid/anaconda3/envs/weis-env/lib/python3.10/site-packages/openmdao/core/explicitcomponent.py", line 311, in _solve_nonlinear
self._compute_wrapper()
File "/home/penelroid/anaconda3/envs/weis-env/lib/python3.10/site-packages/openmdao/core/explicitcomponent.py", line 269, in _compute_wrapper
with self._call_user_function('compute'):
File "/home/penelroid/anaconda3/envs/weis-env/lib/python3.10/contextlib.py", line 153, in __exit__
self.gen.throw(typ, value, traceback)
File "/home/penelroid/anaconda3/envs/weis-env/lib/python3.10/site-packages/openmdao/core/system.py", line 2281, in _call_user_function
raise err_type(
File "/home/penelroid/anaconda3/envs/weis-env/lib/python3.10/site-packages/openmdao/core/system.py", line 2275, in _call_user_function
yield
File "/home/penelroid/anaconda3/envs/weis-env/lib/python3.10/site-packages/openmdao/core/explicitcomponent.py", line 285, in _compute_wrapper
self.compute(*args)
File "/mnt/c/CoDesignTurbineBlade/weis/aeroelasticse/openmdao_openfast.py", line 605, in compute
summary_stats, extreme_table, DELs, Damage, case_list, case_name, chan_time, dlc_generator = self.run_FAST(inputs, discrete_inputs, fst_vt)
File "/mnt/c/CoDesignTurbineBlade/weis/aeroelasticse/openmdao_openfast.py", line 2051, in run_FAST
summary_stats, extreme_table, DELs, Damage, chan_time = fastBatch.run_serial()
File "/mnt/c/CoDesignTurbineBlade/weis/aeroelasticse/runFAST_pywrapper.py", line 361, in run_serial
_name, _ss, _et, _dl, _dam, _ct = evaluate(c)
File "/mnt/c/CoDesignTurbineBlade/weis/aeroelasticse/runFAST_pywrapper.py", line 480, in evaluate
return fast.execute()
File "/mnt/c/CoDesignTurbineBlade/weis/aeroelasticse/runFAST_pywrapper.py", line 184, in execute
openfastlib.fast_run()
File "/mnt/c/CoDesignTurbineBlade/OpenFAST/glue-codes/python/openfast_library.py", line 226, in fast_run
self.fast_init()
File "/mnt/c/CoDesignTurbineBlade/OpenFAST/glue-codes/python/openfast_library.py", line 156, in fast_init
raise RuntimeError(f"Error {_error_status.value}: {_error_message.value}")
RuntimeError: 'aeroelastic' <class FASTLoadCases>: Error calling compute(), Error 4: b'FAST_InitializeAll:HydroDyn_Init:Waves_Init:VariousWaves_Init: The random number generator in use differs from the original code provided by NREL. This pRNG uses 8 seeds instead of the 2 in the HydroDyn input file.\nHydroDyn_Init:WAMIT_Init:OpenFInpFile:The input file, "/mnt/c/CoDesignTurbineBlade/examples_test/11_use_bem/temp/NREL5MW_OC3_spar/BEM/Output/Wamit_format/Buoy.hst", was not found.'
- 12_linearization/doe_driver.py
Traceback (most recent call last):
File "/mnt/c/CoDesignTurbineBlade/examples_test/12_linearization/doe_driver.py", line 13, in <module>
run()
File "/mnt/c/CoDesignTurbineBlade/examples_test/12_linearization/doe_driver.py", line 10, in run
wt_opt, modeling_options, analysis_options = run_weis(fname_wt_input, fname_modeling_options, fname_analysis_options)
File "/mnt/c/CoDesignTurbineBlade/weis/glue_code/runWEIS.py", line 195, in run_weis
wt_opt.run_model()
File "/home/penelroid/anaconda3/envs/weis-env/lib/python3.10/site-packages/openmdao/core/problem.py", line 811, in run_model
self.model.run_solve_nonlinear()
File "/home/penelroid/anaconda3/envs/weis-env/lib/python3.10/site-packages/openmdao/core/system.py", line 3994, in run_solve_nonlinear
self._solve_nonlinear()
File "/home/penelroid/anaconda3/envs/weis-env/lib/python3.10/site-packages/openmdao/core/group.py", line 2560, in _solve_nonlinear
self._nonlinear_solver._solve_with_cache_check()
File "/home/penelroid/anaconda3/envs/weis-env/lib/python3.10/site-packages/openmdao/solvers/nonlinear/nonlinear_runonce.py", line 26, in _solve_with_cache_check
self.solve() # don't use caching
File "/home/penelroid/anaconda3/envs/weis-env/lib/python3.10/site-packages/openmdao/solvers/nonlinear/nonlinear_runonce.py", line 45, in solve
self._gs_iter()
File "/home/penelroid/anaconda3/envs/weis-env/lib/python3.10/site-packages/openmdao/solvers/solver.py", line 787, in _gs_iter
subsys._solve_nonlinear()
File "/home/penelroid/anaconda3/envs/weis-env/lib/python3.10/site-packages/openmdao/core/explicitcomponent.py", line 311, in _solve_nonlinear
self._compute_wrapper()
File "/home/penelroid/anaconda3/envs/weis-env/lib/python3.10/site-packages/openmdao/core/explicitcomponent.py", line 269, in _compute_wrapper
with self._call_user_function('compute'):
File "/home/penelroid/anaconda3/envs/weis-env/lib/python3.10/contextlib.py", line 153, in __exit__
self.gen.throw(typ, value, traceback)
File "/home/penelroid/anaconda3/envs/weis-env/lib/python3.10/site-packages/openmdao/core/system.py", line 2281, in _call_user_function
raise err_type(
File "/home/penelroid/anaconda3/envs/weis-env/lib/python3.10/site-packages/openmdao/core/system.py", line 2275, in _call_user_function
yield
File "/home/penelroid/anaconda3/envs/weis-env/lib/python3.10/site-packages/openmdao/core/explicitcomponent.py", line 285, in _compute_wrapper
self.compute(*args)
File "/mnt/c/CoDesignTurbineBlade/weis/aeroelasticse/openmdao_openfast.py", line 605, in compute
summary_stats, extreme_table, DELs, Damage, case_list, case_name, chan_time, dlc_generator = self.run_FAST(inputs, discrete_inputs, fst_vt)
File "/mnt/c/CoDesignTurbineBlade/weis/aeroelasticse/openmdao_openfast.py", line 2051, in run_FAST
summary_stats, extreme_table, DELs, Damage, chan_time = fastBatch.run_serial()
File "/mnt/c/CoDesignTurbineBlade/weis/aeroelasticse/runFAST_pywrapper.py", line 361, in run_serial
_name, _ss, _et, _dl, _dam, _ct = evaluate(c)
File "/mnt/c/CoDesignTurbineBlade/weis/aeroelasticse/runFAST_pywrapper.py", line 480, in evaluate
return fast.execute()
File "/mnt/c/CoDesignTurbineBlade/weis/aeroelasticse/runFAST_pywrapper.py", line 183, in execute
openfastlib = FastLibAPI(self.FAST_lib, os.path.abspath(os.path.basename(writer.FAST_InputFileOut)))
File "/mnt/c/CoDesignTurbineBlade/OpenFAST/glue-codes/python/openfast_library.py", line 29, in __init__
self._initialize_routines()
File "/mnt/c/CoDesignTurbineBlade/OpenFAST/glue-codes/python/openfast_library.py", line 58, in _initialize_routines
self.FAST_AllocateTurbines.argtypes = [
File "/home/penelroid/anaconda3/envs/weis-env/lib/python3.10/ctypes/__init__.py", line 387, in __getattr__
func = self.__getitem__(name)
File "/home/penelroid/anaconda3/envs/weis-env/lib/python3.10/ctypes/__init__.py", line 392, in __getitem__
func = self._FuncPtr((name_or_ordinal, self))
AttributeError: 'aeroelastic' <class FASTLoadCases>: Error calling compute(), python: undefined symbol: FAST_AllocateTurbines
- 14_level2ccd/weis_driver.py
Traceback (most recent call last):
File "/mnt/c/CoDesignTurbineBlade/examples_test/14_level2ccd/weis_driver.py", line 14, in <module>
wt_opt, modeling_options, opt_options = run_weis(fname_wt_input, fname_modeling_options, fname_analysis_options)
File "/mnt/c/CoDesignTurbineBlade/weis/glue_code/runWEIS.py", line 193, in run_weis
wt_opt.run_driver()
File "/home/penelroid/anaconda3/envs/weis-env/lib/python3.10/site-packages/openmdao/utils/hooks.py", line 132, in execute_hooks
ret = f(*args, **kwargs)
File "/home/penelroid/anaconda3/envs/weis-env/lib/python3.10/site-packages/openmdao/core/problem.py", line 857, in run_driver
return self.driver.run()
File "/mnt/c/CoDesignTurbineBlade/WISDEM/wisdem/optimization_drivers/nlopt_driver.py", line 234, in run
model.run_solve_nonlinear()
File "/home/penelroid/anaconda3/envs/weis-env/lib/python3.10/site-packages/openmdao/core/system.py", line 3994, in run_solve_nonlinear
self._solve_nonlinear()
File "/home/penelroid/anaconda3/envs/weis-env/lib/python3.10/site-packages/openmdao/core/group.py", line 2560, in _solve_nonlinear
self._nonlinear_solver._solve_with_cache_check()
File "/home/penelroid/anaconda3/envs/weis-env/lib/python3.10/site-packages/openmdao/solvers/nonlinear/nonlinear_runonce.py", line 26, in _solve_with_cache_check
self.solve() # don't use caching
File "/home/penelroid/anaconda3/envs/weis-env/lib/python3.10/site-packages/openmdao/solvers/nonlinear/nonlinear_runonce.py", line 45, in solve
self._gs_iter()
File "/home/penelroid/anaconda3/envs/weis-env/lib/python3.10/site-packages/openmdao/solvers/solver.py", line 787, in _gs_iter
subsys._solve_nonlinear()
File "/home/penelroid/anaconda3/envs/weis-env/lib/python3.10/site-packages/openmdao/core/explicitcomponent.py", line 311, in _solve_nonlinear
self._compute_wrapper()
File "/home/penelroid/anaconda3/envs/weis-env/lib/python3.10/site-packages/openmdao/core/explicitcomponent.py", line 269, in _compute_wrapper
with self._call_user_function('compute'):
File "/home/penelroid/anaconda3/envs/weis-env/lib/python3.10/contextlib.py", line 153, in __exit__
self.gen.throw(typ, value, traceback)
File "/home/penelroid/anaconda3/envs/weis-env/lib/python3.10/site-packages/openmdao/core/system.py", line 2281, in _call_user_function
raise err_type(
File "/home/penelroid/anaconda3/envs/weis-env/lib/python3.10/site-packages/openmdao/core/system.py", line 2275, in _call_user_function
yield
File "/home/penelroid/anaconda3/envs/weis-env/lib/python3.10/site-packages/openmdao/core/explicitcomponent.py", line 285, in _compute_wrapper
self.compute(*args)
File "/mnt/c/CoDesignTurbineBlade/weis/aeroelasticse/openmdao_openfast.py", line 605, in compute
summary_stats, extreme_table, DELs, Damage, case_list, case_name, chan_time, dlc_generator = self.run_FAST(inputs, discrete_inputs, fst_vt)
File "/mnt/c/CoDesignTurbineBlade/weis/aeroelasticse/openmdao_openfast.py", line 2051, in run_FAST
summary_stats, extreme_table, DELs, Damage, chan_time = fastBatch.run_serial()
File "/mnt/c/CoDesignTurbineBlade/weis/aeroelasticse/runFAST_pywrapper.py", line 361, in run_serial
_name, _ss, _et, _dl, _dam, _ct = evaluate(c)
File "/mnt/c/CoDesignTurbineBlade/weis/aeroelasticse/runFAST_pywrapper.py", line 480, in evaluate
return fast.execute()
File "/mnt/c/CoDesignTurbineBlade/weis/aeroelasticse/runFAST_pywrapper.py", line 183, in execute
openfastlib = FastLibAPI(self.FAST_lib, os.path.abspath(os.path.basename(writer.FAST_InputFileOut)))
File "/mnt/c/CoDesignTurbineBlade/OpenFAST/glue-codes/python/openfast_library.py", line 29, in __init__
self._initialize_routines()
File "/mnt/c/CoDesignTurbineBlade/OpenFAST/glue-codes/python/openfast_library.py", line 58, in _initialize_routines
self.FAST_AllocateTurbines.argtypes = [
File "/home/penelroid/anaconda3/envs/weis-env/lib/python3.10/ctypes/__init__.py", line 387, in __getattr__
func = self.__getitem__(name)
File "/home/penelroid/anaconda3/envs/weis-env/lib/python3.10/ctypes/__init__.py", line 392, in __getitem__
func = self._FuncPtr((name_or_ordinal, self))
AttributeError: 'aeroelastic' <class FASTLoadCases>: Error calling compute(), python: undefined symbol: FAST_AllocateTurbines
Expected behavior
Should run without error
Code versions
- The latest version from main branch (as of 10/18/2022), following the official install procedure
- Tested with both Python 3.9 and 3.10
- Tested with WSL (Ubuntu 22.04.1 LTS) as well as macOS 10.13.6