File tree Expand file tree Collapse file tree 2 files changed +16
-3
lines changed
pyro/compressible/problems Expand file tree Collapse file tree 2 files changed +16
-3
lines changed Original file line number Diff line number Diff line change 1111
1212PROBLEM_PARAMS = {"gresho.rho0" : 1.0 , # density in the domain
1313 "gresho.r" : 0.2 , # radial location of peak velocity
14- "gresho.p0 " : 59.5 , # ambient pressure in the domain
14+ "gresho.M " : 0.1 , # Mach number
1515 "gresho.t_r" : 1.0 } # reference time (used for setting peak velocity)
1616
1717
@@ -36,13 +36,26 @@ def init_data(my_data, rp):
3636 gamma = rp .get_param ("eos.gamma" )
3737
3838 rho0 = rp .get_param ("gresho.rho0" )
39- p0 = rp .get_param ("gresho.p0 " )
39+ M = rp .get_param ("gresho.M " )
4040
4141 rr = rp .get_param ("gresho.r" )
4242 t_r = rp .get_param ("gresho.t_r" )
4343
4444 q_r = 0.4 * np .pi * L_x / t_r
4545
46+ # pressure peaks at r = rr, and has the value
47+ # p0 + 12.5 * rr**2
48+ #
49+ # Mach number is M = q |u_phi| / sqrt(gamma p / rho),
50+ #
51+ # so p0 is found as:
52+ #
53+ # p0 + 12.5 rr**2 = rho q**2 |u_phi|**2 / (gamma M**2)
54+ #
55+ # where u_phi peaks at 5 * rr
56+
57+ p0 = rho0 * q_r ** 2 * (5 * rr )** 2 / (gamma * M ** 2 )
58+
4659 pres = myg .scratch_array ()
4760 u_phi = myg .scratch_array ()
4861
Original file line number Diff line number Diff line change @@ -27,7 +27,7 @@ yrboundary = periodic
2727[gresho]
2828r = 0.2
2929rho0 = 1.0
30- p0 = 59.5
30+ M = 0.1
3131t_r = 1.0
3232
3333[compressible]
You can’t perform that action at this time.
0 commit comments