mdolab / adflow

ADflow is a finite volume RANS solver tailored for gradient-based aerodynamic design optimization.
Other
229 stars 100 forks source link

Write failed solution when `restart_failed_analysis` is False #343

Closed eytanadler closed 8 months ago

eytanadler commented 9 months ago

Purpose

In the MPhys wrapper, there is an option to try clean restarting an analysis that stalls/fails to converge. In those cases, the failed solution is written so the user can try to figure out what went wrong. However, no failed solution is written when restart_failed_analysis is False (this is the default), making diagnosis challenging. This PR changes it so a solution is written in this case.

Expected time until merged

A few days

Type of change

Testing

Run an MPhys ADflow case where the restart_failed_analysis option in the ADflowBuilder is set to False and set the max number of ADflow iterations to a very small number so it fails to converge. Before this PR, you will see no failed analysis solution written. With the PR, you will.

Checklist

codecov[bot] commented 9 months ago

Codecov Report

Attention: Patch coverage is 0% with 2 lines in your changes are missing coverage. Please review.

Project coverage is 41.47%. Comparing base (de01140) to head (83121a7).

Files Patch % Lines
adflow/mphys/mphys_adflow.py 0.00% 2 Missing :warning:
Additional details and impacted files ```diff @@ Coverage Diff @@ ## main #343 +/- ## ========================================== - Coverage 41.49% 41.47% -0.03% ========================================== Files 13 13 Lines 4066 4068 +2 ========================================== Hits 1687 1687 - Misses 2379 2381 +2 ```

:umbrella: View full report in Codecov by Sentry.
:loudspeaker: Have feedback on the report? Share it here.