Numerical treatment of state-dependent permeability in multiphysics problems