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

    OpenFOAM
    2
    0 赞同
    2 帖子
    213 浏览
    A

    我算358

  • 0 赞同
    2 帖子
    84 浏览
    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

  • 多相流的扭矩提取

    OpenFOAM
    5
    0 赞同
    5 帖子
    217 浏览

    @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,这是为什么?是不是还需要对这个力矩进行下一步处理才可以得到扭矩?需要除以密度嘛?

  • 论坛最近是不是显示有问题

    C斯达克
    7
    0 赞同
    7 帖子
    2k 浏览

    @李东岳 感觉好像能行了:140: 感谢李老师!

  • blockMesh楔形体网格划分

    OpenFOAM
    5
    0 赞同
    5 帖子
    451 浏览
    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文件,根据你之前的提示,我看那个算例里面是先定义了一个矩形出来,然后进行拉伸的,想仿照人家的来做
  • 有大神精通Basilisk的吗?

    C斯达克
    11
    0 赞同
    11 帖子
    3k 浏览
    L

    @zhaocx q求问一下basilisk怎么实现并行操作呢

  • 欧拉拉格朗日方法的问题

    OpenFOAM
    8
    0 赞同
    8 帖子
    606 浏览
    G

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

  • 0 赞同
    6 帖子
    536 浏览
    C

    @evensun 哦哦这样。

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

  • 升阻力系数计算问题

    OpenFOAM
    4
    0 赞同
    4 帖子
    433 浏览
    S

    @Joker 谢谢,我改一下试试

  • turbinesFoam致动线模型

    OpenFOAM
    3
    0 赞同
    3 帖子
    174 浏览
    S

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

  • 物性库编译提示 undefined reference

    OpenFOAM
    2
    0 赞同
    2 帖子
    144 浏览
    L

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

  • 0 赞同
    3 帖子
    601 浏览
    M

    你这read data 是干什么的 没找到哪里调用了啊。

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

    OpenFOAM
    6
    0 赞同
    6 帖子
    556 浏览
    学流体的小明

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

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

    OpenFOAM
    2
    0 赞同
    2 帖子
    210 浏览
    李东岳

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

  • 0 赞同
    1 帖子
    174 浏览
    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

  • 变量未初始化问题

    OpenFOAM
    1
    0 赞同
    1 帖子
    100 浏览
    T

    在lagrangian/intermediate/submodels/Kinematic/ParticleForces路径下添加了一个电场力模型,编译通过,case计算时报错,似乎跟q和E变量未初始化有关,代码小白,求指点。

    563ac197-796b-4021-a867-d6ecd3a34007-image.png
    648c605a-93af-4ff6-9178-8242e48f84bd-image.png

    // * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * // template<class CloudType> Foam::ElectricfieldForce<CloudType>::ElectricfieldForce ( CloudType& owner, const fvMesh& mesh, const dictionary& dict, const word& forceType, const volScalarField& qField ) : ParticleForce<CloudType>(owner, mesh, dict, forceType, true), EName_(this->coeffs().template lookupOrDefault<word>("E", "E")), EInterpPtr_(NULL), qField_(qField) { Info<< "-----p in ELe\n" << endl; qInterpPtr_.reset ( interpolation<scalar>::New ( owner.solution().interpolationSchemes(), qField ).ptr() ); Info<< "-----p2 in ELe\n" << endl; } template<class CloudType> Foam::ElectricfieldForce<CloudType>::ElectricfieldForce ( const ElectricfieldForce& etf ) : ParticleForce<CloudType>(etf), EName_(etf.EName_), EInterpPtr_(NULL), qField_(etf.qField_) {}
  • paraview如何衡量长度

    OpenFOAM
    6
    0 赞同
    6 帖子
    3k 浏览
    L

    收藏!!

  • 关于paraview后处理颗粒的问题

    OpenFOAM
    9
    0 赞同
    9 帖子
    4k 浏览
    L

    学习ing

  • 网站安装的软件包

    C斯达克
    1
    0 赞同
    1 帖子
    211 浏览
    李东岳

    网站安装:

    sudo apt-get install python3-sphinx python3-pip pip install myst-parser sphinx-design sphinx-rtd-theme
  • 0 赞同
    1 帖子
    352 浏览
    G

    看论文的时候看到了这种速度云图,有大神知道是如何后处理得到的吗,可以通过tecplot实现吗?
    屏幕截图 2024-04-29 102300.png