Help using quad grids

23 views
Skip to first unread message

Praveen C

unread,
Dec 31, 2023, 12:36:19 AM12/31/23
to claw-users
Hello

I am trying to write my first code with quad grids.

https://github.com/cpraveen/chpde/tree/master/euler_2d/cylinder

It is set up to solve euler equations exterior to a cylinder. I am using roe solver for mapped grids that is included in clawpack

https://github.com/cpraveen/chpde/blob/master/euler_2d/cylinder/Makefile

  $(CLAW)/riemann/src/rpn2_euler_mapgrid.f90 \
  $(CLAW)/riemann/src/rpt2_euler_mapgrid.f90 \
  $(CLAW)/riemann/src/euler_roe_solver_mapgrid.f90 \
  $(CLAW)/riemann/src/getquadinfo_mapgrid.f90

I believe I have taken care of setting up aux arrays and bc. But when I run even first order method, the code quickly fails with negative sound speeds.

Are these Riemann solvers supposed to work ?

Can somebody glance through my files and see if they spot any mistake ?

Here is the error

CLAW2EZ: Frame    0 output files done at time t =  0.0000D+00

 3-wave is transonic
 3-wave is transonic
 1-wave is transonic
 3-wave is transonic
 3-wave is transonic
 Roe solver :
c2 .lt. 0;  -0.35970417E+02
 ixy =            1
 enth =    67.558869504496357    
 Called from rpn2
 
  0.8591302689298141E+00  0.8591302689298141E+00
 -0.1982120369244459E+02  0.1982120369244459E+02
 -0.1524731924475515E+02 -0.1524731924475515E+02
  0.1454441822214376E+03  0.1454441822214376E+03

Thanks
praveen

Randall J LeVeque

unread,
Jan 1, 2024, 3:56:03 PMJan 1
to claw-...@googlegroups.com
I'm not sure now who wrote these versions of the quadrilateral grid Euler Riemann solvers, maybe someone else has recent experience with them?

I have very different versions of these solvers from 10 or 15 years ago that I used at one point with Clawpack-4. I'm happy to share them with Praveen or anyone else who wants to dig into this.  It would be nice to have a working example of a shock hitting a cylinder, for example.  There are also some related examples for shallow water equations that have not been updated to Clawpack-5,
linked from

But I don't have time to work on it myself at the moment.

- Randy


On Sat, Dec 30, 2023 at 9:36 PM Praveen C <cpra...@gmail.com> wrote:
Hello I am trying to write my first code with quad grids. https: //github. com/cpraveen/chpde/tree/master/euler_2d/cylinder It is set up to solve euler equations exterior to a cylinder. I am using roe solver for mapped grids that is included in
ZjQcmQRYFpfptBannerStart
This Message Is From an Untrusted Sender
You have not previously corresponded with this sender.
See https://itconnect.uw.edu/email-tags for additional information. Please contact the UW-IT Service Center, he...@uw.edu 206.221.5000, for assistance.
 
ZjQcmQRYFpfptBannerEnd
--
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/6487da24-fd53-4e0f-a2d3-13d4d1f678f8n%40googlegroups.com.

Praveen C

unread,
Jan 2, 2024, 1:28:20 AMJan 2
to Clawpack Google Group
I have made an attempt to convert the shallow water cylinder example from chap23 here


I again have trouble even running the first order case. The solution blows up.

I suspect there could be some issue with how time step is computed by clawpack, for quad grids. Is there something user needs to do for this ?

best
praveen

Praveen C

unread,
Jan 2, 2024, 3:09:08 AMJan 2
to Clawpack Google Group
The cylinder in shallow water case works now, a mistake in reordering indices


I am still trying to make the euler case work.

best
praveen

donnac...@boisestate.edu

unread,
Jan 4, 2024, 12:36:03 PMJan 4
to claw-users
What are you using for boundary conditions for the polar coordinates at r=0?   

I wrote the original "getquadinfo" routine, and may have had a hand in the 2d mapped Riemann solvers for the Euler equations (although I'd have to look).  If you can send a few more details on your problem, I can take a look.  

Take care, 

Donna

Praveen C

unread,
Jan 4, 2024, 9:41:49 PMJan 4
to Clawpack Google Group
Hello Donna

I have set up flow over a cylinder here


It should solve mach=0.1 flow over cylinder of radius = 1 and outer boundary radius = 50.

On r=1, I set wall boundary condition. On outer boundary I fill freestream values. Periodic in the other direction.

I have filled aux(7,..) array to contain

   !    aux(1,i,j)  = ax

   !    aux(2,i,j)  = ay   where (ax,ay) is unit normal to left face

   !    aux(3,i,j)  = ratio of length of left face to dyc


   !    aux(4,i,j)  = bx

   !    aux(5,i,j)  = by   where (bx,by) is unit normal to bottom face

   !    aux(6,i,j)  = ratio of length of bottom face to dxc


   !    aux(7,i,j)  = ratio of cell area to dxc*dyc

   !                  (approximately Jacobian of mapping function)


Running first order, the solution blows up quite early with this error


 +++ mx, my =           61         100

 running...

  

CLAW2EZ: Frame    0 output files done at time t =  0.0000D+00


CLAW2EZ: Frame    1 output files done at time t =  0.1980D-01


CLAW2EZ: Frame    2 output files done at time t =  0.4031D-01


CLAW2EZ: Frame    3 output files done at time t =  0.5825D-01


CLAW2EZ: Frame    4 output files done at time t =  0.7411D-01


CLAW2EZ: Frame    5 output files done at time t =  0.8829D-01


 1-wave is transonic

 3-wave is transonic

 Roe solver : 

c2 .lt. 0;  -0.72214308E+02

 ixy =            1

 enth =    71.109959431410303     

 Called from rpn2 

  

  0.1564951969485085E+01  0.1564951969485085E+01

 -0.2702260413176127E+02  0.2702260413176127E+02

 -0.3510838022563935E+02 -0.3510838022563935E+02

  0.2586649442085526E+03  0.2586649442085526E+03


Here are some plots. 


Initially it seems to develop correctly, wall bc is acting,  but something goes wrong near cylinder surface.

Thanks a lot for looking into this.
best
praveen
Reply all
Reply to author
Forward
0 new messages