# Simulations of Extrusion 3D Printing of Chitosan Hydrogels
## 3 Theoretical Model  
As previously mentioned, different factors, such as the inlet velocity, nozzle diameter, and viscosity, can influence the printing quality during the printing process. The chitosan-based ink 3D printing demonstrates shear-thinning behavior--the shear-thinning changes with temperature and shear rate. Hence, Equation (1) states that shear stress determines the fluid viscosity with gradual deformation. \[\eta=\frac{\tau}{\dot{\gamma}} \tag{1}\]  
where \(\eta\) is the viscosity, \(\tau\) (Pa) is the shear stress, and \(\dot{\gamma}\) (s\({}^{-1}\)) is the shear rate. Additionally, the shear rate behavior affects the viscosity of the fluid. The Carreau Yasuda model is the simplest approach to explain this process. This model determines the fluid viscosity at a shear rate. The viscosity equations of the Carreau model are expressed in Equations (2) and (3). \[\eta=k|\dot{\gamma}|^{n-1}for\;shear-thinning\;fluids\;(n<1) \tag{2}\]\[\eta=\eta_{nf}+\left(\eta_{0}-\eta_{inf}\right)\left[1+\left(\lambda y\right)^{ \alpha}\right]^{\frac{n-1}{a}} \tag{3}\]  
where \(K\) is the consistency coefficient, \(\eta_{0}\) is the fluid viscosity when the shear rate is zero, \(\eta_{inf}\) is the fluid viscosity in the case of infinite shear rate, \(\lambda\) is the relaxation time index, \(a\) is a dimensionless parameter, \(\dot{y}\) is the shear rate, and \(n\) is the shear-thinning index. The viscosity decreases by raising the shear rate when the shear-thinning of fluid \(n\) is less than one (\(n<1\)). Conversely, when the shear-thinning of fluids \(n\) is greater than one (\(n>1\)), the viscosity increases by raising the shear rate. In Newtonian fluids, when \(n=1\), the shear rate does not affect the fluid viscosity. In this study, the interface of two immiscible fluids was tracked. As there is more than one phase in this system, the numerical simulation of the two-phase flow model solves the system. The two fluids' level set and phase-field were solved using the general Navier-stokes equation, which is given by the following:  
\[\rho\frac{\partial u}{\partial t}+p(u\cdot\
abla)u=\
abla\cdot\left[-pI+\mu \left(\
abla u+\left(\
abla u\right)^{T}\right)-\frac{2}{3}\mu(T)(\
abla\cdot u )I\right]+pg+F_{st}+F \tag{4}\]  
where \(\rho\) denotes the density \(\left(\mathrm{kg}/\mathrm{m}^{3}\right)\), \(u\) is the velocity \(\left(\mathrm{m}/\mathrm{s}\right)\), \(t\) represents the time \(\left(\mathrm{s}\right)\), \(\eta\) is the dynamic viscosity \(\left(\mathrm{Pa}\cdot\mathrm{s}\right)\), \(p\) is the pressure \(\left(\mathrm{Pa}\right)\) such that \(p=0\), and \(F_{st}\) denotes the surface tension force \(\left(\mathrm{N}/\mathrm{m}^{3}\right)\). The level set technique explains the fluid interface. Therefore, a continuity equation solves the level set technique:  
\[\rho\
abla\cdot u=0 \tag{5}\]  
\[\rho(u\cdot\
abla)_{u}=\
abla\cdot\left[\rho I+k\right]+F \tag{6}\]  
\[\frac{\partial u}{\partial t}=\
abla\cdot\left[-pI+\mu\left(\
abla u+\left( \
abla u\right)^{T}\right)\right]+pg+F_{st}+F \tag{7}\]  
The two-phase flow and laminar level set modes set up the momentum transport. The COMSOL Multiphysics can solve the transport equation to track the interface of two fluids employing the following equation:  
\[\frac{\partial\phi}{\partial t}+u\cdot\
abla\phi=\gamma\
abla\left(-\phi(1- \phi)\frac{\
abla\phi}{\left|\
abla\phi\right|}\varepsilon\
abla\phi\right) \tag{8}\]  
where \(\phi\) is the level set function interface (0.05), \(\gamma\) and \(\varepsilon\) are the numerical stabilization parameters, and \(u\) is the flow velocity. In this model, the continuum air contour is set as 0, and the dispersed fluid ink contour is set as 1 of the level set function. \(\gamma\) represents the start variable. It is an estimated value of the maximum speed occurring. Because the flow speed is not always known in advance, an initial computation must find a correct value. \(\varepsilon\) is the controlling interface thickness. It is the maximum element size in the subdomains passed by the interface.