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

examples refer to non-existent solver SHWUvlm #119

Closed
wmschy opened this issue Jan 12, 2021 · 5 comments
Closed

examples refer to non-existent solver SHWUvlm #119

wmschy opened this issue Jan 12, 2021 · 5 comments
Assignees

Comments

@wmschy
Copy link

wmschy commented Jan 12, 2021

A few SHARPy examples for Jupyter notebooks specify a solver SHWUvlm. There is no reference to SHWUvlm in the repository, nor any documentation. The problem is in the wind turbine example, and "SHWUvlm" appears in other examples as well.

The first symptom is an unhandled Python exception at a line indexing solvers, e.g., SimInfo.solvers['SHWUvlm']['convection_scheme'] = 2

I would assume SHWUvlm has been superseded by another solver, but it is unclear to a new user how to find a suitable replacement that will yield comparable results.

Aero solver SHWUvlm appears in version 1.1, but not in the current version.

@ArturoMS13
Copy link
Contributor

HI wmschy,

thank you for reporting this. Yes, SHWUvlm has been replaced by StaticUvlm plus a definition of a helicoidal wake in AerogridPlot.

I will update the Jupyter notebooks. In the mean time, you can see an example on line 118 of this file: /~https://github.com/ImperialCollegeLondon/sharpy/blob/master/tests/utils/test_generate_cases.py

Best regards, Arturo.

@ArturoMS13 ArturoMS13 self-assigned this Jan 12, 2021
@wmschy
Copy link
Author

wmschy commented Jan 12, 2021

Arturo,

I applied your suggestion, and the wake looks good so far. I'll let it finish and compare the aero results to those of OpenFAST.

Thank you

@wmschy
Copy link
Author

wmschy commented Jan 13, 2021

Thank you for your quick response. Here are my results after attempting to implement your suggestions.

The results overall look good, except for the wake. Screenshots of the final results and one wake and the my code diffs for the Jupyter notebook are attached.

Cp and Ct are both .01 closer to OpenFAST results than the original example:
OpenFAST SHARPy
Cp[-] 0.49 0.54
Ct[-] 0.70 0.75

The blades and the beam look fine over time.

The wake begins to appear aberrant at about timestep 50.

Could you please offer any suggestions about what has gone wrong with the wake?

Here is an excerpt from the Jupyter notebook diffs (with current v1.2) with my main code changes. I:

  • to set u_inf, I called set_variable_all_dicts to set 'velocity_field_input' from 'SteadyVelocityField'
  • replaced references from SHWUvlm with StaticUvlm (commenting old code), and
  • copied in init code for HelicoidalWake and StaticUvlm

