CFD中文网

    CFD中文网

    • 登录
    • 搜索
    • 最新

    Smagorinsky模型及边界条件设置问题

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

      昨天听同济大学曹教授的讲座(报告讲座 || 计算流体动力学在风工程中的应用),提到Smagorinsky模型(视频时间47:51),比较建议使用van Direst函数。

      1b5cf19a29f0986780dc2146dc62dae.png

      关于OpenFOAM在使用Smagorinsky模型及边界条件有些疑问如下:

      1. 如何调用van Direst 函数问题。是否选用 Smagorinsky 模型,然后 printCoeffs 设置为 on,就会自动调用下边的 vanDriestCoeffs ?
      /*--------------------------------*- C++ -*----------------------------------*\
      | =========                 |                                                 |
      | \\      /  F ield         | OpenFOAM: The Open Source CFD Toolbox           |
      |  \\    /   O peration     | Version:  v2012                                 |
      |   \\  /    A nd           | Website:  www.openfoam.com                      |
      |    \\/     M anipulation  |                                                 |
      \*---------------------------------------------------------------------------*/
      FoamFile
      {
          version     2.0;
          format      ascii;
          class       dictionary;
          location    "constant";
          object      turbulenceProperties;
      }
      // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
      
      simulationType LES;
      
      LES
      {
          LESModel        Smagorinsky;
      
          turbulence      on;
      
          printCoeffs     on;
      
          delta           cubeRootVol;
      
          dynamicKEqnCoeffs
          {
              filter simple;
          }
      
          cubeRootVolCoeffs
          {
              deltaCoeff      1;
          }
      
          PrandtlCoeffs
          {
              delta           cubeRootVol;
              cubeRootVolCoeffs
              {
                  deltaCoeff      1;
              }
      
              smoothCoeffs
              {
                  delta           cubeRootVol;
                  cubeRootVolCoeffs
                  {
                      deltaCoeff      1;
                  }
      
                  maxDeltaRatio   1.1;
              }
      
              Cdelta          0.158;
          }
      
          vanDriestCoeffs
          {
              delta           cubeRootVol;
              cubeRootVolCoeffs
              {
                  deltaCoeff      1;
              }
      
              smoothCoeffs
              {
                  delta           cubeRootVol;
                  cubeRootVolCoeffs
                  {
                      deltaCoeff      1;
                  }
      
                  maxDeltaRatio   1.1;
              }
      
              Aplus           26;
              Cdelta          0.158;
          }
      
          smoothCoeffs
          {
              delta           cubeRootVol;
              cubeRootVolCoeffs
              {
                  deltaCoeff      1;
              }
      
              maxDeltaRatio   1.1;
          }
      }
      // ************************************************************************* //
      
      
      1. 使用了 van Direst 函数,是否可同时在边界条件中设置壁面函数?还是这两者只能二选一?

      2. 使用 van Direst 函数是否有要求壁面的 y+ 必须小于1?如果 y+ 无法满足小于1的条件,比如大概10左右,是否适合使用 van Direst 函数?

      3. 使用 van Direst 函数,对应的 nut 边界条件设置,wall 边界怎么设置才合理,是设置为 calculated,还是用壁面函数 nutUSpaldingWallFunction,还是用 fixedValue 为0?

      /*--------------------------------*- C++ -*----------------------------------*\
      | =========                 |                                                 |
      | \\      /  F ield         | OpenFOAM: The Open Source CFD Toolbox           |
      |  \\    /   O peration     | Version:  v2012                                 |
      |   \\  /    A nd           | Website:  www.openfoam.com                      |
      |    \\/     M anipulation  |                                                 |
      \*---------------------------------------------------------------------------*/
      FoamFile
      {
          version     2.0;
          format      ascii;
          class       volScalarField;
          location    "1";
          object      nut;
      }
      // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
      
      dimensions      [0 2 -1 0 0 0 0];
      
      internalField   uniform 0;
      
      boundaryField
      {
         
          inlet
          {
              type            calculated;
              value           uniform 0;
          }
      
          outlet
          {
              type            calculated;
              value           uniform 0;
          }
      
          top
          {
              type            symmetry; 
          }
      
          ground
          {
      
              type            calculated;
              value           uniform 0;
      
              //type            nutUSpaldingWallFunction;
              //value           $internalField;
      
              //type            fixedValue;
              //value           uniform 0;
          }
          
          frontAndBack
          {
              type            symmetry;
          }
      
      
          Building
          {
              type            calculated;
              value           uniform 0;
      
      
              //type            nutUSpaldingWallFunction;
              //value           $internalField;
              
              //type            fixedValue;
              //value           uniform 0;
          }
      
      }
      
      
      // ************************************************************************* //
      

      初学OpenFOAM,问题比较基础,请各位大佬指点迷津,非常感谢

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

        捕获.JPG

        vanDirest一般不使用壁面函数,因此网格要足够细、nut就是0。

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

        C 1 条回复 最后回复 回复 引用
        • C
          coolhhh @李东岳 最后由 编辑

          @李东岳
          谢谢李老师,另外如果想用 Smagorinsky模型+壁面函数,设置不调用 van Direst 函数,是 turbulence 设置为 off 吗?刚试了 printCoeffs 好像只是显示系数作用而已

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

            @coolhhh Smagorinsky模型+壁面函数,需要设置nut。你那个没用上vanDirest,vanDirest要改delta函数。你用的是cuberoot现在。

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

            C 1 条回复 最后回复 回复 引用
            • C
              coolhhh @李东岳 最后由 编辑

              @李东岳
              谢谢老师,不好意思问了非常小白的问题。刚再查了下,官方文档的设置:OpenFOAM: User Guide: Van Driest ,OpenFOAM: User Guide: Cube-root volume 。下面是官方的设置说明,再次感谢李老师

              delta           vanDriest;
              
              vanDriestCoeffs
              {
                  delta           <geometricDelta>;
              
                  // Optional entries
                  kappa           0.41;
                  Aplus           26;
                  Cdelta          0.158;
                  calcInterval    1;
              }
              
              X 1 条回复 最后回复 回复 引用
              • X
                xjwang @coolhhh 最后由 xjwang 编辑

                @coolhhh 请问你这个vandriestCoeffs中的delta是怎么设置的?用的cubeRootVol吗?你在最开始贴的那个代码,应该是复制的Openfoam basic trainning那个文档中的设置吧:

                @coolhhh 在 Smagorinsky模型及边界条件设置问题 中说:

                vanDriestCoeffs
                {
                delta cubeRootVol;

                官方文档中这么是这样的:

                @coolhhh 在 Smagorinsky模型及边界条件设置问题 中说:

                vanDriestCoeffs
                {
                delta <geometricDelta>;

                搜了一下也没找到具体的例子,希望不吝赐教!
                如果用van driest的话,是不是nut在你的building表面是不是可以写成fixedvalue 0?还是只能在网格比较精细的时候才能使用fixedvalue 0?

                C 1 条回复 最后回复 回复 引用
                • C
                  coolhhh @xjwang 最后由 编辑

                  @xjwang

                  1 vandriestCoeffs中的delta设置

                  我在这个帖子CFD Online 上看到这个文件 projectReport,里边关于van Direst 的阐述:

                  微信图片_20220520132950.png

                  vanDirestDelta.c 中程序如下:

                      delta_ = min
                      (
                          static_cast<const volScalarField&>(geometricDelta_()),
                          (kappa_/Cdelta_)*((scalar(1) + small) - exp(-y/ystar/Aplus_))*y
                      );
                  

                  程序与官网的说明 OpenFOAM: User Guide: Van Driest 计算方法是一致的。因此我的理解是<geometricDelta>设置为cubeRootVol,就跟文档说明一样选一种geometric-based delta,然后会根据系数设置计算min delta。还可以参照李老师之前其他贴子的回复,也是这么设置。

                  2.png

                  2 nut的设置

                  nut的设置,我也不确定是设置 fixedValue=0 还是calculated。李老师说网格要足够细、nut就是0。因此我就设置为calculated,认为当网格足够细算出来就是0。我尝试过其他湍流模型,无论设置 fixedValue=0 还是calculated,结果也没很大区别。

                  X 1 条回复 最后回复 回复 引用
                  • X
                    xjwang @coolhhh 最后由 编辑

                    @coolhhh 感谢回复!

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