Hi Dmitry, this is currently not easily possible with cell-centered methods but should be easy for the box method (see comment below).
If you’re material law depends on pressure gradient that means it depends on neighbouring elements as you already said. But we don’t derive the storage term wrt to the neighbour degrees of freedom in the assembly so you would get an inexact Jacobian. While that might or might not be a problem this is currently not implemented in the default implementation. You could use the gradient of the last time step by just making it accessible to the spatial params. That would work quite easily. If you want the correct Jacobian for a fully implicit configuration you could provide your own element solution that provided neighbour values as well and then also derive the storage (or simply the entire residual) with respect to neighbours. If you use the box method then you can evaluate the gradient on the element using the provided element solution. There is also an evalGradients function to help with that. Best regards Timo -- _________________________________________________ Timo Koch phone: +49 711 685 64676 IWS, Universität Stuttgart fax: +49 711 685 60430 Pfaffenwaldring 61 email: timo.k...@iws.uni-stuttgart.de D-70569 Stuttgart url: www.iws.uni-stuttgart.de/en/lh2/ _________________________________________________ > On 30. Apr 2020, at 10:40, Dmitry Pavlov <dmitry.pav...@outlook.com> wrote: > > Hello, > > I am doing a porous medium flow simulation and I would like to specify custom > laws for relative permeability and capillary pressure that depend on water > saturation, surfactant concentration and pressure gradient. > > I have my own spatial parameters class, of course, and I gather that the > following method should help me in what I am trying to achieve: > > template<class ElementSolution> > MaterialLawParams materialLawParams(const Element& element, > const SubControlVolume& scv, > const ElementSolution& elemSol) const > > So there is no problem in getting water saturation and surfactant > concentration for the element, and also the pressure. However, I am having > trouble estimating the pressure gradient. To do that, I need to know (in this > method) the pressure in neighbor elements. But how do I access the current > solution values for those elements, while given only an ElementSolution for > the element of interest? > > Best regards, > > Dmitry > > > _______________________________________________ > Dumux mailing list > Dumux@listserv.uni-stuttgart.de > https://listserv.uni-stuttgart.de/mailman/listinfo/dumux
_______________________________________________ Dumux mailing list Dumux@listserv.uni-stuttgart.de https://listserv.uni-stuttgart.de/mailman/listinfo/dumux