<jupyter_start><jupyter_text>Input parameters<jupyter_code>W = 200.0                    # channel width (m)
D = 12.0                     # channel depth (m)
pad = 100                    # padding (number of nodepoints along centerline)
deltas = 50.0                # sampling distance along centerline
nit = 2000                   # number of iterations
Cf = 0.022                    # dimensionless Chezy friction factor
crdist = 1.5*W               # threshold distance at which cutoffs occur
kl = 60.0/(365*24*60*60.0)   # migration rate constant (m/s)
kv =  1.0E-11               # vertical slope-dependent erosion rate constant (m/s)
dt = 2*0.05*365*24*60*60.0     # time step (s)
dens = 1000                  # density of water (kg/m3)
saved_ts = 20                # which time steps will be saved
n_bends = 30                 # approximate number of bends you want to model
Sl = 0.0                     # initial slope (matters more for submarine channels than rivers)
t1 = 500                    # time step when incision starts
t2 = 700                    # time step when lateral migration starts
t3 = 1400                    # time step when aggradation starts
aggr_factor = 4e-9           # aggradation factor (m/s, about 0.18 m/year, it kicks in after t3)<jupyter_output><empty_output><jupyter_text>Initialize model<jupyter_code>ch = mp.generate_initial_channel(W,D,Sl,deltas,pad,n_bends) # initialize channel
chb = mp.ChannelBelt(channels=[ch],cutoffs=[],cl_times=[0.0],cutoff_times=[]) # create channel belt object<jupyter_output><empty_output><jupyter_text>Run simulation<jupyter_code>chb.migrate(nit,saved_ts,deltas,pad,crdist,Cf,kl,kv,dt,dens,t1,t2,t3,aggr_factor) # channel migration
fig = chb.plot('strat', 20, 60, chb.cl_times[-1], len(chb.channels)) # plotting<jupyter_output>100%|██████████| 2000/2000 [00:45<00:00, 44.06it/s]<jupyter_text>Create a "geomorphologic" display that takes into account that older point bars and cutoffs are covered by vegetation:<jupyter_code>fig = chb.plot('morph', 20, 60, chb.cl_times[-1], len(chb.channels))<jupyter_output><empty_output><jupyter_text>Create a map that is colored by the age of the point bars:<jupyter_code>fig = chb.plot('age', 20, 60, chb.cl_times[-1], len(chb.channels))<jupyter_output><empty_output><jupyter_text>Create movie<jupyter_code>dirname = '/Users/zoltan/Dropbox/Channels/temp/'
chb.create_movie(xmin=10000, xmax=30000, plot_type='strat', filename='movie', dirname=dirname,
                 pb_age = 1, ob_age = 20, end_time = chb.cl_times[-1], n_channels = len(chb.channels))<jupyter_output><empty_output><jupyter_text>Build 3D fluvial model Non-interactive definition of x- and y-extentIf the parameters 'xmin', 'xmax', ymin', and 'ymax' are non-zero (as in the cell below), they will be used to define the extent of the area of interest used to build the 3D model. At least initially, it is a good idea to keep this segment relatively small (only a few bends long) to avoid building very large models.<jupyter_code>h_mud = 0.3 # thickness of overbank deposit for each time step
dx = 20.0 # gridcell size in meters

chb_3d, xmin, xmax, ymin, ymax = chb.build_3d_model('fluvial', h_mud=h_mud, levee_width=800.0, h=12.0, w=W, 
            bth=0.0, dcr=10.0, dx=dx, delta_s=deltas, starttime=chb.cl_times[0], endtime=chb.cl_times[-1],
            xmin=7000, xmax=12000, ymin=-3500, ymax=3500)
# create plots
fig1,fig2,fig3 = chb_3d.plot_xsection(100, [[0.5,0.25,0],[0.9,0.9,0],[0.5,0.25,0]], 4)<jupyter_output><empty_output><jupyter_text>Interactive definition of x- and y-extentAfter you run the next cell, you need to select the upper left and lower right corners of the area of interest for which you want to build a 3D model. At least initially, it is a good idea to keep this segment relatively small (only a few bends long) to avoid building very large models. The area will only be highlighted (as a red rectangle) after the 3d model building has finished.<jupyter_code>h_mud = 0.3 # thickness of overbank deposit for each time step
dx = 20.0 # gridcell size in meters

