title: Unified methods for computing incompressible and compressible flow
text: # Unified methods for computing incompressible and compressible flow
  
  Computation of incompressible and compressible flow generally depends on the Mach number M, where for a range of zero to supersonic compressible equations are applied but with a possible error on a range of M<0.2. For this range we have to apply incompressible Navier Stokes and Euler equations but the work would be much easier if we find a Unified Method for solving both the flows. Unified method can also lead us towards much more accuracy and efficiency.
  
  The standard method for solving compressible flows fails; the basic cause of failure for the compressible flow methods is the stiffness of the governing equations.
  
  ## Conservation of mass
  
  ${\frac {\partial\rho}{\partialt}}+\nabla.\left(\rhoV\right)=0$
  
  ## Conservation of momentum
  
  $\rho{\frac {DV}{Dt}}=-\nablap+\nabla.\tau+\rhof$
  
  ## Conservation of energy
  
  $\rho\left[{\frac {\partialh}{\partialt}}+\nabla.\left(hV\right)\right]=-{\frac {Dp}{Dt}}+\nabla.\left(k\nablaT\right)+\Phi$
  
  One way to fix this problem is to change the governing equation; known as preconditioning; which can also increases the accuracy.
  
  The other cause for the breakdown is pressure because it is not taken into account as primary unknown. For making the governing equation workable for both the compressible and incompressible flows, following things needs to be corrected:-
  
  * Usage of dimensionless pressure thereby removing the difficulties faced while solving for very low Mach number
  * Use non conservative form of energy which increases the efficiency
  * Discretization of the mass conservation equation
  * Use MUSCL and Runge–Kutta time stepping
  
  ## Governing equation
  
  ### Conservation of mass
  
  ${\rho}_{p}p_{t}+{\rho}_{T}T_{t}+m_{x}=0$
  
  ### Equation of state
  
  ${\rho}_{p}=\gammaM_{r}^{2}/T$
  
  ${\rho}_{T}=-{\frac {\rho}{T}}$
  
  ### Momentum equation
  
  $m_{t}+{(um+p)}_{x}=0$
  
  By using the dimensionless pressure and equation of state the governing equation can be best described as: $T_{t}+{(uT)}_{x}+\left(\gamma-2\right)Tu_{x}=0$
  
  ## Finite volume scheme
  
  For the above specified governing equations the finite volume scheme is
  
  $\gammaM_{r}^{2}\left(p_{j}^{n+1}-p_{j}^{n}\right)-{\rho}_{j}^{n}\left(T_{j}^{n+1}-T_{j}^{n}\right)+\lambdaT_{j}^{n}\left(s^{n}{\rho}^{n}u^{n}+\left(1-s^{n}\right)m^{n+1}\right){\vert}_{j-1/2}^{j+1/2}=0$
  
  $m_{j+1/2}^{n+1}-m_{j+1/2}^{n}+\lambda\left(u^{n}m^{n}+p^{n+1/2}\right){\vert}_{j}^{j+1}=0$
  
  $T_{j}^{n+1}-T_{j}^{n}+\lambda\left(u^{n}T^{n}\right){\vert}_{j-{\frac {1}{2}}}^{j+{\frac {1}{2}}}+\lambda\left(\gamma-2\right)T_{j}^{n}u^{n}{\vert}_{j-{\frac {1}{2}}}^{j+{\frac {1}{2}}}=0$
  
  where $\lambda=\tau/h$
  
  $p^{n+1/2}=(p^{n}+p^{n+1})/2$
  
  $s^{n}=s(M^{n})$
  
  $s(M)=0,M<=1/2,$ $s(M)=M-1/21/2<\vertM\vert<3/2$ $s(M)=1M>=3/2$
  
  Here$M_{j+{\frac {1}{2}}}={\frac {2\left\vertu_{j+{\frac {1}{2}}}\right\vert}{c_{j}+c_{j+1}}}$
  
  with c as the speed of the sound.
  
  And it is found that here m and p are the terms evaluated at new time level t^(n+1) This is mostly based on the 1 dimension case
  
  ## Pressure correction method
  
  For a higher order nonlinear system we have to use iterative methods. So for the better results we use the pressure-correction method In this method first t^(n+1)is obtained. Next a momentum prediction m* by replacing p^(n+1/2) by p^n
  
  $m_{j+1/2}^{*}-m_{j+{\frac {1}{2}}}^{n}+\lambda\left(u^{n}m^{n}+p^{n}\right){\vert}_{j}^{j+1}=0$
  
  A momentum correction$\deltam=m^{n+1}-m^{*}$is postulated as
  
  $\deltam_{j+{\frac {1}{2}}}=-\left({\frac {1}{2}}\right)\lambda\deltap{\vert}_{j}^{j+1}$
  
  $\deltap=p^{n+1}-p^{n}$ Substitution of $m^{n+1}=m^{*}+\deltam$ gives the following pressure Correction Equation for $\deltap:$
  
  $\gammaM_{r}^{2}\deltap_{j}-\left({\frac {1}{2}}\right){\lambda}^{2}T_{j}^{n}\left\{\left(1-s_{j+{\frac {1}{2}}}^{n}\right)\deltap{\vert}_{j}^{j+1}-\left(1-s_{j-{\frac {1}{2}}}^{n}\right)\deltap{\vert}_{j-1}^{j}\right\}={\rho}_{j}^{n}T_{j}{\vert}_{n}^{n+1}-\lambdaT_{j}^{n}\left(s^{n}{\rho}^{n}u^{n}\right){\vert}_{j-{\frac {1}{2}}}^{j+{\frac {1}{2}}}$
  
  ### Boundary conditions
  
  Boundary conditions needed for solving above methods for j=1
  
  $\left({\frac {1}{2}}\right)\lambda\deltap{\vert}_{0}^{1}=-\lambda\deltam_{1/2}=-\lambda({\rho}_{b}u_{b}){\vert}_{t_{n}}^{t_{n+1}}$ For j=J the momentum equation is integrated over a half cell:
  
  $m_{J+1/2}^{*}-m_{J+1/2}^{n}+2\lambda\left(u^{n}m^{n}+p^{n}\right){\vert}_{J}^{J+1/2}=0$
  
  $p_{J+1/2}^{n}=p_{b}(t^{n})$ $\deltam_{J+1/2}=-\lambda(p_{b}{\vert}_{t_{n}}^{t_{n+1}}-\deltap_{j})$
  
  ## Runge–Kutta method
  
  There are other methods too for finding the more accurate, more efficient results like one is Runge–Kutta method. it is known as a time stepping method in which one can freeze the time of first three steps and jump to the fourth level of the Euler equation with full time T so (m+1) stage becomes: $T_{j}^{(m+1)}-T_{j}^{n}+{\alpha}_{m+1}\lambda\left(u^{n}T^{(m)}\right){\vert}_{j-1/2}^{j+1/2}+{\alpha}_{m+1}\lambda\left(\gamma-2\right)T_{j}^{(m)}u^{n}{\vert}_{j-1/2}^{j+1/2}=0$
  
  $m_{j+{\frac {1}{2}}}^{\left(m+1\right)}-m_{j+{\frac {1}{2}}}^{n}+{\alpha}_{m+1}\lambda\left(u^{n}m^{\left(m\right)}+p^{n}\right){\vert}_{j}^{j+1}=0$
  
  In the fourth stage pressure correction is carried out:
  
  $\gammaM_{r}^{2}\deltap_{j}-\left({\frac {1}{2}}\right){\lambda}^{2}T_{j}^{\left(4\right)}\left\{\left(1-s_{j+{\frac {1}{2}}}^{\left(4\right)}\right)\deltap{\vert}_{j}^{j+1}-\left(1-s_{j-{\frac {1}{2}}}^{\left(4\right)}\right)\deltap{\vert}_{j-1}^{j}\right\}={\rho}_{j}^{n}\left(T_{j}^{\left(4\right)}-T_{j}^{n}\right)-\lambdaT_{j}^{\left(4\right)}\left(s^{\left(4\right)}{\rho}^{n}u^{n}\right){\vert}_{j-{\frac {1}{2}}}^{j+{\frac {1}{2}}}$
  
  