计 算 流 体 力 学 Computational fluid dynamics

Download Report

Transcript 计 算 流 体 力 学 Computational fluid dynamics

计 算 流 体 力 学
Computational fluid dynamics
课时: 40小时
40 hours
教材:王新月, 杨青真 .《计算流体力学基础》,
西北工业大学讲义,西北工业大学出版社
Textbook: Wang.X.Y, Yang.Q.Z “Foundation of
Computational fluid dynamics”,Lecture of NPU.
课程性质: 专业课
Specialty course
适用对象:硕士研究生
for Master Degree
基础要求:
Requirements :
 学过流体力学、粘性流体力学等专业课基础
 Fluid Dynamics, Foundation Dynamics of Viscous
Flow have been studied
 学过数值分析、计算方法等数学基础课
 Learn Numerical Analysis, Computational Method
主要内容:
1.计算流体力学的基础知识,差分形式逼近流体力学基
本方程,包括差分逼近基础,流体力学基本方程的解,差
分格式的构造。Includes foundation knowledge of
Computational fluid dynamics, FD approach to FD basic Eq,
solution of the FD Eqs, constitution of FD.
2.定常不可压势流的数值解法,包括不可压势流基本方
程,源汇流动,旋成体绕流,及椭圆型微分方程数值解。
Numerical solution of steady incompressable potential flow,
includes the basic Eqs of steady incompressable potential
flow, source and sink flow, flow arround a rotational body.
3.特征线方法的概念和应用 Concept and
application of characteristic line method
4.跨音速定常小扰动势流混合差分法及隐式近似
因式分解Small perturbation method for steady
transonic flow and Approximate
Factorization(AF)
5.时间推进法:包括守恒的非定常欧拉方程组等
Time march methods, includes conservational
unsteady Euler Eqs.
6.Navier –Stokes 方程的数值解法,包括湍流模型理论,
N-S方程的有限体积法,涡流函数解法。Numerical
methods for Navier-Stokes Eqs, include turbulence models,
finite volume method for N-S Eqs.
7.网格设计:包括集合生成方法,保角变换法,微分方程
法,混合方法,动网格设计Mesh design includes
geometric meshing method, angle conservation method,
TTM method, Vortex –streamline method,moving grids
8.流场计算中的新方法,包括TVD方法,ENO方法,NND
格式谱方法,自适应网格,并行计算与向量计算,非机构
网格及其应用Some new methods computing the flow
fields ,self adapt grids, parallel methods and vector
computing, unstructured grid and its applications.
主要参考资料
References
1.书中各章所列
The references of every chapter.
2.张涵信 沈孟育《计算流体力学:差分方法的原理和应
用》 国防工业出版社,2003年1月
Zhang han kin etc Computational Fluid Dynamics –Fundamentals
and Applications of Finite Difference Minitry Industry Press. 2003
BeiJing
4.John D. Anderson, JR. Computational fluid dynamics,the
basics with application. MCGraw-Hill Apr.2002
计算流体力学入门,清华大学出版社,2003年4月
第一章
差分逼近基础及流体力学
基本方程的解
Chapter 1, Finite Differential Approach and the solution of the
Basic Equation of Fluid Dynamics
1-1 差分逼近基础 Element of Finite Differential Approach
一.流体力学问题的解( The solution of Fluid Dynamics
question )
泛定方程
 描述流动现象的一组封闭方程 The closed equations to
describe fluid phenomenon,
 描述运动的一般规律,不能确定物体形状和边界条件
(初始条件)To describe the normal regulation, not
define to a certain geometry and BC / IC
定解条件:

初始条件 过多则出现无解(不存在)confirm
condition : initial condition : too more, BC / IC takes
no solution

边界条件过少则出现很多解,即不唯一
Boundary condition too less BC / IC load unique
solution

解的连续性问题,定解条件的微小变化引起域
内解的微小变化Continuity of solution , a little change
of BC may lead to little change of solution
 差分方程:微分方程的近似逼近、近似FDE approach
