Let $d\in\mathbb N$, $k\in\{1,\ldots,d\}$, $M$ be a $k$-dimensional embedded $C^1$-submanifold of $\mathbb R^d$ with boundary and $X:M\to\mathbb R^d$ be $C^1$-differentiable.
If $M$ is an open subset of $\mathbb R^d$, then the ordinary divergence of $X$ is defined to be $$(\operatorname{div}X)(a)=\operatorname{tr}T_a(X)\;\;\;\text{for all }a\in M,$$ where $T_a(X):T_a\:M=\mathbb R^d\to\mathbb R^d$ denotes the pushforward of $X$ at $a\in M$.
Is this definition still sensible in the general case, where $T_x\:M$ is only known to be a $k$-dimensional subspace of $\mathbb R^d$?
By definition of the trace, if $a\in M$ and $(\tau_1(a),\ldots,\tau_k(a))$ is an orthonormal basis of $T_a\:M$, then $$\operatorname{tr}T_a(X)=\sum_{i=1}^k\langle T_a(X)\tau_i(a),\tau_i(a)\rangle.\tag2$$
Is this still useful? I couldn't find any reference which considers this generalization of the divergence.
EDIT: Meanwhile, I've found the definition $(2)$ in a lecture note. However, they are assuming that $f$ is not only $C^1$-differentiable, but also satisfies $$X(a)\in T_a\:M\;\;\;\text{for all }a\in M\tag3.$$ Why is that? $(3)$ doesn't seem to be needed to ensure that $(2)$ is well-defined (in particular, independent of the choice of $\tau_i(a)$).