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

Generating only Cp_Ct_Cq table and new .IN file from WindIO #298

Closed
TheMercer opened this issue Jul 13, 2024 · 18 comments
Closed

Generating only Cp_Ct_Cq table and new .IN file from WindIO #298

TheMercer opened this issue Jul 13, 2024 · 18 comments
Assignees

Comments

@TheMercer
Copy link

Description

Hi, so I am trying to generate a new Cp_Ct_Cq table and .IN from WindIO.

Closest examples our example 5 & 6. Which generating new OpenFast model, which is great also. However it also always wants to generate BTS files and run LC even tho I get rid of the DLC dict in model.yaml.

Steps to reproduce issue

Please provide a minimum working example (MWE) if possible

  1. Run example 5 or 6
  2. Remove DLC dict from model.yaml

Current behaviour

It will generate the model but then generate BTS files and run DLCs

Expected behavior

Generate OpenFast model, new Cp_Ct_Cq and .IN, then stop

Code versions

List versions only if relevant

  • Python
@TheMercer
Copy link
Author

If you could help, give example or show how I can go from WindIO to OpenFast + Cp_Ct_Cq + .IN without having to make BTS files. Much appreciated

@gbarter
Copy link
Member

gbarter commented Jul 16, 2024

You are correct. The call to turbsim is hardcoded no matter what the OpenFAST CompInflow or InflowWind-WindType settings are. That might take just a bit to correct. Is TurbSim not working for you?

@TheMercer
Copy link
Author

It works. It's just slow, and I don't need it. So ideally it wouldn't run, unless a flag was said maybe. As I just want the table and .IN without running OpenFast

@TheMercer
Copy link
Author

Unless you have a away to generate, Performance table and new .IN file without having to generate BTS files ?

@gbarter
Copy link
Member

gbarter commented Jul 16, 2024

Yes, I also see that those OpenFAST files are only generated once TurbSim is done. I could start a feature branch to fix this issue if that helps.

@TheMercer
Copy link
Author

Yeah, because atleast I could just kill the process after those files are made.

I think having BTS files first when you don't know the OpenFast is 100% correct yet (due to what ever changes are being made).

Or at somepoint make it possible to have a flag for turbsim files ?

@gbarter
Copy link
Member

gbarter commented Jul 16, 2024

I will see what I can do. . .

@TheMercer
Copy link
Author

If you know ish where that lives. I can always see as well and try and help also

@TheMercer
Copy link
Author

So it doesn't "break* other people's runs. You have that flag as true by default. So original functionality is kept. Just can be disabled

@dzalkind
Copy link
Collaborator

There is a model_only flag in the modeling options that should skip the simulations:

if self.model_only == True:

@TheMercer
Copy link
Author

Would this skip the BTS generation ? Or could we move bts generation into that ?

@TheMercer
Copy link
Author

I will try that tomorrow, and see if that doesn't generate bts files. (Hopefully not)

@dzalkind
Copy link
Collaborator

Here is where the BTS files are generated:

# Generate wind files

It should skip that. My personal workaround would be to only make one short BTS file, like in this example. That should not take much computing time.

@TheMercer
Copy link
Author

I will try that also, if it does make BTS files

@TheMercer
Copy link
Author

Thank you both for your prompt response.

@TheMercer
Copy link
Author

@dzalkind Model_only to true worked, thank you on that one.

@gbarter and dzalkind, also highlighted a bug ?

