Skip to content

OpenFOAM

OpenFOAM交流区

5.3k 主题 31.3k 帖子
  • OpenFoam求教

    2
    2 帖子
    2k 浏览
    李东岳

    这种由发布者发布的视频资料,类似文章的通讯作者,应该具备解答问题的责任,所以你最好联系视频发布者,在这里问,我不好评价别人的工作。
    小提示:你的看起来比较粘。

  • 关于pyFoam残差的问题,请教各位老师。

    6
    6 帖子
    4k 浏览
    F

    @东岳 瞬态问题的话,是不是就是内残差作为收敛标准,初始残差不看的?

  • 如何在of里得到current time

    1
    1 帖子
    1k 浏览
    W

    问题背景:将sixDoFRigidBodyMotion中linearSpring的参数stiffness从常数改成随时间变化的函数 stiffness = f(t)
    f(t) 可以是分段函数也可以是任意函数,t为目前的计算时间。

    因此我对$FOAM_SRC/sixDoFRigidBodyMotion/sixDoFRigidBodyMotion/restraints/linearSpring目录中的.C和.H文件进行改动。但是在获得当前计算时间这一步遇到了问题。。尝试了多种方法都无法编译,以下是我尝试的一些语句和报错:

    (1) scalar current_time = db().time().value()
    Error: ‘db’ was not declared in this scope
    (2) scalar current_time = runTime().value()
    scalar current_time = runTime_.time().timeOutputValue();
    Error: ‘runTime’ was not declared in this scope
    (3) scalar current_time = timeDirs.last().value()
    Error: ‘timeDirs’ was not declared in this scope
    (4) scalar current_time = U.runTime().value();
    scalar current_time = U_.thisDb().time().value();
    Error: ‘U’ was not declared in this scope
    (5) scalar current_time = mesh_.time().value();
    Error: ‘mesh_’ was not declared in this scope
    (6) scalar current_time = this->db().time().timeOutputValue();
    Error: ‘const class Foam::sixDoFRigidBodyMotionRestraints::linearSpring’ has no member named ‘db’

    挺简单一个问题,在网上找了很多方法,都失败了。。。不知道是不是因为没有包含需要的头文件?或者除了修改库文件,是否还有其他方法修改常数参数为time-dependent参数?请大神指教!!

  • piso和pimple的库朗数有建议取值吗

    2
    2 帖子
    2k 浏览
    李东岳

    库朗数如果放在80年代可以引一引,不过现在库朗数基本成为了一个必备内容,不引用应该也很安全

  • OpenFOAM里kOmega模型的问题

    19
    19 帖子
    15k 浏览
    李东岳

    :144: Yes 我同意 @huoyanxiadebing 说的。每个湍流模型有自己适用的流型。这方面需要特定的研究领域的专家才能有很深的理解。

  • Code production of k ?

    4
    4 帖子
    3k 浏览
    K

    @kimy 在 Code production of k ? 中说:

    @东岳 Many thanks. In fact, I understood this procedure. One confusion is that the formula implemented in openfoam is not consistent with that mentioned in the Spalding' paper.WeChat Screenshot_20200504110942.png

    Nobody is interested in this issue?

  • 【红包】OpenFOAM 怎么 homebrew ?

    3
    3 帖子
    3k 浏览
    H

    @wwzhao 好东西!谢谢

  • floatingObject算例相关问题请教

    1
    1 帖子
    1k 浏览
    西

    小白刚接触openfoam,因为做振荡浮子有关的课题,所以在学习floatingObject算例。
    有几个问题想向诸位前辈请教:
    1、constant文件夹下存在两个动网格文件,是两个文件同时起作用吗?还是只有dynamicMeshDict文件控制动网格?
    77152af7-c361-4b22-a3bd-a9778793fe8b-image.png
    2、dynamicMeshDict中joint部分的参数含义是什么?我感觉与六自由度的constraint有关,不知道对不对?
    f4c7d673-3d16-46df-b663-e0acf8965d52-image.png
    3、如何通过pointDisplacement获取浮体的运动位移?是否与forces一样可以在controldict文件中设置functionObject来获取?

  • openfoam的固体求解器还是属于欧拉方法吗

    1
    1 帖子
    941 浏览
    S

    我理解的欧拉方法就是网格不变形,材料在网格间流动。但是stressFoam的基本变量是位移。那么stressFoam还是欧拉的范畴吗,也就是说计算过程中网格会有变形(位移)吗

  • buoyantFoam水库计算

    14
    14 帖子
    9k 浏览
    李东岳

    后续有什么进展么?

  • 关于OpenFOAM里kEpsilon模型的问题

    4
    4 帖子
    3k 浏览
    S

    @东岳 谢谢老师,我调了设置之后kepsilon模型的计算结果基本一致了。因为在对比不同湍流模型对喷流计算结果的影响,发现还是有很多问题呀。。。愁

  • 运行报错

    7
    7 帖子
    6k 浏览

    非常感谢老师们的指点,我去试试看

  • 关于压力在两相交界处的问题

    9
    9 帖子
    6k 浏览
    李东岳

    987.png

    横向加密5倍试试

  • 超算上采用openfoam计算时,mpi报错

    1
    1 帖子
    1k 浏览

    替代文字

  • twoPhaseEulerFoam中的dilatation rates

    10
    10 帖子
    9k 浏览
    M

    @东岳 非常感谢!那我试着推推看这里:jingya:

  • 耦合换热求解器chtMultiRegionBoussinesqPimpleFoam

    8
    8 帖子
    6k 浏览
    D

    @麦迪文 你好,其实openfoam-5.x就可以在状态方程中直接使用boussinesq,亲测可以,因为我最近也在用。我有一个疑惑,请问chtMultiRegionFoam共轭传热边界的换热原理是什么?(关于这个问题,我写了个求租贴,在这里),该原理在求解器中好像没有说明,也不知道这个原理是放到哪个头文件中去了,若你知道的话,请不吝赐教,谢谢!
    另外,祝你五一快乐!

  • OpenFOAM怎么加载重力场?

    5
    5 帖子
    7k 浏览
    李东岳

    不写的话默认是yes

  • 关于interfoam的问题

    6
    6 帖子
    4k 浏览
    李东岳

    网格分辨率与时间步长调小试试

  • MPPICInterFOAM 粒子大小对导致计算失败

    4
    4 帖子
    3k 浏览
    李东岳

    Double check if the lagrangian particle is two-way coupled with the fluid phase. If it is one-way coupled, the restriction can be abandoned.

  • output value vs paraFoam?

    1
    1 帖子
    859 浏览
    K

    I am checking that the variables outbut from source code in solver and I found the differences between output and paraFoam. I cannot understand why it happened? The follow is my codes in simpleFoam.C:
    **const dimensionedScalar myZero("myZero", dimensionSet(0,0,0,0,0,0,0),scalar(0) );

    volScalarField k0=myZeroturbulence->k();
    volScalarField nut0=myZeroturbulence->nut();
    volScalarField nu0=myZero*turbulence->nu();

    const label patchID = mesh.boundaryMesh().findPatchID("wall");
    const tmp<scalarField> tnuw = turbulence->nu(patchID);
    const scalarField& nuw = tnuw();

    const tmp<scalarField> tnutw = turbulence->nut(patchID);
    const scalarField& nutw = tnutw();

    const fvPatchVectorField& Uw = turbulence->U().boundaryField()[patchID];

    const scalarField magGradUw(mag(Uw.snGrad()));

    for (int j=0; j<nut0.size(); j++)
    {
    if (j<=(nutw.size()/2-1)) {nut0[j]=nutw[j]; nu0[j]=nuw[j];}
    if (j>=(mesh.cells().size()-nutw.size()/2)&&j<=mesh.cells().size()-1) {nut0[j]=nutw[j-(mesh.cells().size()-nutw.size())];nu0[j]=nuw[j-(mesh.cells().size()-nutw.size())];}
    }

    volVectorField Uww=U*myZero;
    const fvPatchList& patches = mesh.boundary();
    labelList wallList;
    wallList.clear();

    forAll(patches, patchi)
    {
    const fvPatch& curPatch = patches[patchi];
    if (isType<wallFvPatch>(curPatch))
    {
    forAll(curPatch, facei)
    {
    label faceCelli = curPatch.faceCells()[facei];
    wallList.resize(wallList.size()+1);
    wallList[wallList.size()-1]=faceCelli;
    }
    }
    }

    forAll(wallList,i)
    {

    Uww[wallList[i]] = U[wallList[i]];

    }

    volScalarField uz = Uww.component(vector::Z);
    volVectorField SG = uz*vector(0,0,1);
    volScalarField magGradUww=mag(SG)/myY;

    k0=((nut0+nu0)*magGradUww/0.3);

    Info<<"k0="<<k0<<endl;
    Info<<"nut0="<<nut0<<endl;
    Info<<"nutw="<<nutw<<endl;
    Info<<"magGradUww="<<magGradUww<<endl;
    Info<<"magGradUw="<<magGradUw<<endl;
    Info<<"tauw="<<(nut0+nu0)magGradUww<<endl;
    Info<<"Uw="<<Uw<<endl;*

    nutw and magGradUw are copied from nutkwallfunction. In the end, wallshearstress in the paraFoam is not the same as (nut0+nu0)*magGradUww.