Skip to content

Commit c8467f8

Browse files
authored
Merge pull request #15 from geoflows/q_index
Change q to use index values instead of 1...7
2 parents 893de36 + 81e7f53 commit c8467f8

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

53 files changed

+221
-10662
lines changed

examples/radial_slide/setrun.py

+29-32
Original file line numberDiff line numberDiff line change
@@ -43,7 +43,7 @@ def setrun(claw_pkg='dclaw'):
4343
#------------------------------------------------------------------
4444
# Problem-specific parameters to be written to setprob.data:
4545
#------------------------------------------------------------------
46-
46+
4747
#probdata = rundata.new_UserData(name='probdata',fname='setprob.data')
4848
#probdata.add_param('variable_eta_init', True) # now in qinit info
4949

@@ -95,8 +95,8 @@ def setrun(claw_pkg='dclaw'):
9595
# Index of aux array corresponding to capacity function, if there is one:
9696
clawdata.capa_index = 0
9797

98-
99-
98+
99+
100100
# -------------
101101
# Initial time:
102102
# -------------
@@ -106,7 +106,7 @@ def setrun(claw_pkg='dclaw'):
106106

107107
# Restart from checkpoint file of a previous run?
108108
# If restarting, t0 above should be from original run, and the
109-
# restart_file 'fort.chkNNNNN' specified below should be in
109+
# restart_file 'fort.chkNNNNN' specified below should be in
110110
# the OUTDIR indicated in Makefile.
111111

112112
clawdata.restart = False # True to restart from prior results
@@ -135,9 +135,9 @@ def setrun(claw_pkg='dclaw'):
135135
elif clawdata.output_style == 3:
136136
# Output every iout timesteps with a total of ntot time steps:
137137
clawdata.output_step_interval = 1
138-
clawdata.total_steps = 1
138+
clawdata.total_steps = 3
139139
clawdata.output_t0 = True
140-
140+
141141

142142
clawdata.output_format = 'ascii'
143143

@@ -176,35 +176,33 @@ def setrun(claw_pkg='dclaw'):
176176
# Desired Courant number if variable dt used, and max to allow without
177177
# retaking step with a smaller dt:
178178
# D-Claw requires CFL<0.5
179-
clawdata.cfl_desired = 0.45
180-
clawdata.cfl_max = 0.5
179+
clawdata.cfl_desired = 0.75
180+
clawdata.cfl_max = 0.85
181181

182182
# Maximum number of time steps to allow between output times:
183183
clawdata.steps_max = 5000
184184

185185

186-
187-
188186
# ------------------
189187
# Method to be used:
190188
# ------------------
191189

192190
# Order of accuracy: 1 => Godunov, 2 => Lax-Wendroff plus limiters
193191
clawdata.order = 2
194-
192+
195193
# Use dimensional splitting? (not yet available for AMR)
196194
clawdata.dimensional_split = 'unsplit'
197-
198-
# For unsplit method, transverse_waves can be
195+
196+
# For unsplit method, transverse_waves can be
199197
# 0 or 'none' ==> donor cell (only normal solver used)
200198
# 1 or 'increment' ==> corner transport of waves
201199
# 2 or 'all' ==> corner transport of 2nd order corrections too
202-
clawdata.transverse_waves = 1
200+
clawdata.transverse_waves = 2
203201

204202
# Number of waves in the Riemann solution:
205203
clawdata.num_waves = 5
206-
207-
# List of limiters to use for each wave family:
204+
205+
# List of limiters to use for each wave family:
208206
# Required: len(limiter) == num_waves
209207
# Some options:
210208
# 0 or 'none' ==> no limiter (Lax-Wendroff)
@@ -219,7 +217,7 @@ def setrun(claw_pkg='dclaw'):
219217

220218
# Source terms splitting:
221219
# src_split == 0 or 'none' ==> no source term (src routine never called)
222-
# src_split == 1 or 'godunov' ==> Godunov (1st order) splitting used,
220+
# src_split == 1 or 'godunov' ==> Godunov (1st order) splitting used,
223221
# src_split == 2 or 'strang' ==> Strang (2nd order) splitting used, not recommended.
224222
clawdata.source_split = 'godunov'
225223

