復雜形狀海灘上的海嘯波爬高模擬
本案例來自微信公眾號“陸面體科技”
請點擊關注:
原作者:Stéphane Popinet
版本:110107
運行時間:50min
案例背景
本算例是海嘯模型的經典驗證算例,該算例是在“第三屆長波波浪爬高模型國際研討會”用于對比驗證的標準模型。本文中使用的海嘯模型是基于造波水池數據的提出,用于研究1993年日本奧尻島海嘯期間在藻內地區附近觀察到的極端海嘯波爬高現象。
海嘯波爬高模擬是求解非線性淺水方程組的一個具體應用,該方程組由Navier-Stokes方程組在淺水條件下推導而出,描述具有自由表面的淺水體中水流運動規律的偏微分方程組,1871年由法國科學家Adhémar Jean Claude Barré de Saint-Venant提出,故又名圣維南方程組,該方程在氣動、水力以及其他工程領域中有著廣泛的應用,可以很好地模擬出淺水波的各種特性。
我們的中國船舶科學研究中心(China Ship Scientific Research Center,又稱中國船舶重工集團公司第七〇二研究所),基于長期的研究積累,在國際上首先創立并發展完善了對數值水池的系統論證,較全面地闡述了數值水池的定義,并已開展了相關技術的研發與應用。
既然說到了淺水波,就避不開談論船舶工程這個領域。在船舶工程中,有一個很重要的研究成果—數值水池,即基于數值仿真技術的虛擬造波水池。該成果是在模型驅動、知識驅動的船舶與海洋結構物設計優化流程中,基于CFD應用技術及專家知識,依托高性能計算平臺,為船舶與海洋工程水動力學性能設計、預報、評估和優化提供高效能、高精度、高置信度的沉浸式、情景化虛擬試驗服務的應用技術系統。
言歸正傳,我們來看看法國的開源軟件Gerris創始人-- Stéphane Popinet是如何模擬復雜形狀海灘的海嘯問題的。
圖1: 藻內地區海嘯水面(淺藍色)和岸底(白色)動畫
首先來看圖1的動畫:模擬了海灘的幾何形狀以及海嘯隨時間演變的過程,水深數據和海灘幾何形狀與實驗所用的造波水池一致。實驗過程中在水面的開放邊界處施加波動(圖1右側畫面外)。在動畫中可以清楚地看到圖中央部谷地在開始時的干涸狀態和之后海嘯波爬高至極值的狀態,以及邊界處的波浪反射和由于水下渦旋而引起的水面淺凹。
圖2:該過程的另一個視圖以及用于計算流場的自適應網格。
圖2 自由表面高度(左列)和相應的自適應網格的演變(右列)。圖中給出了地形輪廓等高線,左列圖中白色區域是沒有水的,有水區域根據自由面高度(相對于未受干擾的水面)著色。用于對比驗證的實驗數據包括了在多個位置不同時間的自由面高度(見圖3,t = 18 s)。
圖3,4和5給出了各個時刻實驗和數值計算結果的比較。
圖3:在探針5的位置測量和計算的自由面高度對比
圖4:在探針7的位置測量和計算的自由面高度對比
圖5:在探針9的位置測量和計算的自由面高度對比
最后我們來看看實驗俯瞰視頻和相應的模擬分析視頻對比:
圖6: 實驗視頻(左邊)和模擬結果(右邊)之間的對比。
案例解析
看完結果,我們來看看Stéphane的代碼是否和他的結果一樣優雅漂亮美麗大方~
首先,Gerris是在Linux系統下運行的開源軟件。區別于我們熟知的OpenFoam和SU2,Gerris的案例結果后處理難以直接在傳統的后處理軟件中解決。所以Gerris的爸爸Stéphane就針對Gerris的結果處理專門寫了另外一個開源軟件– GFSview. 簡單地來說,則是用GFSview可以打開Gerris的結果文件。GFSview是一款完整的后處理軟件,用來觀察各種參數(速度、溫度等)的計算結果,也可以調整視角方向、畫面大小的顏色范圍及風格,還可以批量處理所需要的計算結果等。
接下來,我們來看看文件的調動和重要參數設置:
仿真的配置文件:
# below this depth the flow is considered
"dry"
Define DRY 1e-4
# use the GfsRiver Saint-Venant solver
# shift the origin of the reference box to (0,0)
2 1 GfsRiver GfsBox GfsGEdge
{
x = 0.5
y = 0.5
}
{
# the domain is 3.402 m X 6.804 m
# units for time are seconds
PhysicalParams
{
L = 3.402
g = 9.81
}
Refine 6
# maintain the Zb1 variable using the GTS surface
VariableFunction Zb1 bathy.gts
# the initial water level is at z = 0, so the depth P is...
Init {}
{
P = MAX(0., -Zb1)
}
# use a Sweby limiter rather than the default minmod which is too
# dissipative
AdvectionParams
{
gradient = gfs_center_sweby_gradient
}
# adapt down to 9 levels based on the slope of the
(wet)
# free-surface and with a tolerance of 1 mm
AdaptGradient
{
istep = 1
}
{
cmax = 1e-3
cfactor = 2
maxlevel = 9
minlevel = 6
}
(
P < DRY ? 0. : P + Zb
)
# at each timestep
Init
{
istep = 1
}
{
# Add a "shelf" to simulate the wall on the right-hand-side boundary
Zb =
(
x > 5.448 ? 0.13535 : Zb1
)
# read in the experimental timeseries in variable 'input'
input = input.cgd
# implicit quadratic bottom friction with coefficient 1e-3
U = (P > DRY ? U/(1. + dt*1e-3*Velocity/P) : 0.)
V = (P > DRY ? V/(1. + dt*1e-3*Velocity/P) : 0.)
P = (P > DRY ? P : 0.)
}
Time
{
end = 22.5
}
OutputTime
{
istep = 10
}
stderr
OutputTiming
{
start = end
}
stderr
OutputSimulation
{
step = 1
}
stdout
OutputSimulation
{
step = 1
}
sim-%g.gfs
EventScript
{
step = 1
}
{
gzip -f
sim-*.gfs
}
# output data at probe locations
OutputLocation
{
istep = 1
}
input 1e-3 1.7 0
OutputLocation
{
istep = 1
}
p5 4.521 1.196 0
OutputLocation
{
istep = 1
}
p7 4.521 1.696 0
OutputLocation
{
istep = 1
}
p9 4.521 2.196 0
# kinetic energy
OutputScalarSum
{
istep = 1
}
ke
{
v = (P > 0. ? Velocity2*P : 0.)
}
# free-surface elevation
OutputScalarStats
{
istep = 1
}
p
{
v = (Zb > 0. ? P : P + Zb)
}
OutputScalarNorm
{
istep = 1
}
u
{
v = Velocity
}
OutputTime
{
istep = 1
}
balance
OutputBalance
{
istep = 1
}
balance
# generate movies
GModule gfsview
OutputView
{
start = 9 step = 0.0416
}
{
ppm2mpeg -s
640x480 > monai.mpg
}
{
width = 1280
height = 960
}
3D.gfv
OutputView
{
start = 14.63
end = 19.5
step = 0.033333333
}
{
ppm2mpeg -s
400x600 > overhead.mpg
}
{
width = 800
height = 1200
}
overhead.gfv
}
{
dry = DRY
}
GfsBox
{
# use 'subcritical' boundary condition to impose the experimental
# water level on the left boundary
left = Boundary
{
BcSubcritical U
(input - Zb)
}
top = Boundary
bottom = Boundary
}
GfsBox
{
top = Boundary
bottom = Boundary
}
1 2 right
參考文獻
S. Popinet. Quadtree-adaptive tsunami modelling. Ocean Dynamics, 61(9):1261–1285, 2011
在Gfsview中根據自己的需要, 是預先調整好的后處理輸出信息,視角等,將該設置以gfv文件后綴儲存。這樣就可以通過Gfsview批量處理Gerris仿真生成的數據了。
感興趣的朋友可以在后臺跟陸陸索取更多的資料~
工程師必備
- 項目客服
- 培訓客服
- 平臺客服
TOP




















