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/)
-   -   continuity source term in momentum Eq (https://www.cfd-online.com/Forums/openfoam-programming-development/148955-continuity-source-term-momentum-eq.html)

nimasam February 23, 2015 00:56

continuity source term in momentum Eq
 
would you please help me to figure out following source codes:

in interPhaseChangeFoam, UEqn.H:

Code:

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

in DPMFoam, UEqn.H:

Code:

fvVectorMatrix UcEqn
(
    fvm::ddt(alphac, Uc) + fvm::div(alphaPhic, Uc)
  - fvm::Sp(fvc::ddt(alphac) + fvc::div(alphaPhic), Uc)
  + continuousPhaseTurbulence->divDevRhoReff(Uc)
 ==
    (1.0/rhoc)*cloudSU
);


as much as i understand both "Sp" lines should be mathematically zero :), they are continuity terms which multiply with U, my question is why they add to momentum equation and why it considered as negative source terms?

Tushar@cfd February 24, 2015 01:09

Quote:

Originally Posted by nimasam (Post 532953)
would you please help me to figure out following source codes:

in interPhaseChangeFoam, UEqn.H:

Code:

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

in DPMFoam, UEqn.H:

Code:

fvVectorMatrix UcEqn
(
    fvm::ddt(alphac, Uc) + fvm::div(alphaPhic, Uc)
  - fvm::Sp(fvc::ddt(alphac) + fvc::div(alphaPhic), Uc)
  + continuousPhaseTurbulence->divDevRhoReff(Uc)
 ==
    (1.0/rhoc)*cloudSU
);


as much as i understand both "Sp" lines should be mathematically zero :), they are continuity terms which multiply with U, my question is why they add to momentum equation and why it considered as negative source terms?

Dear Nima,

I guess the additional term is due to variable density (rho). Had it been incompressible fluid it would have been zero. Since, for compressible flows these variables cannot be ignored. Please rectify me if I miss anything as I am not well versed with compressible flows.

-
Best Regards!

sharonyue March 5, 2015 17:22

1 Attachment(s)
Hello guys!!

Pls see the image:
http://www.cfd-online.com/Forums/att...1&d=1425593902

The reason maybe in this way, its conservative.

This is like twoPhaseEulerFoam's code. In openfoam 22x, this kind of equation is implemented in non-conservative way, but in OpenFOAM 23x, its implemented in conservative way. U can compare the code to check it out.

Best,

RjwV March 13, 2015 04:39

Hello everyone,

I am not sure but perhaps this has something to do with the diagonal dominance of the system? Although this would only make sense if the Sp term would be negative before converging to zero... if it would be slightly positive before converging to zero it would negatively affect the diagonal dominance...

Again, I am not sure about this, one of the remaining mysteries I am trying to figure out.

Kind regards,
Ramon


All times are GMT -4. The time now is 23:21.