@@ -267,7 +265,7 @@ def setrun(claw_pkg='dclaw'):
267265
pass
268266

269267
elif abs(clawdata.checkpt_style) == 2:
270-
# Specify a list of checkpoint times.
268+
# Specify a list of checkpoint times.
271269
clawdata.checkpt_times = 3600.*np.arange(1,16,1)
272270

273271
elif abs(clawdata.checkpt_style) == 3:
@@ -326,7 +324,7 @@ def setrun(claw_pkg='dclaw'):
326324
amrdata.clustering_cutoff = 0.700000
327325

328326
# print info about each regridding up to this level:
329-
amrdata.verbosity_regrid = 1
327+
amrdata.verbosity_regrid = 1
330328

331329

332330
# ---------------
@@ -360,7 +358,7 @@ def setrun(claw_pkg='dclaw'):
360358
except:
361359
print("*** Error, this rundata has no geo_data attribute")
362360
raise AttributeError("Missing geo_data attribute")
363-
361+
364362
# == Physics ==
365363
geo_data.gravity = 9.81
366364
geo_data.coordinate_system = 1
@@ -396,16 +394,16 @@ def setrun(claw_pkg='dclaw'):
396394
etafile = 'surface_topo.tt3'
397395
qinitdclaw_data.qinitfiles.append([3, 8, 1, 2, etafile])
398396

399-
#mfile = 'mass_frac.tt3'
400-
mfile = 'mass_frac0.tt3' # with m0 = 0 below
397+
#mfile = 'mass_frac.tt3'
398+
mfile = 'mass_frac.tt3' # with m0 = 0 below
401399
qinitdclaw_data.qinitfiles.append([3, 4, 1, 2, mfile])
402-
400+
403401
#hfile = 'landslide_depth.tt3'
404402
#qinitdclaw_data.qinitfiles.append([3, 1, 1, 2, hfile])
405403

406404
# == setauxinit.data values ==
407405
#auxinitdclaw_data = rundata.auxinitdclaw_data # initialized when rundata instantiated
408-
406+
409407
# == fgmax.data values ==
410408
#fgmax_files = rundata.fgmax_data.fgmax_files
411409
# for fixed grids append to this list names of any fgmax input files
@@ -419,10 +417,10 @@ def setrun(claw_pkg='dclaw'):
419417
dclaw_data.phi_bed = 32.0
420418
dclaw_data.theta_input = 0.0
421419
dclaw_data.mu = 0.005
422-
#dclaw_data.m0 = 0.63
423-
dclaw_data.m0 = 0. # pure water
420+
dclaw_data.m0 = 0.63
421+
#dclaw_data.m0 = 0. # pure water
424422
dclaw_data.m_crit = 0.64
425-
dclaw_data.kappita = 1.e-8
423+
dclaw_data.kappita = 1.e-10
426424
#dclaw_data.kappita_diff = 1
427425
#dclaw_data.chi_init_val=0.5 # not currently used.
428426
dclaw_data.alpha_c = 0.05
@@ -444,7 +442,7 @@ def setrun(claw_pkg='dclaw'):
444442
pinitdclaw_data.init_pmax_ratio = 0.00e0
445443
pinitdclaw_data.init_ptf = 0.0
446444
pinitdclaw_data.init_ptf2 = 0.0
447-
445+
448446
# == flowgrades.data values ==
449447
flowgrades_data = rundata.flowgrades_data # initialized when rundata instantiated
450448

@@ -457,12 +455,12 @@ def setrun(claw_pkg='dclaw'):
457455
# flowgradetype: 1 = norm(flowgradevariable), 2 = norm(grad(flowgradevariable))
458456
# flowgrademinlevel: refine to at least this level if flowgradevalue is exceeded.
459457

460-
458+
461459
#flowgrades_data.keep_fine = True
462460
#flowgrades_data.flowgrades.append([1.0e-6, 2, 1, 1])
463461
#flowgrades_data.flowgrades.append([1.0e-6, 1, 1, 1])
464462

