Transonic 2D Cylinder flow NaN

Hello everyone,

I simulted flow around a cylinder in 2D. Runtime error: Nans detected at t =0.25.
Is there anything wrong with the parameters I set?

and the ini. file

[backend]
precision = double
rank-allocator = linear

;[backend-openmp]
;cblas = libblas.so
;cblas-type = serial

[constants]
gamma = 1.4
mu = 0.0
Pr = 0.72
Ma=0.5

rhoin=1.0
uin = 1
vin = 1.0
;p=1
;rhoin*uin*uin/(Ma*Ma*gamma)

[solver]
system = navier-stokes
order = 2
shock-capturing = artificial-viscosity

[solver-artificial-viscosity]
max-artvisc = 0.01
s0 = 0.01
kappa = 5.0

[solver-time-integrator]
scheme = rk4
controller = none
tstart = 0.0
tend = 100.0
dt = 0.005

[solver-interfaces]
riemann-solver = roem
ldg-beta = 0.5
ldg-tau = 0.1

[solver-interfaces-line]
flux-pts = gauss-legendre

[solver-elements-tri]
soln-pts = williams-shunn

[solver-elements-quad]
soln-pts = gauss-legendre

[soln-plugin-writer]
dt-out = 1.0
basedir = .
basename = run-{t:.2f}

[soln-bcs-outflow]
type = sup-out-fn


[soln-bcs-inflow]
type = sup-in-fa

rho=rhoin
u = uin
v = vin
p = rhoin*uin*uin/(Ma*Ma*gamma)

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

[soln-ics]
rho=rhoin
u = uin
v = vin
p = rhoin*uin*u

Best regards

Are you trying to run a supersonic compressible case?

You seem to want to have an inlet Mach number of 0.5. As this is subsonic, this will mean that at the inflow boundary you will have an outwards going characteristic and at the outflow you will have at least one outwards going characteristic. The easiest thing to use are characteristic Riemann invariant BCs as these will sort out the characteristics for you. Otherwise you probably want sub-in-frv and sub-out-fp.

You may also want to consider using globally adaptive time stepping.

Finally, the AV approach that is currently mainline in PyFR isn’t very good at shock-capturing. You will likely need to do some parameter tuning

I want to run supersonic compressible case. then I change u as 2.

[solver-time-integrator]
scheme = rk45
controller = pi
tstart = 0.0
tend = 4.0
dt = 0.0001
atol = 1e-6
rtol = 1e-6

[soln-bcs-inflow]
type = sup-in-fa
rho=1.4
u = 2.0
v = 0.0
p = 1.0
  1. Is the parameter rho, u, v… in the .ini file dimensionless or dimensional? I have
    seen someone just use dimensional.

  2. I have changed this, it comes error
    " raise RuntimeError(‘Minimum sized time step rejected’)
    RuntimeError: Minimum sized time step rejected"

  3. How to adjust the parameters in AV approach? Which article does this method refer to?

Best regards

PyFR doesn’t explicitly do anything to the dimensions of values. So you should make sure that the BCs, constants and ICs are dimensionally consistent. You could non-dimensionalise them yourself if you like.

This will depend on what you are trying to do, but, as an example, for an atmospheric simulation it would probably be a bad idea to use a pressure of 101325 Pa as it would probably cause you to lose some precision.

The minimum time step being rejected is normally a sign that the method is unstable at the condition you set up. You probably want to impulsively start the case, ie set the IC to the inlet BC, although you probably did this. You probably then need to fiddle with the AV settings. See this paper by Perrson and Peraire: https://doi.org/10.2514/6.2006-112, of which this is a slightly modified implementation.

However, I should warn you that getting this shock-capturing approach to work effectively in PyFR is difficult and the resolution of the shock is likely to be quite bad. This is the reason why @tdzanic and I have put a lot if energy into thinking about alternative shock-capturing methods.

Yeah, I see your IDP method, will this be open on PyFR?

And how do I choose to use DG, SD…I see somebody use this below, but I didn’t see this method in user guide.

[solver-interfaces-quad]
vcjh-eta=dg
flux-pts = gauss-legendre

Best regards

This probably won’t be main line in PyFR, although in the future some of our other approaches will be mainlined.

The ability to used other correction functions other than the DG correction function was removed some time ago. I don’t think there is a view to re-adding the feature in the future, at least until there is a strong case/rationale to change the correction function.

Thanks for your answer.

I changed order = 1, and set

[solver-artificial-viscosity]
max-artvisc=1
s0=1
kappa=5

then it works. But if I set it this way, I lose the high order. and get very low resolution. How to take advantage of the FR format?

Is there any other way I can set it?

Best regards

Sadly there is no magic bullet, it will depend on your case and mesh. You will just have to try some different combinations of parameters and see what works best. This is what I meant by: