Full Text
Hydromechanics
I. Yu. Brailovskaya
A Difference Scheme for the Numerical Solution of Two-Dimensional Nonstationary Navier—Stokes Equations for a Compressible Gas
(Presented by Academician G. I. Petrov, 29 VII 1964)
1. This article describes a difference method for calculating two-dimensional nonstationary flows of a viscous compressible gas with variable coefficients of viscosity and thermal conductivity. This method was applied to the calculation of a stationary flow in a rectangular cavity, when the upper boundary of the cavity moves with constant velocity. The formation of the stationary distribution of temperature, density, and velocity then occurred as a result of settling.
2. Let us consider the proposed difference scheme using as an example the heat-conduction equation with a small coefficient \(\nu\) at the second derivative
\[ \frac{\partial u}{\partial t}=a\frac{\partial u}{\partial x}+\nu\frac{\partial^2 u}{\partial x^2}. \]
Introduce the notation: \(x=mh;\ t=n\tau;\) the values of the sought function \(u\) at the grid points are \(u(x,t)=u(mh,n\tau)=u_m^n\).
The difference scheme is as follows:
\[ \frac{\overline{u}_m^{\,n+1}-u_m^n}{\tau} = a\frac{u_{m+1}^n-u_{m-1}^n}{2h} + \nu\frac{u_{m+1}^n-2u_m^n+u_{m-1}^n}{h^2}, \]
\[ \frac{u_m^{n+1}-u_m^n}{\tau} = a\frac{\overline{u}_{m+1}^{\,n+1}-\overline{u}_{m-1}^{\,n+1}}{2h} + \nu\frac{u_{m+1}^n-2u_m^n+u_{m-1}^n}{h^2}. \]
The approximation error of such a scheme is a quantity of order \(o(\tau+h^2)\).
A study of stability showed that the scheme is stable under the following restriction on the time step \(\tau\):
\[ \tau \leqslant \min\left(\frac{h^2}{4\nu};\ \frac{h}{|a|}\right). \]
Since \(\nu\) is small, the stability condition is \(\tau \leqslant h/|a|\).
3. In calculating a two-dimensional flow of a viscous compressible gas, a difference scheme analogous to that described was applied for the numerical solution of the system of Navier—Stokes equations. The Navier—Stokes system was taken in divergence form. The system of difference equations (if the values of the sought functions at the grid points are denoted by \(f(x,y,t)=f(lh_1,mh_2,n\tau)=f_{m,l}^n\)) has the form
\[ \frac{\overline{(\rho u)}_{m,l}^{\,n+1}-(\rho u)_{m,l}^n}{\tau} = -\frac{(\rho u^2)_{m,l+1}^n-(\rho u^2)_{m,l-1}^n}{2h_1} - \frac{(\rho uv)_{m+1,l}^n-(\rho uv)_{m-1,l}^n}{2h_2} \]
\[ -\frac{P_{m,l+1}^n-P_{m,l-1}^n}{2h_1} + \]
\[ \begin{aligned} &+{}^{4}/_{3}\frac{1}{\mathrm{Re}}\, \frac{ \tfrac12(\mu^{n}_{l+1,m}+\mu^{n}_{l,m})(u^{n}_{l+1,m}-u^{n}_{l,m}) -\tfrac12(\mu^{n}_{l,m}+\mu^{n}_{l-1,m})(u^{n}_{l,m}-u^{n}_{l-1,m}) }{h_1^2}+\\ &+\frac{1}{\mathrm{Re}}\, \frac{ \tfrac12(\mu^{n}_{l,m+1}+\mu^{n}_{l,m})(u^{n}_{l,m+1}-u^{n}_{l,m}) -\tfrac12(\mu^{n}_{l,m}+\mu^{n}_{l,m-1})(u^{n}_{l,m}-u^{n}_{l,m-1}) }{h_2^2}+\\ &+\frac{1}{\mathrm{Re}}\, \frac{ \mu^{n}_{m+1,l}(v^{n}_{m+1,l+1}-v^{n}_{m+1,l-1}) -\mu^{n}_{m-1,l}(v^{n}_{m-1,l+1}-v^{n}_{m-1,l-1}) }{4h_1h_2}-\\ &-{}^{2}/_{3}\frac{1}{\mathrm{Re}}\, \frac{ \mu^{n}_{m,l+1}(v^{n}_{m+1,l+1}-v^{n}_{m-1,l+1}) -\mu^{n}_{m,l-1}(v^{n}_{m+1,l-1}-v^{n}_{m-1,l-1}) }{4h_1h_2}=\\ &=-\frac{(\rho u^2)^{n}_{m,l+1}-(\rho u^2)^{n}_{m,l-1}}{2h_1} -\frac{(\rho uv)^{n}_{m+1,l}-(\rho uv)^{n}_{m-1,l}}{2h_2}-\\ &\qquad -\frac{P^{n}_{m,l+1}-P^{n}_{m,l-1}}{2h_1}+L_{1h}; \end{aligned} \]
\[ \begin{aligned} \frac{\overline{(\rho v)}{}^{\,n+1}_{m,l}-(\rho v)^{n}_{m,l}}{\tau} &=-\frac{(\rho uv)^{n}_{m,l+1}-(\rho uv)^{n}_{m,l-1}}{2h_1}-\\ &\quad -\frac{(\rho v^2)^{n}_{m+1,l}-(\rho v^2)^{n}_{m-1,l}}{2h_2} -\frac{P^{n}_{m+1,l}-P^{n}_{m-1,l}}{2h_2}+\\ &\quad +{}^{4}/_{3}\frac{1}{\mathrm{Re}}\, \frac{ \tfrac12(\mu^{n}_{m+1,l}+\mu^{n}_{m,l})(v^{n}_{m+1,l}-v^{n}_{m,l}) -\tfrac12(\mu^{n}_{m,l}+\mu^{n}_{m-1,l})(v^{n}_{m,l}-v^{n}_{m-1,l}) }{h_2^2}+\\ &\quad +\frac{1}{\mathrm{Re}}\, \frac{ \tfrac12(\mu^{n}_{m,l+1}+\mu^{n}_{m,l})(v^{n}_{m,l+1}-v^{n}_{m,l}) -\tfrac12(\mu^{n}_{m,l}+\mu^{n}_{m,l-1})(v^{n}_{m,l}-v^{n}_{m,l-1}) }{h_1^2}+\\ &\quad +\frac{1}{\mathrm{Re}}\, \frac{ \mu^{n}_{m,l+1}(u^{n}_{m+1,l+1}-u^{n}_{m-1,l+1}) -\mu^{n}_{m,l-1}(u^{n}_{m+1,l-1}-u^{n}_{m-1,l-1}) }{4h_1h_2}-\\ &\quad -{}^{2}/_{3}\frac{1}{\mathrm{Re}}\, \frac{ \mu^{n}_{m+1,l}(u^{n}_{m+1,l+1}-u^{n}_{m+1,l-1}) -\mu^{n}_{m-1,l}(u^{n}_{m-1,l+1}-u^{n}_{m-1,l-1}) }{4h_1h_2}=\\ &=-\frac{(\rho uv)^{n}_{m,l+1}-(\rho uv)^{n}_{m,l-1}}{2h_1} -\frac{(\rho v^2)^{n}_{m+1,l}-(\rho v^2)^{n}_{m-1,l}}{2h_2}-\\ &\quad -\frac{P^{n}_{m+1,l}-P^{n}_{m-1,l}}{2h_2}+L_{2h}; \end{aligned} \]
\[ \frac{\overline{\rho}{}^{\,n+1}_{m,l}-\rho^{n}_{m,l}}{\tau} =-\frac{(\rho u)^{n}_{m,l+1}-(\rho u)^{n}_{m,l-1}}{2h_1} -\frac{(\rho v)^{n}_{m+1,l}-(\rho v)^{n}_{m-1,l}}{2h_2}; \]
\[ \begin{aligned} &\frac{ \overline{\bigl(\rho[e+\tfrac12(u^2+v^2)]\bigr)}{}^{\,n+1}_{m,l} -\bigl(\rho[e+\tfrac12(u^2+v^2)]\bigr)^{n}_{m,l} }{\tau}=\\ &=-\frac{ \bigl(\rho u[e+\tfrac12(u^2+v^2)+P/\rho]\bigr)^{n}_{m,l+1} -\bigl(\rho u[e+\tfrac12(u^2+v^2)+P/\rho]\bigr)^{n}_{m,l-1} }{2h_1}-\\ &\quad -\frac{ \bigl(\rho v[e+\tfrac12(u^2+v^2)+P/\rho]\bigr)^{n}_{m+1,l} -\bigl(\rho v[e+\tfrac12(u^2+v^2)+P/\rho]\bigr)^{n}_{m-1,l} }{2h_2}+\\ &\quad +\frac{\gamma}{\mathrm{Re}\,\mathrm{Pr}}\, \frac{ \tfrac12(\lambda^{n}_{m,l+1}+\lambda^{n}_{m,l})(e^{n}_{m,l+1}-e^{n}_{m,l}) -\tfrac12(\lambda^{n}_{m,l}+\lambda^{n}_{m,l-1})(e^{n}_{m,l}-e^{n}_{m,l-1}) }{h_1^2}+\\ &\quad +\frac{\gamma}{\mathrm{Re}\,\mathrm{Pr}}\, \frac{ \tfrac12(\lambda^{n}_{m+1,l}+\lambda^{n}_{m,l})(e^{n}_{m+1,l}-e^{n}_{m,l}) -\tfrac12(\lambda^{n}_{m,l}+\lambda^{n}_{m-1,l})(e^{n}_{m,l}-e^{n}_{m-1,l}) }{h_2^2}+\\ &\quad +\frac{1}{\mathrm{Re}}\left[ \frac{ {}^{2}/_{3}\bigl((\mu u)^{n}_{m,l+1}+(\mu u)^{n}_{m,l}\bigr)(u^{n}_{m,l+1}-u^{n}_{m,l}) -{}^{2}/_{3}\bigl((\mu u)^{n}_{m,l}-(\mu u)^{n}_{m,l-1}\bigr)(u^{n}_{m,l}-u^{n}_{m,l-1}) }{h_1^2}+ \right. \end{aligned} \]
\[ \begin{aligned} &+ \frac{\frac{1}{2}\bigl((\mu v)^n_{m,l+1}+(\mu v)^n_{m,l}\bigr)\bigl(v^n_{m,l+1}-v^n_{m,l}\bigr) -\frac{1}{2}\bigl((\mu v)^n_{m,l}-(\mu v)^n_{m,l-1}\bigr)\bigl(v^n_{m,l}-v^n_{m,l-1}\bigr)}{h_1^2} + \\[4pt] &+ \frac{(\mu v)^n_{m,l+1}\bigl(u^n_{m+1,l+1}-u^n_{m-1,l+1}\bigr) -(\mu v)^n_{m,l-1}\bigl(u^n_{m+1,l-1}-u^n_{m-1,l-1}\bigr)}{4h_1h_2} - \\[4pt] &- \frac{\frac{2}{3}(\mu u)^n_{m,l+1}\bigl(v^n_{m+1,l+1}-v^n_{m-1,l+1}\bigr) -\frac{2}{3}(\mu u)^n_{m,l-1}\bigl(v^n_{m+1,l-1}-v^n_{m-1,l-1}\bigr)}{4h_1h_2} + \\[4pt] &+ \frac{\frac{1}{2}\bigl((\mu u)^n_{m+1,l}+(\mu u)^n_{m,l}\bigr)\bigl(u^n_{m+1,l}-u^n_{m,l}\bigr) -\frac{1}{2}\bigl((\mu u)^n_{m,l}-(\mu u)^n_{m-1,l}\bigr)\bigl(u^n_{m,l}-u^n_{m-1,l}\bigr)}{h_2^2} + \\[4pt] &+ \frac{\frac{2}{3}\bigl((\mu v)^n_{m+1,l}+(\mu v)^n_{m,l}\bigr)\bigl(v^n_{m+1,l}-v^n_{m,l}\bigr) -\frac{2}{3}\bigl((\mu v)^n_{m,l}+(\mu v)^n_{m-1,l}\bigr)\bigl(v^n_{m,l}-v^n_{m-1,l}\bigr)}{h_2^2} + \\[4pt] &+ \frac{(\mu u)^n_{m+1,l}\bigl(v^n_{m+1,l+1}-v^n_{m+1,l-1}\bigr) -(\mu u)^n_{m-1,l}\bigl(v^n_{m-1,l+1}-v^n_{m-1,l-1}\bigr)}{4h_1h_2} - \\[4pt] &\left. - \frac{\frac{2}{3}(\mu v)^n_{m+1,l}\bigl(u^n_{m+1,l+1}-u^n_{m+1,l-1}\bigr) -\frac{2}{3}(\mu v)^n_{m-1,l}\bigl(u^n_{m-1,l+1}-u^n_{m-1,l-1}\bigr)}{4h_1h_2} \right] = \\[4pt] &= -\frac{\bigl(\rho u[e+\tfrac{1}{2}(u^2+v^2)+P/\rho]\bigr)^n_{m,l+1} -\bigl(\rho u[e+\tfrac{1}{2}(u^2+v^2)+P/\rho]\bigr)^n_{m,l-1}}{2h_1} - \\[4pt] &\quad -\frac{\bigl(\rho v[e+\tfrac{1}{2}(u^2+v^2)+P/\rho]\bigr)^n_{m+1,l} -\bigl(\rho v[e+\tfrac{1}{2}(u^2+v^2)+P/\rho]\bigr)^n_{m-1,l}}{2h_2} + L_{3h}; \end{aligned} \]
\[ \frac{(\rho u)^{n+1}_{m,l}-(\rho u)^n_{m,l}}{\tau} = -\frac{\overline{(\rho u^2)}^{\,n+1}_{m,l+1}-\overline{(\rho u^2)}^{\,n+1}_{m,l-1}}{2h_1} -\frac{\overline{(\rho uv)}^{\,n+1}_{m+1,l}-\overline{(\rho uv)}^{\,n+1}_{m-1,l}}{2h_2} -\frac{\overline{P}^{\,n+1}_{m,l+1}-\overline{P}^{\,n+1}_{m,l-1}}{2h_1} +L_{1h}; \]
\[ \frac{(\rho v)^{n+1}_{m,l}-(\rho v)^n_{m,l}}{\tau} = -\frac{\overline{(\rho uv)}^{\,n+1}_{m,l+1}-\overline{(\rho uv)}^{\,n+1}_{m,l-1}}{2h_1} -\frac{\overline{(\rho v^2)}^{\,n+1}_{m+1,l}-\overline{(\rho v^2)}^{\,n+1}_{m-1,l}}{2h_2} -\frac{\overline{P}^{\,n+1}_{m+1,l}-\overline{P}^{\,n+1}_{m-1,l}}{2h_2} +L_{2h}; \]
\[ \frac{\rho^{n+1}_{m,l}-\rho^n_{m,l}}{\tau} = -\frac{\overline{(\rho u)}^{\,n+1}_{m,l+1}-\overline{(\rho u)}^{\,n+1}_{m,l-1}}{2h_1} -\frac{\overline{(\rho v)}^{\,n+1}_{m+1,l}-\overline{(\rho v)}^{\,n+1}_{m-1,l}}{2h_2}, \]
\[ \begin{aligned} &\frac{\bigl(\rho[e+\tfrac{1}{2}(u^2+v^2)]\bigr)^{n+1}_{m,l} -\bigl(\rho[e+\tfrac{1}{2}(u^2+v^2)]\bigr)^n_{m,l}}{\tau} = \\[4pt] &= -\frac{\overline{\bigl(\rho u[e+\tfrac{1}{2}(u^2+v^2)+P/\rho]\bigr)}^{\,n+1}_{m,l+1} -\overline{\bigl(\rho u[e+\tfrac{1}{2}(u^2+v^2)+P/\rho]\bigr)}^{\,n+1}_{m,l-1}}{2h_1} - \\[4pt] &\quad -\frac{\overline{\bigl(\rho v[e+\tfrac{1}{2}(u^2+v^2)+P/\rho]\bigr)}^{\,n+1}_{m+1,l} -\overline{\bigl(\rho v[e+\tfrac{1}{2}(u^2+v^2)+P/\rho]\bigr)}^{\,n+1}_{m-1,l}}{2h_2} +L_{3h}; \end{aligned} \]
\(u\) and \(v\) are the longitudinal and transverse components of velocity; \(\rho\) is density; \(P\) is pressure; \(e\) is the internal energy per unit mass of the fluid; \(\gamma\) is the ratio of specific heats; \(\mu\) and \(\lambda\) are the coefficients of viscosity and thermal conductivity; \(\operatorname{Re}\) and \(\operatorname{Pr}\) are the Reynolds and Prandtl numbers.
The approximation error of the difference equations obtained is of order \(o(\tau+h^2)\); moreover, if the time derivatives are equal to zero, then the approximation error has magnitude \(o(h^2)\). Therefore the scheme is especially convenient in solving stationary problems by the method of establishment. The stability study was limited to an investigation of the stability of the analogue of the constructed difference scheme for the linearized Navier—
Stokes with constant coefficients. It turned out that the scheme is stable if the inequality
\[ \tau \leqslant \min \left(\frac{h^2}{8\nu};\ \frac{h}{|u|+|v|+c\sqrt{2}}\right) \]
is satisfied.
Calculations showed that this condition is also sufficient for the stability of the difference scheme for the nonlinear Navier—Stokes equations.
- A plane flow of a viscous heat-conducting gas in a square cavity was computed, if the lid of the cavity moves with constant velocity relative to its walls. On the boundaries of the cavity the velocities and temperature were assumed known. The density on the boundaries was found from the continuity equation. At the initial instant it was assumed that the gas inside the cavity is at rest, its density and temperature are constant, the velocities on the walls of the cavity are zero, on the upper lid the transverse component of velocity is zero and the longitudinal one is equal to unity, i.e., there is a discontinuity of velocity on the upper lid at the initial instant and in the left and right upper corners throughout the entire computation. The boundary conditions are stationary.
Fig. 1. Streamlines of the established flow in the case \(M=1/3\)
Calculations were carried out with various Mach numbers \(M\) and Reynolds numbers \(\mathrm{Re}\): 1) \(M=1/2\); \(\mathrm{Re}=10^2\), 2) \(M=1/3\); \(\mathrm{Re}=10^2\); 3) \(M=1\); \(\mathrm{Re}=10^2\); 4) \(M=1/3\); \(\mathrm{Re}=500\); 5) \(M=1/3\); \(\mathrm{Re}=10^3\). The number of grid points was \(21 \times 21\).
With time the flow parameters tend to certain stationary values, i.e., the flow becomes established. A comparison of the calculation results for variant (1) with a fine step (number of points \(21 \times 21\)) and a coarse step (number of points \(10 \times 10\)) showed that the difference does not exceed 10%; in view of the large approximation errors in the calculation with the coarse step, the agreement may be considered satisfactory.
In Fig. 1 graphs of the streamlines are given.
Moscow State University
named after M. V. Lomonosov
Received
16 VII 1964