CFD Online Discussion Forums

CFD Online Discussion Forums (
-   OpenFOAM Post-Processing (
-   -   rhoCentralFoam and wallHeatFlux (

RomW October 31, 2012 08:45

rhoCentralFoam and wallHeatFlux
Hi all,

I am working on the calculation of hypersonic flows using 'rhoCentralFoam' solver.

But I cannot make the 'wallHeatFlux' utility working at the post-processing stage.

I always get the same error message:


Not implemented

From function basicThermo::h()
in file basicThermo/basicThermo.C at line 259.

FOAM aborting


Any help would be much appreciated,
Thank you all


PS: is there any adaptive mesh refinement utility with rhoCentralFoam?

RomW November 1, 2012 06:40

any help would be extremely appreciated since I am running a validation case and cannot progress without heat fluxes,

thank you,

alexmogavero November 6, 2012 08:58

Dear all,
I work with RomW at this validation case.
I am looking at the source code to try to understand why it does not work. I admit to be a beginner with C++, even if I have some experience with object oriented programming.

As it can be stated by the error stack trace the error rise within the method BasicThermo.h(), but if I look in the method definition I find this:

Foam::volScalarField& Foam::basicThermo::h()
    return const_cast<volScalarField&>(volScalarField::null());

thus it seems that there is not a way out if you call this method. Actually I can understand the fact that a basic thermodynamic model does not calculate h, but in our case we tried to change the model without any change in the error message.
I have just noticed that before to call the BasicThermo.h() method the tool calls the basicThermo::New(mesh) static method

autoPtr<basicThermo> thermo

I suppose that these point to something related to the employed thermal mode, but I was not able to find the basicThermo::New(mesh) definition.

If anyone knows this problem or may be can give me some tips to spot it within the source code please let us know.


alexmogavero November 7, 2012 16:13

I think we found where the issue originates.
Actually the ePsiThermo that we implement does not provide the hentalpy, since it is energy based.
Once we switched to hRhoThermo wallHeatFlux worked.
However the problem is yet to be resolved since this model is not implemented for rhoCentralFoam.
Therefore I am trying a walk around slightly modifying the wallheatFlux source code. I have planned to calculate the hentalpy starting from the temperature and the Cp, but unlikely I am very new to openFoam and C++ and I cannot even perform a simple moltiplication.
I would like to multiply two volScalarField but seems that the operator* is not defined for this class.
Anybody can help me with this simple (non for me) task?:D

maHein November 8, 2012 05:12

Hey alexmogavero,

my approch would be to use the internal energy "e" and convert it to the enthalpy "h". Then, one could reuse the rest of the code from wallHeatFlux.C. However, I'm not sure about the conversion. As far as I recall, one can use:

h = e*kappa;

Maybe someone could confirm this or recommend an other approch?


alexmogavero November 8, 2012 06:04

Thank you maHein!
I am glad to know that there is someone else which confirm my concerns.
I can confirm the validity of your formula, tough it is strictly valid for perfect gas with constant specific heat.
However it will suite well to me for now.
Do you have any idea on how to make simple operations between object of the class volScalarField?

maHein November 8, 2012 09:01

1 Attachment(s)
I implemented the equation by modifying the wallHeatFlux source code. I simply introduced a new scalar called kappa wih a value of 1.4 (isentropic exponent of air) and changed the equation, where the heat flux is calculated to:


surfaceScalarField heatFlux

Futheremore, some minor changes to the createFields.H are necessary.

However, in this case, kappa is hard coded into the program. I guess it is also be possible to read it from the thermodynamic properties / calculate it via the thermodynamics libraries.

So this is a more quick-and-dirty method ;)

maHein November 8, 2012 11:14

Like I said, you can directly get kappa from the thermodynamic model by:

volScalarField kappa = thermo->Cp() / thermo->Cv();

So this way the programm shoud be comprehensive for gases other than air.

alexmogavero November 8, 2012 11:22

Thank you for your help, now it works!
I agree with your equation for calculating the K so to include every gas, but I am afraid it works just for constant specific heat, since in case of non constant Cp (thus non constant K) an integration over a certain temperature range would be needed.

All times are GMT -4. The time now is 06:40.