Skip to content

OpenFOAM

OpenFOAM交流区

5.4k Topics 31.8k Posts
  • 5 Posts
    4k Views
    C

    @qing 是这样的,openfoam完全可以这样任意折腾。它是基于文件的,只要能读取、识别到相应的文件就可以进行计算。

  • OpenFOAM中matrix relax的bug

    4
    4 Posts
    4k Views
    李东岳

    我思考了下,

    matrix relax 虽然具体实现方式不同,但是本质不变。

    你说的是对的。一楼我说的应该有问题(我更正一下)。不仅仅field relax,matrix relax,也会影响计算结果。我当时把matrix relax理解成不会影响计算结果了。

    matrix relax是使得计算结果更慢的趋向于真实值,但换来一个对角占优矩阵

    field relax是使得计算结果更慢的趋向于真实值

    两个都使得计算结果更慢的趋向于真实值。

    当时看这个公式的时候:$\phi^{n+1}=\phi^n+\beta(\phi^{n+1}-\phi^n)$,以为$\beta$变小时候,$\phi^{n+1}$还是原来那个值。然而并不是:136: :136: 好尴尬

  • 4 Posts
    3k Views
    L

    @李东岳 李老师,您好!现在使用foam-ext 4.0,已经编译完成,计算成功一次,后续计算时一直报错(可以划分网格,计算中读取信息时出现问题)。
    bed30e22-ed0d-4079-b2df-86b3002c91bf-image.png
    7502d3ba-1a3d-4601-bd2a-3de6d249d09f-image.png

  • 5 Posts
    4k Views
    香柏树

    @zhouxu 谢谢,我尝试下。

  • 关于multiphaseEulerFoam的计算问题

    9
    9 Posts
    7k Views
    Z

    @李东岳 东岳老师,请问这个速度能不能从10-2下降到10-4或者-6?

  • 4 Posts
    3k Views
    bestucanB

    这里有介绍:link text

    类似的需求:

    How do I add some other package to the container?

    The easiest way is to modify your Dockerfile and rebuild. Particularly easy if the software you want to add has an Ubuntu deb package.

    里面也有 docker file 的示例。看起来这个比较可行

    没有经验,一直在 linux 上跑

  • 3 Posts
    2k Views
    M

    @李东岳 懂了,谢谢李老师

  • 关于压力松弛因子的疑问

    8
    8 Posts
    8k Views
    李东岳

    应该研究下为什么transonic需要提升对角占优

    @李东岳 回答一下自己的问题。transonic下的压力方程存在对流项,对流项不利于对角占优矩阵的产生,因此transonic的压力方程要增加方程松弛。

    http://dyfluid.com/rhoSimpleFoam.html

  • 4 Posts
    3k Views
    C

    @ruibin_tongji
    Green-Gauss Cell Based
    9f30b62e-ad51-4bd3-ad87-c12ce78f2194-image.png
    Least Squares Cell Based
    8e14d4c0-98f9-4866-b57a-05a79fe25109-image.png
    Green-Gauss Cell Based是最粗暴最直接的,但也许恰好适用于结构网格?我看这个Theory Guide里面是这么说的
    38584698-16af-4fa1-8327-194895b34791-image.png

    有没有测试过对流项的格式?

  • 在Openfoam中新加入weno格式

    14
    14 Posts
    12k Views
    S

    @李东岳 几万还是可以算的 几百万的网格我40核的服务器就算不动了

  • OF后处理中forceCoeffs的几个概念求教

    1
    1 Posts
    1k Views
    A

    想请教各位,我对OF后处理中力系数forceCoeffs中的几个概念不太能理解,想请教一下各位。

    forceCoeffs { type forceCoeffs; libs ( "libforces.so" ); writeControl timeStep; writeInterval 1; patches ( "floatingObject" ); rho rhoInf; log true; rhoInf 1000; liftDir (0 0 1); //升力方向 dragDir (0 0 1); //拖曳力方向 CofR (5 5 2); //用于计算力矩的点 pitchAxis (0 0 1); //pitch方向,围绕转动的轴 magUInf 0; //无限远处来流处的速度 lRef 2; //参考长度 Aref 8; //参考面积 }

    首先这里对liftDir升力和dragDir拖曳力的定义是怎样的 ?举个例子,如果模拟的是一个物体在水中匀速运动,升力可否理解为浮力?那这里的拖曳力又是指什么呢?
    还是这个例子,pitchAxis解释为围绕转动的轴,这又是指什么?另外如果在静水中运动,那magUInf可以设置为0吗?lRef和Aref是相对谁的参考呢,计算域吗?

  • 6 Posts
    4k Views
    D

    @李东岳 是个稳态计算过程,不随时间变化,但是公式中r值更新会影响边界的U的值

  • 输出时间步不对

    8
    8 Posts
    5k Views
    李东岳

    @yu_tian 你这个看起来怎么没有读取controlDict呢,设置的跟读写的不一样

  • 拉格朗日粒子追踪死循环

    14
    14 Posts
    10k Views

    @jqbu minParcelMass 在你这个1e-20的话 大概算出来是3.91486764×10−7 不知道你有没有什么地方设置过vsmall 还有rootvsmall,作为filter,可能有问题吧 不好说。

    另外如果parcel太小,有可能也被trap到某个涡里。看看调整一下你的Euler time step 还有maxco试试
    impinging的流场比较复杂 jet?你先调整试试看one-way 限制尺寸大一点。

  • wallShearStress函数量纲问题咨询

    7
    7 Posts
    6k Views

    @李东岳 好的,我明白啦,感谢李老师~::xinxin:

  • 6 Posts
    2k Views
    L

    1cbfc0cf-4f43-4883-ade9-90274c8b99fb-image.png 14da2f9f-5109-439a-b87e-2d737b126936-image.png
    已安装openfoam-extend4.0编译成功,使用Allmake再编译密度基src文件时报错如下图
    2df90e72-839b-4602-98b6-23a706449938-image.png

    051583eb-9b9a-49b3-8dd2-aaa6ba1076ce-image.png 红圈部分文件在所有文件中未找到。请大神指点一下

  • icoFoam运算出错

    8
    8 Posts
    4k Views
    Z

    @李东岳 好的,谢谢李老师

  • particle erosion函数

    2
    2 Posts
    2k Views
    bestucanB

    在这个地方右上角搜你想要知道的函数
    https://www.openfoam.com/documentation/guides/v2112/doc/

  • 6 Posts
    3k Views
    A

    @tens 感谢您的回复,我试着把这个头文件加入到.C文件中,但是对编译结果貌似并没有作用,报错是一样的。已经把我觉得可能能用到的头文件都放进去了:135:

    #include "mylinearSpring.H" #include "addToRunTimeSelectionTable.H" #include "sixDoFRigidBodyMotion.H" // Foam classes #include "OFstream.H" #include "IFstream.H" #include "Vector.H" // std classes #include <stdio.h> #include <fstream> #include <iostream> #include <string.h> #include <stdlib.h> #include "pointPatchFields.H" #include "addToRunTimeSelectionTable.H" #include "Time.H" #include "polyMesh.H" #include "fixedValuePointPatchField.H" #include "fvCFD.H" #include "fvMesh.H" #include "volFields.H"
  • 关于相邻cell

    8
    8 Posts
    6k Views

    @星星星星晴 本来没想到这么慢,结果发现假如我有1M parcel,1M cell 就要搞1M x 1M次, 实在有点笨。然后现在改为之前那个方法了。。 可能是当时不知道怎么回事有点脑残吧,搞错了,相邻cell一层一层搞出来快很多。。 下面是code, 编程能力有限,想搞成个function,总觉得麻烦。。不过改成function的话应该可以弄n层了吧。。

    还是python好写。。。

    if (neighbor_) { //Info << "cellI = " <<cellI<<nl; //- first layer List<int> first = this->owner().mesh().cellCells()[cellI]; first.append(cellI); sort(first); all_neighbor.append(first); int first_size = first.size(); //Info << "cellI = " << first <<nl; //- second layer List<int> second_all; for (int i1 = 0; i1<first_size; i1++){ List<int> second = this->owner().mesh().cellCells()[first[i1]]; //Info << "cellI second = " << second <<nl; second_all.append(second); } List<int> order,second_unique; uniqueOrder(second_all, order); forAll(order,kk) { second_unique.append(second_all[order[kk]]); } sort(second_unique); all_neighbor.append(second_unique); //- third layer List<int> third_all; for (int i1 = 0; i1<second_unique.size(); i1++){ List<int> third = this->owner().mesh().cellCells()[second_unique[i1]]; //Info << "cellI third = " << third <<nl; third_all.append(third); } List<int> order3,third_unique; uniqueOrder(third_all, order3); forAll(order3,kk) { third_unique.append(third_all[order3[kk]]); } sort(third_unique); all_neighbor.append(third_unique); //- Fourth layer List<int> fourth_all; for (int i1 = 0; i1<third_unique.size(); i1++){ List<int> fourth = this->owner().mesh().cellCells()[third_unique[i1]]; fourth_all.append(fourth); } List<int> order4,fourth_unique; uniqueOrder(fourth_all, order4); forAll(order4,kk) { fourth_unique.append(fourth_all[order4[kk]]); } sort(fourth_unique); all_neighbor.append(fourth_unique); //- collect all List<int> order_all; uniqueOrder(all_neighbor, order_all); forAll(order_all,kk) { all_neighbor_unique.append(all_neighbor[order_all[kk]]); } sort(all_neighbor_unique);