CFD Online Discussion Forums

CFD Online Discussion Forums (
-   OpenFOAM Programming & Development (
-   -   implementation of wallHeatTransfer BC (

Tobi August 6, 2012 06:58

implementation of wallHeatTransfer BC
Hi all,

i have a question to you.
I am using the flamelet solver build by Alberto Cuoci et. al. All variables are depended on the mixture fraction Z in that solver.

There for you just have to solve the navier-stokes-equations (p & U) and two additional equations describing the mixture fraction Z and the variance of it Z". Thats all. With
Z and Z" you go into a look-up-table and extract your values like, cp, T, h, and so on

No energy equation is solved! The extension by Alberto is using the enthalpy defect. Therefor he is solving an additional enthalpy equation H (its not the enthalpy h). You can use zeroGradient or fixedValue temperature BC but a wallHeatTransfer BC is treated like a zeroGradient BC. If you have a fixedValue you calculate the enthalpy-defect from that temperature. Thats a other way then in the inside cells or on a zeroGradient BC.

The idea is to implement a wallHeatTransfer to make the "fixedValue BC" more dynamically...

The problem is the following.
I implemented the BC and now I can use the wallHeatTransfer BC but its like a fixedValue BC couse I am not solving the transport equation for "h" and do not get into
the updateCoeffs() function. If I implement an additional enthalpy equation for "h" its working but the calculated "h" field is not the same like "H" depend on the difference species and therefor the temperature field I get is wrong.

Is it possible to add the BC without solving the enthalpy equation?
Therefor I should get into the "updateCoeffs()" function or?

Hmm I think its hard to understand couse that solver is very complex and the thermodynamics too.

Maybe someone has a suggestion?!

Thanks for ready also.

wyldckat August 8, 2012 08:21

Hi Tobi,

I was about to answer your private message and remembered to come look for a thread of yours on this... and since I found it, I'll reply to it here.


Originally Posted by Tobi
In the wallHeatTransfer BC there is the function "updateCoeffs()" which is updating the wall temperature.

I am searching in which file that function "updateCoeffs()" is called and how. Till now I do not find it in the code. Maybe you can help me?

Since it's a virtual method, you'll have to trek back to the basic class that gives it this virtual method, namely Foam::fvPatchField::updateCoeffs ().
In the Doxygen description for this method you'll see an entry in the section "Referenced by" to fvPatchField< Type >::evaluate(), which is also part of this very same class template, namely:
How I got there? Given this is a very heavy dependency class hierarchy, you'll have to abstract yourself from the complex structure and think that:
  1. There is a master parent (father or mother, whichever you want to name it) class somewhere that defines the existence of said virtual methods.
  2. Once we find the master parent, we look for the virtual method.
  3. Then look for references to this specific virtual method.

This is how I did this trip (fully based on the Doxygen generated code documentation):
  1. Search for parent class, by looking at the header files: Foam::wallHeatTransferFvPatchScalarField -> mixedFvPatchScalarField -> mixedFvPatchFields.H
  2. Things here get confusing because it uses a macro:
  3. Well, we ignore this and keep looking for relevant headers, which you'll find inside the file "mixedFvPatchFields.H", namely:

    #include "mixedFvPatchField.H"
  4. There you'll see:
  5. This class does not re-implement "updateCoeffs", so you'll have to look for the complete member list: List of all members.
  6. There you'll certainly find updateCoeffs() and can then see this line:
    The one in bold is the one you're looking for, because it's the most parent-like class!

So the next question will be: then who calls "evaluate"? ;)

Best regards,

All times are GMT -4. The time now is 08:12.