Diffs follow (sorry for bullets appearing where '+' should be):
@@ -252,35 +261,54 @@
"\n",
"SimInfo.solvers['SteadyVelocityField']['u_inf'] = WSP\n",
"SimInfo.solvers['SteadyVelocityField']['u_inf_direction'] = np.array([0., 0., 1.])\n",

  • "SimInfo.set_variable_all_dicts('velocity_field_input', SimInfo.solvers['SteadyVelocityField'])\n",
    "\n",
    "SimInfo.solvers['BeamLoader']['unsteady'] = 'on'\n",
    "\n",
    "SimInfo.solvers['AerogridLoader']['unsteady'] = 'on'\n",
    "SimInfo.solvers['AerogridLoader']['mstar'] = mstar\n",
    "SimInfo.solvers['AerogridLoader']['freestream_dir'] = np.array([0.,0.,0.])\n",
  • "# added helicoidalwake per suggestion:\n",
  • "SimInfo.solvers['AerogridLoader']['wake_shape_generator'] = 'HelicoidalWake'\n",
  • "SimInfo.solvers['AerogridLoader']['wake_shape_generator_input'] = {'u_inf': WSP,\n",
  • " 'u_inf_direction': np.array([0., 0., 1.]),\n",
  • " 'dt': dt,\n",
  • " 'rotation_velocity': rotation_velocity*np.array([0., 0., 1.])}\n",
  • "\n",
  • "\n",
    "\n",
    "SimInfo.solvers['StaticCoupledRBM']['structural_solver'] = 'RigidDynamicPrescribedStep'\n",
    "SimInfo.solvers['StaticCoupledRBM']['structural_solver_settings'] = SimInfo.solvers['RigidDynamicPrescribedStep']\n",
  • "SimInfo.solvers['StaticCoupledRBM']['aero_solver'] = 'SHWUvlm'\n",
  • "SimInfo.solvers['StaticCoupledRBM']['aero_solver_settings'] = SimInfo.solvers['SHWUvlm']\n",
  • "#SimInfo.solvers['StaticCoupledRBM']['aero_solver'] = 'SHWUvlm'\n",
  • "SimInfo.solvers['StaticCoupledRBM']['aero_solver'] = 'StaticUvlm'\n",
  • "SimInfo.solvers['StaticCoupledRBM']['aero_solver_settings'] = SimInfo.solvers['StaticUvlm']\n",
    "\n",
    "SimInfo.solvers['StaticCoupledRBM']['tolerance'] = 1e-8\n",
    "SimInfo.solvers['StaticCoupledRBM']['n_load_steps'] = 0\n",
    "SimInfo.solvers['StaticCoupledRBM']['relaxation_factor'] = 0.\n",
    "\n",
  • "SimInfo.solvers['SHWUvlm']['convection_scheme'] = 2\n",
  • "SimInfo.solvers['SHWUvlm']['num_cores'] = 8\n",
  • "SimInfo.solvers['SHWUvlm']['rot_vel'] = rotation_velocity\n",
  • "SimInfo.solvers['SHWUvlm']['rot_axis'] = np.array([0.,0.,1.])\n",
  • "SimInfo.solvers['SHWUvlm']['rot_center'] = np.zeros((3),)\n",
  • "SimInfo.solvers['SHWUvlm']['velocity_field_generator'] = 'SteadyVelocityField'\n",
  • "SimInfo.solvers['SHWUvlm']['velocity_field_input'] = SimInfo.solvers['SteadyVelocityField']\n",
  • "#SimInfo.solvers['SHWUvlm']['convection_scheme'] = 2\n",
  • "#SimInfo.solvers['SHWUvlm']['num_cores'] = 8\n",
  • "#SimInfo.solvers['SHWUvlm']['rot_vel'] = rotation_velocity\n",
  • "#SimInfo.solvers['SHWUvlm']['rot_axis'] = np.array([0.,0.,1.])\n",
  • "#SimInfo.solvers['SHWUvlm']['rot_center'] = np.zeros((3),)\n",
  • "#SimInfo.solvers['SHWUvlm']['velocity_field_generator'] = 'SteadyVelocityField'\n",
  • "#SimInfo.solvers['SHWUvlm']['velocity_field_input'] = SimInfo.solvers['SteadyVelocityField']\n",
  • "SimInfo.solvers['StaticUvlm']['horseshoe'] = False\n",
  • "SimInfo.solvers['StaticUvlm']['num_cores'] = 14\n",
  • "SimInfo.solvers['StaticUvlm']['n_rollup'] = 0\n",
  • "SimInfo.solvers['StaticUvlm']['rollup_dt'] = dt\n",
  • "SimInfo.solvers['StaticUvlm']['rollup_aic_refresh'] = 1\n",
  • "SimInfo.solvers['StaticUvlm']['rollup_tolerance'] = 1e-8\n",
  • "SimInfo.solvers['StaticUvlm']['rbm_vel_g'] = np.array([0., 0., 0.,\n",
  • " 0., 0., rotation_velocity])\n",
  • "\n",
    "\n",
    "SimInfo.solvers['SaveData']['compress_float'] = True\n",
    " \n",
    "# Only used for steady_simulation = False\n",
    "SimInfo.solvers['StepUvlm']['convection_scheme'] = 3\n",
  • "SimInfo.solvers['StepUvlm']['num_cores'] = 8\n",
  • "SimInfo.solvers['StepUvlm']['num_cores'] = 14\n",
    "SimInfo.solvers['StepUvlm']['velocity_field_generator'] = 'SteadyVelocityField'\n",
    "SimInfo.solvers['StepUvlm']['velocity_field_input'] = SimInfo.solvers['SteadyVelocityField']\n",
    "\n",

wind_turbine.ipynb.diffs.txt
Screenshot from 2021-01-13 12-39-53
Screenshot from 2021-01-13 12-45-00

Thank you.

@wmschy
Copy link
Author

wmschy commented Jan 13, 2021

Attaching my entire wind_turbine.ipynb as text
wind_turbine.ipynb.txt

@ArturoMS13
Copy link
Contributor

ArturoMS13 commented Jan 14, 2021

I have fixed the bug you kindly reported. It will be updated in the documentation with the next release.

I am sorry the wake looks aberrant, but it is something quite common with vortex methods in my experience. You can try to reduce those weird shapes by increasing the 'vortex_radius_wake_ind' value in StepUvlm. In my experience, most of the cases these weird shape does not influence blade loads.

About the numerical results: this case is just an example on how to run wind turbines and the discretisation has been generated to run in standard computers. However, it is not a converged case. If you are looking for accurate results you should run a spatial and temporal mesh convergence analysis and refine the discretisation accordingly.

Best regards, Arturo.

@ngoiz ngoiz closed this as completed in e4f829f Feb 9, 2021
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

2 participants