CFD Online Logo CFD Online URL
www.cfd-online.com
[Sponsors]
Home > Forums > Software User Forums > OpenFOAM > OpenFOAM Post-Processing

rhoCentralFoam and wallHeatFlux

Register Blogs Community New Posts Updated Threads Search

Like Tree2Likes
  • 1 Post By RomW
  • 1 Post By alexmogavero

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
Old   October 31, 2012, 08:45
Question rhoCentralFoam and wallHeatFlux
  #1
New Member
 
Join Date: Jan 2012
Posts: 8
Rep Power: 14
RomW is on a distinguished road
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:

----------------------------------------------------------------------------------------------------------------------------------

--> FOAM FATAL ERROR:
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

Romain

PS: is there any adaptive mesh refinement utility with rhoCentralFoam?
febriyan91 likes this.
RomW is offline   Reply With Quote

Old   November 1, 2012, 06:40
Default
  #2
New Member
 
Join Date: Jan 2012
Posts: 8
Rep Power: 14
RomW is on a distinguished road
any help would be extremely appreciated since I am running a validation case and cannot progress without heat fluxes,

thank you,
Romain
RomW is offline   Reply With Quote

Old   November 6, 2012, 08:58
Default
  #3
New Member
 
Alessandro Mogavero
Join Date: Nov 2012
Location: Glasgow
Posts: 15
Rep Power: 14
alexmogavero is on a distinguished road
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:
Code:
Foam::volScalarField& Foam::basicThermo::h()
{
    notImplemented("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
Code:
autoPtr<basicThermo> thermo
(
    basicThermo::New(mesh)
);
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.

Thanks
febriyan91 likes this.
alexmogavero is offline   Reply With Quote

Old   November 7, 2012, 16:13
Lightbulb
  #4
New Member
 
Alessandro Mogavero
Join Date: Nov 2012
Location: Glasgow
Posts: 15
Rep Power: 14
alexmogavero is on a distinguished road
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?
alexmogavero is offline   Reply With Quote

Old   November 8, 2012, 05:12
Default
  #5
Member
 
Join Date: Jun 2012
Posts: 76
Rep Power: 14
maHein is on a distinguished road
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?

Regards
maHein is offline   Reply With Quote

Old   November 8, 2012, 06:04
Thumbs up
  #6
New Member
 
Alessandro Mogavero
Join Date: Nov 2012
Location: Glasgow
Posts: 15
Rep Power: 14
alexmogavero is on a distinguished road
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?
alexmogavero is offline   Reply With Quote

Old   November 8, 2012, 09:01
Default
  #7
Member
 
Join Date: Jun 2012
Posts: 76
Rep Power: 14
maHein is on a distinguished road
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:

Code:
surfaceScalarField heatFlux
(
    fvc::interpolate(RASModel->alphaEff())*fvc::snGrad(e)*kappa
);
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
Attached Files
File Type: zip wallHeatFluxEnergy.zip (6.0 KB, 32 views)
maHein is offline   Reply With Quote

Old   November 8, 2012, 11:14
Default
  #8
Member
 
Join Date: Jun 2012
Posts: 76
Rep Power: 14
maHein is on a distinguished road
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.
maHein is offline   Reply With Quote

Old   November 8, 2012, 11:22
Thumbs up
  #9
New Member
 
Alessandro Mogavero
Join Date: Nov 2012
Location: Glasgow
Posts: 15
Rep Power: 14
alexmogavero is on a distinguished road
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.
alexmogavero is offline   Reply With Quote

Reply

Tags
heat flux, rhocentralfoam


Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are Off
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
wallShearStress not work for rhoCentralFoam mechy OpenFOAM 0 July 25, 2011 02:48


All times are GMT -4. The time now is 07:45.