Let $\Omega\subseteq\mathbb R^d$ be open. In the book Navier-Stokes Equations - Theory and Numerical Analysis by Roger Temam the author is using the divergence $\operatorname{div}u$ of a $L^2(\Omega)^d$ function $u$ at the beginning of subsection 1.2 (A density theorem).
What is meant?
I assume that either some kind of weak differentiability is meant or $\operatorname{div}$ is somehow extended to $L^2(\Omega)^d$. For example, I'm aware of the fact that we can extend the gradient $\nabla:C_0^\infty(\Omega)\to L^2(\Omega;\mathbb R^d)$ to the Sobolev space $H_0^1(\Omega)$.
Its the distributional divergence, that is for $v \in L^2(\Omega)$ we have $v = \operatorname{div}u$ iff $$\int_\Omega v \, \varphi \, \mathrm{d}x = -\int_\Omega u \cdot \nabla \varphi \, \mathrm{d}x \quad\forall \varphi \in C_0^\infty(\Omega).$$ To be compared with https://en.wikipedia.org/wiki/Integration_by_parts#Higher_dimensions.