  We developed an open-source scalar wave transport model to estimate the
generalized scattering matrix (S matrix) of a disordered medium in the
diffusion regime. Here, the term generalization refers to the incorporation of
evanescent wave field modes in addition to propagating modes while estimating
the S matrix. For that we used the scalar Kirchhoff-Helmholtz boundary integral
formulation together with the Green's function perturbation method to
generalize the conventional Fisher-Lee relations to include evanescent modes as
well. The estimated S matrix, which satisfies generalized unitarity and
reciprocity conditions, is modeled for a 2D disordered waveguide. The
generalized transmission matrix contained in the S matrix is used to estimate
the optimal phase-conjugate wavefront for focusing onto an evanescent mode. The
phenomena of universal transmission value of 2/3 for such an optimal phase
conjugate wavefront is also shown in the context of evanescent wave mode
focusing through a diffusive disorder. The presented code framework may be of
interest to wavefront shaping researchers for visualizing and estimating wave
transport properties in general.
