Diffusion confusion (implementation)
We decided at some point that diffusion laws, e.g.
FicksLaw, should compute all component fluxes in one go. This means two things
- we can now more efficiently compute the diffusive fluxes depending on the law (Fick / Maxwell-Stefan)
FicksLawnow depends on the equation system
- If I want to neglect diffusion in one phase, i can set the diffusion coefficient to zero. However, then the diffusive fluxes are still computed and I can throw them away in the custom local residual.
- The Richards model is an immiscible two-phase two-component model but the air phase is never balanced. To integrate this in the current framework, we introduced
BalanceEqOpts::mainComponentIsBalanced(phaseIdx)which is overloaded for the Richards model and used in Fick's law. In this case the dependency is actually there in the code in form of the additional dependency on
One thought for a possible solution:
If we would have a class
DiffusionFlux replacing the current
FicksLaw, then we could have a custom implementation
RichardsDiffusionFlux which takes care of special requirements.
DiffusionFlux would be a class on the level of
LocalResidual only containing physics/equations. Internally it could use something like
FicksLaw (new implementation that only contains the transmissibility part and discretization specifics) to compute the actual individual fluxes.
DiffusionFlux may need to be specialized on the Law type (Fick / Maxwell-Stefan) but not the discretization.
Maybe, this would essentially be a code renaming / reordering. But that needs to be further investigated.