465-
# ----- For developers -----
463+
# ----- For developers -----
466464
# Toggle debugging print statements:
467465
amrdata.dprint = False # print domain flags
468466
amrdata.eprint = False # print err est flags
@@ -474,7 +472,7 @@ def setrun(claw_pkg='dclaw'):
474472
amrdata.sprint = False # space/memory output
475473
amrdata.tprint = False # time step reporting each level
476474
amrdata.uprint = False # update/upbnd reporting
477-
475+
478476
amrdata.max1d = 300
479477
# More AMR parameters can be set -- see the defaults in pyclaw/data.py
480478

@@ -493,4 +491,3 @@ def setrun(claw_pkg='dclaw'):
493491
import sys
494492
rundata = setrun(*sys.argv[1:])
495493
rundata.write()
496-

src/2d/dig/Makefile.dclaw

+1-1
Original file line numberDiff line numberDiff line change
@@ -27,9 +27,9 @@ COMMON_MODULES += \
2727

2828
#list of common modules needed for dclaw codes
2929
COMMON_MODULES += \
30+
$(DIGLIB)/digclaw_module.f90 \
3031
$(DIGLIB)/qinit_module.f90 \
3132
$(DIGLIB)/auxinit_module.f90 \
32-
$(DIGLIB)/digclaw_module.f90 \
3333
$(DIGLIB)/fgout_module.f90 \
3434

3535

src/2d/dig/b4step2.f90

+7-6
Original file line numberDiff line numberDiff line change
@@ -5,9 +5,9 @@ subroutine b4step2(mbc,mx,my,meqn,q,xlower,ylower,dx,dy,t,dt,maux,aux,actualstep
55
! # called before each call to step
66
! # use to set time-dependent aux arrays or perform other tasks.
77
!
8-
! This particular routine sets negative values of q(1,i,j) to zero,
8+
! This particular routine sets negative values of q(i_h,i,j) to zero,
99
! as well as the corresponding q(m,i,j) for m=1,meqn.
10-
! This is for problems where q(1,i,j) is a depth.
10+
! This is for problems where q(i_h,i,j) is a depth.
1111
! This should occur only because of rounding error.
1212
!
1313
! Also calls movetopo if topography might be moving.
@@ -25,6 +25,7 @@ subroutine b4step2(mbc,mx,my,meqn,q,xlower,ylower,dx,dy,t,dt,maux,aux,actualstep
2525
use amr_module, only: xperdom,yperdom,spheredom,NEEDS_TO_BE_SET
2626

2727
use digclaw_module, only: i_theta,bed_normal,admissibleq,calc_taudir
28+
use digclaw_module, only: i_h,i_hu,i_hv,i_hm,i_pb,i_hchi,i_bdif
2829

2930
implicit none
3031

@@ -51,10 +52,10 @@ subroutine b4step2(mbc,mx,my,meqn,q,xlower,ylower,dx,dy,t,dt,maux,aux,actualstep
5152
do i=1-mbc,mx+mbc
5253
theta = 0.d0
5354
if (bed_normal.eq.1) theta=aux(i_theta,i,j)
54-
call admissibleq(q(1,i,j),q(2,i,j),q(3,i,j),q(4,i,j),q(5,i,j),u,v,sv,theta)
55-
q(6,i,j) = min(q(6,i,j),q(1,i,j))
56-
q(6,i,j) = max(q(6,i,j),0.0d0)
57-
q(7,i,j) = max(q(7,i,j),0.0d0)
55+
call admissibleq(q(i_h,i,j),q(i_hu,i,j),q(i_hv,i,j),q(i_hm,i,j),q(i_pb,i,j),u,v,sv,theta)
56+
q(i_hchi,i,j) = min(q(i_hchi,i,j),q(i_h,i,j))
57+
q(i_hchi,i,j) = max(q(i_hchi,i,j),0.0d0)
58+
q(i_bdif,i,j) = max(q(i_bdif,i,j),0.0d0) ! DIG: if we store deposition in i_bdif, remove.
5859
enddo
5960
enddo
6061

0 commit comments

Comments
 (0)