Let $\Omega=[0,1]^2$ be the unit square, $\Gamma_1=[0,1]\times\{0;1\}$ its horizontal boundary and $\Gamma_2= \{0;1\}\times[0,1]$ its vertical boundary.
I would like to know the optimal Poincaré constants $C$, defined by $$ \forall u\in W^{1,2}(\Omega)\quad \int_\Omega u^2\le C\int_\Omega |\nabla u|^2, $$
under these conditions (separately):
i) $u|_{\Gamma_1}=0$;
ii) $u|_{\Gamma_1}=0$ and $u$ has zero average: $\int_\Omega u=0 $.
Updated part:
I presume that in the first case the optimal constant is $1/\pi^2$, if I correctly interpreted the method for finding it (as eigenvalue of the laplacian), realized by the function $u(x,y)=\sin(\pi y) $. In the second case I think it could be $1/2\pi^2$, realized by $u(x,y)=\cos(\pi x)\sin(\pi y) $.
iii) $u|_{\Gamma_1}=0$, $u$ has zero average: $\int_\Omega u=0$ and $u$ is periodic at boundary $\Gamma_2$, i.e. $u(0,y)=u(1,y) $
In this case I guess the constant is $1/4\pi^2$, realized by $u(x,y)= \sin(2\pi y) $ (in fact, the function $u(x,y)=\cos(\pi x)\sin(\pi y) $ is not $x$-periodic at $\Gamma_2$).
(I only answer here case i)
For any closed subspace $V\subset H^1(\Omega)$, the eigenvalues $\lambda_1\leq\lambda_2\leq\ldots$ of the positive Laplacian in $V$ satisfy $$ \lambda_k=\min_{H_{k-1}}\rho, $$ where the Rayleigh quotient is $$ \rho(u)=\frac{\|\nabla u\|_{L^2}^2}{\|u\|_{L^2}^2}, $$ and the orthogonal complement of the first $k-1$ eigenspaces is $$ H_{k-1}=\{u\in V:\langle u,u_j\rangle=0,j=1,\ldots,k-1\}. $$ Moreover, if $u\in H_{k-1}$ and $\rho(u)=\lambda_k$ then $-\Delta u=\lambda_ku$. See, for example, page 16 of these notes.
This immediately implies that $$ \lambda_k\|u\|_{L^2}^2\leq\|\nabla u\|_{L^2}^2 \qquad\textrm{for all} \quad u\in H_{k-1}, $$ and $\lambda_k$ is the largest possible constant. So the optimal $C$ is simply $$ C=\frac1{\lambda_k}. $$ What we need to do now is identify the spaces $V$ and $H_{k-1}$, and compute $\lambda_k$.
Case i) In this case, we take $V=\{u\in H^1(\Omega):u|_{\Gamma_1}=0\}$ as the underlying space, and $k=1$, so that $H_{k-1}=H_0=V$. Each of the functions $$ \begin{split} &\sin(m\pi x)\sin(n\pi y),\qquad m=1,2,\ldots,\quad n=1,2,\ldots\\ &\cos(m\pi x)\sin(n\pi y)\qquad m=0,1,\ldots,\quad n=1,2,\ldots, \end{split} $$ is in $V$, and satisfy $-\Delta u = \lambda u$ with $\lambda=\pi^2(m^2+n^2)$. Moreover, completeness of this orthogonal set can be shown by using Fubini's theorem as in Example 26 of the same notes. Thus there are no other eigenfunctions. The smallest eigenvalue occurs at $m=0$ and $n=1$: $$ \lambda_1=\pi^2. $$