首页/文章/ 详情

接触分组赋值

1年前浏览3413

今天将接触分组这部分思考了一下,总结了一下接触分组的做法,并提出一个做法可以实现接触层面赋值的方法。


    首先我们这里提出一个工况,有两层土,底层是砾石,上层是砂土,砾石的参数为:kn=ks=5e7,砂土为:kn=ks=2e7,组间接触为:kn=ks=3e7,颗粒与墙的接触定义为:kn=ks=1e8。


    下面的demo是我经常用的做法,在cmat entry中将除了组间接触之外的所有接触都定义好,id 1对应的是砾石内部,2对应的是砂土内部,3对应的是颗粒与墙的。那组间接触在cmat entry中找不到自己的range时,就会返回到default中。


    newdomain extent -1 1

    wall generate box -0.5 0.5

    ball distribute porosity 0.2 radius 0.02 0.03 group lishi box -0.5 0.5 -0.5 0ball distribute porosity 0.2 radius 0.006 0.01 group shatu box -0.5 0.5  0 0.5

    ball attribute density 3.8e3 damp 0.7 range group lishiball attribute density 2.6e3 damp 0.7 range group shatu

    contact groupbehavior andcmat default model linear property kn 3e7 ks 3e7cmat add 1 model linear property kn 5e7 ks 5e7 range group lishicmat add 2 model linear property kn 2e7 ks 2e7 range group shatucmat add 3 model linear property kn 1e8 ks 1e8 range contact type ball-facetcycle 2000 calm 10set gravity 9.8solve


    运行的结果为:


    微信截图_20220719164833.png


        这个是达到我们预期的结果的,但是我们也会发现这个问题的不足,当出现多个组时,这个方法就不太适用了。


        受到裂纹函数的启发,这里利用contact_activated事件进行接触的定义,demo如下:




      newdomain extent -1 1

      wall generate box -0.5 0.5

      ball distribute porosity 0.2 radius 0.02 0.03 group lishi box -0.5 0.5 -0.5 0ball distribute porosity 0.2 radius 0.006 0.01 group shatu box -0.5 0.5  0 0.5

      ball attribute density 3.8e3 damp 0.7 range group lishiball attribute density 2.6e3 damp 0.7 range group shatu

      contact groupbehavior andcmat default model linear property kn 1e9 ks 1e9cmat add 1 model linear property kn 5e7 ks 5e7 range group lishicmat add 2 model linear property kn 2e7 ks 2e7 range group shatucmat add 3 model linear property kn 1e8 ks 1e8 range contact type ball-facet;def set_contact(entry)    local ct=entry(1)    if type.pointer.name(contact.end1(ct)) # "Facet" then        if type.pointer.name(contact.end2(ct)) # "Facet" then            if ball.group(contact.end1(ct))="lishi" then                if ball.group(contact.end2(ct))="shatu" then                    contact.model(ct)="linear"                    contact.prop(ct,"kn")=3e7                    contact.prop(ct,"ks")=3e7                endif            endif            if ball.group(contact.end2(ct))="lishi" then                if ball.group(contact.end1(ct))="shatu" then                    contact.model(ct)="linear"                    contact.prop(ct,"kn")=3e7                    contact.prop(ct,"ks")=3e7                endif            endif        endif    endifendset fish callback contact_activated @set_contactcycle 2000 calm 10set gravity 9.8solve


          这个是用set_contact函数进行接触的定义,在其中筛选出组间的接触,然后对其进行定义,为了区分之前的,这里将cmat default中的参数设置为1e9,我们可以看一下运行结果:


      image.png


      这个也是符合我们需求的。


      下面测试一下三个分组的:


          这里增加了底层为块石,定义其接触参数为:kn=ks=8e7,砾石和块石间的接触参数为:kn=ks=7e7。


      将demo修改为:




        newdomain extent -1 1

        wall generate box -0.5 0.5

        ball distribute porosity 0.2 radius 0.03 0.05 group kuaishi box -0.5 0.5 -0.5 -0.3ball distribute porosity 0.2 radius 0.02 0.03 group lishi box -0.5 0.5 -0.3 0.1ball distribute porosity 0.2 radius 0.006 0.01 group shatu box -0.5 0.5  0.1 0.5

        ball attribute density 3.8e3 damp 0.7 range group kuaishiball attribute density 3.8e3 damp 0.7 range group lishiball attribute density 2.6e3 damp 0.7 range group shatu

        contact groupbehavior andcmat default model linear property kn 1e9 ks 1e9cmat add 1 model linear property kn 5e7 ks 5e7 range group lishicmat add 2 model linear property kn 2e7 ks 2e7 range group shatucmat add 3 model linear property kn 1e8 ks 1e8 range contact type ball-facetcmat add 1 model linear property kn 8e7 ks 8e7 range group kuaishi;def set_contact(entry)    local ct=entry(1)    if type.pointer.name(contact.end1(ct)) # "Facet" then        if type.pointer.name(contact.end2(ct)) # "Facet" then            if ball.group(contact.end1(ct))="lishi" then                if ball.group(contact.end2(ct))="shatu" then                    contact.model(ct)="linear"                    contact.prop(ct,"kn")=3e7                    contact.prop(ct,"ks")=3e7                endif            endif            if ball.group(contact.end2(ct))="lishi" then                if ball.group(contact.end1(ct))="shatu" then                    contact.model(ct)="linear"                    contact.prop(ct,"kn")=3e7                    contact.prop(ct,"ks")=3e7                endif            endif            if ball.group(contact.end1(ct))="lishi" then                if ball.group(contact.end2(ct))="kuaishi" then                    contact.model(ct)="linear"                    contact.prop(ct,"kn")=3e7                    contact.prop(ct,"ks")=3e7                endif            endif            if ball.group(contact.end2(ct))="lishi" then                if ball.group(contact.end1(ct))="kuaishi" then                    contact.model(ct)="linear"                    contact.prop(ct,"kn")=7e7                    contact.prop(ct,"ks")=7e7                endif            endif        endif            endifendset fish callback contact_activated @set_contactcycle 2000 calm 10set gravity 9.8solve


        运行的结果为:


        image.png


        可以看到也是达到预期了。


            这个方法有个缺点就是速度会稍微慢点,如果两个分组的话,采用第一个方法好点。

        代码&命令科普PFC
        著作权归作者所有,欢迎分享,未经许可,不得转载
        首次发布时间:2022-07-19
        最近编辑:1年前
        lobby
        硕士 |擅长颗粒流PFC
        获赞 829粉丝 4382文章 85课程 21
        点赞
        收藏

        作者推荐

        未登录
        1条评论
        原来是王世纪
        签名征集中
        1月前
        lobby老师,请问contact groupbehavior and这个命令6.0还有嘛
        回复

        课程
        培训
        服务
        行家

        VIP会员 学习 福利任务 兑换礼品
        下载APP
        联系我们
        帮助与反馈