Visualizing models#

import matplotlib.pyplot as plt

import timflow.transient as tft
ml = tft.ModelMaq(
    kaq=[1, 20, 2],
    z=[25, 20, 18, 10, 8, 0],
    c=[500, 1000],
    Saq=[0.1, 1e-4, 1e-4],
    Sll=[0, 0],
    phreatictop=True,
)
ls = tft.RiverString(ml, xy=[(-25, -30), (-15, 10), (10, 20)], tsandh="fixed", layers=0)
w = tft.Well(ml, xw=0, yw=0, rw=0.2, tsandQ=[(0, 1000)], layers=1)

ml.initialize()
ml.solve(silent=True)

Top-view of model#

Plot a top-view of the model and the locations of the elements.

fig, axes = plt.subplots(1, 3, figsize=(10, 4), sharex=True, sharey=True)

ml.plots.topview(ax=axes[0])
axes[0].set_title("All layers")
ml.plots.topview(ax=axes[1], layers=0)
axes[1].set_title("Layer 0")
ml.plots.topview(ax=axes[2], layers=1)
axes[2].set_title("Layer 1");

# OR
# ml.plot()
../../../_images/0d8bceca236c1cdcefaa13ac654ee25ea70280db96f408a78e6143580a0e4092.png

Cross-section of model#

Plot a cross-section of the model along a line. Optionally add labels and parameter values.

Note: Currently no elements are plotted in the cross-section.

ax = ml.plots.xsection(xy=[(-30, 0), (10, 0)], params=True)
../../../_images/7234e4521676ecd6c378fff7c49dfb6ed30825d2c238d8e8f24e07926d534686.png

Head contours#

Plot head contours at time \(t\) in a given window in specified layers.

ax = ml.plots.contour(
    win=[-50, 50, -50, 50],
    ngr=50,
    levels=10,
    t=10,
    decimals=2,
    layers=[0, 1],
)
../../../_images/2a9d819dd2e2680bea33624155c26ea4ae778f7e93e4cf31f92d6fa60ba3f152.png

Head along line#

Plot the heads along a given line at time \(t\) in specified layers.

ax = ml.plots.head_along_line(-30, 10, 0, 0, t=10, layers=[0, 1, 2])
../../../_images/e2e6273ee77ef18a7c0037aa3585104220bedb1f5a1db9f05feaf24fe336be8a.png