关于使用重叠网格模拟双浮体及其连接问题



  • 请问下有哪位重叠网格大佬知道该如何在dynamicMeshDict中定义双浮体?我用的是v1906版本,一旦指定body1和body2,运行时就会出现cannot find centreOfMass的问题;
    另一个是如何采用linearSpring连接两个浮体?因为在restraints参数中有一个anchor点和一个refAttachmentPt点,如果直接用两个refAttachmentPt点是否可行?相关的body该如何指定?
    恳请大佬帮忙答疑!



  • @wwzhao 老师,您是这方面的专家,能否帮忙解答一下呢?


  • OpenFOAM教授

    1. 找不到centreOfMass肯定是字典文件错了,检查字典文件

    2. linearSpring 没法实现双浮体相连的功能



  • @wwzhao 感谢老师解答,还想问下,我该如何在dynamicMeshDict中实现用弹簧连接双浮体呢,找了找网上的资料,没能够找着相关资料



  • @wwzhao 关于字典文件的问题,我先是参考算例中的设置方法,弄成这样:

    sixDoFRigidBodyMotionCoeffs
    {
        bodies
        {
        floatingObject1
        {
    
        patches         (floatingObject1);
        innerDistance   100;
        outerDistance   101;
    
    
        centreOfMass    (2.0 0.5 1.0);
    
        // Cuboid dimensions
        radius	    0.25;
    
        // Density of the solid
        rhoSolid        500;
    
        // Cuboid mass
        mass            #calc "$rhoSolid*4/3*3.1415926*$radius*$radius*$radius";
    
        // Cuboid moment of inertia about the centre of mass
        momentOfInertia #codeStream
        {
            codeInclude
            #{
                #include "diagTensor.H"
            #};
    
            code
            #{
                scalar sqrLx = sqr($radius);
                scalar sqrLy = sqr($radius);
                scalar sqrLz = sqr($radius);
                os  <<
                    $mass
                   *diagTensor(sqrLy + sqrLz, sqrLx + sqrLz, sqrLx + sqrLy)/5.0;
            #};
        };
         
        }
    
    
    
        floatingObject2
        {
      
        patches         (floatingObject2);
        innerDistance   100;
        outerDistance   101;
    
    
        centreOfMass    (3.5 0.5 1.0);
    
        // Cuboid dimensions
        radius	    0.4;
    
        // Density of the solid
        rhoSolid        400;
    
        // Cuboid mass
        mass            #calc "$rhoSolid*4/3*3.1415926*$radius*$radius*$radius";
    
        // Cuboid moment of inertia about the centre of mass
        momentOfInertia #codeStream
        {
            codeInclude
            #{
                #include "diagTensor.H"
            #};
    
            code
            #{
                scalar sqrLx = sqr($radius);
                scalar sqrLy = sqr($radius);
                scalar sqrLz = sqr($radius);
                os  <<
                    $mass
                   *diagTensor(sqrLy + sqrLz, sqrLx + sqrLz, sqrLx + sqrLy)/5.0;
            #};
        };
    
        }
        }
    
        report          on;
        accelerationRelaxation 0.7;
        accelerationDamping    0.9;
    
        solver
        {
            type Newmark;
        }
    
    
        sixDoFRigidBodyMotionRestraint
        {
        linkedspring
        {
         body		floatingObject;
         type		linearSpring;
         anchor	(3.1 0.5 1.0);
         refAttachmentPt	(2.25 0.5 1.0);
         stiffness		100;
         damping		0;
         restLength		0.3;
        }
        }
    
    }
    
    

    之后运行时就提示cannot find centreOfMass,但如果我将上述的bodies、floatingObject1等子目录删掉,像这样:

    sixDoFRigidBodyMotionCoeffs
    {
    
    
        patches         (floatingObject1);
        innerDistance   100;
        outerDistance   101;
    
    
        centreOfMass    (2.0 0.5 1.0);
    
        // Cuboid dimensions
        radius	    0.25;
    
        // Density of the solid
        rhoSolid        500;
    
        // Cuboid mass
        mass            #calc "$rhoSolid*4/3*3.1415926*$radius*$radius*$radius";
    
        // Cuboid moment of inertia about the centre of mass
        momentOfInertia #codeStream
        {
            codeInclude
            #{
                #include "diagTensor.H"
            #};
    
            code
            #{
                scalar sqrLx = sqr($radius);
                scalar sqrLy = sqr($radius);
                scalar sqrLz = sqr($radius);
                os  <<
                    $mass
                   *diagTensor(sqrLy + sqrLz, sqrLx + sqrLz, sqrLx + sqrLy)/5.0;
            #};
        };
           
        patches         (floatingObject2);
        innerDistance   100;
        outerDistance   101;
    
    
        centreOfMass    (3.5 0.5 1.0);
    
        // Cuboid dimensions
        radius	    0.4;
    
        // Density of the solid
        rhoSolid        400;
    
        // Cuboid mass
        mass            #calc "$rhoSolid*4/3*3.1415926*$radius*$radius*$radius";
    
        // Cuboid moment of inertia about the centre of mass
        momentOfInertia #codeStream
        {
            codeInclude
            #{
                #include "diagTensor.H"
            #};
    
            code
            #{
                scalar sqrLx = sqr($radius);
                scalar sqrLy = sqr($radius);
                scalar sqrLz = sqr($radius);
                os  <<
                    $mass
                   *diagTensor(sqrLy + sqrLz, sqrLx + sqrLz, sqrLx + sqrLy)/5.0;
            #};
        };
    
    
        report          on;
        accelerationRelaxation 0.7;
        accelerationDamping    0.9;
    
        solver
        {
            type Newmark;
        }
    
    
        sixDoFRigidBodyMotionRestraint
        {
        linkedspring
        {
         body		floatingObject1;
         type		linearSpring;
         anchor	(3.1 0.5 1.0);
         refAttachmentPt	(2.25 0.5 1.0);
         stiffness		100;
         damping		0;
         restLength		0.3;
        }
        }
    
    }
    
    

    就能运行了,不过这样一来问题就是只有floatingObject2可以动,floatingObject1不能动,所以对这个问题比较迷惑,也不知道该如何解决


  • OpenFOAM教授

    @七辆战车

    如何在dynamicMeshDict中实现用弹簧连接双浮体呢,找了找网上的资料,没能够找着相关资料

    这个应该没有现成模块,需要自己开发。

    只有floatingObject2可以动,floatingObject1不能动

    sixDoFRigidBodyMotion 不支持多物体运动,你可以试试 rigidBodyMotion。



  • @wwzhao 明白,感谢老师解答!


Log in to reply
 

CFD中文网 2016 - 2020 | 京ICP备15017992号-2