pmgbergen / porepy

Python Simulation Tool for Fractured and Deformable Porous Media
GNU General Public License v3.0
246 stars 89 forks source link

Allow for use of DifferentiableFVAd discretizations in model classes #1070

Closed keileg closed 7 months ago

keileg commented 10 months ago

Background

The class pp.ad.DifferentiableFVAd provides a discretization of Darcy's law that may account for state-dependent permeability in multiphysics simulations. This approach has been shown to be superior in terms of Newton performance, but the class is not yet compatible with the models.

Goal

To integrate pp.ad.DifferentiableFVAd seamlessly in the model framework, it must be possible to override the method darcy_flux_discretization to return a pp.ad.DifferentiableFVAd object instead of pp.ad.MpfaAd. This raises two immediate questions:

  1. The signature of pp.ad.DifferentiableFVAd.__init__() requires quite a few arguments. Some of these will be superfluous in the setting of model mixins, but others willl have to be specified (e.g., the permeability function and argument, which represent the constitutive law of the state-dependent permeability). How to make the bridge from a model setting to the existing implementation of pp.ad.DifferentiableFVAd, and to which degree it is possible and desirable to make a generic bridge, independent of the constitutive law, is not clear at the moment.
  2. The implementation in pp.ad.DifferentiableFVAd is (as EK understands it), aimed at having the same constitutive law in a set of subdomains. In general, we will have different constitutive laws, e.g., cubic law in fractures, Kozeny-Carman with some functional dependency in the matrix. An overridden darcy_flux_discretization() will receive an arbitrary list of subdomains and should return an operator covering all subdomains; that is, gluing together subdomains should happen inside the overridden method. How to realize such a coupling is not clear to EK at the moment.

Other updates needed

Expand the list as needs become clear:

keileg commented 7 months ago

Resolved in #1091