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/)
-   -   Source term in the compressible momentum equation (https://www.cfd-online.com/Forums/openfoam-programming-development/151399-source-term-compressible-momentum-equation.html)

dduque April 9, 2015 17:13

Source term in the compressible momentum equation
 
Hello everyone.

I'm studying this piece of code for the source term in the momentum equation. It's a laminar, compressible simulation in which mu is NOT constant.

Code:

tmp<fvVectorMatrix> laminar::divDevRhoReff(volVectorField& U) const
{
    return
    (
      - fvm::laplacian(muEff(), U)
      - fvc::div(muEff()*dev2(T(fvc::grad(U))))
    );
}

I'm guessing it means these right hand side terms in the Navier-Stokes momentum equation:

Laplacian( mu U) + div ( mu ( gradU^t - (2/3) divU I ) )

If mu was constant I would be happy, even if the second term is mathematically equal to (1/3) grad divU. There is surely some reason to write it this way. But I am concerned with the first term, which should be:

div ( mu gradU)

Perhaps that's what fvm::laplacian(muEff(), U) is ??

(It could also be mu Laplacian U, which wouldn't be good.)

Btw, it seems the fluid is supposed to be Stokesian, so that lamba+(2/3) mu =0, am I right?

Thanks!

Daniel

kebsiali April 9, 2015 17:33

Quote:

Originally Posted by dduque (Post 540902)
Perhaps that's what fvm::laplacian(muEff(), U) is ??

In openfoam fvm::laplacian(a, b) is


\nabla \cdot \left( a \nabla b \right)


where a is to be linearized (explicit) and b is to be discretized

so yes is the answer to that little question

and dev is the deviatoric part which is the same as what you expect i think

dduque April 10, 2015 04:58

Quote:

Originally Posted by kebsiali (Post 540910)
In openfoam fvm::laplacian(a, b) is


\nabla \cdot \left( a \nabla b \right)


Great! Everything is fine, then. Yes, dev is the deviatoric part, and dev2 is a funny

dev2(s)=s - (2/3) trace(s) I

The deviatoric is

dev(s)=s - (1/3) trace(s) I ,

but it's precisely dev2 which is needed in this case.


All times are GMT -4. The time now is 02:01.