Overcompensation of anisotropy in porous models (DarcyForchheimer and fixedCoeff)
The porous media models add the porous resistance to the matrix of the velocity equation. To do this they have to reduce the resistance tensor to a scalar that is added to the diagonal of the matrix and compensate with an explicit source term that models the rest of the resistance tensor. For an isotropic porosity (where the tensor is the identity tensor times a factor) no explicit correction should be necessary.
The current implementation uses the trace of the tensor. For an isotropic porosity (where all three diagonal elements have the same value) this is three times higher than the term that should be actually added. This leads to a significant (unnecessary) explicit correction. This is stable (high diagonal term) but may lead to slower convergence (high source term that works against the diagonal)
The attached patch fixes this by using the biggest diagonal element of the tensor as the implicit part
- for isotropic porosity the explicit correction is almost zero
- for anisotropic porosity the explicit correction for the direction with the greatest contribution is zero (assuming the isotropy is oriented along the cartesian coordinates). For the others there is a correction
Applying the patch doesn't change the results but increases the convergence (in the compressible/rhoSimpleFoam/angledDuctExplicitFixedCoeff
tutorial applying the patch lowers the number of timesteps till convergence from 639 to 392)
PS: this behaviour has been in OpenFOAM at least since 1.5 and nobody complained so there is a chance that there is a reason for that factor 3 (but I doubt it)