ImperialCollegeLondon / sharpy

Simulation of High Aspect Ratio aeroplanes and wind turbines in Python: a nonlinear aeroelastic code
https://imperial.ac.uk/aeroelastics/sharpy
BSD 3-Clause "New" or "Revised" License
123 stars 58 forks source link

Minor bug fixes in aero util functions and save data postprocessor #247

Closed sduess closed 1 year ago

sduess commented 1 year ago

Hey team,

I stumbled across two minor bugs recently that are fixed in this pull request.

The first bug occurs when linearization is performed, but StaticTrim is the only solver used in the SHARPy simulation flow. The reason for this is that the aero solver settings (needed to find the velocity generator settings) cannot be retrieved, because StaticTrim was not previously included as one of the possible solvers. This is now changed.

The second bug causes an error when a linear system is saved but an old file already exists. This file cannot be overwritten, so the old file is now removed (as it was previously already for the nonlinear output file). I could also remove the workaround for this bug from the UDP tutorial.

The changes are quite minor and should not take long to review. I have double-checked both fixes myself with simulation examples.

codecov-commenter commented 1 year ago

Codecov Report

Merging #247 (3d52981) into develop (362cd33) will decrease coverage by 0.01%. The diff coverage is 94.11%.

@@             Coverage Diff             @@
##           develop     #247      +/-   ##
===========================================
- Coverage    67.20%   67.20%   -0.01%     
===========================================
  Files          156      156              
  Lines        25924    25926       +2     
===========================================
+ Hits         17423    17424       +1     
- Misses        8501     8502       +1     
Impacted Files Coverage Δ
sharpy/aero/utils/utils.py 76.92% <75.00%> (-0.86%) :arrow_down:
sharpy/cases/templates/flying_wings.py 89.92% <100.00%> (-0.02%) :arrow_down:
sharpy/postproc/savedata.py 80.72% <100.00%> (+0.11%) :arrow_up:

:mega: We’re building smart automated test selection to slash your CI/CD build times. Learn more