Navigation

    CFD中文网

    CFD中文网

    • Login
    • Search
    • 最新

    extra term twophasesystem.C

    OpenFOAM
    4
    20
    913
    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.
    • K
      kimy last edited by

          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 Reply Last reply Reply Quote
      • K
        kimy last edited by

        anybody wish to give some suggestions?

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

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

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

          K 1 Reply Last reply Reply Quote
          • K
            kimy @李东岳 last edited by 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 Reply Last reply Reply Quote
            • 李东岳
              李东岳 管理员 last edited by

              替代文字

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

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

              K 1 Reply Last reply Reply Quote
              • K
                kimy @李东岳 last edited by

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

                1 Reply Last reply Reply Quote
                • K
                  kimy last edited by

                  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 Reply Last reply Reply Quote
                  • 李东岳
                    李东岳 管理员 last edited by

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

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

                    1 Reply Last reply Reply Quote
                    • K
                      kimy last edited by

                      @东岳 在 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 Reply Last reply Reply Quote
                      • 李东岳
                        李东岳 管理员 last edited by

                        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://dyfluid.com/class.html
                        CFD高性能服务器 http://dyfluid.com/servers.html

                        1 Reply Last reply Reply Quote
                        • K
                          kimy last edited by

                          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 Reply Last reply Reply Quote
                          • 李东岳
                            李东岳 管理员 last edited by

                            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://dyfluid.com/class.html
                            CFD高性能服务器 http://dyfluid.com/servers.html

                            K 2 Replies Last reply Reply Quote
                            • K
                              kimy last edited by

                              I see. Great!
                              Grazie mille.

                              1 Reply Last reply Reply Quote
                              • K
                                kimy @李东岳 last edited by

                                @东岳 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 Reply Last reply Reply Quote
                                • X
                                  xpqiu 教授 @kimy last edited by

                                  @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 Reply Last reply Reply Quote
                                  • K
                                    kimy @xpqiu last edited by

                                    @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 Reply Last reply Reply Quote
                                    • K
                                      kimy last edited by

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

                                      1 Reply Last reply Reply Quote
                                      • K
                                        kimy @李东岳 last edited by

                                        @东岳 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 Reply Last reply Reply Quote
                                        • bestucan
                                          bestucan 版主 副教授 last edited by

                                          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 Reply Last reply Reply Quote
                                          • K
                                            kimy last edited by

                                            Thanks a lot. The problem was solved.

                                            1 Reply Last reply Reply Quote
                                            • First post
                                              Last post

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