Freestream density fluctuations using single-precision

I am running an external 2D flow case over an airfoil at Mach 0.2 and Re = 3000. Using Roe Riemann solver for the interfaces/BCs and single precision mode, I notice some odd fluctuations in density in the freestream, of order similar to the density gradients found in the wake. For instance, see below image:

In the above image, the density contours are plotted (the airfoil is in the middle of the domain, with boundaries 20 chord distances away from the origin). The left portion shows the result obtained using single precision mode, and the right shows the results obtained using double precision mode. The results using double precision mode seems OK, but the single precision mode results are odd. This is not clear at low solution polynomial orders like 2 and 3, but starts to become clear at p=4 and above. The above image is using p=5. For reference, the h-mesh looks like the following:

The four outer boundaries are char-riem-inv (but the issue exists with sub-out-fp as well). I added sponge zones via source terms adjacent to the top, right and bottom boundaries. The airfoil surface is a no-slip adiabatic wall. I tested the HLLC and exact Riemann solvers, and the issue exists when using these as well, except using HLLC seems to yield fewer of these fluctuations at lower p like p=4. Is this zebra-banding like artifacts something to be expected due to the round-off errors, or could something be off here?

1 Like

What is the mesh like around your boundary layer? And what happens if you use a Rusanov type solver?

Regards, Freddie.

The mesh (fourth-order curved for airfoil surface) around the boundary layer looks like the following:


With Rusanov Riemann solver, the issue persists (I checked only single precision mode):

The solution near the boundary layer (for the above case) looks like the following:

The behaviour near the airfoil seems reasonable. It is not entirely clear what could be causing the issues in the far-field. I will note that the curvature degree is much higher than would normally be used although I doubt this is responsible for the issues you’re seeing.

Regards, Freddie.

How have you non-dimensionalised here? What is the chord length, and what is the free-stream velocity and density etc?

I non-dimensionalized with the intent to set freestream density and velocity to 1.0. I used

[constants]
gamma = 1.4
mu = 3.33333333333E-04 ; Re 3000
Pr = 0.72

#user-defined
M = 0.2 ;
uc = 1.0
rhoc = 1.0
chord = 1.0

and set the boundary conditions and initial conditions as

[soln-bcs-top]
type = char-riem-inv
rho = rhoc
u = uc
v = 0
p = rhoc*uc*uc/(M*M*gamma) ; T = 1

[soln-bcs-bottom]
type = char-riem-inv
rho = rhoc
u = uc
v = 0
p = rhoc*uc*uc/(M*M*gamma) ; T = 1

[soln-bcs-airfoil]
type = no-slp-adia-wall

[soln-bcs-inlet]
type = char-riem-inv
rho = rhoc
u = uc
v = 0
p = rhoc*uc*uc/(M*M*gamma) ; T = 1

[soln-bcs-outlet]
type = char-riem-inv
rho = rhoc
u = uc
v = 0
p = rhoc*uc*uc/(M*M*gamma) ; T = 1

[soln-ics]
rho = rhoc
u = uc
v = 0
p = rhoc*uc*uc/(M*M*gamma) ; T = 1

In the gmsh mesh, the chord is also 1 units long.