chb_3d, xmin, xmax, ymin, ymax = chb.build_3d_model('fluvial', h_mud=h_mud, levee_width=800.0, h=12.0, w=W, 
            bth=0.0, dcr=10.0, dx=dx, delta_s=deltas, starttime=chb.cl_times[0], endtime=chb.cl_times[-1],
            xmin=0, xmax=0, ymin=0, ymax=0)<jupyter_output><empty_output><jupyter_text>Build 3D submarine channel model<jupyter_code>W = 200.0                    # channel width (m)
D = 12.0                     # channel depth (m)
pad = 50                    # padding (number of nodepoints along centerline)
deltas = 100.0                # sampling distance along centerline
nit = 1500                   # number of iterations
Cf = 0.02                    # dimensionless Chezy friction factor
crdist = 1.5*W               # threshold distance at which cutoffs occur
kl = 60.0/(365*24*60*60.0)   # migration rate constant (m/s)
kv =  1.0E-11               # vertical slope-dependent erosion rate constant (m/s)
dt = 2*0.05*365*24*60*60.0     # time step (s)
dens = 1000                  # density of water (kg/m3)
saved_ts = 20                # which time steps will be saved
n_bends = 50                 # approximate number of bends you want to model
Sl = 0.01                     # initial slope (matters more for submarine channels than rivers)
t1 = 500                    # time step when incision starts
t2 = 700                    # time step when lateral migration starts
t3 = 1000                    # time step when aggradation starts
aggr_factor = 4.0          # aggradation factor (it kicks in after t3)
ch = mp.generate_initial_channel(W,D,Sl,deltas,pad,n_bends) # initialize channel
chb = mp.ChannelBelt(channels=[ch],cutoffs=[],cl_times=[0.0],cutoff_times=[]) # create channel belt object
chb.migrate(nit,saved_ts,deltas,pad,crdist,Cf,kl,kv,dt,dens,t1,t2,t3,aggr_factor) # channel migration
fig = chb.plot('strat',20,60,chb.cl_times[-1],len(chb.channels)) # plotting<jupyter_output>100%|██████████| 1500/1500 [00:18<00:00, 81.94it/s]<jupyter_text>Interactive definition of x- and y-extentAfter you run the next cell, you need to select the upper left and lower right corners of the area of interest for which you want to build a 3D model. At least initially, it is a good idea to keep this segment relatively small (only a few bends long) to avoid building very large models. The area will only be highlighted (as a red rectangle) after the 3d model building has finished.<jupyter_code>h_mud = 3.0*np.ones((len(chb.cl_times[20:]),))
dx = 15.0

chb_3d, xmin, xmax, ymin, ymax = chb.build_3d_model('submarine', h_mud=h_mud, levee_width=5000.0, h=12.0, w=W,
                bth=6.0, dcr=7.0, dx=dx, delta_s=deltas, starttime=chb.cl_times[20], endtime=chb.cl_times[-1],
                xmin=0,xmax=0,ymin=0,ymax=0)

fig1,fig2,fig3 = chb_3d.plot_xsection(100, [[0.5,0.25,0],[0.9,0.9,0],[0.5,0.25,0]], 10)<jupyter_output><empty_output>
{'fraction_non_alphanumeric': 0.11340652990465183, 'fraction_numerical': 0.058364634498699795, 'mean_word_length': 3.3431618569636137, 'pattern_counts': {'":': 0, '<': 41, '<?xml version=': 0, '>': 39, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 4, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'chain_length': '10', 'dir': 'jupyter-structured-clean-dedup', 'id': '464810', 'license': 'Apache-2.0', 'n_tokens_mistral': 2645, 'n_tokens_neox': 2356, 'n_words': 681, 'path': 'meanderpy/meanderpy.ipynb', 'repo_name': 'ThomasMGeo/meanderpy', 'size': '6922'}