CFD Online Logo CFD Online URL
www.cfd-online.com
[Sponsors]
Home > Forums > Software User Forums > OpenFOAM > OpenFOAM Running, Solving & CFD

Error in the enthalpy equation

Register Blogs Members List Search Today's Posts Mark Forums Read

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
Old   April 19, 2007, 17:35
Default Hello everybody, I am using
  #1
danilo
Guest
 
Posts: n/a
Hello everybody,

I am using the reactingFoam solver for a very simple case: the geometry is 2D axisymmetric geometry, the fuel is methane in a coflow of air and the chemistry is simply a 1 step reaction. Unfortunately I have some problems in the enthalpy equation. During the calculations in some cells the temperature reaches a value higher than 5000K which is the maximum value available for the estimation of transport properties in the gaseous mixture; then the following error message appears:

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

-> FOAM FATAL ERROR : attempt to use janafThermo<equationofstate> out of temperature range 200 -> 5000; T = 5081.35#0 Foam::error::printStack(Foam::-Ostream&)
#1 Foam::error::abort()
#2 Foam::specieThermo<foam::janafthermo<foam::perfect gas> >::H(double) const
#3 Foam::hMixtureThermo<foam::reactingmixture>::calcu late()
#4 Foam::hMixtureThermo<foam::reactingmixture>::corre ct()
#5 main
#6 __libc_start_main
#7 __gxx_personality_v0


From function janafThermo<equationofstate>::checkT(const scalar T) const
in file /home/dm2/henry/OpenFOAM/OpenFOAM-1.4/src/thermophysicalModels/specie/lnInclude/ janafThermoI.H at line 73.

FOAM aborting

Aborted

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

I tried different initial conditions and different meshes and I also changed the chemistry of my case but the problem remains.

I saw that many people experienced the same problem but nobody explained the reason and proposed a solution. I am wondering if it is possible to force a maximum value in the temperature field (for example 3500K); this is the solution I usually use in FLUENT, but I don't know how to implement it in OpenFoam

Do you have any suggestions? Is there anybody who fixed this problem?

Thank you,
Danilo
  Reply With Quote

Old   April 20, 2007, 13:51
Default Hi Danilo, i can tell you h
  #2
Senior Member
 
Markus Hartinger
Join Date: Mar 2009
Posts: 102
Rep Power: 17
hartinger is on a distinguished road
Hi Danilo,

i can tell you how to fudge it and limit the enthalpy.
Create 'hEqn.H' in the folder '$FOAM_APP/solvers/combustion/reactingFoam'. If no 'hEqn.H' exists locally, the one from 'XiFoam' is taken.

hEqn.H:
---------------------------------------
{
solve
(
fvm::ddt(rho, h)
+ mvConvection->fvmDiv(phi, h)
- fvm::laplacian(turbulence->alphaEff(), h)
==
DpDt
);

const scalar maxH = ....;

forAll(h.internalField(), cellI)
{
h.internalField()[cellI] = maxH;
}

forAll(h.boundaryField(), patchI)
{
forAll(h.boundaryField()[patchI], faceI)
{

h.boundaryField()[patchI][faceI] = maxH;
}
}

thermo->correct();
}
hartinger is offline   Reply With Quote

Old   April 20, 2007, 15:07
Default Hi Markus, thank you for yo
  #3
danilo
Guest
 
Posts: n/a
Hi Markus,

thank you for your reply! Unfortunately I didn't understand the solution you proposed. In particular:

1. It seems to me that using your solution a uniform value of enthalpy is fixed in every cell; on the contrary I would to correct the value only for the cells where the temperature is higher than Tmax

2. Even if I can choose the cells where the temperature is higher than Tmax it should be simpler to correct the temperature field, not the enthalpy field... in fact the value of enthalpy is not only related to the temperature but also to the composition and therefore the maxH reported in your code is not a uniform and constant value but should be calculated for every cell

