CFD Online Discussion Forums

CFD Online Discussion Forums (
-   OpenFOAM Programming & Development (
-   -   turbulence calculation in programming (

flakid September 19, 2011 10:50

turbulence calculation in programming
There are several turbulence models and Les model in openFoam.How is the turbulence calculation coupled in the code of the solver? I think it's included in turbulenceModel and transportModel.But where is the interface?addToRunTable?

AlmostSurelyRob October 29, 2011 10:22

You have probably answered to your question by now but just in case you didn't: have a look at the code of solvers like pisoFoam or interFoam. They are in OpenFOAM/applications/solvers

In particular look at the UEqn.H file if present. For example

pimpleFoam OF 2.0

tmp<fvVectorMatrix> UEqn
  + fvm::div(phi, U)
  + turbulence->divDevReff(U)

where turbulence was an object created earlier. As I understand divDevReff is the divergence of deviatoric effective stress, physically meaning stress due to unresolved scales of turbulence.

interFoam uses only RAS models so it has to update effective viscosity:

    surfaceScalarField muEff
      + fvc::interpolate(rho*turbulence->nut())

    fvVectorMatrix UEqn
        fvm::ddt(rho, U)
      + fvm::div(rhoPhi, U)
      - fvm::laplacian(muEff, U)
      - (fvc::grad(U) & fvc::grad(muEff))
    //- fvc::div(muEff*(fvc::interpolate(dev(fvc::grad(U))) & mesh.Sf()))

All times are GMT -4. The time now is 18:37.