Navigation

    CFD中文网

    CFD中文网

    • Login
    • Search
    • 最新
    1. Home
    2. wangfei9088
    W
    • Profile
    • Following 0
    • Followers 3
    • Topics 2
    • Posts 62
    • Groups 0

    wangfei9088

    @wangfei9088

    19
    Profile views
    62
    Posts
    3
    Followers
    0
    Following
    Joined Last Online

    wangfei9088 Unfollow Follow

    Latest posts made by wangfei9088

    • RE: OpenFOAM turbulentInlet 求助

      @冠竹 :143: 不是大佬,共同进步:high:

      posted in OpenFOAM
      W
      wangfei9088
    • RE: OpenFOAM turbulentInlet 求助

      turbulentInlet理论公式可以看OpenFOAM Guide的定义:
      https://www.openfoam.com/documentation/guides/latest/api/classFoam_1_1turbulentInletFvPatchField.html

      我看到的也就一篇文献描述过这个进口条件,也可能我看的文献少。供参考。
      https://doi.org/10.1063/5.0017663

      efc43a2a-5f9c-42d6-ab5b-ed731c4bb229-image.png

      posted in OpenFOAM
      W
      wangfei9088
    • RE: 《OpenFOAM用户指南》勘误

      网站上的《OpenFOAM用户指南-9》有个小typo。writeCellCentres,应该是英式拼写Centre,美式的拼写Center不行,我刚试过了。

      捕获.PNG

      posted in OpenFOAM
      W
      wangfei9088
    • RE: 湍流模型增加一laplacian项问题请教

      @李东岳 噢噢,谢谢东岳老师。

      posted in OpenFOAM
      W
      wangfei9088
    • 湍流模型增加一laplacian项问题请教

      请教各位老师,我想在湍流模型中增加一项
      \begin{equation}
      \frac{\partial}{\partial{x_j}} \left(\frac{\partial S}{\partial x_j} \right)
      \end{equation}
      其中
      \begin{equation}
      S=\sqrt{S_{ij} S_{ij}}
      \end{equation}
      \begin{equation}
      S_{ij}=\frac{1}{2} \left( \frac{\partial u_i}{\partial x_j} +\frac{\partial u_j}{\partial x_i} \right)
      \end{equation}
      关键在方程(1)的植入问题,在湍流输运方程中,是不是可以直接写成fvc::laplacian(S)?
      如果是,在case的fvSchemes中,如果laplacianSchemes是default,是不是就不用管了?
      因为S比较特殊,我没见过fvc::laplacian(S)这么写的。烦请大佬解惑。

      posted in OpenFOAM
      W
      wangfei9088
    • RE: 《无痛苦N-S方程笔记》勘误

      @李东岳 :xinxin2:学无止境,接着嗨:high:

      posted in C斯达克
      W
      wangfei9088
    • RE: 《无痛苦N-S方程笔记》勘误

      @李东岳 哈哈,东岳老师,我不是大佬。小青铜科研找不到方向和突破口,:136:只能多看看书。:mihu: 确实这次基本把湍流模型都撸了一遍,模型加代码。每次看这本笔记都收获很大。:high:

      posted in C斯达克
      W
      wangfei9088
    • RE: 《无痛苦N-S方程笔记》勘误

      :xiezuoye: 图中的$r$应该是
      \begin{equation}
      r=\min\left(\frac{\nu+\nu_t}{|\nabla \mathbf{U}| \kappa^2 \tilde{d}^2}, 10\right)
      \end{equation}
      后面$\tilde{d}$更严格的写法应该是
      \begin{equation}
      \tilde{d}=\max\left[y-\left(1- \tanh\left(\left(8r\right)^3\right)\right) \max\left(y-C_{DES}\Delta, 0\right), 0\right]
      \end{equation}
      1.PNG
      请东岳老师斟酌。:zoule:

      posted in C斯达克
      W
      wangfei9088
    • RE: pressureReference

      @evensun

      我猜你的疑问应该是,为什么类似下面这段代码编译器会报错?

      1 pressureReference pressureReference(p, simple.dict());
      
      2 pressureReference pressureReference(pf, simple.dict());
      

      这两条语句有4个pressureReference,我分别编号为1, 2, 3和4号。

      1. 编译器运行到第一行代码时,假设当前函数体内没有声明pressureReference,编译器就会首先去全局域(global )里寻找pressureReference是什么,当找到pressureReference的声明,发现是个类时,编译器把它(1号)解析为一个类(class)。
      2. 编译器继续运行,遇到2号pressureReference,编译器主动构造类型为pressureReference(1号)的对象pressureReference(2号)。
        注意:这两个名称一样,编译器会怎么做?当前作用域里的pressureReference(2号)会把全局域(global)里的pressureReference(1号)隐藏掉,1号就发挥不了作用了。也就是说,在此后的作用域里pressureReference只是个对象,只发挥2号pressureReference的作用。
      3. 编译器继续运行,遇到第二行的3号pressureReference,此时编译器将这个pressureReference解析为一个对象(2号)。
      4. 编译器最后发现4号pressureReference,这是什么,3号对象后面一个4号对象,蜜汁操作,编译器理解不了,编译就失败了。

      那如果我一定要让3号pressureReference发挥类(class)的作用(像1号pressureReference一样),有没有办法?
      有的。在第二行代码的3号前加作用域解析运算符(::),编译器就会去找全局(global)的pressureReference声明了,像上面的第一步一样,然后把3号解析为类(class),再把4号理解为对象。编译就能通过了。
      有兴趣可以试试。

      1 pressureReference pressureReference(p, simple.dict());
      
      2 ::pressureReference pressureReference(pf, simple.dict());
      
      posted in OpenFOAM
      W
      wangfei9088
    • RE: pressureReference

      @evensun 二楼这种写法调用的是第一种构造函数,编译器肯定不会报错,但是应该不会实现一楼描述的目的,一楼默认的是调用第二种构造函数。
      我觉得可以这么改:

      1. 在createFields.H最下方加这段代码:
      volScalarField pf
      (
          IOobject
          (
              "pf",
              runTime.timeName(),
              mesh,
              IOobject::MUST_READ,
              IOobject::AUTO_WRITE
          ),
          mesh
      );
      
      pressureReference PR(pf, simple.dict());//新的对象PR,用新的pf作为参数
      
      mesh.setFluxRequired(pf.name());
      
      1. 在pEqn.H中pEqn.setReference(pressureReference.refCell(), pressureReference.refValue())函数后面加一段
      ......
      pEqn.setReference
      (
          pressureReference.refCell(),
          pressureReference.refValue()
      );
      //原代码
      
      //add
      pEqn.setReference
      (
          PR.refCell(),
          PR.refValue()
      );
      //end
      
      ......
      

      可以试试看能不能实现。我这没装OpenFOAM-9,就没测试。

      posted in OpenFOAM
      W
      wangfei9088