DesiredAndNominalDivergenceOfVelocity

derive a formulation for the desired divergence of velocity

From the mass conservation (see EquationsToSolve) we can derive \begin{align} \begin{array}{*{35}{l}} \left( \nabla ^{T}\mathbf{v} \right)_{target} & =-\frac{d}{dt}\left( \log (\rho ) \right) \\ \left( \nabla ^{T}\mathbf{v} \right)_{target}^{n+1} & \approx -\frac{1}{\Delta t}\left( \log \left( \rho _{c}^{n+1} \right)-\log \left( \rho_{c}^{n} \right) \right) \\ {} & \approx -\frac{1}{\Delta t}\left( \log \left( \rho \left( t^{n+1},p_{hyd}^{n+1}+\tilde{p}_{dyn}^{n}+c,T^{n+1},A_{v}^{n} \right) \right)-\log \left( \rho \left( t^{n},p_{hyd}^{n}+p_{dyn}^{n},T^{n},A_{v}^{n-1} \right) \right) \right) \\ {} & \approx -\frac{1}{\Delta t}\left( \log \left( \rho \left( t^{n+1},p_{hyd}^{n+1}+\tilde{p}_{dyn}^{n},T^{n+1},A_{v}^{n} \right) \right)+\frac{1}{\rho }\frac{\partial \rho }{\partial p}c-\log \left( \rho \left( t^{n},p_{hyd}^{n}+p_{dyn}^{n},T^{n},A_{v}^{n-1} \right) \right) \right) \\ {} & \approx -\frac{1}{\Delta t}\left( \log \left( \frac{\rho \left( t^{n+1},p_{hyd}^{n+1}+\tilde{p}_{dyn}^{n},T^{n+1},A_{v}^{n} \right)}{\rho \left( t^{n},p_{hyd}^{n}+p_{dyn}^{n},T^{n},A_{v}^{n-1} \right)} \right) \right)-\frac{1}{\Delta t}\frac{1}{\rho }\frac{\partial \rho }{\partial p}c \\ {} & \approx \left( \overline{\nabla ^{T}\mathbf{v}} \right)_{c}^{n+1}-\frac{1}{\Delta t}\frac{1}{\rho }\frac{\partial \rho }{\partial p}c \\ \end{array}\end{align} The term \( \frac{1}{\Delta t}\frac{1}{\rho }\frac{\partial \rho }{\partial p}\) represents the compressibility of the fluid. The term is saved in %ind_DiagPcorr%. Finally, the definition of the nominal (compression free) divergence of velocity is \begin{align} \begin{array}{*{35}{l}} \left( \overline{\nabla ^{T}\mathbf{v}} \right)_{c}^{n+1} & \equiv -\frac{1}{\Delta t}\left( \log \left( \frac{\rho \left( t^{n+1},p_{hyd}^{n+1}+\tilde{p}_{dyn}^{n},T^{n+1},A_{v}^{n} \right)}{\rho \left( t^{n},p_{hyd}^{n}+p_{dyn}^{n},T^{n},A_{v}^{n-1} \right)} \right) \right) \\ {} & =-\frac{1}{\Delta t}\left( \log \left( \frac{\rho \left( t^{n+1},p_{hyd}^{n+1}+\tilde{p}_{dyn}^{n},T^{n+1},A_{v}^{n} \right)}{\rho_c^{n}} \right) \right) \\ \end{array}\end{align}
  • Remark 1 : the value of \( \rho_c^{n}\) is stored in the variable %ind_r_c%, it is computed right after solving the CorrectionPressureAlgorithm and the velocity correction, such that it can be used in the next time cycle as the desired reference denisty \( \rho_c^{n}\).
  • Remark 2 : the values of \( \overline{\nabla ^{T}\mathbf{v}} \right)_{c}^{n+1}\) is temporarily stored in the variable %ind_div_bar% (just for the time of execution of CorrectionPressureAlgorithm ). Moreover, for postprocessing reasons, it is also stored in the variable %ind_div_bar_c% .