|
楼主 |
发表于 2006-8-22 15:19
|
显示全部楼层
有关ansys 流固耦合模拟仿真
ansys从9.0发展到10.0,一个最大的进步就是流固耦合计算更加规范,这一点已远领先于其他同类软件,实现了单向耦合到即时双向耦合的飞跃,使用户对于解决流固耦合问题又多了一种选择,希望大家对多种方法-----物理环境转换,fsi,mfx等进行讨论,提供一下案例
本人抛砖引玉:
使用物理环境法进行流固耦合的实例及讲解
流道中有一橡胶垫阻碍水的流动,入口速度为2m/s,其他参数将在命令流中详细给出。求解水通过此流道的压力降,以及稳态条件下橡胶垫的变形。
/prep7
/sho,gasket,grph
shpp,off
ET,1,141 ! Fluid - static mesh
ET,2,56, ! Hyperelastic element
!!!!!!! Fluid Structure Interaction - Multiphysics
!!!!!!! Deformation of a gasket in a flow field.
!
!!!!!!! Element plots are written to the file gasket.grph.
!
! - Water flows in a vertical pipe through a construction
! formed by a rubber gasket.
! - Determine the equilibrium position of the gasket and
! the resulting flow field
!
! | |
! | |
! |----------| Boundary of "morphing fluid"
! | ______|
! | |______ gasket
! | |
! |----------| Boundary of "morphing fluid" (sf)
! | |
!
!! 1. Build the model of the entire domain:
!! Fluid region - static mesh
!!
!! Gasket leaves a hole in the center of the duct
!! Morphing Fluid region is a user defined region around
!! the gasket. The fluid mesh here will deform and be
!! updated as the gasket deforms.
!!
!! Parameterize Dimensions in the flow direction
!!
yent = 0.0 ! Y coordinate of the entrance to the pipe
dyen = 1.0 ! Undeformed geometry flow entrance length
ysf1 = yent+dyen ! Y coordinate of entrance to the morphing fluid region
dsf1 = 0.5 ! Thickness of upstream
ygas = ysf1+dsf1 ! Y coordinate of the bottom of the gasket
dg = 0.02 ! Thickness of the gasket
dg2=dg/2.
ytg = ygas+dg ! Y coordinate of the initial top of the gasket
dsf2 = 0.5 ! Thickness of downstream region
ysf2 = ytg + dsf2! Y of Top of the downstream morphing fluids region
dyex = 6.0 ! Exit fluid length
x = 0. ! Location of the axisymmetric Centerline
dgasr =.20 ! Initial span of gasket
piper = 0.3 ! Radius of the pipe
xrgap = piper-dgasr!! radius of completely unobtructed flow passage
!!
!!! Create geometry
!!
rect,xrgap,piper,ygas,ytg ! A1:Gasket (keypoints 1-4)
rect,x,piper,ysf1,ysf2 ! A2: Morphing fluid region
rect,x,piper,yent,ysf1 ! A3: Fluid region with static mesh
rect,x,piper,ysf2,ysf2+dyex ! A4: Fluid region with static mesh
aovlap,all
k,22,xrgap+dg2,ygas+dg2
rarc = dg2*1.1
larc,1,4,22,rarc
al,6,4
adelete,7
al,6,3,22,7,8,5,21,1
!!Mesh Division information
ngap = 10 ! Number elements across the gap
ngas = 10 ! Number of elements along the gasket
rgas = -2 ! Spacing ratio along gasket
nflu = ngap+ngas ! Number of elements across the fluid region
raflu = -3 ! Space fluid elements near the walls and center
nenty =8 ! Elements along flow - entrance
raent =5 ! Size ratio in the inlet region
nfl1 = 20 ! Elements along flow - first morph.fluid.
nthgas = 4 ! Elements in the gasket
nfl2 = 3 ! Elements along flow - second morph.fluid.
next = 30 ! Elements along flow - exit region
rext = 6 ! Size ratio in flow direction of outlet
rafls = 12 ! Initial element spacing ratio - morph.fluid
lesize,1,,,ngas,rgas
lesize,3,,,ngas,rgas
nfl11= nfl1*2+9
lsel,s,,,2,4,2 ! (Modify lesize of line 8 if changing gasket mesh)
lesize,all,,,nthgas
alls
lesize,5,,,nflu,raflu
lesize,7,,,nflu,raflu
lesize,9,,,nflu,raflu
lesize,15,,,nflu,raflu
lesize,18,,,nenty,1./raent
lesize,17,,,nenty,1./raent
lesize,21,,,nfl1,rafls
lesize,8,,,nfl11,-1./(rafls+3)
lesize,22,,,nfl1,rafls
lesize,19,,,next,rext
lesize,20,,,next,rext
!!! AATT,MAT,REAL,TYPE - Set the attributes for the areas
asel,s,,,1,2
aatt,2,2,2 ! Gasket (material 2)
asel,s,,,3
cm,area2,area
alist ! List area selected for further morphing
asel,a,,,5,6
aatt,1,1,1 ! Fluid area (material 1)
alls
eshape,2
asel,u,,,2,3
amesh,all
eshape,0
asel,s,,,2,3
amesh,all
!-----------------
!!!!! Create element plot and write to the file gasket.grph
asel,s,,,1,3
esla,s
/Title, Initial mesh for gasket and neighborhood
eplot
/ZOOM,1,RECT,0.3,-0.6,0.4,-0.5
alls
!-----------------
!!
!!!!! 2. Create Physics Environment for the Fluid
et,1,141
et,2,0 ! Gasket becomes the Null Element
vin=3.5e-1 ! Inlet water velocity (meters/second)
!! CFD Solution Control
flda,solu,flow,1
flda,solu,turb,1
flda,iter,exec,400
flda,outp,sumf,10
!! CFD Property Information
flda,prot,dens,constant
flda,prot,visc,constant
flda,nomi,dens,1000. ! 1000 kg/m3 for density - water
flda,nomi,visc,4.6E-4 ! 4.6E-4 kg-s/m (viscosity of water)
flda,conv,pres,1.E-8 ! Tighten pressure equation convergence
!! CFD Boundary Conditions (Applied to Solid Model)
lsel,s,,,8,17,9
lsel,a,,,20
dl,all,,vx,0.,1 ! Centerline symmetry
lsel,s,,,9
dl,all,,vx,0.,1
dl,all,,vy,vin,1 ! Inlet Condition
lsel,s,,,2
lsel,a,,,18,19
lsel,a,,,21,22
dl,all,,vx,0.,1 ! Outer Wall
dl,all,,vy,0.,1
lsel,s,,,1,3,2
lsel,a,,,6
dl,all,,vx,0.,1 ! Gasket
dl,all,,vy,0.,1
lsel,s,,,15
dl,15,,pres,0.,1 ! Outlet pressure condition
!!! create named component of nodes at the bottom of gasket
lsel,s,,,1
nsll,,1
cm,gasket,node
nlist ! List initial nodal positions of the bottom of the gasket
/com, +++++++++ STARTING gasket coordinates --------
alls
/title,Fluid Analysis
physics,write,fluid,fluid
!!
!!!!! 3. Create Physics Environment for the Structure
!!
physics,clear
et,1,0 ! The Null element for the fluid region
et,2,56 ! Gasket element - material 2
mp,ex,2,2.82E+6 ! Young's modulus for rubber
mp,nuxy,2,0.49967 ! Poisson's ratio for the rubber
tb,mooney,2
tbdata,1,0.293E+6 ! Mooney-Rivlin Constants
tbdata,2,0.177E+6 ! " " "
lsel,s,,,2
nsll,,1
d,all,ux,0.
d,all,uy,0. ! Fix the end of the gasket
alls
/title,structural analysis
finish
/solu
antype,static
nlgeom,on
cnvtol,f,,,,-1
physics,write,struc,struc
physics,clear
save
!!
!!!!! 4. Fluid-Structure Interaction Loop
!!
loop=25 ! Maximum allowed number of loops
toler=0.005 ! Convergence tolerance for maximum displacement
*dim,dismax,array,loop ! Define array of maximum displacement values
*dim,strcri,array,loop ! Define array of convergence values
*dim,index,array,loop
*do,i,1,loop ! Execute fluid -> structure solutions
/solu
physics,read,fluid ! Read in fluid environment
*if,i,ne,1,then
flda,iter,exec,100 ! Execute 100 global iterations for
*endif ! each new geometry
solve ! FLOTRAN solution
fini
! end of fluid portion
physics,read,struc ! Read in structures environment
/assign,esave,struc,esav ! Files for restarting nonlinear structure
/assign,emat,struc,emat
*if,i,gt,1,then ! Structural restart loop
parsave,all ! Save parameters for convergence check
resume ! Resume DB - to return original node positions
parresume ! Resume parameters needed for convergence check
/prep7
antype,stat,rest
fini
*endif
/solu
solc,off
lsel,s,,,1,3,2 ! Select proper lines to apply fluid pressures
lsel,a,,,6 ! to the entire gasket surface
nsll,,1
esel,s,type,,2
ldread,pres,last,,,,,rfl ! Apply pressure surface load from Flotran
alls
rescontrol,,none ! Do not use multiframe restart for nonlinear
solve
*if,i,eq,1,then
save ! save original node locations at the first run
*endif
fini
/post1
cmsel,s,gasket
nsort,u,sum,1,1
*get,dismax(i),sort,0,max ! Get the maximum displacement value
strcri(i)=toler*dismax(i)
alls
fini
/prep7
mkey=2 ! Select level of mesh morphing for fluid
damorph,area2, ,mkey ! Perform morphing of "morphing fluid"
!----------------
!!!!! Create element plot and write it in file gasket.grph
fini
/prep7
et,1,42
asel,s,,,1,3
esla,s
/Title, EPLOT after DAMORPH,area2, ,%mkey% step number %i%
eplot
alls
!-----------------
cmsel,s,gasket
nlist ! List updated coordinates of bottom of gasket for comparison
/com, +++++++++ UPDATED gasket coordinates --------
alls
fini
/assign,esav
/assign,emat
!!!! Checking convergence criteria
imax= i
index(i)=i
*if,i,gt,1,then
strcri(i)=abs(dismax(i)-dismax(i-1))-toler*dismax(i-1)
*if,strcri(i),le,0,then
strcri(i)=0
*exit ! Stop looping if convergence is reached
*endif
*endif
*enddo
!!!!! End of the Computational loop
save ! Nodal coordinates of deformed geometry are saved
!!!!! Convergence printout
*vwrite
(/'Loop No. Max.Displacement Struct.Convergence')
/nopr
*vlen,imax
*vwrite,index(1),dismax(1),strcri(1)
(f7.0,2e17.4)
finish
!!!!! Postprocessing of the results
!!! 1. Flotran results.
physics,read,fluid
/post1
set,last
/Title, Flotran: Streamlines Near Gasket
plnsol,strm
/Title, Flotran: Pressure Contours
plnsol,pres
fini
!!! 2. Structural results.
physics,read,struc
/post1
set,last
upcoord,-1 ! Return original node positions changed by morphing
/Title, Structural results: von Mises Stress
plnsol,s,eqv,1,1
fini
!/exit,nosave |
|