首页
学习
活动
专区
圈层
工具
发布
社区首页 >问答首页 >OpenFoam:改变STL位置会导致不确定的行为或崩溃

OpenFoam:改变STL位置会导致不确定的行为或崩溃
EN

Stack Overflow用户
提问于 2021-12-27 21:11:45
回答 1查看 63关注 0票数 1

我正在测试OpenFoam-9 https://drive.google.com/file/d/1J2rKIRU8DAZadORyjUfd6OBBcfR-9rLo/view?usp=sharing的Magnus效应示例。

我从https://holzmann-cfd.com/community/training-cases/magnus-effect那里得到了什么

它工作得很好:

但是当我改变STL对象时,在STL文件中移动一点位置,那么模拟就会中断。

代码语言:javascript
复制
snappyHexMeshDict:
geometry
{
    cylinder_x01y0z0.stl
    {
        type triSurfaceMesh;
        name cylinder;
    }
};

请帮助理解为什么在STL文件中的一个小位置移动中断模拟。

提前谢谢你。

EN

回答 1

Stack Overflow用户

回答已采纳

发布于 2021-12-28 13:08:30

尝试将0.orig/U中的代码更改为cylinder边界条件,如下所示(请参阅注释):

代码语言:javascript
复制
    cylinder 
    {

        type            codedFixedValue;
        value           uniform (0 0 0);
        name            myBC;

        code
        #{
            const scalar time = this->db().time().value();

            const fvPatch& boundaryPatch = patch(); 

            const vectorField& Cf = boundaryPatch.Cf(); 

            vectorField rot(Cf.size(), vector(0,0,0));
            
            const vector CENTER(0.1,0.0, 0.0); // <<<< Add this line and add it below

            const scalar rotate_speed_max = 10.0;
            const scalar rotate_time_start = 0.0;

            scalar rotate_speed = 0.5 * (time - rotate_time_start) * (time - rotate_time_start);
            rotate_speed = rotate_speed > rotate_speed_max ? rotate_speed_max : rotate_speed;

            //- Start motion of the wall after 15s
            if (time > rotate_time_start)
            {
                rot = rotate_speed * vector(0,0,1) ^ (Cf- CENTER); //<<<< Added here
                // std::cout << __func__ << ":" << __LINE__ << " rotate_speed=" << rotate_speed <<std::endl;
            }

            operator==(rot);

        #};
    }
票数 1
EN
页面原文内容由Stack Overflow提供。腾讯云小微IT领域专用引擎提供翻译支持
原文链接:

https://stackoverflow.com/questions/70500453

复制
相关文章

相似问题

领券
问题归档专栏文章快讯文章归档关键词归档开发者手册归档开发者手册 Section 归档