[PNM][Bug] Varibales stored in fluxVarsCache are not updated correctly with box discretization
For current PNM implementation, all variables related to the throat (scvf) are stored in fluxVarsCache. Some of them (e.g. capillary pressure in throat) needs to be updated before discretizing local residual to get Jacobian. This is missing for Box where only Volume Variables are updated. I think there are two solutions:
- Update flux variables cache in box assemble
auto evalResiduals = [&](Scalar priVar)
{
elemSol[scv.localDofIndex()][pvIdx] = priVar;
deflectionHelper.deflect(elemSol, scv, this->problem());
elemFluxVarsCache.bind(element, fvGeometry, curElemVolVars);
return this->evalLocalResidual();
};
Note deflect
method updates volume variables, and bind
method updates fluxVarsCache
.
- Stores variables needs to be updated in VolVars and call it from VolVars instead of fluxVarsCache.