OpenFOAM

4.5k Topics 26.5k Posts
  • 2 Posts
    944 Views

    现准备取图中一点进行测量,霜层顶部距离平板的长度,作为霜层厚度并绘制随时间t变化的曲线,请问该如何操作?
    QD}YL35CX{MJ~88OJX2UR`E.png (此图为3600s时的霜层分布,不同颜色表示的体积含冰率不一样,取得点为蓝色和白色交界处某一点)

  • 2 Posts
    1k Views

    看看算例下面有没有带空格的、中文的、以及其他可能的乱七八糟的文件,包括隐藏的文件

  • hpc安装openfoam5问题

    1 Posts
    500 Views

    之前在安装openfoam5,以为安装ok了,但是在hpc提交脚本文件时,出现如下错误,rmall-.png

    在cfdonline上面找到如下相关帖子:
    https://www.cfd-online.com/Forums/openfoam-solving/216750-error-when-running-through-slurm.html
    不知道是编译还未完成,或是需要打个补丁?还望解答,谢谢!

  • OpenFoam新手安装求助

    8 Posts
    2k Views

    @东岳 谢谢,已经安装成功,非常感谢!

  • 关于geometricOneField的理解

    4 Posts
    1k Views

    湍流模型中的alpha是1,之所以调用,是为了节省代码复用,rho也是一样的,不可压缩里面也调用rho。但是在可压缩里面,rho就不是1了

    如果想在epsilon source term中加入基于volScalarField类型的alpha的一些计算,该如何实现?

    代码:

    const volScalarField& alphaField = mesh_.lookupObject<volScalarField>("alpha");

    然后你就可以调用alphaField了,上面代码没测试,你看看能不能用,不确定kEpsilon.C里面有没有mesh_成员,没有的话换一个别的

  • 直接计算气泡流问题,欢迎讨论

    10 Posts
    3k Views

    不过我碰到一个问题,这样的计算的时候单核计算可以进行,但是并行会碰到“mpirun noticed that process rank 0 with pid on node exited on signal 8”这个问题。谷歌也没找到

  • 5 Posts
    2k Views

    最近打算重写一个 :mihu:

  • 2 Posts
    1k Views

    @星星星星晴请问 如何在paraview中获得particle的速度 中说:

    如何能在某一个time step 获得这个截面上的particle的速度?

    如果这个time step上截面没有粒子,该怎么办呢?

  • 虚拟机计算扩容问题

  • Openfoam残差监控与判断

    1 Posts
    812 Views

    大家好,
    我最近计算了一个简单的ramp问题,使用OF5.0的simpleFoam求解,通过设置p和U的收敛条件为1E-6,计算自动停止。

    我的残差图如下:
    d9f121d8-a721-4dc7-9aa0-e7605837d1a6-image.png
    8d6a934b-e015-4580-be61-fbe03e849112-image.png
    0f93e56c-5265-45cf-bbc2-565b422f404c-image.png

    请问如何来对残差图进行分析,是否对计算需要做出调整。

    谢谢

  • error: incomplete type is not allowed

    2 Posts
    907 Views

    在使用phaseCompressibleTurbulenceModel前,需要给出定义
    在主程序中添加#include "phaseCompressibleTurbulenceModel.H"

  • coalChemistryFoam如何添加热解模型

    3 Posts
    1k Views

    多谢老师指点

  • 1 Posts
    787 Views

    大家好!

    我现在利用interPhaseChangeFoam里面的LES 一方程涡粘模型 计算绕Clark-Y水翼空化流动,计算出的升力系数cl比试验值偏大一倍,总的空穴体积小与实验值。我分析是我计算的 流场压力,出了问题,我感觉主要可能是离散格式 和求解器的问题,请问谁 利用interPhaseChangeFoam里面的LES计算过水翼空化呢? 可以分享一下经验吗?

    谢谢!

    求解器设置

    /*--------------------------------*- C++ -*----------------------------------*\ | ========= | | | \\ / F ield | OpenFOAM: The Open Source CFD Toolbox | | \\ / O peration | Version: 4.0 | | \\ / A nd | Web: www.OpenFOAM.org | | \\/ M anipulation | | \*---------------------------------------------------------------------------*/ FoamFile { version 2.0; format ascii; class dictionary; location "system"; object fvSolution; } // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // solvers { alpha.water { nAlphaCorr 1; nAlphaSubCycles 1; cAlpha 1; MULESCorr yes; nLimiterIter 5; solver smoothSolver; smoother symGaussSeidel; tolerance 1e-8; relTol 0; maxIter 100; } alpha.waterFinal { nAlphaCorr 1; nAlphaSubCycles 1; cAlpha 1; MULESCorr yes; nLimiterIter 5; solver smoothSolver; smoother symGaussSeidel; tolerance 1e-8; relTol 0; maxIter 100; } "U.*" { solver smoothSolver; smoother symGaussSeidel; tolerance 1e-6; relTol 0; }; ".*(rho|rhoFinal)" { solver diagonal; } pcorr { solver PCG; preconditioner { preconditioner GAMG; tolerance 1e-05; relTol 0; smoother DICGaussSeidel; } tolerance 1e-05; relTol 0; maxIter 500; } pcorrFinal { solver PCG; preconditioner { preconditioner GAMG; tolerance 1e-05; relTol 0; smoother DICGaussSeidel; } tolerance 1e-05; relTol 0; maxIter 500; } Phi { $p_rgh; relTol 0; }; p_rgh { solver GAMG; tolerance 1e-07; relTol 0.00001; smoother DIC; } p_rghFinal { solver PCG; preconditioner { preconditioner GAMG; tolerance 1e-07; relTol 0; nVcycles 2; smoother DICGaussSeidel; nPreSweeps 2; } tolerance 1e-07; relTol 0; maxIter 1000; } U { solver smoothSolver; smoother GaussSeidel; tolerance 1e-06; relTol 0; nSweeps 1; } "(U|k|omega)" { solver smoothSolver; smoother symGaussSeidel; tolerance 1e-08; relTol 0.0001; } "(T|k|B|nuTilda).*" { solver smoothSolver; smoother symGaussSeidel; tolerance 1e-08; relTol 0; maxIter 100; } "(U|k|omega)Final" { solver smoothSolver; smoother symGaussSeidel; tolerance 1e-08; relTol 0; } } PIMPLE { momentumPredictor no; transonic no; nOuterCorrectors 1; nCorrectors 2; nNonOrthogonalCorrectors 0; } // ************************************************************************* //

    离散格式设置

    /*--------------------------------*- C++ -*----------------------------------*\ | ========= | | | \\ / F ield | OpenFOAM: The Open Source CFD Toolbox | | \\ / O peration | Version: 4.0 | | \\ / A nd | Web: www.OpenFOAM.org | | \\/ M anipulation | | \*---------------------------------------------------------------------------*/ FoamFile { version 2.0; format ascii; class dictionary; location "system"; object fvSchemes; } // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // ddtSchemes { default Euler; } gradSchemes { default Gauss linear; } divSchemes { default none; div(phi,alpha) Gauss vanLeer; div(phirb,alpha) Gauss linear; div(phi,rho) Gauss limitedLinear 1; div(rhoPhi,U) Gauss linearUpwind grad(U); div(phi,thermo:rho.water) Gauss upwind; div(phi,thermo:rho.air) Gauss upwind; div(rhoPhi,T) Gauss upwind; div(rhoPhi,K) Gauss upwind; div(phi,p) Gauss upwind; div(phi,k) Gauss upwind; div(rhoPhi,omega) Gauss limitedLinear 1; div(phi,omega) Gauss upwind; div(rhoPhi,k) Gauss upwind; div(((rho*nuEff)*dev2(T(grad(U))))) Gauss linear; } laplacianSchemes { default Gauss linear limited corrected 0.33; } interpolationSchemes { default linear; } snGradSchemes { default limited corrected 0.33; } wallDist { method meshWave; } // ************************************************************************* //
  • 并行计算无法输出结果

    1 Posts
    629 Views

    在算例运行中出现如下提示,计算结果也不按writeInterval设置输出。请问这种情况该怎么解决

    83900b4f-bcfd-480d-a512-145f554ffaf7-image.png

  • 涡激振动振幅监测

    2 Posts
    934 Views

    @VamosZhi 忘说了,是OpenFOAM,用的pimpleDyMFoam

  • 大网格-奇怪报错

    8 Posts
    8k Views

    @白礼耕 “”应该只是报警不是报错。

    时间好久了,当时好像用到的命令:

    mpiexec --mca mpi_warn_on_fork 0 -n 288 pisoFoam -parallel > 0-pisoFoam_LES_288_${PBS_JOBID}.out
  • 6 Posts
    2k Views

    哦,那就是和层流计算时的压力有区别了。

  • 感谢李老师!

    3 Posts
    1k Views

    感谢 :wolaile:

  • partialSlip

    1 Posts
    516 Views

    请问大家知道partialSlip的使用格式么,我在tutorials中没有找到,谢谢!

  • 5 Posts
    2k Views

    这个问题主要是找到边界面正对的面,然后通过neighbor-owner找到单元。可以通过边界面的点找到共点的edge,然后找到另一顶点,再来查找面。呃,好像有点繁琐。第二个可以通过particle类,将边界面法相取反作为位移方向,edge长度作为位移,trackToFace找到面。记得用labelPair保存相邻单元。

  • 3 Posts
    1k Views

    @yfclark 谢谢你的建议,我去了解了解。

  • 3 Posts
    2k Views

    https://github.com/OpenFOAM/OpenFOAM-6/blob/master/src/TurbulenceModels/turbulenceModels/linearViscousStress/linearViscousStress.C 这里面计算的散度

    template<class BasicTurbulenceModel> Foam::tmp<Foam::fvVectorMatrix> Foam::linearViscousStress<BasicTurbulenceModel>::divDevRhoReff ( volVectorField& U ) const { return ( - fvc::div((this->alpha_*this->rho_*this->nuEff())*dev2(T(fvc::grad(U)))) - fvm::laplacian(this->alpha_*this->rho_*this->nuEff(), U) ); }
  • 1 Posts
    686 Views

    各位老师好,我最近研究了一下reactingmultiphaseEulerFoam,对其中的表面张力的计算有一些困惑:
    在pEqn.H中定义了:

    phigFs.set ( phasei, ( alpharAUfs[phasei] *( ghSnGradRho - (fvc::interpolate(phase.rho() - rho))*(g & mesh.Sf()) - fluid.surfaceTension(phase)*mesh.magSf() ) ).ptr() );

    最后通过该式更新各项的速度:

    mSfGradp = pEqnIncomp.flux()/rAUf; forAll(phases, phasei) { phaseModel& phase = phases[phasei]; phase.U() = HbyAs[phasei] + fvc::reconstruct ( alpharAUfs[phasei]*mSfGradp - phigFs[phasei] ); phase.U().correctBoundaryConditions(); fvOptions.correct(phase.U()); }

    我个人推导的公式为:
    78b21ff7-7858-4542-a777-3f2e993f3957-image.png
    代码里面实现的公式为:
    efa31825-beb7-4ee1-8483-980d46400369-image.png
    表面张力项多了一个alpha,请大佬看看,不知道是我推导错了还是代码有bug
    @东岳
    reactingtwophaseEulerFoam中的式(20)和式(21)有个地方符号有问题:
    d07eb439-d134-41ab-862d-944dc3a3efd9-image.png
    最后压力项前应该为$-\alpha_{d}$

  • New snappyHexMesh directional stretching

    5 Posts
    2k Views

    多次尝试,终于搞定了,打扰了

  • 1 Posts
    773 Views

    80a6ed67-6d71-4c4f-9c0b-de7dd78ac863-image.png
    如图左侧进口压力为0梯度,来流速度为抛物线分布,上下两边为0,中间最大。中点处速度从零开始平缓增大至最大值,其随时间的变化规律如下式,请问这种情况如何设置0文件夹下的边界条件呢?谢谢
    4956dd8a-7642-4853-9570-74be9dab8073-image.png

  • 2 Posts
    1k Views

    自问自答一波:
    我现在感觉好像是检查constant/porosityProperties 文件里面的字典. 只要里面存在字典 cellZone(键) 对应的 name_(值)的block就被当作是多孔介质, 然后通过

    cellZoneID = mesh.cellZone().indices(name_)

    这个函数来确认该区域的ID
    上述内容是在
    porosityModel.H porosityModel.C中感觉到的.但是没有找到实质的证据.

  • TwoPhaseEulerFOAM的一些小问题

    11 Posts
    3k Views

    @东岳 明白了,谢谢东岳老师

  • 16 Posts
    8k Views

    @王金成 我用的1812,可以编译SWAK,不过需要自己做些配置,不然会报错,过段时间我写个教程。

  • List类的问题

    5 Posts
    2k Views

    @浪迹天大 谢谢您! 问题解决了

  • 3 Posts
    1k Views

    @东岳 把基类重写了一遍,实现了我想要的功能,虽然麻烦,但是相当于在Cloud里面添加功能,对原有的代码结构基本没有影响,还算不错的思路。

  • 8 Posts
    4k Views

    @hy1112006 谢谢,之前网址打不开,没有看见里面内容,今天基本看懂了。

  • Paraview中如何输出焓值和熵值?

    6 Posts
    3k Views

    @qjh888 您好,不知道您如何更新的solver?方便讲一下吗?最近我也在做相关的事情。

  • 求助一些FireFoam的学习资料

    1 Posts
    729 Views

    各位CFD朋友,目前我想学习一下firefoam,但是baidu搜到的资料实在有限,如果方便的话能否提供一些算例资料给我,谢谢大家。

  • 1 Posts
    635 Views

    在求解可压缩流动时,出现了如下情况:导致最终结果发散,可能是哪个参数的问题呢?

    rhoEqn max/min : 1.21419 0
  • 13 Posts
    4k Views

    @东岳 请问东岳老师,可以用速度基求解器比如rhoCentralFoam求解这个算例么?还得加个温度去解压力?
    没算过DNS,望指点!谢谢!

  • simpleFoam中的 rAtU

    8 Posts
    4k Views
  • 5 Posts
    2k Views

    @东岳 谢谢李老师,ABL是大气边界层,是风场的边界条件,

  • 3 Posts
    1k Views

    已经解决了。谢谢您。可能是自己安装的经验不够吧。

  • 2 Posts
    2k Views

    滤镜-time annodate
    即可

  • 咨询,关于文件读写的问题

    10 Posts
    3k Views

    :tishizi:

  • 8 Posts
    2k Views

    谢谢,谢谢。

  • 6 Posts
    4k Views

    @程迪 程老师您好,请问您知道如何把Prt定义成某个表达式吗?

  • 湍流算例porousBlockage出现错误

    1 Posts
    720 Views

    东岳老师好,大家好:
    我是正在学习OpenFOAM的新手
    最近在学习模拟湍流时运行pisoFoam下自带算例porousBlockage时出现错误:

    Create time Create mesh for time = 0 Reading field p Reading field U Reading/calculating face flux field phi Selecting incompressible transport model Newtonian Selecting turbulence model type laminar Selecting laminar stress model Stokes No MRF models present Creating finite volume options from "constant/fvOptions" Selecting finite volume options model type explicitPorositySource Source: porosity1 - selecting cells using cellZone porousBlockage --> FOAM FATAL ERROR: Cannot find cellZone porousBlockage Valid cellZones are 0() From function void Foam::fv::cellSetOption::setCellSet() in file cellSetOption/cellSetOption.C at line 142. FOAM exiting

    请问是什么原因呢?

    此外,还想问一下,如果使用标准k-epsilon模型(RAS算例下)模拟湍流,进出口使用什么条件比较合适呢?

  • 动网格设置两块旋转域问题?

    1 Posts
    771 Views

    如果想要设置两块旋转域(对转),dynamicMeshDict应该怎么编写呢?我像下面那样编写,结果只有sector_part2旋转。

    dynamicFvMesh dynamicMotionSolverFvMesh; motionSolverLibs ("libfvMotionSolvers.so"); motionSolver solidBody; cellZone sector_part1; solidBodyMotionFunction rotatingMotion; origin (0 0 0); axis (0 0 1); omega 112.573737; // rad/s cellZone sector_part2; solidBodyMotionFunction rotatingMotion; origin (0 0 0); axis (0 0 1); omega -112.573737; // rad/s

    正确的编写形式应该是怎样的呢?

  • 3 Posts
    1k Views

    @星星星星晴

    :wolaile: 没太细看哈不过

    我需要return dClass,PUr和PUz。

    你可以把这三个打包成一个struct或者class,而不是三个哦,然后返回这个struct或者class,差不多这种

    class test { public: scalar A_; scalar B_; } test returnFunction(test& f) { f.A_ = 1; f.B_ = 2; return f; }
  • 复杂几何体的绘制

    1 Posts
    653 Views

    想问一下,针对复杂几何,大家都用什么软件画然后导入啊?

  • paraview显示网格的问题

    2 Posts
    1k Views

    还没关注过这个问题 :xinlei:

  • 1 Posts
    977 Views

    对于使用KomegaSST模型作低雷诺数的湍流管流模拟,当y+值小于1时,是不是可以认为网格足够精细,无需再细化?
    另外k omega nut三个量大概在哪个范围内合理?我的结果大概是以下:

    k 10的负3次方

    omega 最大50w+,最小500左右
    nut 10的负10到负5次方

  • 6 Posts
    3k Views

    这里整理了一些 找对象 的诀窍:xinxin:

  • forAll boundary

    3 Posts
    1k Views

    应该是Sb.boundaryField() 返回const reference
    Sb.boundaryField().ref() 返回 reference
    根据我的经验是这样,如果错误的话把编译错误贴上来
    认真看看代码很简单的,编译器的错误已经告诉你所有信息了!