I met this problem also using the reactingFoam tutorial reported in the wiki page without making any changes... I don't know if the other combustion solvers are affected by the same problem, but for reactingFoam I never reached a steady solution: I tried different geometries, different meshes, kinetic schemes and fuels but I always had the same error...
The strange thing is that in the iteration preceding the message error the thermal field seems to be correct and the maximum value of temperature seems to be correct (around 2500K for methane, for example)... suddenly in the next iteration the temperature is some cells reaches a value higher of 5000K or in some case is negative!!!

Danilo
  Reply With Quote

Old   April 20, 2007, 15:49
Default 1.) yes, you're right, i forgo
  #4
Senior Member
 
Markus Hartinger
Join Date: Mar 2009
Posts: 102
Rep Power: 17
hartinger is on a distinguished road
1.) yes, you're right, i forgot to insert an if-statement:
if ( h.internalField()[cellI] > maxH)
{
...
}
and so on

2.) since you're solving for the enthalpy which feeds into 'hCombustionThermo' with 'thermo->correct()' you have to limit the enthalpy, unless you want to change the 'hCombustionThermo', which i wouldn't recommend for a start. As you say the maximum enthalpy needs to be caluclated for each cell, which should be possible.

regarding your instability:
havent' used it, no clue, but general things:
- try upwind for the convection terms
- try different boundary conditions
- increase the solution tolerances
- decrease timesteps
- under-relax the enthalpy, for steady-state only

good luck
markus
hartinger is offline   Reply With Quote

Old   April 20, 2007, 16:15
Default i meant: decrease solution tol
  #5
Senior Member
 
Markus Hartinger
Join Date: Mar 2009
Posts: 102
Rep Power: 17
hartinger is on a distinguished road
i meant: decrease solution tolerances
hartinger is offline   Reply With Quote

Old   April 20, 2007, 17:10
Default Hi Markus, thank you very m
  #6
danilo
Guest
 
Posts: n/a
Hi Markus,

thank you very much for your suggestions... I'll try in the next days...

Danilo
  Reply With Quote

Old   November 26, 2009, 08:29
Default
  #7
Sim
New Member
 
Simon
Join Date: Nov 2009
Posts: 3
Rep Power: 16
Sim is on a distinguished road
Hello everyone,

I tried to limit the enthalpy in the XiFoam-solver as described above but it doesn`t work...
Maybe here is anyone who can help me.

Sim
Sim is offline   Reply With Quote

Old   November 26, 2009, 08:42
Default
  #8
Sim
New Member
 
Simon
Join Date: Nov 2009
Posts: 3
Rep Power: 16
Sim is on a distinguished road
Its all new for me so i dont know if its right...
here is what I´ve written in the hEqn.H:

{

solve
(
fvm::ddt(rho, h)
+ mvConvection->fvmDiv(phi, h)
- fvm::laplacian(turbulence->alphaEff(), h)
==
DpDt



);
if ( h.internalField()[cellI] > maxH)
{
const scalar maxH = 1000;



forAll(h.internalField(), cellI)
{
h.internalField()[cellI] = maxH;
}


forAll(h.boundaryField(), patchI)
{
forAll(h.boundaryField()[patchI], faceI)
{

h.boundaryField()[patchI][faceI] = maxH;
}
}
}

thermo->correct();
}
Sim is offline   Reply With Quote

Reply

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

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
Total enthalpy equation cosimobianchini OpenFOAM Running, Solving & CFD 0 August 24, 2007 06:21
Error in the enthalpy equation danilo OpenFOAM Pre-Processing 0 April 19, 2007 17:33
enthalpy equation in saturated asghari Main CFD Forum 1 May 25, 2006 16:48
Energy equation and Enthalpy Martin FLUENT 1 January 25, 2001 18:11
Enthalpy equation and Cp dependency upon specis Mads Bang Main CFD Forum 1 July 30, 2000 07:43


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