Skip to content

OpenFOAM

OpenFOAM交流区

4.6k 主题 26.6k 帖子
  • 1 帖子
    29 浏览

    33ae34d9-4a5a-4ebd-8603-c18a65d1b2a3-image.png 按照经验来看,在高约化速度下,圆柱振幅应该降低的,结果振幅一直下不去,有没有大佬遇见过类似的问题?用的是圆形计算域

  • 借助localPoints实现网格运动控制的问题

    5
    5 帖子
    2k 浏览
    V

    不知道楼主还看不看得到,我是想把翼型3维主动变形和overset结合起来。但现在第一步,用codefixedvalue来定义displacement边界,就出现了不收敛问题,不知道能否分享下您当时这部分的codes,我学习一下。

  • sixDoFRigidBodyMotion问题求助

    10
    10 帖子
    4k 浏览
    V

    不知道楼主还看不看得到,我是想把翼型3维主动变形和overset结合起来。但现在第一步,用codefixedvalue来定义displacement边界,就出现了不收敛问题,不知道能否分享下您当时这部分的codes,我学习一下。

  • 多相流interface

    3
    3 帖子
    372 浏览
    M

    感谢李老师的回答!我刚接触of不久,请问contour是什么边界条件吗,我找了好久没有找到,of的算例里面有类似的吗

  • 3 帖子
    395 浏览
    M

    感谢大佬

  • OpenFOAM 长波辐射模拟

    1
    1 帖子
    53 浏览
    S

    想请教一下大家openfoam中有涉及长波辐射模拟吗,如何实现呢?

  • chemkinToFoam

    4
    4 帖子
    215 浏览
    X

    @wangfei9088 不好意思,才看见消息。
    非常感谢您的回复,或许我还是应该使用FLUENT去实习自己的需求。

  • 搅拌桨叶附近压力异常

    21
    21 帖子
    2k 浏览
    1

    @青山 好的谢谢!

  • 后向台阶流动的入口速度给定问题

    2
    2 帖子
    190 浏览
    A

    我算358

  • 2 帖子
    68 浏览
    C

    给大家分享一下当采用自定义的求解器对波浪进行数值仿真的时候采用wave2Foam waveGaugeProbes对波高进行监测
    当前对波高进行监测主要有wave2Foam中的waveGaugeProbes,IHFoam和olaFlow都有自己的波高监测仪,OpenFOAM中也有interfaceHeight函数对波高进行监测。
    但是有一个问题是,当采用interfaceHeight对alpha.water进行监测的时候,会导致OpenFOAM运行速度慢,而采用自定义的求解器对波高进行监测的时候,那只能采用sampleDict对alpha.water进行监测,这样的结果是在postProcessing会生成一系列的时间文件,需要采用其他方法对这一些列的时间文件中的波高重新提取,也是很不方便。
    因此我这边就是结合wave2Foam中的waveGaugeProbes和interFoam,这样在interFOAM求解器运行的时候,可以采用wave2Foam中的波高仪进行监测,这样的效率会得到很大的提高。

    wave2foam waveGuages.png
    1.把interFoam求解器拷贝到wave2Foam路径的waves2Foam/applications/solvers/solvers2206_PLUS(当然这个求解器solvers2206_PLUS对应的是OpenFOAM相应的版本)
    2.在interFoam文件夹中修改Make/files中修改EXE = $(FOAM_USER_APPBIN)/DinterFoam,使得编译后的程序在platforms中
    3.在这个拷贝的interFoam文件夹中的Make/Options中添加如上图所示2和3步的关于wave2foam的代码
    4.对wave2Foam进行编译就行
    使用方法
    1.在constant文件中添加probeDefinitions文件,这个文件是在wave2Foam中就有的,主要是用来设置波高仪
    2.采用wave2foam的命令waveGaugesNProbes,就可以生成waveGaugesNProbes文件
    3.在controlDict中添加waveGaugesNProbes文件中的 自定义波高仪名称_controlDict
    4.OKOK
    完美实现
    地下这个是放在github的文件,和上面也是一模一样
    https://github.com/byChen47/waveHeightGauge

  • 多相流的扭矩提取

    5
    5 帖子
    133 浏览

    @tidedrinker 你好,我发现of9中可以在force文件中单独定义相名称来提取相分数和对应的密度,输出的力和力矩如下:

    forces forces write: sum of forces: pressure : (-10.813 0 -5.80003) viscous : (-0.000457782 -0.000707157 0.000145593) porous : (0 0 0) sum of moments: pressure : (-0.00441956 4.53963 -0.00703327) viscous : (-3.21179e-05 7.86609e-05 -2.42533e-05) porous : (0 0 0)

    我的搅拌轴是y轴,所以我的扭矩是否就是4.53963N·M,但是这和实验值相差甚远,实验值大概只有0.06N·M,这是为什么?是不是还需要对这个力矩进行下一步处理才可以得到扭矩?需要除以密度嘛?

  • blockMesh楔形体网格划分

    5
    5 帖子
    345 浏览
    J

    @李东岳 ```
    /--------------------------------- C++ -----------------------------------\

    \ / F ield OpenFOAM: The Open Source CFD Toolbox \ / O peration Website: https://openfoam.org \ / A nd Version: 10 \/ M anipulation

    *---------------------------------------------------------------------------*/
    FoamFile
    {
    format ascii;
    class dictionary;
    object extrudeProperties;
    }
    // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //

    constructFrom patch;
    sourceCase "$FOAM_CASE";

    sourcePatches (front);
    exposedPatchName back;

    extrudeModel wedge;

    sectorCoeffs
    {
    axisPt (0 0 0);
    axis (0 -1 0);
    angle 5;
    }

    flipNormals false;
    mergeFaces false;

    // ************************************************************************* //

    老师,这是我的extrudeMeshDict文件,我用这个文件进行拉伸,它提示我的wedge不是一个平面,为什么会这样呢?

    /--------------------------------- C++ -----------------------------------\

    \ / F ield OpenFOAM: The Open Source CFD Toolbox \ / O peration Website: https://openfoam.org \ / A nd Version: 10 \/ M anipulation

    *---------------------------------------------------------------------------*/
    FoamFile
    {
    format ascii;
    class dictionary;
    object blockMeshDict;
    }
    // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //

    convertToMeters 0.001;

    vertices
    (
    (0 0 0)//0
    (7 0 0)//1
    (10 0 0)//2
    (1010 0 0)//3
    (2010 0 0)//4

    (0 5 0)//5 (5 5 0)//6 (10 5 0)//7 (1010 5 0)//8 (2010 5 0)//9 (0 40 0)//10 (7 40 0)//11 (10 40 0)//12 (1010 40 0)//13 (2010 40 0)//14 (0 1640 0)//15 (7 1640 0)//16 (10 1640 0)//17 (0 0 10)//0 (7 0 10)//1 (10 0 10)//2 (1010 0 10)//3 (2010 0 10)//4 (0 5 10)//5 (7 5 10)//6 (10 5 10)//7 (1010 5 10)//8 (2010 5 10)//9 (0 40 10)//10 (7 40 10)//11 (10 40 10)//12 (1010 40 10)//13 (2010 40 10)//14 (0 1640 10)//15 (7 1640 10)//16 (10 1640 10)//17

    );

    blocks
    (
    hex (0 1 6 5 18 19 24 23) (20 50 1) simpleGrading (1 ((1 1 50)(0 0 0)) 1)//1

    hex (1 2 7 6 19 20 25 24) (30 50 1) simpleGrading (((1 1 0.05)(0 0 0)) ((1 1 50)(0 0 0)) 1)//2 hex (2 3 8 7 20 21 26 25) (300 50 1) simpleGrading (((1 1 1500)(0 0 0)) ((1 1 50)(0 0 0)) 1)//3 hex (3 4 9 8 21 22 27 26) (40 50 1) simpleGrading (1 ((1 1 50)(0 0 0)) 1)//4 hex (5 6 11 10 23 24 29 28) (20 100 1) simpleGrading (1 1 1)//5 hex (6 7 12 11 24 25 30 29) (30 100 1) simpleGrading (((1 1 0.05)(0 0 0)) 1 1)//6 hex (7 8 13 12 25 26 31 30) (300 100 1) simpleGrading (((1 1 1500)(0 0 0)) 1 1)//7 hex (8 9 14 13 26 27 32 31) (40 100 1) simpleGrading (1 1 1)//8 hex (10 11 16 15 28 29 34 33) (20 400 1) simpleGrading (1 ((1 1 50)(0 0 0)) 1)//9 hex (11 12 17 16 29 30 35 34) (30 400 1) simpleGrading (((1 1 0.05)(0 0 0)) ((1 1 50)(0 0 0)) 1)//10

    );

    boundary
    (
    inlet
    {
    type patch;
    faces
    (
    (15 33 34 16)
    (16 34 35 17)
    );
    }

    outlet { type patch; faces ( (4 9 27 22) (9 14 32 27) ); } upper { type symmetry; faces ( (12 30 31 13) (13 31 32 14) ); } axis { type symmetry; faces ( (0 18 23 5) (5 23 28 10) (10 28 33 15) ); } bottom { type wall; faces ( (0 1 19 18) (1 2 20 19) (2 3 21 20) (3 4 22 21) ); } wall { type wall; faces ( (12 17 35 30) ); } back { type symmetry; faces ( (0 5 6 1) (1 6 7 2) (2 7 8 3) (3 8 9 4) (5 10 11 6) (6 11 12 7) (7 12 13 8) (8 13 14 9) (10 15 16 11) (11 16 17 12) ); } front { type symmetry; faces ( (18 19 24 23) (19 20 25 24) (20 21 26 25) (21 22 27 26) (23 24 29 28) (24 25 30 29) (25 26 31 30) (26 27 32 31) (28 29 34 33) (29 30 35 34) ); }

    );

    // ************************************************************************* //

    这是我的blockMesh文件,根据你之前的提示,我看那个算例里面是先定义了一个矩形出来,然后进行拉伸的,想仿照人家的来做
  • 欧拉拉格朗日方法的问题

    8
    8 帖子
    524 浏览
    G

    是的,趋势没啥问题,但是看起来这个case对于网格的依赖性没那么强,网格和液滴直径的比值小于1的情况也和另外的基本吻合

  • 6 帖子
    453 浏览
    C

    @evensun 哦哦这样。

    燃烧如果是FPV啥的,想耦合FLUENT自带的确实有些麻烦,不如直接把FPV涉及的那些变量都自定义uds再求解。如果不是FPV就不清楚了。

  • 升阻力系数计算问题

    4
    4 帖子
    359 浏览
    S

    @Joker 谢谢,我改一下试试

  • turbinesFoam致动线模型

    3
    3 帖子
    137 浏览
    S

    @李东岳 李老师你好,这有论文的,这个是作者写的
    Bachant, P., Goude, A., and Wosnik, M. (2016) Actuator line modeling of vertical-axis turbines. arXiv preprint 1605.01449.

  • 物性库编译提示 undefined reference

    2
    2 帖子
    127 浏览
    L

    因为密度和温度是成反比,多项式拟合即使用7次方拟合,效果仍然较差,而不可压理想气体模型可以又快又准的计算出密度

  • 如何加速压力求解器收敛

    6
    6 帖子
    450 浏览
    学流体的小明

    😅我自己写的程序必须是simple的分解,scotch都不能用,更不用说metis了

  • #无痛苦N-S方程笔记#勘误

    2
    2 帖子
    173 浏览
    李东岳

    已更新,确实有遗漏。谢谢!

  • reactingFoam/reactingDNS计算一维球形火焰传播

    1
    1 帖子
    156 浏览
    B

    (One dimensional spherical flame initiation)
    我们最近在用reactingFoam、reactingDNS(考虑了组分的详细输运特性)来计算1D球形火焰传播,并且想与ASURF对照。在该算例中,火焰是在固定区域内沉积能量来引发的,该能量沉积区域位于1D计算域的左侧,长度rig=0.2mm,持续时长tig=0.2ms。该能量直接加入能量方程:power=energy/(4/3X3.14Xrig^3Xtig)Xexp(-(r/rig)^6)(X表示*)。在算例中使用topoSet工具降能量沉积区域disZone圈出来,求解器内部读取该disZone中的网格变化,然后对能量源项进行赋值。

    首先创建能量源项sparkE,读取算例中给的能量沉积半径dis_radius,持续时间dis_duration,能量dis_energy。 volScalarField sparkE ( IOobject ( "sparkE", runTime.timeName(), mesh, IOobject::NO_READ, IOobject::AUTO_WRITE ), mesh, dimensionedScalar("sparkE", dimEnergy/dimTime/dimVolume, 0.0) // J/m3/s ); IOdictionary chemistryDict ( IOobject ( thermo.phasePropertyName("chemistryProperties"), thermo.db().time().constant(), thermo.db(), IOobject::MUST_READ, IOobject::NO_WRITE, false ) ); const dictionary& dischargeTypeDict = chemistryDict.subDict("sparkDischarge"); scalar dis_duration = dischargeTypeDict.lookupOrDefault<scalar>("dis_duration", 2E-4); // 200 us scalar dis_radius = dischargeTypeDict.lookupOrDefault<scalar>("dis_radius", 2E-4); // 200 um scalar dis_energy = dischargeTypeDict.lookupOrDefault<scalar>("dis_energy", 1E-3); // 1 mJ //scalar dis_central = dischargeTypeDict.lookupOrDefault<scalar>("dis_central", 1E-3); // 1 mJ scalar PI = 3.1415926; scalar dis_paramTot = dis_energy/(4.0*PI/3.0*dis_radius*dis_radius*dis_radius*dis_duration); //scalar dis_paramTot = dis_energy/(PI*Foam::sqrt(PI)*dis_radius*dis_radius*dis_radius*dis_duration); 在求解器主程序中,对能量赋值 const label& disZoneID = mesh.cellZones().findZoneID("disZone"); const labelList& cZone = mesh.cellZones()[disZoneID]; forAll(mesh.C(),cellI) { sparkE[cellI] = 0.0; } if (disZoneID != -1 && cZone.size() > 0 && runTime.value() <= dis_duration) { forAll(cZone,cellI) { sparkE[cZone[cellI]] = dis_paramTot*std::exp(-PI/4.0*pow(mesh.C()[cZone[cellI]].x()/dis_radius,6)); // sparkE[cZone[cellI]] = dis_paramTot*std::exp(-pow(mesh.C()[cZone[cellI]].x()/dis_radius,2)); } } if ( (runTime.value()+runTime.deltaTValue()) > dis_duration && runTime.value() < dis_duration ) { runTime.setDeltaT((dis_duration-runTime.value())); } Info << " sparkE max/min: "<< max(sparkE).value() <<" "<< min(sparkE).value() << endl;

    但是如果采用ASURF中不能点火的能量,在openfoam中竟然能点燃。
    并且火焰半径(即火焰位置,定义为最大温度梯度)随时间的变化与ASURF完全不一样,图片左侧为openfoam计算结果,右侧为ASURF计算结果。请大家指点
    07dcd785-c9d6-4cca-a1e6-37f88d616cc8-flameRadius_left(reactingFoam)_right(ASURF).png

    算例可见附件:
    1Dflame_case.zip