CFD Online Discussion Forums (http://www.cfd-online.com/Forums/)
-   OpenFOAM Programming & Development (http://www.cfd-online.com/Forums/openfoam-programming-development/)
-   -   Viscous term expansion (http://www.cfd-online.com/Forums/openfoam-programming-development/86460-viscous-term-expansion.html)

 santiagomarquezd March 23, 2011 08:35

Viscous term expansion

Hi all, I'm studying the implementation of the viscous term in NS equations in the general framework used for example in pisoFoam, nevertheless I can't understand some of the things that are done. Viscous term is:

due incompressibility and applying div to the product, it becomes

in laminar regime nuEff=nu and in turbulent regime nuEff=nu+nut. Reading the code we have from pisoFoam.C:

Code:

00065            fvVectorMatrix UEqn 00066            ( 00067                fvm::ddt(U) 00068              + fvm::div(phi, U) 00069              + turbulence->divDevReff(U) 00070            );
so that the viscous term is contained in turbulence->divDevReff(U) calling. Taking, for example, the kEpsilon.C implementation:

Code:

00181 tmp<fvVectorMatrix> kEpsilon::divDevReff(volVectorField& U) const 00182 { 00183    return 00184    ( 00185      - fvm::laplacian(nuEff(), U) 00186      - fvc::div(nuEff()*dev(fvc::grad(U)().T())) 00187    ); 00188 }
the laplacian term is present, but the second term is completely different to the second one in (1). I tried to derive the above formulation without success and my advisor showed me that both expressions [(1) and which is present in divDevRefff] give different results in deed, using a counterexample with a div(U)=0 field.

All ideas are welcome.

Regards.

 piccinini December 13, 2011 21:44

Hello, Santiago.

Perhaps you have it already solved, but here goes my try:

The laminar part of viscous stress tensor is:

The turbulent part of viscous stress tensor is

Now, summing both contributions:

The last term in OpenFOAM code is not the same, though:
- it is computed the deviatoric of and not the gradient itself. This is discussed in another topic: http://www.cfd-online.com/Forums/ope...ivdevreff.html

The trace of last term is zero because of the explicit formulation using the velocity field from previous time step, that should be divergence free.

 All times are GMT -4. The time now is 19:54.