## 6 Numerical Methods and Algorithms
### Models at the Macro-Scale
#### 6.1.3 The Discrete Model of The Navier-Stokes Equations for Viscoelastic Fluids
\begin{split}{}^{\epsilon}\mathbf{K}_{\mathbf{TIV}}^{*j}(T)& =\left[\sum_{k=1}^{n}\left[\int_{\Omega_{\epsilon}}\mathbf{\Pi}^{T \epsilon}\mathbf{T}_{kj}\frac{\partial\mathbf{\Psi}^{T}}{\partial x_{k}}dx\right] \right],\hskip 56.905512 pt{}^{\epsilon}\mathbf{K}_{\mathbf{\Psi}\mathbf{\Phi}}^{i}& =\left[\int_{\Omega_{\epsilon}}\frac{\partial\mathbf{\Psi}}{\partial x _{i}}\mathbf{\Phi}^{T}dx\right],\\ {}^{\epsilon}\mathbf{\check{K}}_{\mathbf{T}\mathbf{T}}^{i}(\mathbf{V})& =\left[\sum_{l=1,\ldots,n}\left[\int_{\Omega_{\epsilon}}\rho\mathbf{ \Psi}\mathbf{\Psi}^{T\epsilon}\mathbf{v}_{j}\frac{\partial\mathbf{\Psi}^{T}}{\partial x_{ j}}dx\right]\right],\hskip 56.905512 pt{}^{\epsilon}\mathbf{M}_{\mathbf{T}}& =\left[\int_{\Omega_{\epsilon}}\rho\mathbf{\Psi}\mathbf{\Psi}^{T}dx \right],\\ {}^{\epsilon}\mathbf{H}&=\left[\left(\int_{\Omega_{ \epsilon}}\mathbf{\Psi}^{T\epsilon}\mathbf{h}_{1}dx\right)\cdots\left(\int_{\Omega_{ \epsilon}}\mathbf{\Psi}^{T\epsilon}\mathbf{h}_{n}dx\right)\right]^{\mathsf{T}},\\ {}^{\epsilon}\mathbf{K}_{\mathbf{T}\mathbf{T}}&=- \left(\mathbf{I}\otimes diag\big{(}{}^{\epsilon}\mathbf{K}_{\mathbf{T}\mathbf{T}}^{j} \big{)}_{j=1,\ldots,n}\right)-\left(diag\big{(}{}^{\epsilon}\mathbf{K}_{\mathbf{T }\mathbf{T}}^{i}\big{)}_{i=1,\ldots,n}\otimes I\right)\\ &\quad-\bigg{(}\mathbf{I}\otimes diag\big{(}{}^{\epsilon}\mathbf{K}_{ \mathbf{T}\mathbf{T}}^{j}(T)\big{)}_{j=1,\ldots,n}\bigg{)}-\bigg{(}diag\big{(} {}^{\epsilon}\mathbf{K}_{\mathbf{T}\mathbf{T}}^{i\alpha}(T)\big{)}_{i=1,\ldots,n} \otimes I\bigg{)},\\ {}^{\epsilon}\mathbf{K}_{\mathbf{T}\mathbf{T}}({}^{\epsilon}\mathbf{V})& =\left(diag\big{(}{}^{\epsilon}\mathbf{K}_{\mathbf{T}\mathbf{T}}^{i} (\mathbf{V})\big{)}_{i=1,\ldots,n}+(\mathbf{I}\otimes{}^{\epsilon}\mathbf{K}_{\mathbf{T }\mathbf{T}})\right)+{}^{\epsilon}\mathbf{\check{K}}_{\mathbf{T}\mathbf{T}},\\ {}^{\epsilon}\mathbf{\check{K}}_{\mathbf{T}\mathbf{T}}&=- \left[\begin{array}{ccc}\left[\int_{\Omega_{\epsilon}}\mu_{s}\frac{\partial \mathbf{\Psi}}{\partial x_{1}}\frac{\partial\mathbf{\Psi}^{T}}{\partial x_{1}}dx \right]&\cdots&\left[\int_{\Omega_{\epsilon}}\mu_{s}\frac{\partial\mathbf{\Psi}}{ \partial x_{n}}\frac{\partial\mathbf{\Psi}^{T}}{\partial x_{1}}dx\right]\\ \vdots&\ddots&\vdots\\ \left[\int_{\Omega_{\epsilon}}\mu_{s}\frac{\partial\mathbf{\Psi}}{\partial x_{1}} \frac{\partial\mathbf{\Psi}^{T}}{\partial x_{n}}dx\right]&\cdots&\left[\int_{ \Omega_{\epsilon}}\mu_{s}\frac{\partial\mathbf{\Psi}}{\partial x_{n}}\frac{ \partial\mathbf{\Psi}^{T}}{\partial x_{n}}dx\right]\end{array}\right],\end{split} \]  
and where \(\mathbf{I}\) is the identity matrix of dimension \(n\times n\). The operator \(\otimes\) represents the Kronecker products of two matrices: if \(A=\big{(}a_{ij}\big{)}_{i,j=1,\ldots,n}\) and \(B=\big{(}b_{ij}\big{)}_{i,j=1,\ldots,m}\) are respectively matrices of dimensions \(n\times n\) and \(m\times m\), \(A\otimes B\) is a matrix of dimensions \(mn\times mn\), where  
\[A\otimes B=\left[ \begin{array}{ccc}a_{11}B&\ldots&a_{1n}B\\ \vdots&\ldots&\vdots\\ a_{n1}B&\ldots&a_{m}B\end{array} \right].\]  
The operator \(\text{diag}(B_{i})_{i=1,\ldots,n}\) represents the matrix of dimensions \(mn\times mn\)  
\[diag(B_{i})_{i=1,\ldots,n}=\left[ \begin{array}{ccc}B_{1}&\ldots&0\\ \vdots&\ldots&\vdots\\ 0&\ldots&B_{n}\end{array} \right].\]  
where \(B_{i}\) is a matrix of dimension \(m\times m\) for all \(i=1,\ldots,n\).. The assembly process of all the elements of the finite element mesh generates an algebraic system of the type in Equation (111) where the matrices and vectors have the structure described in Equation (172), that is,  
\[{}^{NSVF}\mathbf{M}^{NSVF}\mathbf{\hat{u}}+{}^{NSVF}\mathbf{K}\Big{(}{}^{NSVF}\mathbf{u} \Big{)}\mathbf{u}={}^{NSVF}\mathbf{f}, \tag{173}\]  
where  
\[{}^{NSVF}\mathbf{M} = \left[ \begin{array}{ccc}M_{V}&\mathbf{0}&\mathbf{0}\\ \mathbf{0}&\mathbf{0}&\mathbf{0}\\ \mathbf{0}&\mathbf{0}&\mathbf{M}_{\mathsf{T}}\end{array} \right], \tag{174}\] \[{}^{NSVF}\mathbf{K}(\mathbf{u}) = \left[