我正在测试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文件中移动一点位置,那么模拟就会中断。
snappyHexMeshDict:
geometry
{
cylinder_x01y0z0.stl
{
type triSurfaceMesh;
name cylinder;
}
};

请帮助理解为什么在STL文件中的一个小位置移动中断模拟。
提前谢谢你。
发布于 2021-12-28 13:08:30
尝试将0.orig/U中的代码更改为cylinder边界条件,如下所示(请参阅注释):
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);
#};
}https://stackoverflow.com/questions/70500453
复制相似问题