Skip to content

Add loading efficiency to xsection plot - #170

Open
MattBrst wants to merge 10 commits into
timflow-org:devfrom
MattBrst:add-loading-efficiency-plot
Open

Add loading efficiency to xsection plot#170
MattBrst wants to merge 10 commits into
timflow-org:devfrom
MattBrst:add-loading-efficiency-plot

Conversation

@MattBrst

Copy link
Copy Markdown
Contributor

I would like to add the loading efficiency to the cross section plots.

Example from the benchmark with the following line of code:

ml_leff[0].plots.xsection(params=True, names=False, labels=False, sep="\n")
image

So basically non-zero loading efficiencies for aquifers are plotted.

@dbrakenhoff

Copy link
Copy Markdown
Contributor

Good addition, but could you modify it to use the symbol $\beta$, similar to Mark's paper? Looks a bit cleaner than load eff written out, though it is a bit more obscure as to what that means.

We could consider a small list of symbols somewhere to help users understand what's what. Or at least have the loading_efficiency notebook mention $\beta$.

@mbakker7

Copy link
Copy Markdown
Contributor

And to be one step ahead in the process, the loading efficiency of the leaky layer is on its way. So can we include that right away as well?

@mbakker7

mbakker7 commented Sep 2, 2026

Copy link
Copy Markdown
Contributor

In the mathematical formulation, we use \beta for the loading efficiency. In the code it is called leffaq and leffll. I don't think that betaaq and betall is better (definitely less readable). But I think the $\beta$ symbol in the xsection plots is better, since the other parameters are also symbols, like $k_h$ and $S_s$.
Once #74 has been merged, we can also add $\beta$ to the leaky layers in this PR.

@dbrakenhoff dbrakenhoff mentioned this pull request Sep 2, 2026
4 tasks
MattBrst and others added 9 commits September 2, 2026 10:36
param_maq never broadcast/padded leffaq and leffll in the confined/
phreatic-top branch, unlike c/Sll/porll, so leffll was off-by-one
relative to the lli index used when plotting. Also add the missing
beta line to plots.py's standalone xsection implementation, which
never had it (unlike inhom1d.py's Xsection.plot).
inhom1d.py's Xsection.plot already showed leffaq as beta text, but
plots.py's separate xsection implementation (used by regular
ModelMaq/Model3D models) never had it. leffll (leaky layer beta) is
not added here since this branch has no leffll plumbing yet -- that
depends on the head_in_leaky_layer work.
Guarded with hasattr since this branch doesn't have leffll plumbed
into AquiferData yet (that lands with the head_in_leaky_layer work).
Once it is, beta will show for leaky layers here too, same as it
already does for aquifers.
self.leffll was referenced unconditionally, but this branch doesn't
plumb leffll through AquiferData yet, so plotting params on any
confined model with a leaky layer raised AttributeError. Guard with
hasattr, consistent with the same guard just added in plots.py.
param_maq's confined/phreatic branch never broadcast leffaq to naq
(unlike the leaky-top branch, which does), so leffaq stayed length 1
for any multi-aquifer confined model. Dormant since the original
loading-efficiency commit; surfaced now because ml.plots.xsection()
and Xsection.plot() both index leffaq[aqi] for aqi up to naq-1.
@MattBrst

MattBrst commented Sep 2, 2026

Copy link
Copy Markdown
Contributor Author

@dbrakenhoff:

  • I modified the PR to use the β symbol for both aquifers and leaky layers. This should work even when leffll is not yet defined in the model.
  • I had to add the labeling code twice (once in plots.py for the normal models and once in inhom1d.py for the 1D models).

@mbakker7:

  • I had to make some changes in aquifer_parameters.py for leffaq, and would guess you will have to do the same for the leffll.

Currently my plot from the benchmark River1D becomes:
image

And for an 'normal' model with the code below:

image
import timflow.transient as tft

ml = tft.ModelMaq(
    kaq=50,
    z=[7, 5, 2, 1, 0],
    c=100,
    leffaq=[0.3, 0.1],
    leffll=0.7,
    topboundary="semi",
    tmin=0.1,
    tmax=100,
)

ml.plots.xsection(params=True)

@mbakker7

mbakker7 commented Sep 3, 2026

Copy link
Copy Markdown
Contributor

Pictures look nice! But I think it should work w/o any changes to aquifer_parameters, I would think. Let's first merge #74, which is almost done (working on some benchmark notebooks) and then see what needs to be done.

@mbakker7

mbakker7 commented Sep 5, 2026

Copy link
Copy Markdown
Contributor

When Sll=0, Timflow substitutes Sll=1e-20 (as it cannot deal with exactly zero). Maybe this can be done more elegant in the code. But that is what it is for now. In the xsection plot, can you check if Sll=1e-20 and print 0 instead?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants