CFD中文网

    CFD中文网

    • 登录
    • 搜索
    • 最新

    在单管泊肃叶流动中与例子不符的问题(新手菜鸟)

    OpenFOAM
    4
    8
    1330
    正在加载更多帖子
    • 从旧到新
    • 从新到旧
    • 最多赞同
    回复
    • 在新帖中回复
    登录后回复
    此主题已被删除。只有拥有主题管理权限的用户可以查看。
    • 热
      热爱CFD的卡卡 最后由 编辑

      在网上找了一个学习open foam的算例学习文件,完全按照算例画网格和编写边界条件,最终结果与算例结果有很大的不同,对照例子找了半天没找到原因,希望各位大佬能帮忙看一下,感谢!

      自己的曲线结果
      !!自己结果.jpg
      例子的曲线
      例子曲线.jpg
      教程图
      34cfe050-4cc6-46aa-b128-f20a9eaad9aa-image.png
      61481554-507d-46df-bcda-8f5f9ca63ed0-image.png
      我的程序文件

      /*--------------------------------*- C++ -*----------------------------------*\
      | =========                 |                                                 |
      | \\      /  F ield         | OpenFOAM: The Open Source CFD Toolbox           |
      |  \\    /   O peration     | Version:  5                                     |
      |   \\  /    A nd           | Web:      www.OpenFOAM.org                      |
      |    \\/     M anipulation  |                                                 |
      \*---------------------------------------------------------------------------*/
      FoamFile
      {
          version     2.0;
          format      ascii;
          class       dictionary;
          location    "constant";
          object      turbulenceProperties;
      }
      // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
      
      simulationType laminar;
      
      /*RAS
      {
          // Tested with kEpsilon, realizableKE, kOmega, kOmegaSST, v2f,
          // ShihQuadraticKE, LienCubicKE.
          RASModel        kEpsilon;
      
          turbulence      on;
      
          printCoeffs     on;
      }*/
      
      
      // ************************************************************************* //
      
      
      /*--------------------------------*- C++ -*----------------------------------*\
      | =========                 |                                                 |
      | \\      /  F ield         | OpenFOAM: The Open Source CFD Toolbox           |
      |  \\    /   O peration     | Version:  5                                     |
      |   \\  /    A nd           | Web:      www.OpenFOAM.org                      |
      |    \\/     M anipulation  |                                                 |
      \*---------------------------------------------------------------------------*/
      FoamFile
      {
          version     2.0;
          format      ascii;
          class       dictionary;
          location    "constant";
          object      turbulenceProperties;
      }
      // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
      
      simulationType laminar;
      
      // ************************************************************************* //
      
      
      /*--------------------------------*- C++ -*----------------------------------*\
      | =========                 |                                                 |
      | \\      /  F ield         | OpenFOAM: The Open Source CFD Toolbox           |
      |  \\    /   O peration     | Version:  5                                     |
      |   \\  /    A nd           | Web:      www.OpenFOAM.org                      |
      |    \\/     M anipulation  |                                                 |
      \*---------------------------------------------------------------------------*/
      FoamFile
      {
          version     2.0;
          format      ascii;
          class       volVectorField;
          object      U;
      }
      // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
      
      dimensions      [0 1 -1 0 0 0 0];
      
      internalField   uniform (0 0 0);
      
      boundaryField
      {
          inlet
          {
              type            fixedValue;
              value           uniform (1 0 0);
          }
      
          outlet
          {
              type            zeroGradient;
          }
      
          top
          {
              type            symmetryPlane;
          }
      
          bottom
          {
              type           fixedValue;
              value          uniform (0 0 0);
          }
      
          frontAndBack
          {
              type            empty;
          }
      }
      
      // ************************************************************************* //
      
      /*--------------------------------*- C++ -*----------------------------------*\
      | =========                 |                                                 |
      | \\      /  F ield         | OpenFOAM: The Open Source CFD Toolbox           |
      |  \\    /   O peration     | Version:  5                                     |
      |   \\  /    A nd           | Web:      www.OpenFOAM.org                      |
      |    \\/     M anipulation  |                                                 |
      \*---------------------------------------------------------------------------*/
      FoamFile
      {
          version     2.0;
          format      ascii;
          class       volScalarField;
          object      p;
      }
      // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
      
      dimensions      [0 2 -2 0 0 0 0];
      
      internalField   uniform 0;
      
      boundaryField
      {
          inlet
          {
              type            zeroGradient;
          }
      
          outlet
          {
              type            fixedValue;
              value           uniform 0;
          }
      
          top
          {
              type            symmetryPlane;
          }
      
          bottom
          {
              type            zeroGradient;
          }
      
      /*--------------------------------*- C++ -*----------------------------------*\
      | =========                 |                                                 |
      | \\      /  F ield         | OpenFOAM: The Open Source CFD Toolbox           |
      |  \\    /   O peration     | Version:  5                                     |
      |   \\  /    A nd           | Web:      www.OpenFOAM.org                      |
      |    \\/     M anipulation  |                                                 |
      \*---------------------------------------------------------------------------*/
      FoamFile
      {
          version     2.0;
          format      ascii;
          class       dictionary;
          location    "system";
          object      fvSolution;
      }
      // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
      
      solvers
      {
          p
          {
              solver          GAMG;
              tolerance       1e-06;
              relTol          0.1;
              smoother        GaussSeidel;
          }
      
          U
          {
              solver          smoothSolver;
              smoother        symGaussSeidel;
              tolerance       1e-05;
              relTol          0.1;
          }
      }
      
      SIMPLE
      {
          nNonOrthogonalCorrectors 0;
          consistent      yes;
      
          residualControl
          {
              p               1e-5;
              U               1e-5;
          }
      }
      
      relaxationFactors
      {
          equations
          {
              U               0.9; // 0.9 is more stable but 0.95 more convergent
              ".*"            0.9; // 0.9 is more stable but 0.95 more convergent
          }
      }
      
      
      // ************************************************************************* //
      
      1 条回复 最后回复 回复 引用
      • S
        shepherd 最后由 编辑

        关注一下,也等一个回复:xiezuoye:

        1 条回复 最后回复 回复 引用
        • 热
          热爱CFD的卡卡 最后由 编辑

          例子用的openfoam3.0,我用的5.0,应该和版本没有问题吧
          我自己看曲线的感觉是考虑粘滞力的设置问题,但是不知道在程序中哪一块出了问题,

          1 条回复 最后回复 回复 引用
          • V
            veen 最后由 编辑

            今天刚好跑了一个,可以试试这个:Hagen_Poiseuille_flow.zip
            你的案例中
            fvSolution 的U final和p final没有定义
            p文件中frontAndBack粘漏了?

            热 1 条回复 最后回复 回复 引用
            • 热
              热爱CFD的卡卡 @veen 最后由 编辑

              @veen 是的,p文件中frontAndBack粘漏了,现在就下载例子,试一试,感谢

              1 条回复 最后回复 回复 引用
              • 李东岳
                李东岳 管理员 最后由 编辑

                把你的粘度调高试试

                线上CFD课程开始报名:http://www.dyfluid.com/class.html

                CFD高性能服务器 http://dyfluid.com/servers.html

                热 1 条回复 最后回复 回复 引用
                • 热
                  热爱CFD的卡卡 最后由 编辑

                  找到错误了,网格尺度与例子不符,因为例子设置的流体粘度偏低,所以只有在毫米尺度的网格观察才会是抛物线,而我的网格是0.1m的,所以看上去就像是一条陡峭的直线。
                  图中就是网格尺度,我错误写成0.1了。
                  85960c09-b854-48b0-822e-e38bf1af5154-image.png

                  1 条回复 最后回复 回复 引用
                  • 热
                    热爱CFD的卡卡 @李东岳 最后由 编辑

                    @东岳 是的,粘度调高也可以出现抛物线,感谢 感谢。我把网格尺度变小了,也能观察到。

                    1 条回复 最后回复 回复 引用
                    • First post
                      Last post