the PDE
 数值解必须条件Condition needed for Numerical
solution
① 适定性问题(有解) Confirmed solution
① (问题)解的性质 the feature of solution
① 实用的近似方案 be of a practical approach solution
① 4.近似方程适定,变量数目与方程数目相同Number
of equations equal to number of variables
② 5.可行的求解代数方程组的方法:迭代方法
(iterative method),直接求解( directive solving
method)Possible / valid method to solve linear
equations.
③ 6.具备计算条件(内存,速度等) computation
facility
④ 7.稳定性,收敛性和精度(h0,得到精确解)
Stability, convergence, accuracy
二.微分方程解的存在性和唯一性
Existence and uniqueness of the PDE solution
1.物理过程:适定性Physic phenomena;fixed
2.数学方程:可解不适定Math equation ; possibility not
fixed
3.原因:近似的数学方程忽略了一些次要影响因素
Reason; approximate math equation usually neglect some
unimportant influence
4.数学上适定性问题:只能近似的反应物理现象
A fixed question in math ;can approximately reflect the
physic phenomena
5.偏微分方程解的唯一性:数理方程重有详尽叙述
Uniqueness of a PDE, has been descript detailedly in Math
6.适定问题+定解条件 差分方程数值唯一性
Fixed question +confirmed BC/IC the uniqueness of the
related FDE
7.若微分方程的精确解是唯一的 稳定收敛解也是唯一的
If the solution of PDE is unique then the solution of FDE is
unique
三.差分方程数值解收敛性 相容性和稳定性
Convergence consistency and stability
1.收敛性(convergence)
当时间步长和空间步长()趋于零,若差分方程的问题
趋于偏微分方程(相同的适定条件,定解条件)When
time step and space step tend to zero ,the solution of FDE
tend to the solution of PDE
Lax等价定理
Lax equipollence theorem
2.相容性(consistency)
差分方程对微分方程的近似程序How approximate is the FDE
to PDE
3.稳定性(stability)
描述差分解在计算过程中的发展To indicate the
development of the error of FDE
误差对后续计算的形象问题(影响小时或者有界)
It reflects the influence of error of the following computation
稳定:计算过程重误差逐渐消失或者有界
Stable ,the error disappear graduately or keep limited
稳定性分析方法
Methods for analysing stability
 直观法(或称离散摄动法):观察计算引入的误差的
发展过程In discrete perturbation (direct) method, to
investigation the development procedure of
computational error
矩阵法(Matrix method)
 较严格的方法,考虑了边界条件的影响 Strict
method, the BC influence is considered
 解得到最完整的稳定性估计 Can gain the
most integrating (completed) estimation of
stabling
 用很多矩阵代数知识,使用困难 Refer to a lot
knowledge about maxtix analysis
Von Nenmann方法
Von Nenmann method(Fourrie series)
 优点:最常用,方便,可靠Advantage: most
common,convenience,reliable
 缺点:只能用在常数系数的线性初值问题
Disadvatage:Only can be used for linear initial value
equation with constant coefficient
 变系数非线性及各种不同边界条件问题中的应用受限
Limited usage for non-linear BC problem with
different coefficient
线性化:局部线性化方程后可以使用
Linearized: usable for linearized equation
在网格点式边界点上可以用它得到有用信息
To get useful message at grids and BC
它不仅提供误差影响的发展信息,而且还展现差分格
式对解相位变化的作用
It provides the message development of the error
Von Neumann方法揭示了误差发展的内部机理
Von Neumann method discovered the mechanism of
the numerical error development
d.Hirt 方法(1968)
Hirt method (1968)
 改型:将差分方程各项用Taylor级数展开
Reformed type Eq: Reform the FDE using Taylor
series expansion
 分析改型方程的稳定性
To analyse the stability of the reformed Eq
 优点:简单,对简单问题可以得到与其他方
法相同结果
Advantage: simple, can gain the same results as
other methods for a simple eq
缺点:
不如矩阵方法和傅里叶方法严谨和完整
Disadvantage: not so strict as Matix
method and Fourrie series
方法的某些假定的定义不清楚
Meaning of some assumer is not clear
对复杂问题的实用性尚待研究
The applicability for complex question is
still to be investigated.
四. Lax定理
Lax Therem
1-2 流体力学基本方程的解
The solution of the Basic Equation of Fluid Dynamics
 Euler 方程组的解
Euler Eqs solution
1.定常不可压流Euler方程
Euler Eqs solution for steady incompressible flow
 无粘、定常
Inviscous, steady flow
•2维Euler方程
2D Euler Eqs
•拟线性方程组
Quasilinear
•特征根
Character root
•既不是双曲型,也不是椭圆型
Neither hyperbolic, nor elliptic
•类型不确定
Type of the equation is uncertain
•不能按某确定的方法给出适定性条件
Could not determine the fit condition using
specified method
在无旋流中,可以引入势函数Ф
In irrotational flow, the potential function can be
introduced
Where the p0 denotes total pressure
这时的方程为Laplace方程,为椭圆型
The equation becomes a Laplace Eqs, it is elliptic
给定边界条件即可求出Ф, 微分后可得到速
度分量
The solution can be gained when the BC is specified,
and the components of the velocity can be calculated.
定常不可压Euler方程只有在无旋条件下才
有解
Therefore,the solution of Euler Eqs exist only in
irrotional flow.
由连续方程和无旋条件
Here with the continuity equation and irrotional flow,the
equation for:
•用流函数表示有旋流动方程
The equation for rotational flow using stream function
双曲型方程Cauchy边界问题有解
Hyperbolic Eqs with the Cauchy boundary value
problem is solvable.
双曲型方程Dirichlet边界问题无解
Hyperbolic Eqs with the Dirichlet boundary value
problem is unsolvable.
2.非定常不可压Euler方程
Euler equation for unsteady incompressible flow
•三个自变量 t、x、y
Three variables are t,x,y
•特征方程
Eigenvalue
速度矢量
特征值矢量
Velocityvector
Eigenvalue
类型不确定(不可压非定常流Euler方程),但下
列情况有解:
The type of the equation is uncertain and unsolvable,
but in following cases
 无旋情况存在速度势Ф,则有解
If is irrotational flow, there exist the velocity potential
function and the equation is solvable.
其解代表有重力作用下的U形管中流体的振动问
题
The solution deputy is the vibrancy of the flow in a Ushape tube in the gravity field.
非定常有旋流动(引入流函数)
Unsteady rotational flow(introduce the stream function)
流函数方程(椭圆型elliptic type)
Stream function equation
涡量方程(混合型hybrid type)
Vortex equation
初边值混合问题有解
Initial and boundary value problems are solvable
两方程有解
Two equations are solvable
3.定常可压流Euler方程
Euler equation for steady compressible flow
•多了变量 ρ
Additional variable is ρ
•能量方程
The energy equation
为当地音速
a is the speed of sound
•特征值
Eigenvalue
超音速: 当M>1时(supersonic)全部特征
值为实数
Supersonic: when M>1, all eigenvalue are real
number
方程是双曲型方程组
equations are hyperbolic
初值问题有解
the solution exist for initial problem
亚音速: M<1时
Subsonic when M<1
为虚数 imaginary number
为实数
real number
不能确定类型
the type is uncertain
不能给出适当的定解条件
the solution boundary is not possible
需要补充说明流线垂直方向上的熵分布
The complement of the entropy distribution is needed
跨声速: 只要正确处理求解域边界上属于超音
区边界和亚音区边界的边界条件
Transonic: The correct BC in each region for sub、
supersonic flow
无旋流动有解(无激波或弱激波)
It is solvable for irrotional flow
4.非定常可压缩流的Euler方程组
Euler equation for unsteady compressible flow
•特征根全部是实数,方程组为双曲型
Eigenvalues are all the real number, the equation is
hyperbolic
•初边界混合问题有解
The solution exist for mixed BC problem
•超音速问题:指定上游边界条件
For supersonic problem: to specify upstream BC.
•亚音速问题:指定边界上的Dirichlel条件.
(Neumamn)
For subsonic problem : to specify the Dirichlel BC.
•跨音速时:先分出亚音速、超音速,分别给出
cauchy和 Neumamn 条件
For transonic : specify the cauchy and Neumamn BC for sub
and super sonic respectively
•非定常Euler 方程是无粘流的理想方程,可以用来求
解亚、跨、超音速流
The unsteady Euler Eq. is a full equation for inviscous flow, and
can be used for solving the sub tran and supersonic flow.
•一般采用时间推进方法:
Time match method is generally used
二、Navier——Stokes方程
1、定常不可压N-S 方程(二维)
Steady incompressible flow N-S equations
•无需能量方程
the energy equation is unnecessary
•流线数解(涡—流量数法)
The stream function equation
•椭圆型方程
The stream function equation is elliptical
•边值问题可解(有解)
Boundary value crotale is solvable
•当 γ下降 , Re上升(Re=400)时变为无粘流,
求解困难。
When γ↓ ,Re↑ , the flow becomes inviscous and to
solve is becomes difficulty
2.非定常NS方程组
Unsteady NS equations
•压力一定后可以求出速度场,但连续方程不能
修正压力项
After specify the pressure, the velocity field can be
gained , but the continuously equation can not be
used to get pressure corretion
•解决方法:将NS方程变为涡量方程
Solving method : to translate the NS equation into
vortex equation
•涡流函数方程
Vortex –stream function equation
•高Re数时,它退化为时间的双曲方程,初值问
题可解。
At the high Re number ,it degenerates to a hyperbola
form in corresponding to time ,which is solvable for a
initial value problem.
•对三维问题,需求解原参数的非定常不可压NS方程
以解决满足连续方程的问题
For 3D problem, to solve the original parameter NS equation is needed.
•Chorin (1968)和Amsdon , Harhov(1969)提出求
解原函数NS方程。
Chorin,Amsdon and Harhov developed the method to-solve the
original NS equation.
把动量方程分裂为两个方程:
First, the moment equation is separated into two finlte reference
equation
a)
(求V)
b)
(求出P)
c)
d)
求解采用迭代方法步骤
The procedure for solving the equation with iterative method
 用a)式求 ,代表 中间量,V 初值
Using a) to get ,it denotes middle variable , V denotes the initial value
V
n 1
(1)
 用d)式求与 对应的 p 中间量
(1)
Using a) to get p corresponding to the
 用b)式求 V n 1 代表(n+1)步的 V 值,检查
是否满足连续方程
n 1
n 1
Using b) to get V
,which denotes the V at time step n+1, validate if V satisfy
the continuity Eqs
=0 ?
n 1
( 2)
n 1
如果不满足,将 V 带入c)求 p 再代入b)求V
,直到
=0
(<ε)
n 1
( 2)
If not satisfy the continuity Eqs, get p using c), after that using b) to get V
again, till
=0.
流程图如下:
3.定常可压N-S方程组
N-S Eqs for steady compressible flow
对于可压流ρ≠const,应增加一个能量方程
For compressible flow, ρ≠const, the energy Eq. is necessary.
此方程不可用于求解低速气流
These equations can not use for low speed flow
对高速气流Re很大时,粘性项可忽略,退化为Euler方程
For high speed flow Reynolds number becomes large , the viscous term in
equations can be neglect it degenerate to Euler equation.
适应于高亚音速流动(层流问题),方程式椭圆型方程
It is suitable for high speed subsonic flow, and is elliptic
对于高亚音速湍流问题,粘性系数μ应当包括分子粘性与
 eff
涡粘性两部,因此应当用 (有效粘性系数)。
For turbulent higher speed subsonic flow, both the molecular viscous and
vertex viscous should be consider . There fore μ should be  eff (effect
viscosity).
超音速流情况下,方程退化为前面的Euler方程
For supersonic flow ,the equations all degenerates to Euler equation.
4 . 非定常可压流的N-S方程组
N-S equations of unsteady compressible flow
在低速气流中此方程是对时间是抛物型方程,对空间是椭
圆型(时间固定)
Low speed flow, these equations are parabolic for time ,and elliptic for space.
在高速时,对于时间是双曲型方程
At high speed ,it is Hyperbolic with respect to time.
已知初边值条件下,方程组是适定的
The equations are solved when initial conditions are known.
可以用来求解亚、跨、超声速层流问题和湍流问题
It can be used to solve subsonic , transonic and supersonic flow.
是求解流场的最完整形式的N-S方程
It is also the fullest form of the N-S Equations.
1.3差分格式的构造
To construct the finite difference schemes
多种方法:
There are many method to construct a finite difference scheme
一、系数待定法
The Method with coefficient to be determined
 利用Taylor级数展开可以构造不同阶的差分格式
To construct a finite difference scheme using Taylor series.
 向前差分格式:将u j 1 、u j  2 在j点展开
(forward finite difference scheme) To expand u j 1、 u j at
2 point j
由(1)+(2),得:
b  u (jn1) +a  u (jn)2  (2a  b)u (jn )  (u x )(jn ) (b  2a )x
b  4a
 (u )
(x) 2
2!
b  8a
 (u xxx )(jn )
(x)3  ...]
3!
n
xx j
忽略 (x) 项 u j 、u j 1、u j 2 可以构成2阶精度差分格式.
3
令
(x) 2 的系数为0,且 (x)系数为1
由此构成二阶精度差分近似:
(u x ) j ( n )  (u / x) j ( n ) 
u j  2 ( n )  4u j 1( n )  3u j ( n )
2x
 x)2 
 O(
 同样的,用 u j 3 u j 2 u j 可以构成三阶向前差分
用
uj
u j 1 u j  2可以构成二阶向后差分
 用 u j u j 1 u j  2 u j 3 可以构成三阶中心差分
 用 u j 1 u j u j 1 可以构成二阶向后差分
二、多项式方法
对Laplace方程可以是三个网格点(如图)
Txx  Tyy  0
Txx代表y不变的情况下对x 的二阶导数。可令:
T  a  bx  cx
2
其中a, b, c是待定系数
Tx  b
Txx  2c
取(i-1,j),( i , j),(i+1, j)三点,假定:
xi 1, j  0
网格间距相等则
Ti , j  a
Ti 1, j  a  bx  c (x ) 2
Ti 1, j  a  bx  c (x )
2
两式相加即得:
2c 
Ti 1, j  2Ti , j  Ti 1, j
2(x)2
!此差分格式近似具有(x) 2 阶精度(二阶),同样用此方法可以
构造其他高阶格式。
三、积分方法
例如一维热传导方程或波动方程:
T
 2T
a 2
t
x
u
 2u
a 2
t
x
对时间导数应用一阶差分:
u (t0  t , x)  u (t0 , x)
ut 
t
 2u u (t , x0  x / 2) u (t , x0  x / 2)


2
x
x
x
则对
和x分别积分形式的方程可写为:
t0

x0 x / 2
x0 x / 2
[u (t0  t , x)  u (t0 , x)]dx  a 
t0 t
t0
[(u x )i 1/ 2  (u x)
i-1/2 ]dt
应用积分中值定理,得:
Using the centre valume law
x(ui( n1)  ui( n) )  a[(u x ) ( n11)  (u x ) ( n11) ]t
i
( n 1)
i
( n 1)
i
其中, u
Where u
代表i点在 t 之后的值,即
denotes the value of
ui
i
2
at the time
2
u (t 0  t , x0 )
t0  t
u i( n ) 代表i点在t时间的值,即 u (t , x0 )
u i( n ) denotes the value of u at the time
i
(u x ) ( n 11)
i
2
( n 1)
x
1
i
2
(u )
(u x ) ( n 11)
i
2
( n 1)
x
1
i
2
(u )
代表i和i+1之中点的导数 u
t0
x
denotes theat the u center between point i and i+1
x
代表i-1和i之中点的导数
denotes the u at the center between point i-1 and i
x
利用一阶差分格式得
Using first order finite difference scheme
x  (u x ) ( n11) 
i
2
x  (u x ) ( n11) 
i
2
u
t
(t 0  t , x0  )x  ui(n11)  ui( n1)
x
2
u
t
(t 0  t , x0  )x  ui( n1)  ui(n11)
x
2
代入(1-3-5)得
Substitute into(1-3-5)
u i( n 1)  u i( n )
a
( n 1)
( n 1)
( n 1)

[
u

2
u

u
i 1
i
i 1 ]
2
t
(x)
其上标n+1代表 t 0  t 时刻,n代表 t 0 时刻
The subscript (n+1) denotes the time t0  t , n denotes the time t
i-1、i、i+1代表X轴方向相邻的三点
i-1、i、i+1 denote the three neighbor points on x axis
四、有限体积方法(finite volume method)
方程推导来自微元体,求解时再回到微元体。将描述某一个区域
的方程离散到有限个微元体积内,使每个有限体积内流动满足运动方程(守恒律)
The deriver of the equations is base on finite volume ,and will back to the similar
concept, to discrete the space into the finite volumes ,and discrete the equation to
the finite volume.
例如无源热传导问题(当k=const时)
For a non-source heat conduct problem
Txx  T yy  0
  T  0
 将求解域划分成若干体积(如图)
 To discrete the flow field into serial small volume
形状相同的微小体积(如图),内网格点取在有限体积的
中心For the similar volume ,the node is located on the center
边界点则取在有限体积的边界上Boundary located on the boundary
of finite volume
将方程
 2T
应用于有限体积A上,则其表面的净热流量为0.
2
Using the equation
T
onto a finite volume ,then the heat flux on surface is zero
应用傅里叶热传导公式: According to the fourier law for heat
transfer
q  k  T
 对于k~k(T)情况,热传导方程为 For the case of variable k, the
transfer equation become    q    ( kT )  0
对其在有限体积上积分,并应用高斯定理得
Apply the gauss integration law on the finite volume
   (kT )dv   (kT  n)ds  0
v
s
对于二维问题,面积可写成,
For 2D problem ,the surface integration can be written as
(nds)E  (y )i
(nds ) w  -( y )i
(nds) N  ( x ) j
(nds ) s  -( x ) j
E: (k
T
T
T
) E y  (k
) E  0  (k
) 1 y
x
y
x i  2 , j
W: (k T ) w (  y )  (k T ) w  0  (k T ) 1 y
x
y
x i  2 , j
S: (k T ) S  0  (k T )W x  (k T )
x
N:
(k
y
y
i, j
1
2
x
T
T
T
) N  0  (k
) N x  ( k
) 1 x
x
y
y i , j  2
故有(k与T无关时)
Therefore (k=const)
k (TX )
1
I  ,J
2
y  k (T )
1
i , j
2
y  k (Ty )
1
i, j 
2
x  k (Ty )
1
i, j 
2
x  0
 T x , T y 表示为中心差分格式,并整理得:
T x , T y can be express using center finite difference scheme and then it
becomes
ky
Ti 1, j  Ti , j
x
 ky
Ti 1, j  Ti , j
x
 kx
Ti , j 1  Ti , j
y
 kx
Ti , j 1  Ti , j
y
0
Ti 1, j  2Ti , j  Ti 1, j
(x)
2

Ti , j 1  2Ti , j  Ti , j 1
(y)
2
0
 有限体积方法与Taylor级数法的差别:有限体积方法构造成
差分格式总是满足离散化的散度定理的,因此总是守恒的
The difference between the finite volume and Taylor series expansion is that finite difference
scheme construct using finite volume method always satisfies the Divergence Low this it is
constructional scheme.