  In this paper we calculate some exact solutions of the grand partition
functions for quantum gases in confined space, such as ideal gases in two- and
three-dimensional boxes, in tubes, in annular containers, on the lateral
surface of cylinders, and photon gases in three-dimensional boxes. Based on
these exact solutions, which, of course, contain the complete information about
the system, we discuss the geometry effect which is neglected in the
calculation with the thermodynamic limit $V\to \infty $, and analyze the
validity of the quantum statistical method which can be used to calculate the
geometry effect on ideal quantum gases confined in two-dimensional irregular
containers. We also calculate the grand partition function for phonon gases in
confined space. Finally, we discuss the geometry effects in realistic systems.