Airfoil number 59 tab number 0 has the moment coefficient different between +-180 deg. This is changed to be the same now.
Writing rotor performance text file: C:\Users\ksm\WEIS\examples\06_IEA-15-240-RWT\outputs/06_IEA15_model_only\openfast_runs\rank_0\weis_job_0_Cp_Ct_Cq.txt
Writing new controller parameter file parameter file: C:\Users\ksm\WEIS\examples\06_IEA-15-240-RWT\outputs/06_IEA15_model_only\openfast_runs\rank_0\weis_job_0_DISCON.IN.
Traceback (most recent call last):
  File "C:\Miniconda3\envs\weis-env\Lib\site-packages\openmdao\core\system.py", line 2666, in _call_user_function
    yield
  File "C:\Miniconda3\envs\weis-env\Lib\site-packages\openmdao\core\explicitcomponent.py", line 264, in _compute_wrapper
    self.compute(self._inputs, self._outputs,
  File "C:\Users\ksm\WEIS\weis\aeroelasticse\openmdao_openfast.py", line 612, in compute
    self.write_FAST(fst_vt, discrete_outputs)
  File "C:\Users\ksm\WEIS\weis\aeroelasticse\openmdao_openfast.py", line 2693, in write_FAST
    writer.execute()
  File "C:\Users\ksm\WEIS\weis\aeroelasticse\FAST_writer.py", line 189, in execute
    self.write_MainInput()
  File "C:\Users\ksm\WEIS\weis\aeroelasticse\FAST_writer.py", line 207, in write_MainInput
    f.write('{:<22} {:<11} {:}'.format(self.fst_vt['Fst']['TMax'], 'TMax', '- Total run time (s)\n'))
                                       ~~~~~~~~~~~~~~~~~~^^^^^^^^
KeyError: 'TMax'

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "C:\Users\ksm\WEIS\examples\06_IEA-15-240-RWT\weis_driver_model_only.py", line 16, in <module>
    wt_opt, modeling_options, opt_options = run_weis(fname_wt_input, fname_modeling_options, fname_analysis_options)
                                            ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "C:\Users\ksm\WEIS\weis\glue_code\runWEIS.py", line 213, in run_weis
    wt_opt.run_model()
  File "C:\Miniconda3\envs\weis-env\Lib\site-packages\openmdao\core\problem.py", line 677, in run_model
    self.model.run_solve_nonlinear()
  File "C:\Miniconda3\envs\weis-env\Lib\site-packages\openmdao\core\system.py", line 4682, in run_solve_nonlinear
    self._solve_nonlinear()
  File "C:\Miniconda3\envs\weis-env\Lib\site-packages\openmdao\core\group.py", line 3458, in _solve_nonlinear
    self._nonlinear_solver._solve_with_cache_check()
  File "C:\Miniconda3\envs\weis-env\Lib\site-packages\openmdao\solvers\nonlinear\nonlinear_runonce.py", line 26, in _solve_with_cache_check
    self.solve()  # don't use caching
    ^^^^^^^^^^^^
  File "C:\Miniconda3\envs\weis-env\Lib\site-packages\openmdao\solvers\nonlinear\nonlinear_runonce.py", line 45, in solve
    self._gs_iter()
  File "C:\Miniconda3\envs\weis-env\Lib\site-packages\openmdao\solvers\solver.py", line 865, in _gs_iter
    subsys._solve_nonlinear()
  File "C:\Miniconda3\envs\weis-env\Lib\site-packages\openmdao\core\group.py", line 3458, in _solve_nonlinear
    self._nonlinear_solver._solve_with_cache_check()
  File "C:\Miniconda3\envs\weis-env\Lib\site-packages\openmdao\solvers\nonlinear\nonlinear_runonce.py", line 26, in _solve_with_cache_check
    self.solve()  # don't use caching
    ^^^^^^^^^^^^
  File "C:\Miniconda3\envs\weis-env\Lib\site-packages\openmdao\solvers\nonlinear\nonlinear_runonce.py", line 45, in solve
    self._gs_iter()
  File "C:\Miniconda3\envs\weis-env\Lib\site-packages\openmdao\solvers\solver.py", line 865, in _gs_iter
    subsys._solve_nonlinear()
  File "C:\Miniconda3\envs\weis-env\Lib\site-packages\openmdao\core\explicitcomponent.py", line 293, in _solve_nonlinear
    self._compute_wrapper()
  File "C:\Miniconda3\envs\weis-env\Lib\site-packages\openmdao\core\explicitcomponent.py", line 247, in _compute_wrapper
    with self._call_user_function('compute'):
  File "C:\Miniconda3\envs\weis-env\Lib\contextlib.py", line 158, in __exit__
    self.gen.throw(value)
  File "C:\Miniconda3\envs\weis-env\Lib\site-packages\openmdao\core\system.py", line 2672, in _call_user_function
    raise err_type(
  File "C:\Miniconda3\envs\weis-env\Lib\site-packages\openmdao\core\system.py", line 2666, in _call_user_function
    yield
  File "C:\Miniconda3\envs\weis-env\Lib\site-packages\openmdao\core\explicitcomponent.py", line 264, in _compute_wrapper
    self.compute(self._inputs, self._outputs,
  File "C:\Users\ksm\WEIS\weis\aeroelasticse\openmdao_openfast.py", line 612, in compute
    self.write_FAST(fst_vt, discrete_outputs)
  File "C:\Users\ksm\WEIS\weis\aeroelasticse\openmdao_openfast.py", line 2693, in write_FAST
    writer.execute()
  File "C:\Users\ksm\WEIS\weis\aeroelasticse\FAST_writer.py", line 189, in execute
    self.write_MainInput()
  File "C:\Users\ksm\WEIS\weis\aeroelasticse\FAST_writer.py", line 207, in write_MainInput
    f.write('{:<22} {:<11} {:}'.format(self.fst_vt['Fst']['TMax'], 'TMax', '- Total run time (s)\n'))
                                       ~~~~~~~~~~~~~~~~~~^^^^^^^^
KeyError: "'comp.aeroelastic' <class FASTLoadCases>: Error calling compute(), 'TMax'"

@gbarter
Copy link
Member

gbarter commented Jul 18, 2024

Thank you- we will have to check that one out.

@dzalkind dzalkind self-assigned this Jul 23, 2024
@dzalkind
Copy link
Collaborator

I pushed a fix in #302.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants