CFD Online Discussion Forums

CFD Online Discussion Forums (
-   OpenFOAM Programming & Development (
-   -   compressibleInterFoam incl. viscous dissipation heating (

vigges March 20, 2014 17:04

compressibleInterFoam incl. viscous dissipation heating
Hello Foamers!

I am working on a modification of compressibleInterFoam, more specifically, I am trying to implement the term for viscous dissipation into TEqn.H in order to take viscous dissipation heating of highly viscous fluids (i.e. oil) into account. I managed to extend the source code of the TEqn.H file according to this thread:

    volScalarField muEff(turbulence->muEff());
    volTensorField gradU = fvc::grad(U);
    volTensorField tau = muEff * (gradU + gradU.T());

    fvScalarMatrix TEqn
        fvm::ddt(rho, T)
      + fvm::div(rhoPhi, T)
      - fvm::laplacian(twoPhaseProperties.alphaEff(turbulence->mut()), T)
      + (
            fvc::div(fvc::absolute(phi, U), p)
          - ( tau && gradU )    // viscous dissipation heating of fluid
          + fvc::ddt(rho, K) + fvc::div(rhoPhi, K)
        + alpha2/twoPhaseProperties.thermo2().Cv()

My test case is a simple impingement oil jet (T_jet = 302.6 K) on an adiabatic Wall (zeroGradient).

The results so far:
T_aw = 305.4 K | standard compressibleInterFoam
T_aw = 328.7 K | modified compressibleInterFoam

Somehow, it seems to be working, however, it's strange that T_aw of the standard solver is almost 3 K higher than T_jet.
Theoretically, it should be the same, right? The wall and outlet patches all have zeroGradient BCs.

Another thing which makes me second-guessing my above mentioned implementation of the viscous terms, is a CFX simulation of the same problem.
With viscous dissipation heating, it yields a adiabatic wall temperature of T_aw = 305.9 K which is significantly lower than the result of the modified solver.

My question is quite simple: Did I miss something during the implementation of the viscous term?

I tend to think that my definition of muEff is not completely right.
AFAIK, it's muEff = mu + mut, which should hold since I'm using the kOmegaSST model.
But I think, I made a mistake regarding the multiphase character of the case.

If anyone has experience with this, your help will be greatly appreciated :)

olivierG June 5, 2014 12:07


Did you get any good result ? Because i need to do the same.

Did you take a look at this:

By the way, you use muEff from turbulence->muEff(), but this is multiphase:
this should be something like mixture.muEff instead ?


vigges June 5, 2014 12:42

Salut Olivier,

I'm not able to access my final version of the modified solver or my data, however, the results were pretty good compared to the CFX solution I used as reference. Maybe, with a bit of fine tuning, they would be extremely good ;)

Let get back to you as soon as I can access my stuff again (I am moving at the moment :D)


olivierG June 20, 2014 05:35

Hello Victor,

Did you find your final version of your modified solver ?


vigges June 20, 2014 05:56

Hello Olivier,

sorry for the delay, setting up everything took a bit longer than expected :)

In fact, I used the code from my first post and did a re-run of the exact case. The only thing I did was implementing a ramp for my mass flow rate.

The modified solver now yields a T_aw = 306.7K, compared to T_aw = 305.9K from the CFX run. For the time being, it's sufficiently exact, but your point regarding the muEff is completely valid. I'm gonna check up on that, when I find the time ;)

Best regards,

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