ansys help流固耦合算例fluid_structure(内含解析)
- 1、下载文档前请自行甄别文档内容的完整性,平台不提供额外的编辑、内容补充、找答案等附加服务。
- 2、"仅部分预览"的文档,不可在线预览部分如存在完整性等问题,可反馈申请退款(可完整预览的文档不适用该条件!)。
- 3、如文档侵犯您的权益,请联系客服反馈,我们会尽快为您处理(人工客服工作时间:9:00-18:30)。
/BATCH
/COM,ANSYS RELEASE 12.1 UP20091102 13:06:05 10/24/2010
/PREP7
! /Batch,list
/prep7
/sho,gasket,grph
shpp,off
ET,1,141 ! Fluid - static mesh
ET,2,182, ! 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 channel through a constriction
! 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 channel
!! 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
!!
*SET,yent , 0.0 ! Y coordinate of the entrance to the channel
*SET,dyen , 1.0 ! Undeformed geometry flow entrance length
*SET,ysf1 , yent+dyen ! Y coordinate of entrance to the morphing fluid region *SET,dsf1 , 0.5 ! Thickness of upstream
*SET,ygas , ysf1+dsf1 ! Y coordinate of the bottom of the gasket
*SET,dg , 0.02 ! Thickness of the gasket
*SET,dg2,dg/2.
*SET,ytg , ygas+dg ! Y coordinate of the initial top of the gasket
*SET,dsf2 , 0.5 ! Thickness of downstream region
*SET,ysf2 , ytg + dsf2! Y of Top of the downstream morphing fluids region
*SET,dyex , 6.0 ! Exit fluid length
*SET,x , 0. ! Location of the centerline
*SET,dgasr ,.20 ! Initial span of gasket
*SET,piper , 0.3 ! Width of the analysis domain
*SET,xrgap , piper-dgasr!! Width 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 !定义一个关键点为22号,坐标是x,y
*SET,rarc , dg2*1.1
larc,1,4,22,rarc !定义一个通过1,4点半径为dg2*1.1,圆心在22点这边的圆弧
al,6,4 !定义一个由相关线围成的面
adelete,7 !删除面7 adele,7
al,6,3,22,7,8,5,21,1 !定义一个由相关线围成的面
!!Mesh Division information
*SET,ngap , 10 ! Number elements across the gap
*SET,ngas , 10 ! Number of elements along the gasket
*SET,rgas , -2 ! Spacing ratio along gasket
*SET,nflu , ngap+ngas ! Number of elements across the fluid region
*SET,raflu , -3 ! Space fluid elements near the walls and center
*SET,nenty ,8 ! Elements along flow - entrance
*SET,raent ,5 ! Size ratio in the inlet region
*SET,nfl1 , 20 ! Elements along flow - first morph.fluid.
*SET,nthgas , 4 ! Elements in the gasket
*SET,nfl2 , 3 ! Elements along flow - second morph.fluid.
*SET,next , 30 ! Elements along flow - exit region
*SET,rext , 6 ! Size ratio in flow direction of outlet
*SET,rafls , 12 ! Initial element spacing ratio - morph.fluid
lesize,1,,,ngas,rgas !指定所选线上单元数线1上划分10个单元中间尺寸比两端尺寸=|-2|
lesize,3,,,ngas,rgas !指定所选线上单元数线3上划分10个单元中间尺寸比两端尺寸=|-2|
*SET,nfl11, nfl1*2+9
lsel,s,,,2,4,2 ! (Modify lesize of line 8 if changing gasket mesh) 选择
线从2号线递增到4号线每次递增2
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 !选择面从1号面递增到2号面每次递增1(默认)
aatt,2,2,2 ! Gasket (material 2) 赋给选择的区域(点,面,线或体)2号材料属性,2号实常数,2号单元类型
asel,s,,,3 !选择面3
cm,area2,area !把选择的面名称定义为area2
alist ! List area selected for further morphing
asel,a,,,5,6 !在原来的基础上添选面2,3
aatt,1,1,1 ! Fluid area (material 1)
alls
/eshape,2 !
asel,u,,,2,3 !在当前已经选择的面中选面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 !选择面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 !定义1号单元为141号材料单元
et,2,0 ! Gasket becomes the Null Element定义2号单元为0号单元
*SET,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 !选择线8,17,9
lsel,a,,,20 !添选线20
dl,all,,vx,0.,1 ! Centerline symmetry 定义所选中的直线中的所有的直线的约束,x速度为0,直线的端点同样被作用
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外围边界条件vx,vy为0
dl,all,,vy,0.,1
lsel,s,,,1,3,2
lsel,a,,,6
dl,all,,vx,0.,1 ! Gasket橡皮垫的vx,vy为0
dl,all,,vy,0.,1
lsel,s,,,15
dl,15,,pres,0.,1 ! Outlet pressure condition出口压力条件压力为0
!!! create named component of nodes at the bottom of gasket
lsel,s,,,1 !选择线1
nsll,,1 !选择所选择的线上的节点,包括关键点
cm,gasket,node !把所选择的点定义为gasket
nlist ! List initial nodal positions of the bottom of the gasket
/com, +++++++++ STARTING gasket coordinates --------
alls !选择所有的东东
/title,Fluid Analysis
physics,write,fluid,fluid !把all element information写下来
!!
!!!!! 3. Create Physics Environment for the
Structure ..........................................第三大步创建结构的物理环境
!!
physics,clear !从数据库清除所有的信息,但是不清除当前的physics文
件,删除的信息:all material properties, solution options, load step options, constraint equations, coupled nodes, results, and GUI preference settings !SOLCONTROL, , , NOPL,
et,1,0 ! The Null element for the fluid region
et,2,182 ! Gasket element - material 2
keyopt,2,3,2 ! Plane stress 单元2的第3个选项为2 表面Z strain=0 平面应力状况keyopt,2,6,1 ! mixed u-P
keyopt,2,1,2 ! Enhanced strain
mp,nuxy,2,0.49967 ! Poisson's ratio for the rubber定义2号单元的泊松比为……
tb,mooney,2 ! 数据表??
tbdata,1,0.293E+6 ! Mooney-Rivlin Constants 在数据表的第一个表??
tbdata,2,0.177E+6 ! " " "
tb,hyper,2,,2,mooney
tbdata,1,0.293E+6,0.177E+6, (1.0-2.0*0.49967)/(0.293E+6+0.177E+6)
lsel,s,,,2 !选择线2
nsll,,1 !选择所选择的线上的点,包括端点
d,all,ux,0. !定义所有选择的点的x位移为0
d,all,uy,0. ! Fix the end of the gasket定义所有选择的点的y位移为0
alls
/title,structural analysis
finish
/solu !进入求解器
antype,static !定义分析类型为静态求解
nlgeom,on !在静态分析或完全瞬态分析中包含大变形效应
cnvtol,f,,,,-1 !设置非线性分析的收敛值
physics,write,struc,struc !把all element information写下来
physics,clear !从数据库清除所有的信息,但是不清除当前的physics文件
save !保存
!!
!!!!! 4. Fluid-Structure Interaction Loop ...................................................第四大步固流循环
!!
loop=25 ! Maximum allowed number of loops 定义最大循环次数为25
toler=0.005 ! Convergence tolerance for maximum displacement 定义最大
位移的收敛误差
*dim,dismax,array,loop ! Define array of maximum displacement values 定义大小
为25的名为dismax的矩阵
*dim,strcri,array,loop ! Define array of convergence values 定义大小
为25的名为strcri的矩阵
*dim,index,array,loop ! 定义大小
为25的名为index的矩阵
*do,i,1,loop ! Execute fluid -> structure solutions do循环===============================================↓↓↓
/solu !进入求解器..............................................................................
.....|*↓*|
physics,read,fluid ! Read in fluid environment 读取流体环境设置
*if,i,ne,1,then !如果i不等于1,执行……
|
flda,iter,exec,100 ! Execute 100 global iterations for设置PLOTRAN分析中用
到的参数 |if循环
*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 如果i>1,执行……
|
parsave,all ! Save parameters for convergence check 保存所有的参数
|
resume ! Resume DB - to return original node positions 恢复数据返
回初始节点位置|
parresume ! Resume parameters needed for convergence check 恢复所有
的参数数据 |if循环
/prep7 ! |
antype,stat,rest !Restart the analysis. 重启分析
|
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 添选线6
nsll,,1 ! 选择线上的点,包括端点
esel,s,type,,2 ! 选择一簇单元,按照单元类型号,跨幅最大为2 ldread,pres,last,,,,,rfl ! Apply pressure surface load from Flotran读取流体面的
压力结果文件作为结构分析的荷载条件
sfelist !列表显示单元的面荷载
alls rescontrol,,none ! Do not use multiframe restart for nonlinear !nsub,4,10,1 solve !结构分析完毕..............................................................................
.......|*↑*|
*if,i,eq,1,then !如果i等于1,执行……................................|
save ! save original node locations at the first run......|if循
环
*endif !....................................................|
fini
/post1
cmsel,s,gasket !选择gsket(gasket见line160)
nsort,u,sum,1,1 !设置列表顺序显示总位移按递增顺序按绝对值
*get,dismax(i),sort,0,max ! Get the maximum displacement value 得到最大的位移值
strcri(i)=toler*dismax(i) !初始化strcri矩阵第i个元素
alls
fini
/prep7
mkey=2 ! Select level of mesh morphing for fluid
damorph,area2, ,mkey ! Perform morphing of "morphing fluid",移动area2的节
点,使其服从变形
!----------------
!!!!! 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 !Produces an element display of the selected elements
alls
!-----------------
cmsel,s,gasket !选择gsket
nlist ! List updated coordinates of bottom of gasket for comparison显示节点
/com, +++++++++ UPDATED gasket coordinates --------。