Riemann problem in 2D

Hello everyone,

I am simulating Riemann problem in 2D, I met two questons:

  1. I’m using Gmsh to generate the grid in this format, this is different from grid in examples, and it doesn’t work.
  2. I set the initial value in the.ini file, such as below, it also comes error. I don’t know if I can do that.

(I don’t know how to upload file, so I attached pintures below)



With best regards

I don’t think you can use if statements in the ini file, but I might be wrong. There is support for max and min functions, but I think that you should try using tanh functions.

i.e. u = 0.5 + 0.5tanh(100*x), approximately gives a step function.

But my function values are discontinuous, maybe not in terms of trigonometry. I think only be represented by an if statement.

And do you know if there is a problem with my grid ?

Best regards

If you use tanh(c*x) and increase c, after the function is sampled to grid it will look identical to the discontinuous function. This the same method Tarik has used in our recent shock capturing work, including when Tarik has run the 2D Riemann problem.

In terms of your grid, it is hard to say from eye balling the mesh file if it will work. But when you run pyfr import does it throw any errors?

I don’t understand this sentence, tanh function is continuous,the value of tanh function is also continuous with increasing c.

The grid is ok.

A discontinuous function makes no sense within the context of a high order method wherein the solution inside of each element is represented by a smooth polynomial. Hence, Will’s suggestion to use tanh with a suitable constant (which will be more robust against round off errors and minor perturbations in solution point placement).

Regards, Freddie.

@WillT @fdw

I use max, min and tanh function to initialize the solution points. and periodic boundary conditions are set in x and y directions respectively.

Then it comes error TypeError: 'NoneType' object is not subscriptable. Did I do something wrong?

[backend]
precision = double
rank-allocator = linear

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

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

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

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

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

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

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

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

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

[soln-plugin-nancheck]
nsteps = 50

[soln-plugin-residual]
nsteps = 10
file = residual.csv
header = true

[soln-ics]
; Factored common subexpression

p=1.0
rho=2+tanh(-10000*x*y)

;a=min(0,x)
;b=max(0,y)
;rho=tanh(-1000*a)+tanh(1000*b)

c=max(0,y)
u=-0.75+1.5*tanh(1000*c)

d=max(0,x)
v=0.5-tanh(1000*d)

Best regards

The syntax you are using to substitute expressions in the initial condition is not correct. I think you need something like:

c = max(0, y)
u = -0.75 + 1.5*tanh(1000*%(c)s)

A post was merged into an existing topic: Double Shock case

Boundary conditions for Riemann problems in 2D.

I set the left and right boundary to be periodic boundary, the up and down boundary to be periodic boundary, and can’t get right contour.

Are the boundary conditions right? Thanks a lot.

Best regaeds

I think they need to inviscid walls throughout, no periodics.

If you want to use periodics, however, I think this paper has some details on the case setup: Redirecting

I have tried slp-adia-wall, but a runtime error always occurred, “Minimum sized time step rejected”. no matter change the parameters of AV.

then I use sub-in-frv, it can work, but the result is also wrong. As shown below, T=0.3.
5197b2fa1978ea5afcf46614728f721

Besr regaeds

I don’t think you can use inflow BCs as the shocks will move relative to the walls, which seems to be what is happening here.

Slip walls are correct for this case, it might just be a problem of resolution.

Thanks for your answer.

  1. You mean resolution is the sparsity of grid? In the slip wall condition, I set the grid from 2020 to 400400, it also comes with “Minimum sized time step rejected”. But when I set the sub-out-fp, it can work, but the result is also wrong. As shown below, but the bottom of density contour comes with vortex.

9d6ddda5c02dd8d1e3035a732ba3be1

  1. Simulation of sod tube in 1D

In PyfR, a two-dimensional grid is used to simulate the one-dimensional shock tube problem. On the top, bottom, left and right of the grid, I tried some boundary conditions. The results are wrong.

Could you give me some advice?

I’m not really sure what to tell you, slip wall boundaries are what are required for this case. Anything else may be stable but it’ll be wrong. It could be that the large gradients at the wall are enough to make the scheme unstable. If I’m not mistake the gradients appear in this boundary condition. You could try stripping those out so it’s more like the Euler slip BC.

Yep, pyfr can’t simulate 1D problems, so you have to use a 2D domain. This is the configuration you want:

                         Slip wall
         _________________________________________
        |  |  |  |  |  |  |  |  |  |  |  |  |  |  |
Left BC |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  Right BC
        |__|__|__|__|__|__|__|__|__|__|__|__|__|__|
                         Slip wall