新浪博客

FEM-SPH 耦合算法的整体实现

2013-01-13 16:04阅读:
煎熬啊,FEM-SPH耦合算法三部分的实现已告一段落。第一版本的实现借鉴了张雄的FEP3D程序和G.Liu 的SPH程序。毕竟是第一个项目经历,所以大部分都有些生搬硬套,呵呵,好吧。前处理使用ABAQUS生成数据,后处理使用Tecplot。后期希望进一步完善的工作:包括添加一个适应结构动力学的FEM求解器。然后整体整合地更流畅些,现在流、固两部分数据还是独立的。 最后,OOP方向改改
program SPH-FEM
! 流、固数据初始化
call input()
! 时间积分
do t=1,time
call FEForce(f2s)
! 利用上一时间步的f2s,更新当前时间步的FEM结点vel, pos
call repulse_force(BC_FEM_node(nbc).pos)
! 搜索NB_SPH_Particle(NB_count)
!计算斥力s2f(dim,nb_count) 和 f2s(dim,nbc)
call sphForce(s2f)
! 更新当前时间步的流域信息
t=t+timestep
enddo
! 结果
call output()
end
!--------------------------2013.2.16 完整更新-----------------
subroutine integration()
use Simulation
use FEM_Param
use SPH_Param

do while (CurrentTime.le.EndTime)

! calculate time step size
DTK=DTK1
DTK1=1.0d6

if(mod(CurrentTime,print_step).eq.0) then
write (*,*) '__________________________________'
write (*,*) 'current number of time step =',
& itimestep, 'current time=', CurrentTime
write (*,*) '__________________________________'
endif

if(mod(CurrentTime,save_step).eq.0) then
! call save...
endif

do i=1, max_bc_node
do d=1,dim
f2s(d,i)=0.0
enddo
enddo

do i=1,ntotal_particle
do d=1,dim
s2f(d,i)=0.0
enddo
enddo
! each currenttime needs reset f2s, s2f to zero

call interface_data_transfer()
call Fem_Single_Integration()
call Sph_Single_Integration()

! output

itimestep=itimestep+1
CurrentTime=CurrentTime+dtk1
enddo

end subroutine integration

我的更多文章

下载客户端阅读体验更佳

APP专享