adflow icon indicating copy to clipboard operation
adflow copied to clipboard

Incorrect Y+ printout in complex mode

Open marcomangano opened this issue 3 years ago • 3 comments

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)

marcomangano avatar Sep 03 '21 14:09 marcomangano

What problem are you running? I'd expect something like this to happen if you were using Euler.

joanibal avatar Sep 24 '21 18:09 joanibal

Nope, this happens on my RANS tests for rotating frames. I showed this to @anilyil and he recommended to open the issue

marcomangano avatar Sep 24 '21 19:09 marcomangano

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.

sseraj avatar Mar 03 '23 15:03 sseraj