mbakker7 / ttim

MIT License
33 stars 23 forks source link

LeakyLineDoubletString gives nonsensical results #43

Open Huite opened 1 year ago

Huite commented 1 year ago

In this case a well is placed behind a leaky line doublet, yet the head increases in front of the doublet.

A minimum working example:

import numpy as np
import matplotlib.pyplot as plt
import ttim

ttim_model = ttim.ModelMaq(
    kaq=[5.0],
    z=[5.0, -5.0],
    c=[1000.0],
    topboundary="conf",
    Sll=None,
    Saq=[0.001],
    phreatictop=True,
    tstart=0.0,
    tmin=0.01,
    tmax=10.0,
    M=10,
)
ttim_put_0 = ttim.Well(
    xw=81130.42215923329,
    yw=455434.3435890436,
    tsandQ=[(0.0, 500.0), (4.9, 0.0)],
    rw=1.0,
    res=1.0,
    layers=0,
    label=None,
    rc=None,
    wbstype="pumping",
    model=ttim_model,
)
ttim_damwand_0 = ttim.LeakyLineDoubletString(
    xy=[
        [81107.98915395162, 455450.4747433619],
        [81107.90424919, 455436.13784482394],
        [81107.90424919, 455432.6390460523],
        [81107.91222551298, 455418.08787068544],
    ],
    res=3000.0,
    layers=0,
    order=4,
    label=None,
    model=ttim_model,
)
ttim_model.solve()
ttim_head = ttim_model.headgrid(
    xg=np.arange(81075.0, 81147.5, 1),
    yg=np.arange(455466.5, 455404.0, -1),
    t=[1.0, 1.5, 2.0, 5.0, 6.0],
)
# %%

plt.plot(ttim_head[0, 0, 31])

# %%

plt.contour(ttim_head[0, 0])

image

image

If the line doublet geometry is simplified to just two points, the answer looks more reasonable:

ttim_damwand_0 = ttim.LeakyLineDoubletString(
    xy=[
        [81107.98915395162, 455450.4747433619],
        [81107.91222551298, 455418.08787068544],
    ],
    res=3000.0,
    layers=0,
    order=4,
    label=None,
    model=ttim_model,
)

image

mbakker7 commented 1 year ago

Thanks for finding this issue. It indeed seems incorrect. Strangely, ttim gives reasonable results if the order is anything but 4. So 2, 3, 5, 6, 7 all gives reasonable to good results. I will have to investigate. Maybe really unlucky placement of control points? Incidentally, you also get unreasonable results when the string is impermeable, which will make looking for the bug easier.