Skip to content

Conversation

@baugetfa
Copy link
Collaborator

@baugetfa baugetfa commented Aug 5, 2025

The first 4 commits (9d42bc3, 5c0fdb2, 0bb808d, e87dd27) are also on branch psi_equivalent and PR #69.

I probably created the branch psi_equivalent from the solver_wrapper branch

@baugetfa baugetfa self-assigned this Aug 5, 2025
@baugetfa baugetfa added the bug Something isn't working label Aug 5, 2025
@baugetfa baugetfa linked an issue Aug 5, 2025 that may be closed by this pull request
@baugetfa
Copy link
Collaborator Author

baugetfa commented Aug 5, 2025

The solute-water solver is limited at this stage to uniform external condition. This is not a bug or an error because in the function the external potential or pressure are set explicitly uniform. Here again this because they were developed for uniform conditions. This easy to change.

@baugetfa
Copy link
Collaborator Author

baugetfa commented Aug 5, 2025

Still in the Flux class the case where invert_model = False , never used, should, if I well understood, distributes the flux according to the Jv given. But the code below do in fact calculate nothing else than psi_in. And for me it is not correct because psi_e and psi_base are input by definition then the potential inside the root are fixed by the boundary conditions and Jv. If we distribute the flux something must adapt and it is not the case, and it can not unless K and/or k. I am for deleting this case.

  if not(invert_model) : # distribute a given output into the root system

      #print 'entering Jv distribution'

      for v in traversal.pre_order2(g, v_base):
      #compute psi according to Millman theorem, then compute radial flux
          parent = g.parent(v)
          brothers = g.children_iter(parent)
          children = g.children(v) # prefer list because used twice

          Keq_brothers = sum( Keq[cid] for cid in brothers)
          Keq_children = sum( Keq[cid] for cid in children)

          if parent is None:
              assert v == v_base
              psi_out[v] = psi_base
              J_out[v] = Jv
          else:
              psi_out[v] = psi_in[parent]
              J_out[v] = (J_out[parent] - j[parent]) / ( 1.0 + Keq_brothers / Keq[v]  ) # only if no_soil

          if not self.HAS_SOIL:
              psi_in[v] = (K[v] * psi_out[v] + psi_e * (k[v] + Keq_children)) / (k[v] + K[v] + Keq_children)
              j[v] = (psi_e - psi_in[v]) * k[v]
          else:
              # psi_in[v] = (K[v] * psi_out[v] + psi_e[v] * (k[v] + Keq_children)) / (k[v] + K[v] + Keq_children)
              KeqPeq = sum( Peq[cid]*Keq[cid] for cid in children )
              psi_in[v] = (K[v] * psi_out[v] + psi_e[v] * k[v] + KeqPeq) / (k[v] + K[v] + Keq_children)
              j[v] = (psi_e[v] - psi_in[v]) * k[v]

the case inverted_model=False is not correct even with uniform Pe, it was never used
@baugetfa
Copy link
Collaborator Author

baugetfa commented Aug 6, 2025

I closed it because I replaced it by PR #72. There were some commits from different branches and PR.

@baugetfa baugetfa closed this Aug 6, 2025
@baugetfa baugetfa deleted the psi_equivalent branch August 6, 2025 08:06
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

bug Something isn't working

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants