李江飛,石兆東,段興華,李巖芳,張 康,逯國強,陳穎超,任亞東(承德石油高等??茖W校熱能工程系,河北承德067000)
MAC算法計算二維方腔頂蓋流動
李江飛,石兆東,段興華,李巖芳,張康,逯國強,陳穎超,任亞東
(承德石油高等??茖W校熱能工程系,河北承德067000)
二維方腔流動是不可壓縮黏性的典型流動,可以用來檢驗各種數(shù)值算法計算精度和可靠性,目前尚不能求得它的解析解.基于Matlab編程,采用交錯網(wǎng)格MAC算法求解二維方腔流動,計算采用控制容積積分法離散控制方程,對流項和擴散項采用中心差分格式,得到流動達到穩(wěn)定狀態(tài)時各物理量的分布.
數(shù)值模擬;方腔流動;控制容積積分法;MAC算法;離散
Li JF,ShiZD,Duan XH,etal.Calculation of Two-dimensionalCavity Flow Based on MAC[J].Journal of Yibin Univer?sity,2015,15(6):28-31.
二維不可壓縮黏性流體方腔流動頂蓋拖動速度為utop,方腔的長度和高度均為H,流體密度為ρ、動力粘度為 μ.邊界條件:流動速度u、v采用無滑移邊界條件,利用動量方程推導壓力p的邊界條件[1].
流動與傳熱的控制方程如下:
其中,p為壓力,u、v分別為x、y方向速度分量.用高度H、流體密度ρ和拖動速度utop作為無量綱標尺,將控制方程無量綱化,流場初始狀態(tài)為靜止,R e=1000求流動達到穩(wěn)定狀態(tài)時,x方向中垂線(x=H/2)上的無量綱速度U,y方向中垂線(y=H/2)上的無量綱速度V,繪制出速度分布曲線,并求出中垂線上||U、||V的平均值.
1.1渦量控制方程無量綱化
以高度H、流體密度ρ和速度utop作為無量綱標尺,將控制方程無量綱化[2]:
將上述無量綱量代入題中流動與傳熱的控制方程,得出如下的無量綱方程:
1.2邊界條件
邊界條件為:流動速度采用無滑移邊界條件,壁面處法向速度恒為0,切向速度也為零.頂蓋u=1,v=0;其余u=v=0.
采用均分網(wǎng)格,網(wǎng)格數(shù)80×80的交錯網(wǎng)格來離散方程,將壓力和速度放在不同位置,壓力放在網(wǎng)格中心,以Pi,j為主節(jié)點,背離P點的U、V與P點有相同的編號,速度分量U與P在X方向位置相錯半個網(wǎng)格,速度分量V與P在Y方向位置相錯半個網(wǎng)格,具體如下[3]:
P:
X方向:0—81,左邊點0,右邊點81,邊點與內點距離為,其余ΔX;Y方向:0—81,下邊點0,上邊點81,邊點與內點距離,其余ΔY;
U:
X方向:0—80,左邊點0,右邊點80,相鄰兩點距離ΔX;Y方向:0—81,下邊點0,上邊點81,邊點與內點距離,其余ΔY;
V:
對于MAC算法而言,采用交錯網(wǎng)格,用控制容積積分法離散控制方程,對流項和擴散項采用中心差分格式.時間步長為Δτ,空間步長為ΔX、ΔY.
對速度分量U進行離散[4-5]:
內點處理:
非穩(wěn)態(tài)項:
對流項:
擴散項:
壓力項:
邊界點處理:
對于上邊界點,擴散項:
對于下邊界點,擴散項:
內點離散后的動量方程為:
對速度分量V進行離散:
內點處理:
非穩(wěn)態(tài)項:
對流項:
擴散項:
壓力項:
對于左邊界點,其擴散項:
對于右邊界點,其擴散項:
離散后的動量方程為:
整理化簡可得壓力離散方程:
其中:aP=aE+aW+aN+aS,aE=aW=aN=
求解步驟如下[6-8]:
①確定網(wǎng)格信息,如空間步長、時間步長:ΔX,ΔY,Δτ;②定義變量,給速度場和壓力場賦初始值和邊界值;③經(jīng)過(1)、(2),可得完整的速度場離散結果,據(jù)公式求;④根據(jù)(3)求解壓力泊松方程,采用Gauss-Seidel迭代求解,循環(huán)直至滿足收斂條件;⑤用該時層滿足收斂條件最新的壓力場去更新速度場,得到下一時層的,;⑥用下一時層的,返回(4),直到穩(wěn)態(tài)的解,求出速度場和壓力場.程序流程如圖1所示.
圖1 求解程序框圖
圖2 方腔壓力場分布圖(N=80;R e=400;t=0.0005,0.001,0.002,0.005,0.01)
圖3 方腔中心速度分布比較圖(N=20,40,80;R e=1000)
[1]Peng Y F,Shiau Y H,Hwang R R.Transtion in a 2-D lid-driven cavity flow[J].Computer&Fluids,2003,32(3):337-352.
[2]陶文銓.數(shù)值傳熱學[M].第二版.西安:西安交通大學出版社,2010.
[3]Abdallah S.Numerical solutions for the pressure poisson equation with neumann boundary conditions using a non-staggered grid[J].Journalofcomputationalphysics,1987,70(1):182-192.
[4]Hortmann M,Peri?M,ScheuererG.Finite volumemultigrid predic?tion of laminar natural convection:Bench-mark solutions[J].Inter?national Journal for Numerical Methods in Fluids,1990,11(2):189-207.
[5]Demird?i?I,Peri?M.Finite volumemethod for prediction of fluid flow in arbitrarily shaped domainswithmoving boundaries[J].Inter?national Journal for Numerical Methods in Fluids,1990,10(7):771-790.
[6]Brandt A.Multi-level adaptive technique(MLAT)for fast numeri?cal solution to boundary value problems[C].Proceedings of the Third International Conference on NumericalMethods in Fluid Me?chanics,Springer Berlin/Heidelberg,1973:82-89.
[7]Wang J,Li JF,ChengW X,et al.Comparison of finite difference and finite volume method for numerical simulation of the incom?pressible viscous driven cavity flow[J].Advanced Materials Re?search,2013(732-733):413-416.
[8]Li JF,Long J,Yuan L A,etal.Comparison of finite difference and finite volumemethod for numerical simulation of driven cavity flow based on MAC[C].Computational and Information Sciences(IC?CIS),2013 Fifth International Conference on,Shiyang,2013:891-894.
(編校:許潔)
Calculation of Tw o-dimensionalCavity Flow Based on MAC
LIJiangfei,SHIZhaodong,DUAN Xinghua,LIYanfang,ZHANG Kang,LUGuoqiang,CHEN Yingchao,REN Yadong
(DepartmentofThermalEngineering,ChengdePetroleum College,Chengde,Hebei067000,China)
Two-dimensional square cavity flow is a typical incompressible viscous flow,which can be used to testa vari?ety ofnumericalalgorithms for computationalaccuracy and reliability,yet itsanalytical solution still cannotbe achieved.Based on Matlab programming,the staggered grid MAC algorithm was used to solve two-dimensional square cavity flow.Control volume integralmethod was used to discrete the control equations for calculation.Central difference scheme was applied for convection and diffusion terms.In the end,the flow simulation resultsofeach physicalquantity distribution in steady statewere obtained.
numericalsimulation;cavity flow;controlvolumemethod;MAC;discrete
TB126
A
1671-5365(2015)06-0028-04
2015-04-12修回:2015-04-17
李江飛(1988-),男,講師,碩士,研究方向為油氣儲運
網(wǎng)絡出版時間:2015-04-21 20:46網(wǎng)絡出版地址:http://www.cnki.net/kcms/detail/51.1630.Z.20150421.2046.001.html
引用格式:李江飛,石兆東,段興華,等.MAC算法計算二維方腔頂蓋流動[J].宜賓學院學報,2015,15(6):28-31.