CFD Online Discussion Forums

CFD Online Discussion Forums (
-   OpenFOAM (
-   -   reactingFoam boundary conditions (

pas32 March 10, 2010 12:58

reactingFoam boundary conditions

I'm simulating the combustion of hydrogen with a burner in atmospheric air and I have problems with the boundary conditions.

I did a 2D representation of the environment at the burner exit with a symmetry plan in the middle of the burner. Which boundary condition sould i use where the boundary is air? outlet or inletoutlet? Where do I define the temperature and pressure of the environment?

I am new with OpenFOAM and i hope someone can help.

Thank you

kalle March 10, 2010 22:21


For pressure I would use:

type totalPressure;
U U;
phi phi;
rho rho;
psi none;
gamma 1;
p0 uniform 100000;
value uniform 100000;

For Velocity I would use:

type fluxCorrectedVelocity;
phi phi;
rho rho;
value uniform (0 0 0);

And for other scalars I would use zeroGradient

Good Luck!

pas32 March 11, 2010 12:24


But what about the temperature? How do I indicate that the ambiant temperature at the boundary is 295K?

kalle March 11, 2010 19:40

Well, you can always force scalars (T, Yi) to be like surrounding values (air at 295K), but if you get a piece of hot product gases or so at the outflow boundary, you might get divergence due to strong gradients. If you put initial conditions correctly, it is likely that values will remain good at the boundary.

Will you use both an atmospheric BC and a separate outlet BC where you think that the products will leave? I would use the above mentioned BC's at the whole 'outlet' i.e. not use a separate outflow BC together with an atmospheric BC.

pas32 March 12, 2010 15:15

I applied the atmospheric boundary like you mentionned to all the "outlet" for p and U and I left the rest with zero gradient. Unfortunately, when I ran the problem without combustion (just hydrogen entering in air), it looked like if the domain was closed because it filled with hydrogen and after 2 sec of simulation, the whole grid was filled with 100% hydrogen.

kalle March 13, 2010 00:07

Hmm.. can you post your case?

pas32 March 15, 2010 13:28

4 Attachment(s)
Here is my case. Sorry for the delay, I didn't have my files with me over the week-end.


kalle March 16, 2010 01:56

1 Attachment(s)

I see. You get really strong recirculation at the inlet, and this gradually fills your domain with H2. This recirculation is present in the whole domain, and if you want to simulate an open flame, you should probably do something about this... .typically move away boundaries. You can also try to set the AIR_BAS patch as an inlet and specify some small velocity that will counteract this recirculation.

Anyway, I believe the problem with filling of the domain can be avoided by using the inletOutlet BC instead of zeroGradient for scalars. That BC acts as zeroGradient when fluid is leaving the domain, but allows you to specify scalar values when fluid is entering the domain... Hence, in the attachment, I specified that air should be entering when you have inflow at your atmospeheric boundary.... Later, when you let it burn, you may want to do this for T also.

Good luck

p.s. massfraction O2 in standard air would be around 0.23

pas32 March 29, 2010 11:13


Thanks for the information. It now seems to work properly without the combustion.

I did some tests with combustion and i'm having some problems. Maybe you can help.

With an inlet speed of fuel at 20 m/s (laminar flow), the combustion seems to be working. I tried to reduce the speed to 0.5 m/s to reproduce simulations from an article and it wasn't working. I increased to 10 m/s and after 0.13 sec, it wrote the following:

Solving chemistry
#0 Foam::error::printStack(Foam::Ostream&) in "/usr/local/OpenFOAM/OpenFOAM-1.6/lib/linux64GccDPOpt/"
#1 Foam::sigFpe::sigFpeHandler(int) in "/usr/local/OpenFOAM/OpenFOAM-1.6/lib/linux64GccDPOpt/"
#2 __restore_rt at sigaction.c:0
#3 Foam::ODEChemistryModel<Foam::psiChemistryModel, Foam::sutherlandTransport<Foam::specieThermo<Foam: :janafThermo<Foam::perfectGas> > > >::derivatives(double, Foam::Field<double> const&, Foam::Field<double>&) const in "/usr/local/OpenFOAM/OpenFOAM-1.6/lib/linux64GccDPOpt/"
#4 Foam::SIBS::SIMPR(Foam::ODE const&, double, Foam::Field<double> const&, Foam::Field<double> const&, Foam::Field<double> const&, Foam::SquareMatrix<double> const&, double, int, Foam::Field<double>&) const in "/usr/local/OpenFOAM/OpenFOAM-1.6/lib/linux64GccDPOpt/"
#5 Foam::SIBS::solve(Foam::ODE const&, double&, Foam::Field<double>&, Foam::Field<double>&, double, Foam::Field<double> const&, double, double&, double&) const in "/usr/local/OpenFOAM/OpenFOAM-1.6/lib/linux64GccDPOpt/"
#6 Foam::ODESolver::solve(Foam::ODE const&, double, double, Foam::Field<double>&, double, double&) const in "/usr/local/OpenFOAM/OpenFOAM-1.6/lib/linux64GccDPOpt/"
#7 Foam::ode<Foam::psiChemistryModel, Foam::sutherlandTransport<Foam::specieThermo<Foam: :janafThermo<Foam::perfectGas> > > >::solve(Foam::Field<double>&, double, double, double, double) const in "/usr/local/OpenFOAM/OpenFOAM-1.6/lib/linux64GccDPOpt/"
#8 Foam::ODEChemistryModel<Foam::psiChemistryModel, Foam::sutherlandTransport<Foam::specieThermo<Foam: :janafThermo<Foam::perfectGas> > > >::solve(double, double) in "/usr/local/OpenFOAM/OpenFOAM-1.6/lib/linux64GccDPOpt/"
#9 main in "/home/pouimette/OpenFOAM/pouimette-1.6/applications/bin/linux64GccDPOpt/reactingFoam"
#10 __libc_start_main in "/lib64/"
#11 Foam::regIOobject::writeObject(Foam::IOstream::str eamFormat, Foam::IOstream::versionNumber, Foam::IOstream::compressionType) const in "/home/pouimette/OpenFOAM/pouimette-1.6/applications/bin/linux64GccDPOpt/reactingFoam"
Floating point exception

Do you know what it means?


kalle March 29, 2010 22:59

The output suggests that there occurred an illegal operation (sigfpe) - typically divide by zero. I would guess it is related to the chemistry solver in this case. You can try to play around with different solvers in the 'chemistryProperties' file. You can also try setting the equilibriumRateLimiter on. To find out what is happening you can also closely monitor the solution just before the crash.

Someone else have any suggestions?


gfoam October 2, 2011 17:07

Can you post again the chemkin zip file (it may be damaged)? I am having the same problem with reactinFoam...I'm trying to run a case of gas mixture only to figure out how the diffusion progress in time. If somebody can help me I'm willing to upload the directories ASAP...THANKS!

kmpang July 27, 2012 04:58

Hi Foamers,

I don't really understand the implementation of 'fluxCorrectedVelocity' B/C. May I ask how does it work? Also, how is it different from 'zeroGradient' B/C?

Best regards,

ni-openfoam-user January 7, 2014 08:24

Hydrogen release case
Dear colleagues,

I am new to OpenFOAM. I have completed the relevant tutorials and read through all the useful information that I can find.

I am currently starting to play and modify the tutorials to meet my goals.

I wish to start by modelling a simple generic 3D hydrogen release case, say from a simple pipe into the atmosphere.

Can anyone give me pointers about how to start modifying the tutorials to meet this goal? Any help would be greatly appreciated.

Many thanks,


jason January 8, 2014 08:35

Hydrogen Release Case
3 Attachment(s)
Hi James,

Here is a simplified test case from a long time ago which I just updated to the latest OF version. I would check the properties of the gases just to be sure.

The floor wall could quite easily be your pipe wall with a hole in it and you specify the release velocity.

The H2 concentration at the injection point you change in the '0' directories for the N2, O2 and H2 concentrations (0 to 1 = 0% to 100%)

You use the reactingFoam solver but turn off chemistry and combustion so you are only considering mixing in this example case.

Try playing around with variables such as the Courant number and also the mesh density (I would think the mesh has to be quite fine at the mixing interfaces to reduce numerical diffusion). In addition, you might want to experiment with the numerical schemes.

If it were me, before even thinking about combustion or chemistry I would get the case working correctly just for mixing ... then make it more complicated.



ni-openfoam-user February 12, 2014 13:48


Thanks again for sending me the case file, it is proving very usual for me.

I have an additional question if you don't mind.

Considering your post in the 'reactingFoam boundary conditions' thread: i.e. "The H2 concentration at the injection point you change in the '0' directories for the N2, O2 and H2 concentrations (0 to 1 = 0% to 100%)".

I understand that you can change the H2 concentration here at anything from 0 to 100% ( 0 -1).

However, if a change is made here does this change not also require a change to be made in the 'thermo.dat' file to reflect the new concentration of H2 being investigated? (considering combustion scenario)

Many thanks for taking the time to answer my queries.

Kind regards,


jason February 13, 2014 05:01

Hi James,

Unfortunately I've never used reactingFoam for combustion (not my field).

But in thermo.dat you specify the coefficients for the chosen thermodynamic model (which is specified in the thermophysicalproperties file). In the example janaf was chosen so you have to specify the coefficient for this model.

I think you will find what you need to know here :)



ni-openfoam-user June 2, 2014 13:23

thermo.dat 2
Hi Jason,

Thanks again for sending the case file it has proved very useful.
I have been able to test it and modify it, and have completed a number of low velocity release test simulations.

I am now moving on to increasing the release velocity and decreasing the orifice diameter. I am specifically looking at a scenario with a 3
mm opening and a release velocity of approximately 1000 m/s.

As you can imagine this requires quite a small timestep and a refined mesh to solve.

My question is regarding the thermo.dat file. In the vicinity of the release a partial vacuum may be created, and therefore very small temperatures. These temperatures may be lower than the range specified in thermo.dat (i.e. lower than 200).

Q1. To modify thermo.dat, is it simply a case of lowering the lower temperature range?

Q2. How is this file created? And if required how can it be modified to incorporate such low temperatures? Where do the values for "highCpCoeffs" and "lowCpCoeffs" come from and how are they calculated? (I guess from Chemkin or similar, could you please expand)

Many thanks again for your previous reply and (hopefully) thanks for taking the time to answer my queries.

Kind reagrds,


ni-openfoam-user July 7, 2014 10:45

Updating older solvers to new version

I am attempting to use the solver "alternateSteadyReactingFoam" for my simulations. This solver was created using v1.5. I am trying to use it with version 2.2.

You previously stated that you updated the test case which you previously provided from an old to the new version of OpenFOAM.

Could you please kindly comment on the steps required to update an old solver / case to the new version of OpenFOAM?

Many thanks,


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