CFD Online Discussion Forums

CFD Online Discussion Forums (https://www.cfd-online.com/Forums/)
-   OpenFOAM Programming & Development (https://www.cfd-online.com/Forums/openfoam-programming-development/)
-   -   Adding volumetric body force term to compressibleInterFoam (https://www.cfd-online.com/Forums/openfoam-programming-development/167579-adding-volumetric-body-force-term-compressibleinterfoam.html)

alicharchi March 4, 2016 14:05

Adding volumetric body force term to compressibleInterFoam
 
I would like to add a volumetric body force term (F) to compressibleInterFoam. Is it done by just adding F to UEqn in UEqn.H file? Like this:

Code:

    fvVectorMatrix UEqn
    (
        fvm::ddt(rho, U)
      + fvm::div(rhoPhi, U)
      + turbulence->divDevRhoReff(U)
      - F
    );

    UEqn.relax();

    if (pimple.momentumPredictor())
    {
        solve
        (
            UEqn
        ==
            fvc::reconstruct
            (
                (
                    interface.surfaceTensionForce()
                  - ghf*fvc::snGrad(rho)
                  - fvc::snGrad(p_rgh)
                ) * mesh.magSf()
            )
        );

        K = 0.5*magSqr(U);
    }


alicharchi March 4, 2016 14:07

Of course, I have already defined and calculated F. The issue is just including it in momentum equation.

brabblbassi April 4, 2016 20:12

You should read this:

http://www.cfd-online.com/Forums/ope...ody-force.html

http://www.cfd-online.com/Forums/ope...-pressure.html

http://www.tfd.chalmers.se/~hani/kur...7/rhiechow.pdf

https://openfoamwiki.net/index.php/B...sinesqPisoFoam

http://openfoamwiki.net/index.php/BubbleFoam

...

Hope this helps!

Best,
Pascal

alicharchi April 18, 2016 11:40

Thanks pascal! It helped me very much!


All times are GMT -4. The time now is 13:06.