We present a method of calculating the invariant measure (IM) of hydrodynamical systems describing incompressible viscous fluid flow in bounded 3D volume~$V$. Using a basis $\{\wv_I\}$ of zero-divergence vector functions on $V$ satisfying boundary conditions we transform the Navier-Stokes equations (NSE) for the velocity field $\vv(\xv,t)=\sum_I v_I(t)\,\wv_I(\xv)$ into a simple system of ordinary differential equations for $v_I(t)$. The fact that fluid consists of a finite number of molecules in thermal motion implies that the number~$N$ of variables $v_I$ is finite too and that the system of equations for $v_I(t)$ contains a white-noise term. We prove that all solutions of this system are global, the IM exists and is unique. Its density $\psi(v)$ defined on the phase space $\mathbb{R}^N$ satisfies an elliptic partial differential equation (PDE). Expanding $\psi(v)=\sum_\mu\bla \He_\mu\bra\,\He_\mu(v)\,\phe(v)$ into Hermite functions $\He_\mu(v)\,\phe(v)$ (where $\phe$ is a Gaussian function on $\mathbb{R}^N$, $\He_\mu$ are Hermite polynomials orthonormal with the weight $\phe$ and $\bla\He_\mu\bra=\int\He_\mu(v)\,\psi(v)\,d^Nv $ are IM mean values of $\He_\mu$) we transform this PDE into an infinite system of linear algebraic equations for $\bla\He_\mu\bra$ and suggest some methods for solving it numerically. From known first- and second-order $\bla\He_\mu\bra$ we could easily calculate mean turbulent velocity $\bla\vv(\xv)\bra$ and Reynolds stress at any point $\xv$. Cylindrical pipe flow is used to illustrate the method everywhere in the paper. All conclusions are derived from the mathematical model by rigorous mathematics, with no further assumptions. All approximations can be arbitrarily improved.