In [1]:
# Import package
from flumy import *
nx = 250 # Number of grid nodes along Ox
ny = 200 # Number of grid nodes along Oy
mesh = 10 # Horizontal grid mesh size: 10m
hmax = 3 # Maximum channel depth: 3m
ng = 50 # Required Net-to-Gross: 50%
isbx = 80 # Required sand bodies extension (medium extension = few meander cutoffs)
verbose = False # Verbose mode
res = 30 # Vertical resolution (increase 'res' to get higher resolution)
dz = hmax / res # Vertical discretization step (0.1m)
zul = 4 * hmax # Fill a reservoir of 4 x hmax height (12m)
nz = int(3 * hmax / dz) # Number of vertical nodes of the resulted block of sediments (9m)
In [10]:
%%javascript
IPython.OutputArea.prototype._should_scroll = function(lines) {
return false;
}
In [2]:
# Launch the simulation
seed = 123456 # Simulation seed
# Create the simulator
flsim = Flumy(nx, ny, mesh, verbose)
# Launch up to zul
success = flsim.launch(seed, hmax, isbx, ng, zul)
if (not success):
print("Error while running Flumy")
In [3]:
# Display the age of the simulation, the mean topography reached and the total number of meander cutoffs
print("Final age:",flsim.getAge(), "yr")
print("Mean topography:",round(flsim.getDomain().getMeanTopo(),2), "m")
print("Number of cutoffs:",flsim.getNbCutoff())
# Retrieve the simulated block informed with facies, grain size and age (in three numpy arrays)
fac,grain,age = flsim.getBlock(dz, zb=0 ,nz=nz)
print("type(fac):", type(fac))
print("fac.shape:", fac.shape)
# Display facies proportions
props = getProps(fac)
print("Facies proportions (%):", props)
# Sand proportion (PB) corresponds more or less to the required Net-to-Gross
Final age: 25341 yr Mean topography: 12.79 m Number of cutoffs: 99 type(fac): <class 'numpy.ndarray'> fac.shape: (250, 200, 90) Facies proportions (%): {'CL': 1.46, 'PB': 60.18, 'SP': 1.04, 'CSI': 0.01, 'CCh': 0.06, 'CSII': 0.0, 'LV': 7.58, 'OB': 16.15, 'MP': 13.52}
In [4]:
# Display Facies cross-flow section
showSection(fac = fac[50,:,:], size = 8, legend=1)
# Display Grain Size along-flow section
showSection(grain = grain[:,20,:], size = 8, legend=2)
# Display Age horizontal slice section
showSection(age = age[:,:,2], size = 8, legend = 1, title = "Age horizontal slice")
In [11]:
# Display Vertical Proportion Curve of the simulation
showVPC(flsim, dz, 0, 6)
In [12]:
from dash import Dash, dcc, html, Input, Output, callback
app = Dash()
app.layout = html.Div([
dcc.Graph(id='graph-court'),
dcc.Slider(0, 89, 1,
value=5, marks=None,
id='iz-slider'
),
])
@callback(
Output('graph-court', 'figure'),
Input('iz-slider', 'value'))
def update_output(value):
# Display three slices for grain size for the following grid indices
data = [sliceFromGrid(grain,0,50),
sliceFromGrid(grain,1,20),
sliceFromGrid(grain,2,value)
]
fig1 = go.Figure(data=data)
fig1.layout.title = f"Grainsize Z-Slice at {value}m"
return fig1
app.run()
In [ ]: