find adjacent elements for each node

Asked by Elco Luijendijk

Hi,

I am trying to construct a model of groundwater flow and solute transport using escript/Finley. I solve 2 PDEs sequentially, one for fluid pressure and one for solute transport. For the moment i use Dirichlet boundary conditions for both PDEs. Now i would like to set a specified solute concentration (Dirichlet) boundary only for nodes where there is a net groundwater influx accross the model boundary, and leave the concentration unchanged for nodes where the groundwater discharges from the model domain.

One option would be to do this iteratively, by adjusting the specified concentration boundary condition based on the boundary flux and then solve the two PDEs again. The problem is that the flux variable ( derived from PDE 1 using K*(grad(P)+density*g) ) is defined on elements and concentration on nodes. Therefore something like this:

specified_C_bnd_new = wherePositive(specified_C_bnd) * wherePositive(flux[1])

does not work unfortunately.

Is there a way to find the adjacent elements for each node in escript? With this it would be possible to select the nodes for which the boundary condition should be adjusted.

btw, i am not using the built-in Darcy PDE since I am using a different formulation of the groundwater flow equation.

best regards,
Elco Luijendijk

Question information

Language:
English Edit question
Status:
Solved
For:
esys-escript Edit question
Assignee:
No assignee Edit question
Solved by:
Lutz Gross
Solved:
Last query:
Last reply:
Revision history for this message
Best Lutz Gross (l-gross) said :
#1

The direct answer to your question is: no!
However, you can project the flux to the nodes, for instance:

proj=LinearPDESystem(domain)
proj.setSymmetryOn()
proj.setValue(D=kronecker(domain), Y=flux)
flux_nodes=proj.getSolution()

There are various ways how you can adjust this (use lumping, which is faster, or impose boundary conditions)

Revision history for this message
Elco Luijendijk (elco-luijendijk) said :
#2

Thanks Lutz Gross, that solved my question.

Revision history for this message
Elco Luijendijk (elco-luijendijk) said :
#3

thanks for the support, projecting the flux works perfectly. And many thanks too for sharing escript/finley, its an excellent tool and opens a lot of new research possibilities.
all the best
Elco