On 17.06.19 15:42, Flemisch, Bernd wrote:

Hi Felix,


the derivatives are currently only used inside the laws themselves, particularly for the regularization. See for example the pc function in regularizedvangenuchten.hh. There, the function VanGenuchten::dpc_dswe is called to determine the correct slope of the regularized curve.


If you implement your own law, you don't need the derivative functions since they are never called from outside.


One could use the derivative functions to calculate analytical derivatives for the Jacobian matrix, but this hasn't been done so far. Maybe a clean approach for the future would be to remove these functions from the interface.

Hi Felix, hi Bernd,


just as a side-note to that, the derivatives are actually used to calculate an analytical Jacobian matrix for the 2p model (
incompressible, constant viscosities)

(https://git.iws.uni-stuttgart.de/dumux-repositories/dumux/blob/master/dumux/porousmediumflow/2p/incompressiblelocalresidual.hh). But per default numeric differentiation is used to compute the Jacobian.

This can be changed by switching the DiffMethod (template parameter) of the Assembler class. Analytic Jacobians are currently only implemented for the incompressible 1p and 2p model. To use it, the corresponding local residual class that implements the derivative has to be set for the LocalResidual property.


Best wishes

Timo



Kind regards

Bernd


--
_______________________________________________________________

Bernd Flemisch                         phone: +49 711 685 69162
IWS, Universität Stuttgart             fax:   +49 711 685 60430
Pfaffenwaldring 61            email: be...@iws.uni-stuttgart.de
D-70569 Stuttgart            url: www.hydrosys.uni-stuttgart.de
_______________________________________________________________
------------------------------------------------------------------------
*Von:* Dumux <dumux-boun...@listserv.uni-stuttgart.de> im Auftrag von Felix Feldmann <felix.feldm...@ku.ac.ae>
*Gesendet:* Montag, 17. Juni 2019 15:18:16
*An:* DuMuX User Forum
*Betreff:* [DuMuX] Fluidmatrix interactionlaws - partial derivatives

Dear DuMux developer,

Looking at the fluidmatrixinteractionlaws, I do find the implementation of several partial derivatives.

For example, in case of the BrooksCorey model:

•            The derivative of the relative permeability for the non-wetting phase in regard to the wetting saturation  dkrn_dswe()

•            The derivative of the relative permeability for the wetting phase with regard to the wetting saturation  dkrw_dswe()

•            The partial derivative of the capillary pressure w.r.t. the effective saturation dpc_dswe()

•            The partial derivative of the effective saturation w.r.t. the capillary pressure dswe_dpc()

I don’t really understand the purpose of the derivatives. In case I remove them, my code is still running fine and is given me the identical result. However, since I am currently implementing a modified fluidmatrixinteractionlaw, I would like to understand the purpose of the derivatives. Unfortunately, in this case, the DuMux Handbook as well as the online documentation provides quite limited information.

Best regards,

Felix

*--------------------------------*

*Felix Feldmann*

Research Assistant

cid:image001.png@01D3DFD3.27E5A010

SAN Campus

P O Box 2533, Petroleum Institute

Abu Dhabi, UAE
M +971 565624402

felix.feldm...@ku.ac.ae <mailto:felix.feldm...@ku.ac.ae>


_______________________________________________
Dumux mailing list
Dumux@listserv.uni-stuttgart.de
https://listserv.uni-stuttgart.de/mailman/listinfo/dumux

--
_______________________________________________________________

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.hydrosys.uni-stuttgart.de
_______________________________________________________________

_______________________________________________
Dumux mailing list
Dumux@listserv.uni-stuttgart.de
https://listserv.uni-stuttgart.de/mailman/listinfo/dumux

Reply via email to