We construct the Fermi gas formalism for the partition function of supersymmetric Chern-Simons theories with affine D-type quiver diagrams with non-uniform ranks of the gauge groups and Fayet-Illiopoulos parameters by two different approaches: the open string formalism and the closed string formalism. In the closed string formalism approach, we find a novel connection between the partition function of this theory and the partition function of a four-nodes circular quiver supersymmetric Chern-Simons theory. We also studied a symmetry of a density matrix appeared in the closed string formalism. We further calculate the exact values of the partition function for finite N, with which we identified the exponent of the leading non-perturbative effect in 1/N corresponding to the worldsheet instantons in the circular quiver supersymmetric Chern-Simons theories.