Nghiên cứu ứng dụng mô hình toán số sph trong tính toán dòng thấm

107 30 0
Nghiên cứu ứng dụng mô hình toán số sph trong tính toán dòng thấm

Đang tải... (xem toàn văn)

Tài liệu hạn chế xem trước, để xem đầy đủ mời bạn chọn Tải xuống

Thông tin tài liệu

ðẠI HỌC QUỐC GIA TP HCM TRƯỜNG ðẠI HỌC BÁCH KHOA NGUYỄN QUANG TRƯỜNG NGHIÊN CỨU ỨNG DỤNG MÔ HÌNH TỐN SỐ SPH TRONG TÍNH TỐN DỊNG THẤM CHUN NGÀNH: XÂY DỰNG CƠNG TRÌNH THỦY LUẬN VĂN THẠC SĨ TP HỒ CHÍ MINH, tháng 07 năm 2011 CƠNG TRÌNH ðƯỢC HOÀN THÀNH TẠI TRƯỜNG ðẠI HỌC BÁCH KHOA –ðHQG -HCM Cán hướng dẫn khoa học : PGS TS HUỲNH THANH SƠN TS BÙI HỒNG HÀ Cán chấm nhận xét : PGS TS NGUYỄN THỐNG Cán chấm nhận xét : TS LƯU XUÂN LỘC Luận văn thạc sĩ ñược bảo vệ Trường ðại học Bách Khoa, ðHQG Tp HCM ngày 21 tháng 09 năm 2011 Thành phần Hội ñồng ñánh giá luận văn thạc sĩ gồm: Chủ tịch hội ñồng: PGS TS LÊ SONG GIANG Thư ký hội ñồng: TS CHÂU NGUYỄN XUÂN QUANG Ủy viên: PGS TS HUỲNH THANH SƠN Ủy viên: PGS TS NGUYỄN THỐNG Ủy viên: TS LƯU XUÂN LỘC Xác nhận Chủ tịch Hội ñồng ñánh giá LV Trưởng Khoa quản lý chuyên ngành sau luận văn ñã ñược sửa chữa (nếu có) CHỦ TỊCH HỘI ðỒNG TRƯỞNG KHOA KỸ THUẬT XÂY DỰNG ðẠI HỌC QUỐC GIA TP.HCM TRƯỜNG ðẠI HỌC BÁCH KHOA CỘNG HÒA Xà HỘI CHỦ NGHĨA VIỆT NAM ðộc lập - Tự - Hạnh phúc NHIỆM VỤ LUẬN VĂN THẠC SĨ Họ tên học viên: NGUYỄN QUANG TRƯỜNG MSHV: 02008538 Ngày, tháng, năm sinh: 22/02/1985 Nơi sinh: ðồng Nai Chun ngành: XÂY DỰNG CƠNG TRÌNH THỦY Mã số : 60.58.40 I TÊN ðỀ TÀI: NGHIÊN CỨU ỨNG DỤNG MƠ HÌNH TỐN SỐ SPH TRONG TÍNH TỐN DỊNG THẤM II NHIỆM VỤ VÀ NỘI DUNG: - Chương 1: Tổng quan - Chương 2: Cơ sở lý thuyết phương pháp SPH - Chương 3: Bộ chương trình mã nguồn mở SPH - Chương 4: Ứng dụng mơ hình tốn số SPH cho tốn đơn giản - Kết luận kiến nghị III NGÀY GIAO NHIỆM VỤ: IV NGÀY HOÀN THÀNH NHIỆM VỤ: V CÁN BỘ HƯỚNG DẪN: PGS TS HUỲNH THANH SƠN TS BÙI HỒNG HÀ Nội dung ñề cương Luận văn thạc sĩ ñã ñược Hội ðồng Chuyên Ngành thông qua Tp HCM, ngày 22 tháng 09 năm 2011 CÁN BỘ HƯỚNG DẪN PGS TS HUỲNH THANH SƠN CHỦ NHIỆM BỘ MÔN ðÀO TẠO PGS TS HUỲNH THANH SƠN TS BÙI HỒNG HÀ TRƯỞNG KHOA KỸ THUẬT XÂY DỰNG LỜI CẢM ƠN ðầu tiên xin bày tỏ lịng biết ơn sâu sắc đến thầy Huỳnh Thanh Sơn anh Bùi Hồng Hà, người hướng dẫn, giúp đỡ tơi tận tình bước ñầu nghiên cứu khoa học ñã truyền đạt kiến thức q báu để tơi hồn thành luận văn Tôi xin cảm ơn thầy cô Bộ môn Kỹ thuật Tài nguyên nước; lời cảm ơn chân thành đến thầy kiến thức khoa học quý báu lẽ sống mà tơi học suốt thời gian học tập công tác trường Xin gửi lời cám ơn đến thầy hội đồng chấm luận văn quan tâm theo dõi góp ý cho ñề tài luận văn thạc sĩ ðặc biệt, xin cám ơn gia đình, nguồn động viên lớn tơi, hỗ trợ tơi nhiều vật chất tinh thần để tơi hồn thành luận văn Cảm ơn tất anh chị lớp cao học Xây dựng cơng trình thủy bạn bè ủng hộ suốt thời gian học tập thực luận văn Tp.HCM, tháng 07 năm 2011 Nguyễn Quang Trường Tóm tắt Luận văn trình bày mơ hình tốn số Thủy động lực hạt trơn (Smoothed Particle Hydrodynamics, SPH) ứng dụng SPH vào số tốn đơn giản Tác giả dựa sở mã nguồn mở SPH tốn vỡ đập để mơ lại diễn biến dịng thấm thân đập đất Trong q trình tính tốn, khối nước trước đập mơ chất lưu nén ñược có ñộ nhớt nhân tạo ñập ñất ñược tạo thành từ mơ hình hạt đất cứng khơng biến dạng Dịng thấm thân đập mơ dựa kết tính tốn tương tác hạt nước hạt đất Kết mơ cho thấy tính khả thi hiệu áp dụng mơ hình tốn số SPH vào tốn dịng thấm ðây sở ñể tác giả tiếp tục nghiên cứu sâu ứng dụng mơ hình SPH Abstract A numerical simulation method, smoothed particle hydrodynamics (SPH), and its application in several simple problems are presented in this thesis The progressive development of seepage flow through a earth dam is simulated that based on the breaking_dam SPH code In this calculation, the upper water volume is modeled as a weakly compressible fluid with artificial viscosity and the dam is simulated as an undeformed hard-soil model The seepage flow through the dam is emulated from modeling result of soil-water interaction Numerical results obtained in this thesis have shown the feasibility and the efficiency of SPH in seepage problems This is the fundamentality for the author to continue studying in SPH application MỤC LỤC Chương Tổng quan 1.1 ðặt vấn ñề 1.2 Mục đích nghiên cứu 1.3 Tình hình nghiên cứu ngồi nước 1.4 Phương pháp nghiên cứu luận văn Chương Cơ sở lý thuyết phương pháp SPH (PP SPH) 2.1 Khái niệm phương pháp SPH 2.1.1 Biểu diễn tích phân hàm số phép nội suy Kernel 2.1.2 Biểu diễn ñạo hàm hàm số phép nội suy Kernel 2.1.3 Xấp xỉ hạt 10 2.1.4 Miền ảnh hưởng 13 2.1.5 Cấu trúc hàm trơn 14 2.2 Các dạng hàm trơn sử dụng cho PP SPH 16 2.3 Mơ hình SPH cho tốn thủy động học 20 2.3.1 Hệ phương trình Navier-Stokers theo quan điểm Lagrange 20 2.3.2 Công thức SPH cho hệ phương trình Navier-Stokes 21 2.3.2.1 Phép xấp xỉ hạt cho khối lượng riêng 21 2.3.2.2 Phép xấp xỉ hạt cho ñộng lượng 22 2.3.2.3 Phép xấp xỉ hạt cho lượng 23 2.3.3 Phương diện số SPH cho toán thủy ñộng học 24 2.3.3.1 ðộ nhớt nhân tạo 24 2.3.3.2 Chiều dài làm trơn 25 2.3.3.3 Sự ñối xứng hóa tương tác hạt 25 2.3.3.4 Khả chịu nén nhân tạo 26 2.3.3.5 Hiệu chỉnh biên 27 -i- 2.3.3.6 Bước thời gian tính toán 30 2.3.4 Sự tương tác hạt 31 2.3.4.1 Phương pháp tìm kiếm hạt gần 31 2.3.4.2 Sự tương tác đơi 32 Chương Bộ chương trình mã nguồn mở SPH 34 3.1 Bộ chương trình mã nguồn mở SPH 34 3.2 Bộ mã nguồn 3D SPH tính toán hệ PT Navier-Stokes 37 3.2.1 Các ñặc ñiểm mã nguồn 3D SPH 37 3.2.2 Mô tả tổng thể mã nguồn 3D SPH 37 3.2.2.1 Cấu trúc mã nguồn 37 3.2.2.2 Mô tả mã nguồn chương trình 39 3.2.2.3 Các biến yếu mã nguồn 40 Chương Ứng dụng mơ hình tốn số SPH cho tốn đơn giản 43 4.1 Bài tốn 1: Ứng dụng PP SPH cho tượng sụp ñổ khối nước bể chứa (bài toán 2D) 43 4.1.1 ðiều kiện ban đầu cho mơ hình cột nước 43 4.1.2 Biên cứng 45 4.1.3 Lựa chọn hàm trơn W 47 4.1.4 Mô hình SPH cho pha nước 49 4.1.5 Bước thời gian tính tốn 50 4.1.6 Kết tính tốn 51 4.1.7 Kết mơ q trình sụp đổ khối nước theo thời gian 53 4.2 Bài toán 2: Tiếp tục phát triển tốn trường hợp phía sau khối nước ñập chắn 58 4.2.1 Mơ tốn 58 4.2.2 Mơ hình SPH cho pha nước có tương tác với mơ hình ñập 63 4.2.3 Kết mô 66 - ii - 4.3 Bài tốn 3: Xét tốn dịng thấm qua mơ hình đập đất trường hợp giữ cho mực nước trước đập khơng đổi 71 Kết luận kiến nghị 79 Tài liệu tham khảo 82 Phụ lục 83 - iii - DANH MỤC HÌNH VẼ Hình 2.1 Miền Ω Hình 2.2 Phép xấp xỉ hạt sử dụng hạt miền ảnh hưởng hàm trơn W ñối với hạt i Miền ảnh hưởng vịng trịn bán kính kh 10 Hình 2.3 Miền ảnh hưởng nút 1,2,3 xấp xỉ biến x 13 Hình 2.4 Hàm Gaussian kernel ñạo hàm bậc 16 Hình 2.5 Hàm Cubic Spline kernel đạo hàm bậc 17 Hình 2.6 Hàm Quadratic kernel ñạo hàm bậc 18 Hình 2.7 Hàm Quintic kernel đạo hàm bậc 19 Hình 2.8 Minh họa hạt thực loại hạt ảo I, II 28 Hình 2.9 PP tìm tất cặp tương tác khơng gian chiều 32 Hình 3.1 Cấu trúc ñiển hình mã nguồn SPH 36 Hình 3.2 Mối quan hệ tập tin nguồn mã chương trình 38 Hình 4.1 Thơng số ban đầu cột nước bể chứa 43 Hình 4.2 Mơ hình loại hạt thời điểm ban đầu 47 Hình 4.3 Sự phân bố hạt nước theo thời gian 53 Hình 4.3 Sự phân bố hạt nước theo thời gian (Tiếp theo) 54 Hình 4.3 Sự phân bố hạt nước theo thời gian (Tiếp theo) 55 Hình 4.3 Sự phân bố hạt nước theo thời gian (Tiếp theo) 56 Hình 4.4 Thơng số ban ñầu cột nước, ñập bể chứa 58 Hình 4.5 Mơ hình loại hạt thời ñiểm ban ñầu 62 Hình 4.6 Sự phân bố hạt nước theo thời gian 66 Hình 4.6 Sự phân bố hạt nước theo thời gian (Tiếp theo) 67 Hình 4.6 Sự phân bố hạt nước theo thời gian (Tiếp theo) 68 Hình 4.6 Sự phân bố hạt nước theo thời gian (Tiếp theo) 69 Hình 4.7 Sự phân bố hạt nước theo thời gian-Trường hợp mực nước trước ñập không ñổi 73 - iv - Hình 4.7 Sự phân bố hạt nước theo thời gian-Trường hợp mực nước trước đập khơng đổi (Tiếp theo) 74 Hình 4.7 Sự phân bố hạt nước theo thời gian-Trường hợp mực nước trước đập khơng đổi (Tiếp theo) 75 Hình 4.8 Kết đường bão hịa thân đập theo giải tích 78 Hình 4.9 So sánh kết tính tốn theo SPH giải tích 78 -v- TÀI LIỆU THAM KHẢO [1] Liu GR and Liu MB (2003), Smoothed Particle Hydrodynamics a meshfree particle method, World Scientific Publishing Co Pte Ltd [2] Monaghan JJ (2001), Smoothed Particle Hydrodynamics Code Basics, Journal of The Korean Astronomical Society; 34: S203 ∼ S207, 2001 [3] Swegle JW, Hicks DL and Attaway SW, Smoothed Particle Hydrodynamics Stability Analysis, Journal of Computational Physics; 116, 123-134 (1995) [4] Ha H Bui, K Sako, R Fukagawa and J C Wells, SPH-Based Numeriacl Simualtions for Large Deformation of geomaterial Considering Soil-Structure Interaction, International Association for Computer Methods and Advances in Geomechanics; 1-6 October, 2008 [5] Ha H Bui, K Sako, R Fukagawa, Numerical simulation of soil-water interaction using Smoothed Particle Hydrodynamics (SPH) method, Journal of Terramechanics, 2007; 44(5): 339-346 [6] Huỳnh Thanh Sơn (2008), Bài giảng môn học: ðộng lực học sông - biển, ðại học Bách Khoa Tp.HCM - 82 - PHỤ LỤC Mã lập trình cho mơ hình tốn số SPH với ngơn ngữ Fortran Param.inc c c Including file for parameters and constants used c in the entire SPH software packages c c dim : Dimension of the problem (1, or 3) integer dim parameter ( dim = 2) c maxn : Maximum number of particles c max_interation : Maximum number of interaction pairs integer maxn,max_interaction parameter ( maxn = 20000 , & max_interaction = 100 * maxn ) c SPH algorithm for particle approximation (pa_sph) c pa_sph = : (e.g (p(i)+p(j))/(rho(i)*rho(j)) c : (e.g (p(i)/rho(i)**2+p(j)/rho(j)**2) integer pa_sph parameter(pa_sph c Nearest neighbor particle searching (nnps) method c nnps = : Simplest and direct searching integer nnps parameter(nnps = 1) c Smoothing length evolution (sle) algorithm c sle = : Keep unchanged, c : h = fac * (m/rho)^(1/dim) c : dh/dt = (-1/dim)*(h/rho)*(drho/dt) c : Other approaches (e.g h = h_0 * (rho_0/rho)**(1/dim) ) integer sle parameter(sle = 0) c Smoothing kernel function c skf = 1, cubic spline kernel by W4 - Spline (Monaghan 1985) c = 2, Gauss kernel (Gingold and Monaghan 1981) c = 3, Quintic kernel (Morris 1997) integer skf parameter(skf = 1) c Switches for different senarios c summation_density = TRUE : Use density summation model in the code, c FALSE.: Use continuity equation c average_velocity = TRUE : Monaghan treatment on average velocity, c FALSE.: No average treatment c config_input = TRUE : Load initial configuration data, c FALSE.: Generate initial configuration c virtual_part = TRUE : Use virtual particle, c FALSE.: No use of virtual particle c vp_input = TRUE : Load virtual particle information, c FALSE.: Generate virtual particle information c visc = true : Consider viscosity, c false.: No viscosity c ex_force =.true : Consider external force, c false.: No external force c visc_artificial = true : Consider artificial viscosity, c false.: No considering of artificial viscosity c self_gravity = true : Considering self_gravity, c false.: No considering of self_gravity c nor_density = true : Density normalization by using CSPM, c false.: No normalization logical summation_density, average_velocity, config_input, & virtual_part, vp_input, visc, ex_force, heat_artificial, & visc_artificial, self_gravity, nor_density parameter ( summation_density = false ) parameter ( average_velocity = true ) parameter ( config_input = false ) parameter ( virtual_part = true ) parameter ( vp_input = false ) parameter ( visc = true ) parameter ( ex_force = true.) parameter ( visc_artificial = true ) parameter ( self_gravity = true ) parameter ( nor_density = true ) c Symmetry of the problem c nsym = : no symmetry, c = : axis symmetry, c = : center symmetry integer nsym parameter ( nsym = 0) c Control parameters for output c int_stat = true : Print statistics about SPH particle interactions c including virtual particle information c print_step: Print Timestep (On Screen) c save_step : Save Timestep (To Disk File) - 83 - c moni_particle: The particle number for information monitoring logical int_stat parameter ( int_stat = true ) integer print_step, save_step, moni_particle parameter ( print_step = 1000, & save_step = 1000, & moni_particle = 1600 ) double precision pi parameter ( pi = 3.14159265358979323846 ) c Simulation cases c burstingdam = true : carry out shear cavity simulation c virtypeone = true : carry out Monaghan type of virtual boundary c virtypetwo = true : carry out Libersky type of ghost boundary logical burstingdam, virtypeone, virtypetwo parameter ( burstingdam = true ) parameter ( virtypeone = true ) parameter ( virtypetwo = true ) vr = 0.e0 Art_visc.f Subroutine art_visc(ntotal,hsml,itype,mass,x,vx, rr = 0.e0 & rho, niac,c,pair_i,pair_j,w,dwdx,dvxdt,dedt) d=1,dim implicit none dvx(d) = vx(d,i) - vx(d,j) include 'param.inc' dx = x(d,i) - x(d,j) integer ntotal, niac, pair_i(max_interaction), vr = vr + dvx(d)*dx & pair_j(max_interaction), itype(maxn) rr = rr + dx*dx double precision hsml(maxn), mass(maxn), enddo x(dim,maxn),vx(dim,maxn), c Artificial viscous force only if v_ij * r_ij < & rho(maxn), c(maxn), w(max_interaction), if (vr.lt.0.e0) then & dwdx(dim,max_interaction), muv = mhsml*vr/(rr + mhsml*mhsml*etq*etq) dvxdt(dim,maxn), dedt(maxn) mc = 0.5e0*(c(i) + c(j)) integer i,j,k,d mrho = 0.5e0*(rho(i) + rho(j)) double precision dx, dvx(dim), alpha, beta, etq, piv = (beta*muv - alpha*mc)*muv/mrho piv, c Calculate SPH sum for artificial viscous force & muv, vr, rr, h, mc, mrho, mhsml d=1,dim parameter( alpha=0.01e0, beta=0.e0, etq = 0.1e0 ) h = - piv*dwdx(d,k) c vr = v_ij * r_ij; v_ij = vi - vj; r_ij = xi - xj dvxdt(d,i) = dvxdt(d,i) + mass(j)*h i=1,ntotal dvxdt(d,j) = dvxdt(d,j) - mass(i)*h d=1,dim dedt(i) = dedt(i) - mass(j)*dvx(d)*h dvxdt(d,i) = 0.e0 dedt(j) = dedt(j) - mass(i)*dvx(d)*h enddo enddo dedt(i) = 0.e0 endif enddo endif k=1,niac enddo i = pair_i(k) i=1,ntotal j = pair_j(k) dedt(i) = 0.5e0*dedt(i) if (itype(i).eq.2.and.itype(j).eq.2) then enddo mhsml= (hsml(i)+hsml(j))/2 end epsilon = 0.01 Av_vel.f subroutine av_vel(ntotal,mass,niac,pair_i, & i = 1, ntotal pair_j, itype, w, vx, rho, av) d = 1, dim implicit none av(d,i) = include 'param.inc' enddo integer ntotal, niac, pair_i(max_interaction), enddo & pair_j(max_interaction), itype(maxn) k=1,niac double precision mass(maxn), i = pair_i(k) & w(max_interaction) j = pair_j(k) & vx(dim,maxn), rho(maxn), av(dim, maxn) if (itype(i).eq.2.and.itype(j).eq.2) then integer i,j,k,d d=1,dim double precision vcc, dvx(dim), epsilon dvx(d) = vx(d,i) - vx(d,j) - 84 - av(d, i) = av(d,i) i = 1, ntotal 2*mass(j)*dvx(d)/(rho(i)+rho(j))*w(k) d = 1, dim av(d, j) = av(d,j) + av(d,i) = epsilon * av(d,i) 2*mass(i)*dvx(d)/(rho(i)+rho(j))*w(k) enddo enddo enddo endif end enddo -enddo Density.f subroutine sum_density(ntotal,hsml,mass, c Thirdly, calculate the normalized rho, & niac,pair_i,pair_j,w,itype,rho) rho=sum(rho)/sum(w) implicit none if (nor_density) then include 'param.inc' i=1, ntotal integer i, j, k, d, ntotal, niac, rho(i)=rho(i)/wi(i) & pair_i(max_interaction), enddo & pair_j(max_interaction),itype(maxn) endif double precision hsml(maxn),mass(maxn), end w(max_interaction), c & rho(maxn), selfdens, hv(dim), r, wi(maxn) subroutine con_density(ntotal,mass,niac,pair_i, c wi(maxn) integration'of the kernel itself & pair_j,dwdx, vx, itype, x, rho, drhodt) d=1,dim c drhodt : Density change rate of each particle hv(d) = 0.e0 implicit none enddo include 'param.inc' c Self density of each particle: Wii (Kernel for integer distance 0) i,j,k,d,ntotal,niac,pair_i(max_interaction), c and take contribution of particle itself: & pair_j(max_interaction), itype(maxn) r=0.e0 double precision mass(maxn), dwdx(dim, c Firstly calculate the integration of the kernel max_interaction), over the space & vx(dim,maxn), x(dim,maxn), rho(maxn), i=1,ntotal drhodt(maxn) call kernel(r,hv,hsml(i),selfdens,hv) double precision vcc, dvx(dim) wi(i)=selfdens*mass(i)/rho(i) i = 1, ntotal enddo drhodt(i) = k=1,niac enddo i = pair_i(k) k=1,niac j = pair_j(k) i = pair_i(k) wi(i) = wi(i) + mass(j)/rho(j)*w(k) j = pair_j(k) wi(j) = wi(j) + mass(i)/rho(i)*w(k) if (itype(i).eq.2.and.itype(j).eq.2) then enddo d=1,dim c Secondly calculate the rho integration over the dvx(d) = vx(d,i) - vx(d,j) space enddo i=1,ntotal vcc = dvx(1)*dwdx(1,k) call kernel(r,hv,hsml(i),selfdens,hv) d=2,dim rho(i) = selfdens*mass(i) vcc = vcc + dvx(d)*dwdx(d,k) enddo enddo c Calculate SPH sum for rho: drhodt(i) = drhodt(i) + mass(j)*vcc k=1,niac drhodt(j) = drhodt(j) + mass(i)*vcc i = pair_i(k) endif j = pair_j(k) enddo rho(i) = rho(i) + mass(j)*w(k) end rho(j) = rho(j) + mass(i)*w(k) -& pair_j,w,dwdx,countiac) Direct_find.f subroutine direct_find(itimestep, implicit none ntotal,hsml,x,niac,pair_i, include 'param.inc' - 85 - integer itimestep, ntotal,niac,pair_i(max_interaction), & pair_j(max_interaction), countiac(maxn) double precision hsml(maxn), x(dim,maxn), w(max_interaction), & dwdx(dim,max_interaction) integer i, j, d, sumiac, maxiac, miniac, noiac, & maxp, minp, scale_k double precision dxiac(dim), driac, r, mhsml, tdwdx(dim) enddo else print *, & ' >>> ERROR Statistics: interactions per particle:' print *,'**** Particle:',maxp, ' maximal interactions:',maxiac print *,'**** Particle:',minp, ' minimal interactions:',miniac print *,'**** Average :',real(sumiac)/real(ntotal) print *,'**** Total pairs : ',niac print *,'**** Particles with no interactions:',noiac endif endif end if (skf.eq.1) then scale_k = else if (skf.eq.2) then scale_k = else if (skf.eq.3) then scale_k = endif i=1,ntotal countiac(i) = enddo niac = i=1,ntotal-1 j = i+1, ntotal dxiac(1) = x(1,i) - x(1,j) driac = dxiac(1)*dxiac(1) d=2,dim dxiac(d) = x(d,i) - x(d,j) driac = driac + dxiac(d)*dxiac(d) enddo mhsml = (hsml(i)+hsml(j))/2 if (sqrt(driac).lt.scale_k*mhsml) then if (niac.lt.max_interaction) then niac = niac + pair_i(niac) = i pair_j(niac) = j r = sqrt(driac) countiac(i) = countiac(i) + countiac(j) = countiac(j) + call kernel(r,dxiac,mhsml,w(niac),tdwdx) d=1,dim dwdx(d,niac) = tdwdx(d) rho0 = 1000.e0 Eos.f subroutine p_art_water(rho, p, c) Hmax = 2.5 implicit none b = 800.e0*9.81e0*Hmax*rho/gamma double precision rho, u, p, c, b, Hmax p = b*((rho/rho0)**gamma-1) double precision gamma, rho0 c = 20.e0*SQRT(2.e0*9.81e0*Hmax) end gamma = 7.e0 integer ntotal, itype(maxn), niac, External_force.f subroutine ext_force(ntotal,mass,x,niac,pair_i,pair_j, & pair_i(max_interaction), & itype,hsml,vx,dvxdt) pair_j(max_interaction) implicit none double precision mass(maxn), x(dim,maxn), include 'param.inc' hsml(maxn), - 86 - & dvxdt(dim,maxn), vx(dim,maxn), dx(d) = x(d,i) - x(d,j) rho(maxn) rr = rr + dx(d)*dx(d) integer i, j, k, d enddo double precision dx(dim), rr, f, rr0, dd, p1, p2, rr = sqrt(rr) Hmax, np, kp, if(rr.lt.rr0) then & p,u,c f = ((rr0/rr)**p1-(rr0/rr)**p2)/rr**2 i = 1, ntotal d = 1, dim d = 1, dim dvxdt(d, i) = dvxdt(d, i) + dd*dx(d)*f dvxdt(d, i) = enddo enddo endif enddo endif c Consider self-gravity enddo i = 1, ntotal c - Seepage force if ((self_gravity).and.(itype(i).eq.2))then c - np: the porosity dvxdt(2, i) = -9.81 c - kp: the soil permeability endif np = 0.6 enddo kp = 0.01 c Boundary particle force and penalty antido i=1, ntotal penetration force if(itype(i).eq.2) then rr0 = 0.05 if ((x(1,i).gt.2.5).and.(x(1,i).lt.4.5)) then Hmax = 2.5 d = 1, dim dd = 5.*9.81*Hmax p1 = dvxdt(d,i) = dvxdt(d,i) p2 = 9.81*np*vx(d,i)/kp k=1,niac enddo i = pair_i(k) endif j = pair_j(k) endif if(itype(i).gt.0.and.itype(j).eq.-1) then enddo rr = end d=1,dim -Hsml.f subroutine h_upgrade(dt,ntotal, mass, vx, rho, niac, & pair_i, pair_j, dwdx, hsml) implicit none include 'param.inc' integer ntotal, niac, pair_i(max_interaction), & pair_j(max_interaction) double precision mass(maxn), vx(dim, maxn), rho(maxn), & dwdx(dim, max_interaction), hsml(maxn) integer i,j,k,d double precision dt, fac, dvx(dim), hvcc, vcc(maxn), dhsml(maxn) if (sle.eq.0 ) then c - Keep smoothing length unchanged return mp = 500 ! number of particles in x Inlet_water.f subroutine inlet_water(x,vx,mass,rho,p,itype,hsml, np = 500 ! number of particles in y ntotal) xl = 2.5 ! maximum extend of fluid implicit none intending to create include 'param.inc' yl = 2.5 ! maximum high of water level integer itype(maxn),ntotal,i,j,k,d,mp,np dx = 0.05 ! seperation of particle in x real x(dim,maxn),vx(dim,maxn),mass(maxn), dy = 0.05 ! seperation of particle in y p(maxn), rho(maxn), irho = 1000.0 ! initial density of real particle & hsml(maxn),irho,xl,yl,xi,yi,dx,dy,ymax ymax = 0.0 - 87 - i = 1, ntotal if ((itype(i).eq.2).and.(x(1,i).lt.xl)) then if (x(2,i).gt.ymax) ymax = x(2,i) endif enddo if (ymax.ge.yl) return x(2, ntotal) = yi vx(1, ntotal) = 0.0 vx(2, ntotal) = 0.0 itype(ntotal) = rho(ntotal) = irho mass(ntotal)= dx*dy*rho(ntotal) p(ntotal) = 0.0 hsml(ntotal) = 1.2*dx endif enddo enddo i = 1, mp j = 1, !create one layer only xi = i*dx - dx/2.0 yi = j*dy + ymax if (xi.le.xl) then ntotal = ntotal + end x(1, ntotal) = xi write(1,1001) i, (x(d, i),d = 1, dim), (vx(d, i),d = 1, dim) Input.f subroutine input(x, vx, mass, rho, p, u, itype, write(2,1002) i, mass(i), rho(i), p(i), u(i) hsml, ntotal, write(3,1003) i, itype(i), hsml(i) & ndam, nwater) enddo implicit none 1001 format(1x, I5, 6(2x, e14.8)) include 'param.inc' 1002 format(1x, I5, 7(2x, e14.8)) integer itype(maxn), ntotal, ndam, nwater 1003 format(1x, I5, 2x, I2, 2x, e14.8) double precision x(dim, maxn), vx(dim, maxn), call dam_part(x, vx, mass, rho, p, u, mass(maxn), & itype, hsml, ndam, nwater) & p(maxn), u(maxn), hsml(maxn), i = nwater + 1, nwater + ndam rho(maxn) write(4,1004) i, (x(d, i),d = 1, dim), (vx(d, i),d integer i, d, im = 1, dim) if(config_input) then write(5,1005) i, mass(i), rho(i), p(i), u(i) open(1,file="input_data/f_xv.dat") write(6,1006) i, itype(i), hsml(i) open(2,file="input_data/f_state.dat") enddo open(3,file="input_data/f_other.dat") 1004 format(1x, I5, 6(2x, e14.8)) write(*,*)' ********************************' 1005 format(1x, I5, 7(2x, e14.8)) write(*,*)' Loading initial particle configuration ' 1006 format(1x, I5, 2x, I2, 2x, e14.8) read (1,*) ntotal write(*,*)' Total number of particles ', endif ntotal write(*,*)' ********************************' ntotal = ndam + nwater write(*,*)' ********************************' i = 1, ntotal write(*,*)' Initial particle configuration read(1,*)im, (x(d, i),d = 1, dim), (vx(d, i),d = generated ' 1, dim) write(*,*)' Total number of particles ', read(2,*)im, mass(i), rho(i), p(i), u(i) ntotal read(3,*)im, itype(i), hsml(i) close(1) enddo close(2) else close(3) open(1,file="output_data/ini_xv.dat") close(4) open(2,file="output_data/ini_state.dat") close(5) open(3,file="output_data/ini_other.dat") close(6) open(4,file="output_data/xv_dam.dat") end open(5,file="output_data/state_dam.dat") open(6,file="output_data/other_dam.dat") subroutine bursting_dam(x,vx,mass,rho,p,u, call bursting_dam(x, vx, mass, rho, p, u, itype,hsml,nwater) & itype, hsml, nwater) implicit none i = 1, nwater include 'param.inc' integer itype(maxn), nwater - 88 - double precision x(dim, maxn), vx(dim, maxn), mass(maxn), & rho(maxn), p(maxn), u(maxn), hsml(maxn) integer i, j, d, mp, np, k double precision xl, yl, dx, dy, B c itype types of particles [out] =2 water mp = 50 np = 50 nwater = mp * np xl = 2.5 yl = 2.5 dx = xl/mp dy = yl/np B = 800.*9.81*1000.*yl/7.e0 i = 1, mp j = 1, np k = j + (i-1)*np x(1, k) = (i-1)*dx + dx/2 x(2, k) = (j-1)*dy + dy/2 enddo enddo i = 1, mp*np vx(1, i) = vx(2, i) = rho(i) = 1000.*(1 + 1000.*9.81*(yl x(2,i))/B)**(1./7.) mass(i) = dx*dy*rho(i) p(i) = 9.81*rho(i)*(yl-x(2,i)) u(i) = 357.1 itype(i) = hsml(i) = 1.2*dx enddo end implicit none include 'param.inc' integer itype(maxn), ndam, nwater double precision x(dim, maxn), vx(dim, maxn), mass(maxn), & rho(maxn), p(maxn), u(maxn), hsml(maxn) integer i, j, d, mdp, ndp, k double precision xl, yl, dx, dy c itype types of particles [out] =1 dam mdp = 40 ndp = 60 ndam = mdp * ndp xl = 2.0 yl = 3.0 dx = xl/mdp dy = yl/ndp i = 1, mdp j = 1, ndp k = nwater + j + (i-1)*ndp x(1, k) = 2.5 + (i-1)*dx + dx/2 x(2, k) = (j-1)*dy + dy/2 enddo enddo i = 1, ndam vx(1, nwater + i) = vx(2, nwater + i) = rho(nwater + i) = 1000 mass(nwater + i) = dx*dy*rho(i) p(nwater + i) = u(nwater + i) = 357.1 itype(nwater + i) = hsml(nwater + i) = 1.2*dx enddo end subroutine dam_part(x,vx,mass,rho,p,u,itype,hsml, ndam, nwater) & vcc(maxn), hxx, hyy, hxy, h, hvcc, he, Internal_force.f subroutine int_force(itimestep,dt,ntotal,hsml,mass, rhoij vx,niac,rho, eta,pair_i,pair_j, & dwdx,u,itype,x,t,c,p,dvxdt,tdsdt,dedt) c Initialization of shear tensor, velocity implicit none divergence include 'param.inc' c viscous energy, internal energy, acceleration integer itimestep, i=1,ntotal ntotal,niac,pair_i(max_interaction), txx(i) = 0.e0 & pair_j(max_interaction), itype(maxn) tyy(i) = 0.e0 double precision dt, hsml(maxn), mass(maxn), txy(i) = 0.e0 vx(dim,maxn), vcc(i) = 0.e0 & rho(maxn), eta(maxn), tdsdt(i) = 0.e0 dwdx(dim,max_interaction), u(maxn), dedt(i) = 0.e0 & x(dim,maxn), t(maxn), c(maxn), p(maxn), d=1,dim dvxdt(dim,maxn), dvxdt(d,i) = 0.e0 & tdsdt(maxn),dedt(maxn) enddo integer i, j, k, d enddo double precision dvx(dim), txx(maxn), c Calculate SPH sum for shear tensor Tab = va,b tyy(maxn), txy(maxn), + vb,a - 2/3 delta_ab vc, c - 89 - if (visc) then k=1,niac i = pair_i(k) j = pair_j(k) if (itype(i).eq.2.and.itype(j).eq.2) then d=1,dim dvx(d) = vx(d,j) - vx(d,i) enddo hxx = 2.e0*dvx(1)*dwdx(1,k) dvx(2)*dwdx(2,k) hxy = dvx(1)*dwdx(2,k) + dvx(2)*dwdx(1,k) hyy = 2.e0*dvx(2)*dwdx(2,k) dvx(1)*dwdx(1,k) hxx = 2.e0/3.e0*hxx hyy = 2.e0/3.e0*hyy txx(i) = txx(i) + mass(j)*hxx/rho(j) txx(j) = txx(j) + mass(i)*hxx/rho(i) txy(i) = txy(i) + mass(j)*hxy/rho(j) txy(j) = txy(j) + mass(i)*hxy/rho(i) tyy(i) = tyy(i) + mass(j)*hyy/rho(j) tyy(j) = tyy(j) + mass(i)*hyy/rho(i) d=1,dim Pressure part h = -(p(i) + p(j))*dwdx(d,k) he = he + (vx(d,j) - vx(d,i))*h c Viscous force if (visc) then if (d.eq.1) then c x-coordinate of acceleration h = h + (eta(i)*txx(i) + eta(j)*txx(j))*dwdx(1,k) if (dim.ge.2) then h = h + (eta(i)*txy(i) + eta(j)*txy(j))*dwdx(2,k) endif elseif (d.eq.2) then c y-coordinate of acceleration h = h + (eta(i)*txy(i) + eta(j)*txy(j))*dwdx(1,k) & + (eta(i)*tyy(i) + eta(j)*tyy(j))*dwdx(2,k) endif endif h = h*rhoij dvxdt(d,i) = dvxdt(d,i) + mass(j)*h dvxdt(d,j) = dvxdt(d,j) - mass(i)*h enddo he = he*rhoij dedt(i) = dedt(i) + mass(j)*he dedt(j) = dedt(j) + mass(i)*he c For SPH algorithm else if (pa_sph.eq.2) then c Pressure part d=1,dim h = -(p(i)/rho(i)**2 + p(j)/rho(j)**2)*dwdx(d,k) he = he + (vx(d,j) - vx(d,i))*h c Viscous force if (visc) then if (d.eq.1) then c x-coordinate of acceleration h = h + (eta(i)*txx(i)/rho(i)**2 + & eta(j)*txx(j)/rho(j)**2)*dwdx(1,k) if (dim.ge.2) then h = h + (eta(i)*txy(i)/rho(i)**2 + & eta(j)*txy(j)/rho(j)**2)*dwdx(2,k) endif elseif (d.eq.2) then c y-coordinate of acceleration h = h + (eta(i)*txy(i)/rho(i)**2 & + eta(j)*txy(j)/rho(j)**2)*dwdx(1,k) & + (eta(i)*tyy(i)/rho(i)**2 & + eta(j)*tyy(j)/rho(j)**2)*dwdx(2,k) endif endif dvxdt(d,i) = dvxdt(d,i) + mass(j)*h dvxdt(d,j) = dvxdt(d,j) - mass(i)*h c c Calculate SPH sum for vc,c = dvx/dx + dvy/dy + dvz/dz: hvcc = 0.e0 d=1,dim hvcc = hvcc + dvx(d)*dwdx(d,k) enddo vcc(i) = vcc(i) + mass(j)*hvcc/rho(j) vcc(j) = vcc(j) + mass(i)*hvcc/rho(i) endif enddo endif i=1,ntotal c Viscous entropy Tds/dt - 1/2 eta/rho Tab Tab if (visc) then tdsdt(i) = txx(i)*txx(i) + 2.e0*txy(i)*txy(i) & + tyy(i)*tyy(i) tdsdt(i) = 0.5e0*eta(i)/rho(i)*tdsdt(i) endif c Pressure from equation of state call p_art_water(rho(i), p(i), c(i)) enddo c Calculate SPH sum for pressure force -p,a/rho c and viscous force (eta Tab),b/rho c and the internal energy change de/dt due to p/rho vc,c k=1,niac i = pair_i(k) j = pair_j(k) he = 0.e0 if (itype(i).eq.2.and.itype(j).eq.2) then c For SPH algorithm rhoij = 1.e0/(rho(i)*rho(j)) if(pa_sph.eq.1) then - 90 - enddo c Change of specific internal energy de/dt = T dedt(i) = dedt(i) + mass(j)*he ds/dt - p/rho vc,c: dedt(j) = dedt(j) + mass(i)*he i=1,ntotal endif dedt(i) = tdsdt(i) + 0.5e0*dedt(i) endif enddo enddo end stop Kernel.f subroutine kernel(r,dx,hsml,w,dwdx) endif implicit none if (q.ge.0.and.q.le.1.e0) then include 'param.inc' w = factor * (2./3 - q*q + q**3 / 2.) double precision r, dx(dim), hsml, w, dwdx(dim) d = 1, dim integer i, j, d dwdx(d) = factor * (-2.+3./2.*q)/hsml**2 * double precision q, dw, factor dx(d) q = r/hsml enddo w = 0.e0 else if (q.gt.1.e0.and.q.le.2) then d=1,dim w = factor * 1.e0/6.e0 * (2.-q)**3 dwdx(d) = 0.e0 d = 1, dim enddo dwdx(d) =-factor * 1.e0/6.e0 * 3.*(2.if (skf.eq.1) then q)**2/hsml * (dx(d)/r) if (dim.eq.1) then enddo factor = 1.e0/hsml else elseif (dim.eq.2) then w=0 factor = 15.e0/(7.e0*pi*hsml*hsml) d= 1, dim elseif (dim.eq.3) then dwdx(d) = factor = 3.e0/(2.e0*pi*hsml*hsml*hsml) enddo else endif print *,' >>> Error Statistics: Virtual boundary particles:' i = 1, 2*np + print *,' Number of virtual particles:',NVIRT nvirt = nvirt + endif x(1, ntotal + nvirt) = 10.0 endif x(2, ntotal + nvirt) = ymin - dx/2.e0 + i*dx/2.e0 end vx(1, ntotal + nvirt) = -Viscosity.f subroutine viscosity(ntotal,itype,x,rho,eta) implicit none include 'param.inc' integer ntotal,i,itype(maxn) double precision x(dim,maxn),rho(maxn),eta(maxn) i=1,ntotal if (abs(itype(i)).eq.1) then eta(i)=0 else if (abs(itype(i)).eq.2) then eta(i)=1.0e-3 endif enddo end - - 96 - - LÝ LỊCH TRÍCH NGANG Họ tên : NGUYỄN QUANG TRƯỜNG Năm sinh : 1985 Nơi sinh: ðồng Nai ðịa liên lạc : 609 lô M cc Bàu cát II, P.14, Q Tân Bình, Tp.HCM ðiện thoại : 0917239007 Email : quangtruong222@gmail.com QUÁ TRÌNH ðÀO TẠO - Từ năm 2003 ñến 2008: sinh viên Trường ðại học Bách Khoa Tp.HCM, Khoa Kỹ thuật Xây dựng, Bộ môn Kỹ thuật Tài nguyên nước - Từ năm 2008 ñến 2011: học viên cao học Trường ðại học Bách Khoa Tp.HCM, chun ngành Xây dựng Cơng trình thủy Q TRÌNH CƠNG TÁC Từ năm 2008 đến nay: Cơng tác Trường ðại học Bách Khoa Tp.HCM - 97 - ... THỦY Mã số : 60.58.40 I TÊN ðỀ TÀI: NGHIÊN CỨU ỨNG DỤNG MƠ HÌNH TỐN SỐ SPH TRONG TÍNH TỐN DÒNG THẤM II NHIỆM VỤ VÀ NỘI DUNG: - Chương 1: Tổng quan - Chương 2: Cơ sở lý thuyết phương pháp SPH -... tác hạt nước hạt đất Kết mơ cho thấy tính khả thi hiệu áp dụng mơ hình tốn số SPH vào tốn dịng thấm ðây sở ñể tác giả tiếp tục nghiên cứu sâu ứng dụng mơ hình SPH Abstract A numerical simulation... Tình hình nghiên cứu nước Luận văn tổng hợp trước hết nghiên cứu ñã ñược thực nước ngồi liên quan đến PP SPH, sau tập trung phân tích chi tiết số nghiên cứu liên quan đến tính tốn dịng thấm,

Ngày đăng: 03/02/2021, 23:27

Từ khóa liên quan

Tài liệu cùng người dùng

Tài liệu liên quan