Skip to content

OpenFOAM

OpenFOAM交流区

5.3k 主题 31.8k 帖子
  • 合集:OpenFOAM安装准备工作贴

    已固定
    28
    28 帖子
    42k 浏览
    N

    请问那个含有很多版本的离线的虚拟机,怎么设置共享文件夹啊,VMtools设置了出错呢?

  • OpenFOAM教程 初级入门建议

    已固定
    55
    55 帖子
    197k 浏览
    李东岳

    新版的transportProperties改成了physicalProperties,你改个名

  • 热压通风p_rgh边界条件设置

    1
    1 帖子
    7 浏览
    K

    各位大佬,小白请教(Openfoam org V12):
    想问一下在设置热压通风下的缝隙开孔渗透风时,我采用了prghTotalPressure边界,设定:

    room_window { type prghTotalPressure; p0 uniform 0; }

    设定pRef在文件constant/pRef
    为101325

    问题在于如此计算的渗透风速过高 不符合常理,1.2高差的窗户居然上边缘风速有3.5m/s。

    初步排查因该确认为 prghTotalPressure中的p0为固定值pRef,外界压力没有随高差下降,导致流域内的p_rgh全为正值,且不同高度处的 p_rgh差值近似为 rg*高差

    所以想要请教一下各位前辈:
    1.是否是我的边界设置错误
    2.如果是p0的问题 我该如何设置随高度变化的外部压力呢(用ai帮忙写的压力边界会使计算直接发散,如下):

    room_window { type codedFixedValue; value $internalField; name simplePrghPressure; code #{ // 简化版本 - 手动指定重力 const vector g(0, -9.81, 0); // 重力矢量 // 硬编码字段名 const word rhoName = "rho"; const word UName = "U"; // 获取边界场 const fvPatchScalarField& rhoBoundary = patch().lookupPatchField<volScalarField, scalar>(rhoName); const fvPatchVectorField& UBoundary = patch().lookupPatchField<volVectorField, vector>(UName); // 获取坐标 const vectorField& C = patch().Cf(); scalarField p0(C.size()); // 参考参数 const scalar p0_ref = 0; // 参考压力 const scalar H_ref = 0; // 参考高度 const scalar rho_ref = 1.2; // 参考密度 (kg/m³) // 线性压力分布 forAll(C, i) { scalar h = C[i].y() - H_ref; p0[i] = p0_ref - rho_ref * mag(g) * h; } // 计算prghTotalPressure vectorField hVector(C.size()); forAll(C, i) { hVector[i] = vector(0, C[i].y() - H_ref, 0); } operator== ( p0 - 0.5*rhoBoundary*magSqr(UBoundary) - rhoBoundary*(g & hVector) ); #}; // 必需字段 rho rho; U U; }
  • OpenFOAM编译时内部编译器出错

    19
    19 帖子
    67 浏览
    A

    @李东岳 我只复制了0 constant system,里面都是数字啊 会有问题吗

  • tecplot Linux版安装

    5
    5 帖子
    2k 浏览
    A

    @陶震 谷歌搜一下tecplot 360 ex 和关键字SSQ, SSQ是破解组的名字

  • 加密网格周围的结果不连续

    6
    6 帖子
    58 浏览
    李东岳

    160万太难debug。你可以用2D网格,做个3000-5000的,然后也是类似这种非均一细化。看看有没有问题。

  • interIsofoam射流问题

    3
    3 帖子
    32 浏览
    X

    @李东岳 感谢东岳老师的回复,设置我也贴一下:

    FoamFile { version 2.0; format ascii; class dictionary; location "system"; object fvSolution; } // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // solvers { "alpha.phase1.*" { nAlphaCorr 3; nAlphaSubCycles 1; alphaOuterCorrectors yes; cAlpha 0; isoFaceTol 1e-6; surfCellTol 1e-6; nAlphaBounds 3; snapTol 1e-12; clip true; gardAlphaNormal false; MULESCorr yes; nLimiterIter 3; solver smoothSolver; smoother symGaussSeidel; tolerance 1e-8; relTol 0; orientationMethod LS; //RDF splitWarpedFace false; writePlicFields false; mapAlphaField true; nAlphaSubCycles 1; cAlpha 1; } "pcorr.*" { solver GAMG; tolerance 1e-08; relTol 0.01; smoother DIC; cacheAgglomeration no; } p_rgh { solver GAMG; tolerance 1e-08; relTol 0.01; smoother DIC; cacheAgglomeration no; } p_rghFinal { $p_rgh; relTol 0; tolerance 1e-9; } U { solver smoothSolver; smoother symGaussSeidel; tolerance 1e-07; relTol 0; } UFinal { $U; tolerance 1e-06; relTol 0; } kFinal { $k; solver smoothSolver; smoother symGaussSeidel; tolerance 1e-06; relTol 0; } epsilonFinal { $epsilon; solver smoothSolver; smoother symGaussSeidel; tolerance 1e-06; relTol 0; } epsilon { solver smoothSolver; smoother symGaussSeidel; tolerance 1e-06; relTol 0; } k { solver smoothSolver; smoother symGaussSeidel; tolerance 1e-06; relTol 0; } } PIMPLE { momentumPredictor yes; nOuterCorrectors 3; nCorrectors 5; nNonOrthogonalCorrectors 1; pRefPoint (0.01 0.01 0.01); pRefValue 0; } reconstructionSchemes { alpha.phase1 { method isoAlpha; isoAlphaMethod isoAlpha; alpha alpha.phase1; isoValue 0.5; surfaceCellSize 0; linearCorrection true; smoothNormals true; nSmoothNormals 3; cellNormalMethod corrected; faceNormalMethod corrected; } } relaxationFactors { fields { } equations { ".*" 1; } } FoamFile { version 2.0; format ascii; class dictionary; location "system"; object fvSchemes; } // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // ddtSchemes { default CrankNicolson 1; } gradSchemes { default Gauss linear ; } divSchemes { div(Phi,U) Gauss linearUpwind grad(U); div(rhoPhi,U) Gauss limitedLinearV 1; div(phi,alpha.phase1) Gauss interfaceCompression vanLeer 3; div(phirb,alpha) Gauss interfaceCompression; div(phi,k) Gauss upwind; div(phi,epsilon) Gauss upwind; div((muEff*dev(T(grad(U))))) Gauss linear; div(((rho*nuEff)*dev2(T(grad(U))))) Gauss linear; } laplacianSchemes { default Gauss linear corrected; } interpolationSchemes { default linear; } snGradSchemes { default corrected; } interfaceCompression { cAlpha 2; } wallDist { method meshWave; } fluxRequired { default no; p_rgh; pcorr; alpha.phase1; } FoamFile { version 2.0; format ascii; class dictionary; location "system"; object setFieldsDict; } // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // defaultFieldValues ( volScalarFieldValue alpha.phase1 1 ); regions ( cylinderToCell { p1 (0 0 0); p2 (0 0 0.004); radius 0.0003925; fieldValues ( volScalarFieldValue alpha.phase1 0 ); } ); FoamFile { version 2.0; format ascii; class dictionary; location "system"; object controlDict; } // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // application interIsoFoam; startFrom startTime; startTime 0; stopAt endTime; endTime 0.2; deltaT 0.0001; writeControl adjustableRunTime; writeInterval 0.005; purgeWrite 0; writeFormat ascii; writePrecision 6; writeCompression uncompressed; timeFormat general; timePrecision 6; runTimeModifiable yes; adjustTimeStep yes; maxCo 5; maxAlphaCo 1; maxDeltaT 0.01; libs ("libfiniteVolume.so" "libsampling.so"); functions { bubbleTracking { type surfaces; libs ("libsampling.so"); surfaceFormat vtk; fields (alpha.phase1 U); surfaces ( bubbleSurface { type isoSurface; isoField alpha.phase1; isoValue 0.5; interpolate true; } ); executionInterval 5; } gasVolumeFraction { type volFieldValue; libs ("libfieldFunctionObjects.so"); enabled true; operation average; fields (alpha.phase1); mean on; base time; writeControl timeStep; writeInterval 1; log true; valueOutput true; writeFields false; surfaceFormat none; format csv; } FoamFile { format ascii; class volScalarField; location "0"; object epsilon; } // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // dimensions [0 2 -3 0 0 0 0]; internalField uniform 1e-6; boundaryField { outlet { type zeroGradient; } inlet { type fixedValue; value uniform 1.04e5; } nozzlewall { type epsilonWallFunction; value uniform 1e-6; } bottom { type epsilonWallFunction; value uniform 1e-6; } pipewall { type epsilonWallFunction; value uniform 1e-6; } } FoamFile { version 2.0; format ascii; class volScalarField; object k; } // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // dimensions [0 2 -2 0 0 0 0]; internalField uniform 1e-6; boundaryField { outlet { type zeroGradient; } inlet { type fixedValue; value uniform 11.34; } nozzlewall { type kqRWallFunction; value uniform 1e-6; } bottom { type kqRWallFunction; value uniform 1e-6; } pipewall { type kqRWallFunction; value uniform 1e-6; } } FoamFile { version 2.0; format ascii; class volScalarField; object nut; } // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // dimensions [0 2 -1 0 0 0 0]; internalField uniform 1e-6; boundaryField { outlet { type calculated; value uniform 0; } inlet { type calculated; value uniform 0; } nozzlewall { type nutkWallFunction; value uniform 0; } bottom { type nutkWallFunction; value $internalField; } pipewall { type nutkWallFunction; value uniform 0; } } FoamFile { version 2.0; format ascii; class volScalarField; object p_rgh; } // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // dimensions [1 -1 -2 0 0 0 0]; internalField uniform 0; boundaryField { outlet { type totalPressure; p0 uniform 0; } inlet { type fixedFluxPressure; value uniform 0; } nozzlewall { type fixedFluxPressure; value uniform 0; } bottom { type fixedFluxPressure; value uniform 0; } pipewall { type fixedFluxPressure; value uniform 0; } }

    具体就是这样,设定喷气体,容器里面充满液体,改了一个月也没怎么收敛,头大得很,之前画了个200w的网格,△t很小就调粗网格了,能够调成功的话打算在捕获相界面的方法上下点功夫。

  • 基于PIMPLE算流固耦合的数值方法优化

    2
    2 帖子
    39 浏览
    李东岳

    一般情况,如果可以的话,piso+小Co更好一些。PIMPLE适合小Co算的时间步实在太长了难以忍受那种。

    你的初始残差什么样的。把你log贴一下

  • 单空泡溃灭

    8
    8 帖子
    1k 浏览
    S

    @李东岳 在 单空泡溃灭 中说:

    bubbleCollapse.tar.gz

    适配openfoam10

    @李东岳 在 单空泡溃灭 中说:

    bubbleCollapse.tar.gz

    适配openfoam10

    非常感谢

  • 请教一下关于openfoam湍流模型的设置问题

    5
    5 帖子
    78 浏览
    C

    假如约束太弱的话,就是会漂出去一段距离,也和实际情况相符。可以提高约束刚度试试。

  • 15 帖子
    3k 浏览
    C

    @Prometheus10 对,“界面褶皱”的问题一直存在的,加密三相接触线附近网格会好一些,但是不能完全祛除,原因未知。

  • Openfoam虚拟机全系列压缩包损坏

    4
    4 帖子
    65 浏览
    C

    好嘞谢谢您

  • 三维圆柱绕流案例

    6
    6 帖子
    104 浏览
    P

    @李东岳 好的 那我换个版本吧

  • vmware虚拟机 复制粘贴不成功

    4
    4 帖子
    117 浏览
    C

    东岳老师,我之前电脑坏了现在电脑在重新下载Openfoam虚拟机全系列,发现你那个保存到百度网盘上的虚拟机全系列好像坏了,您能再上传一下吗,我解压的时候说压缩包已损坏

  • 使用sprayFoam求解器设置多喷雾入口算例

    8
    8 帖子
    3k 浏览
    R

    或许可以在createClouds.H中声明多个basicSprayCloud对象,并将相应的源项添加进去

  • OpenFoam柴油机模拟求指导

    8
    8 帖子
    176 浏览
    L

    @李东岳 感谢老师,我已在那个帖子上上传了

  • 免费帮助debug算例

    4
    4 帖子
    3k 浏览
    L

    老师您好,这是我请教的问题

    case在这里下载链接

    感谢老师

  • 请教一个关于两相流激波的问题

    8
    8 帖子
    1k 浏览
    A

    @Lubing 好的好的,十分感谢

  • 求教换热器表面换热功率的计算

    4
    4 帖子
    118 浏览
    李东岳

    我对paraview那个操作也不熟悉。我只对openfoam代码稍微熟悉。paraview我只会看结果复杂的我也不会

  • 怎样添加新的equationOfState?

    5
    5 帖子
    102 浏览
    U

    另外我在youtube上找到一个较为详细的教程,需要的朋友可以看看。
    https://www.youtube.com/watch?v=jJHOeDZJUrU