adflow
adflow copied to clipboard
Incorrect Y+ printout in complex mode
Description
When running ADflow in complex mode, the exponents in the Y+
printout are clearly wrong.
Steps to reproduce issue
Run a complex ADflow simulation and monitor the Y+
Current behavior
The Y+
printout will look like this:
-------------------------------------------------
| Y+_max |
-------------------------------------------------
0.2461515118008841-311 +0.2419075202248823E-311i
The exponent of the real part is too small, identical to the complex one, and missing the E
character.
The complex exponent itself looks suspiciously small as well.
Expected behavior
Show the correct order of magnitude for the real (and complex) components of the Y+
Code versions
- ADflow v2.5.2 (HEAD)
What problem are you running? I'd expect something like this to happen if you were using Euler.
Nope, this happens on my RANS tests for rotating frames. I showed this to @anilyil and he recommended to open the issue
This occurs with any of the "max" monitor variables: https://github.com/mdolab/adflow/blob/cd6ec63f37e3d8027aeba1a8ae071e6e7a8e501d/src/solver/solvers.F90#L1428-L1438
The maximum value doesn't have a meaning for complex numbers, so I think the fix would just be to cast the value to real before taking the max.