Grid stretching in one direction via grid-mapping using an Euler HLLE solver

15 views
Skip to first unread message

Lukas Wagner

unread,
Oct 7, 2024, 12:03:35 PM10/7/24
to claw-users
Hello,
can someone please help me to realize a grid stretching in one direction via grid-mapping to extended the farfield in one direction.
So far I was able to implement with the following function:

def mapc2p(xc,yc):
import Grid_mapping as Gm
  Nc = len(xc[:,0])
  xe = xc[-1,0]
  dxl = a*(xc[1,0]-xc[0,0])
  for i in range(1,Nc):
      xc[i,:] = xc[0,:] + dxl*i
  k = Gm.min(0,xk,xc[:,0],Nc)
   c = dxl*(Nc-k-2)/(xe-xc[k,0]-dxl)
   for j in range(Nc-k):
      xc[k+j,:] = (c*xe*j+xc[k,:]*(Nc-1-k-j))/(Nc-1-k+j*(c-1.))
   return [xc,yc] resulting in the blue graph (bottom left). euler_hlle_2D_gridmap.JPG

Comparing the maximum density at 12 microseconds with and without a grid-mapping (see figure 2), a clear distinction is visible. euler_hlle_2D_nomap.JPG I have already used different grid-mappings and different Euler solvers, but the error between these two cases remains nearly constant. I have also considered the solver "euler_mapgrid_rpt2", however here the simulation simply froze, indepent of claw.tfinal. I would really appreciate it if someone is able to point out any errors or can show me a working grid-mapping for the "rpn2_euler_hlle.f90" solver or a solver where my solution doesnt freeeze and can correct the induced error by the grid-mapping.

David Ketcheson

unread,
Oct 7, 2024, 12:24:22 PM10/7/24
to claw-users
Hi Lukas,

It's not completely clear to me from your message what you are plotting and what output you expected, but I will reply based on my best guess.

My first thought is that perhaps the issue is just in the plotting/post-processing step.  Without seeing your code, it's impossible for me to know, but it looks like what would happen if you computed on a mapped grid but then plotted on a uniform grid.

Are you using PyClaw or one of the other packages?  I don't think there is a mapped grid 2D Euler example for PyClaw, so if you get this working and would like to contribute, that would be great.  Perhaps the closest PyClaw example is the 2D acoustics with a mapped grid: clawpack/pyclaw/examples/acoustics_2d_mapped/acoustics_2d_inclusions.py.

David

Praveen C

unread,
Oct 7, 2024, 10:46:49 PM10/7/24
to Clawpack Google Group
Is there a classic 2d euler example with mapped grids somewhere that one can study ?

I have setup one here for subsonic flow over cylinder, but I havent been able to make it work. It fails with some negative quantities appearing in the roe riemann solver.


best
praveen

-- 
You received this message because you are subscribed to the Google Groups "claw-users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to claw-users+...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/claw-users/7e30ee3f-a7bd-4047-9500-f6b96c789984n%40googlegroups.com.

Kyle Mandli

unread,
Oct 7, 2024, 11:26:31 PM10/7/24
to Clawpack Google Group
Have you tried an HLLC solver?  Roe is known to fail near vacuum states.

Kyle

Praveen C

unread,
Oct 7, 2024, 11:35:34 PM10/7/24
to Clawpack Google Group
This is subsonic, so I would expect Roe should work. 

Is there a HLLC solver for mapped grids ? 

I am using this


which has some extra things for mapped grids. I could not find similar solver for hlle or hllc. 

Thanks
praveen

Kyle Mandli

unread,
Oct 7, 2024, 11:43:26 PM10/7/24
to Clawpack Google Group
I still might try using HLLC.  I am not aware of a mapped grid HLLC solver but you could use the Roe version and replace (pretty much simplify) that solver with the HLLC components.

Kyle
--
You received this message because you are subscribed to the Google Groups "claw-users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to claw-users+...@googlegroups.com.

Praveen C

unread,
Oct 7, 2024, 11:46:08 PM10/7/24
to Clawpack Google Group


On 8 Oct 2024, at 9:13 AM, Kyle Mandli <kyle....@gmail.com> wrote:

I still might try using HLLC.  I am not aware of a mapped grid HLLC solver but you could use the Roe version and replace (pretty much simplify) that solver with the HLLC components.

Kyle

Thanks, I will try that.

Previous discussion on this is here


best
praveen
Reply all
Reply to author
Forward
0 new messages