Navigation

    CFD中文网

    CFD中文网

    • Login
    • Search
    • 最新

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

    OpenFOAM
    4
    8
    1055
    Loading More Posts
    • Oldest to Newest
    • Newest to Oldest
    • Most Votes
    Reply
    • Reply as topic
    Log in to reply
    This topic has been deleted. Only users with topic management privileges can see it.
    • 热
      热爱CFD的卡卡 last edited by

      在网上找了一个学习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 Reply Last reply Reply Quote
      • S
        shepherd last edited by

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

        1 Reply Last reply Reply Quote
        • 热
          热爱CFD的卡卡 last edited by

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

          1 Reply Last reply Reply Quote
          • V
            veen last edited by

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

            热 1 Reply Last reply Reply Quote
            • 热
              热爱CFD的卡卡 @veen last edited by

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

              1 Reply Last reply Reply Quote
              • 李东岳
                李东岳 管理员 last edited by

                把你的粘度调高试试

                CFD课程 改成线上了 http://dyfluid.com/class.html
                CFD高性能服务器 http://dyfluid.com/servers.html

                热 1 Reply Last reply Reply Quote
                • 热
                  热爱CFD的卡卡 last edited by

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

                  1 Reply Last reply Reply Quote
                  • 热
                    热爱CFD的卡卡 @李东岳 last edited by

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

                    1 Reply Last reply Reply Quote
                    • First post
                      Last post

                    CFD中文网 | 东岳流体 | 京ICP备15017992号-2