CFD中文网

    CFD中文网

    • 登录
    • 搜索
    • 最新

    extra term twophasesystem.C

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

          if (pPrimeByA_.valid())
          {
              fvScalarMatrix alpha1Eqn
              (
                  fvm::ddt(alpha1) - fvc::ddt(alpha1)
                - fvm::laplacian(alpha1alpha2f()*pPrimeByA_(), alpha1, "bounded")
              );
      
              alpha1Eqn.relax();
              alpha1Eqn.solve();
      
              phase1_.alphaPhi() += alpha1Eqn.flux();
          }
      

      Hi everyone,

      I have a question that I need to add one term in phase fraction equation (alpha1Eqn), The following is my continuity equation:
      c8bfeb21-c01a-4906-a43f-d13382468cb3-image.png
      Thus, could I add the term like "fvc::laplacian(phase2.turbulence().nut/mysigma, alpha1)? Thanks for your attention.

      1 条回复 最后回复 回复 引用
      • K
        kimy 最后由 编辑

        anybody wish to give some suggestions?

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

          The equation you posted is not correct. Also, it looks like a constrain condition rather than a transport equation.

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

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

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

            @东岳 Thanks dongyue. I am not sure you are saying which transport equation. However the equation in the image, this is the continuity equation in spalding's IPSA method and we published a lot of paper in which this equation used.

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

              替代文字

              The first term is a second rank tensor, the second term is a scalar, they are inconsistent.

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

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

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

                @东岳 ed9efe4c-136f-45e9-8590-980ed552d851-image.png

                1 条回复 最后回复 回复 引用
                • K
                  kimy 最后由 编辑

                  Dongyue, I understood what you mean but I also found the solution procedure of alpha transport equation in Passalacqua's paper, like following, both of them include the term of fraction gradient.
                  fb85c24f-5537-4f96-84cd-cdf146f8121f-image.png

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

                    @kimy You can have a look at alphaEqn of driftFluxFoam. A similar alpha equation with diffusion term was implemented.

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

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

                    1 条回复 最后回复 回复 引用
                    • K
                      kimy 最后由 编辑

                      @东岳 在 extra term twophasesystem.C 中说:

                      driftFluxFoam

                      Thank you for your advice. The problem is that there is no alphaEqu.H in twophaseeulerfoam and only the code lines related to "alpha1Eqn" are given in twophasesystem.C file as I mentioned in top. I am confused that why no convective term in that equation. And after I compile this twophasesystem.C file, how can I link it to the solver file?

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

                        I am confused that why no convective term in that equation.

                        Don't bother with the convection term. It was handled by explicit FCT scheme. So if you manage to add the diffusion term, it should work.

                        And after I compile this twophasesystem.C file, how can I link it to the solver file?

                        If you modify the original file, you dont need to link it, it is linked automatically

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

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

                        1 条回复 最后回复 回复 引用
                        • K
                          kimy 最后由 编辑

                          Really thank you. Usually, if we would like to add a new model, such as a turbulence model, we need to compile it as a user's library and then include the path "lib***" in the system/controdict. Here, I am not sure what I should do agter I compile "twophasesysterm.C".
                          2bd91ed2-546f-4d37-9f0f-cdb134b09233-image.png

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

                            Yes you can do it. twoPhaseSystem is a combined lib. It combines lots of class into one lib. Its difficult to explain here. I would suggest you modify the original file directly to see if it works. If it works, then you can consider to build your own lib.

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

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

                            K 2 条回复 最后回复 回复 引用
                            • K
                              kimy 最后由 编辑

                              I see. Great!
                              Grazie mille.

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

                                @东岳 Hi Dongyue, it works. Now I am trying to add it into user's library. I changed the Make/files as following and I include "libmycompressibleTwoPhaseSystem" in system/controDict, but the solver neglect it. I really don't know how to make the solver to call the modified "twophasesystem.C", or I need to change the name of "twophasesystem.C". Do you have any suggestion? Thanks.

                                LIB = $(FOAM_USER_LIBBIN)/libmycompressibleTwoPhaseSystem
                                
                                X 1 条回复 最后回复 回复 引用
                                • X
                                  xpqiu 教授 @kimy 最后由 编辑

                                  @kimy 在 extra term twophasesystem.C 中说:
                                  but the solver neglect it.

                                  Is there any error message, like "cannot find dynamic library..." or "duplicate entry ..." ?

                                  K 1 条回复 最后回复 回复 引用
                                  • K
                                    kimy @xpqiu 最后由 编辑

                                    @xpqiu Thanks for your reply. In fact, There is no error for the compilation and simulation. I don't know how to link the new modified twophasesystem.C to the solver.

                                    1 条回复 最后回复 回复 引用
                                    • K
                                      kimy 最后由 编辑

                                      Anyone has suggestion about how to link the revised twophasesystem.C to the solver as a user's library?

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

                                        @东岳 Hi, dongyue. I tried many ways to reach my goal, such as create a newtwophasesystem.C (I found this file in the reactingtwophaseeulerfoam, so it should be possible to use a new one) and compile. But I still cannot link the new file to the solver if I put it in the user's library. Do you have any suggestion? Many Thanks.

                                        1 条回复 最后回复 回复 引用
                                        • bestucan
                                          bestucan 版主 副教授 最后由 编辑

                                          the easy way:

                                          cd \$FOAM_LIBBIN/ 
                                          mv libcompressibleTwoPhaseSystem.so libcompressibleTwoPhaseSystem.so.bk
                                          cp \$FOAM_USER_LIBBIN/libmycompressibleTwoPhaseSystem.so ./libcompressibleTwoPhaseSystem.so
                                          

                                          the best best way:

                                          add below line in solver's Make/options file

                                          -L$(FOAM_USER_LIBBIN) \
                                          -lmycompressibleTwoPhaseSystem
                                          

                                          make sure every line have "\" end except last line.

                                          滚来滚去……~(~o ̄▽ ̄)~o 滚来滚去都不能让大家看出来我不是老师么 O_o

                                          异步沟通方式(《posting style》from wiki)(下载后打开):
                                          https://www.jianguoyun.com/p/Dc52X2sQsLv2BRiqnKYD
                                          提问的智慧(github在gitee的镜像):
                                          https://gitee.com/bestucan/How-To-Ask-Questions-The-Smart-Way/blob/master/README-zh_CN.md

                                          1 条回复 最后回复 回复 引用
                                          • K
                                            kimy 最后由 编辑

                                            Thanks a lot. The problem was solved.

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