# reactingFoam boundary conditions

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

 March 10, 2010, 12:58 reactingFoam boundary conditions #1 New Member   Join Date: Feb 2010 Posts: 6 Rep Power: 9 Hi, 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 fuguang likes this.

 March 10, 2010, 22:21 #2 Senior Member   Karl-Johan Nogenmyr Join Date: Mar 2009 Location: Linköping Posts: 274 Rep Power: 14 Hi, For pressure I would use: airBC { type totalPressure; U U; phi phi; rho rho; psi none; gamma 1; p0 uniform 100000; value uniform 100000; } For Velocity I would use: airBC { type fluxCorrectedVelocity; phi phi; rho rho; value uniform (0 0 0); } And for other scalars I would use zeroGradient Good Luck! fuguang likes this.

 March 11, 2010, 12:24 #3 New Member   Join Date: Feb 2010 Posts: 6 Rep Power: 9 Thanks. But what about the temperature? How do I indicate that the ambiant temperature at the boundary is 295K?

 March 11, 2010, 19:40 #4 Senior Member   Karl-Johan Nogenmyr Join Date: Mar 2009 Location: Linköping Posts: 274 Rep Power: 14 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. fuguang likes this.

 March 12, 2010, 15:15 #5 New Member   Join Date: Feb 2010 Posts: 6 Rep Power: 9 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.

 March 13, 2010, 00:07 #6 Senior Member   Karl-Johan Nogenmyr Join Date: Mar 2009 Location: Linköping Posts: 274 Rep Power: 14 Hmm.. can you post your case?

March 15, 2010, 13:28
#7
New Member

Join Date: Feb 2010
Posts: 6
Rep Power: 9
Here is my case. Sorry for the delay, I didn't have my files with me over the week-end.

Thanks
Attached Files
 0.zip (4.0 KB, 199 views) chemkin.zip (71.3 KB, 161 views) constant.zip (93.1 KB, 189 views) system.zip (1.8 KB, 111 views)

March 16, 2010, 01:56
#8
Senior Member

Karl-Johan Nogenmyr
Join Date: Mar 2009
Posts: 274
Rep Power: 14
Thanks...

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
Kalle

p.s. massfraction O2 in standard air would be around 0.23
Attached Files
 0.tar.gz (1.2 KB, 164 views)

 March 29, 2010, 11:13 #9 New Member   Join Date: Feb 2010 Posts: 6 Rep Power: 9 Hi, 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:rintStack(Foam::Ostream&) in "/usr/local/OpenFOAM/OpenFOAM-1.6/lib/linux64GccDPOpt/libOpenFOAM.so" #1 Foam::sigFpe::sigFpeHandler(int) in "/usr/local/OpenFOAM/OpenFOAM-1.6/lib/linux64GccDPOpt/libOpenFOAM.so" #2 __restore_rt at sigaction.c:0 #3 Foam::ODEChemistryModel > > >::derivatives(double, Foam::Field const&, Foam::Field&) const in "/usr/local/OpenFOAM/OpenFOAM-1.6/lib/linux64GccDPOpt/libchemistryModel.so" #4 Foam::SIBS::SIMPR(Foam::ODE const&, double, Foam::Field const&, Foam::Field const&, Foam::Field const&, Foam::SquareMatrix const&, double, int, Foam::Field&) const in "/usr/local/OpenFOAM/OpenFOAM-1.6/lib/linux64GccDPOpt/libODE.so" #5 Foam::SIBS::solve(Foam::ODE const&, double&, Foam::Field&, Foam::Field&, double, Foam::Field const&, double, double&, double&) const in "/usr/local/OpenFOAM/OpenFOAM-1.6/lib/linux64GccDPOpt/libODE.so" #6 Foam::ODESolver::solve(Foam::ODE const&, double, double, Foam::Field&, double, double&) const in "/usr/local/OpenFOAM/OpenFOAM-1.6/lib/linux64GccDPOpt/libODE.so" #7 Foam:de > > >::solve(Foam::Field&, double, double, double, double) const in "/usr/local/OpenFOAM/OpenFOAM-1.6/lib/linux64GccDPOpt/libchemistryModel.so" #8 Foam::ODEChemistryModel > > >::solve(double, double) in "/usr/local/OpenFOAM/OpenFOAM-1.6/lib/linux64GccDPOpt/libchemistryModel.so" #9 main in "/home/pouimette/OpenFOAM/pouimette-1.6/applications/bin/linux64GccDPOpt/reactingFoam" #10 __libc_start_main in "/lib64/libc.so.6" #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? Thanks Pascale fuguang likes this.

 March 29, 2010, 22:59 #10 Senior Member   Karl-Johan Nogenmyr Join Date: Mar 2009 Location: Linköping Posts: 274 Rep Power: 14 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? Kalle fuguang likes this.

 October 2, 2011, 17:07 #11 Senior Member   Gonzalo Join Date: Mar 2011 Location: Argentina Posts: 120 Rep Power: 9 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!

 July 27, 2012, 04:58 #12 New Member   Pang Join Date: Mar 2011 Location: Denmark Posts: 25 Rep Power: 8 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, Pang.

 January 7, 2014, 08:24 Hydrogen release case #13 Member   James Join Date: Jul 2013 Posts: 38 Rep Power: 5 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, James

January 8, 2014, 08:35
Hydrogen Release Case
#14
Member

Jason Dale
Join Date: Mar 2009
Location: UK
Posts: 73
Rep Power: 10
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.

Regards

Jason
Attached Files
 0.zip (12.1 KB, 95 views) constant.zip (78.3 KB, 79 views) system.zip (4.9 KB, 57 views)

 February 12, 2014, 13:48 thermo.dat #15 Member   James Join Date: Jul 2013 Posts: 38 Rep Power: 5 Jason, 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, James

 February 13, 2014, 05:01 #16 Member   Jason Dale Join Date: Mar 2009 Location: UK Posts: 73 Rep Power: 10 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 http://www.openfoam.org/docs/user/thermophysical.php Regards Jason

 June 2, 2014, 13:23 thermo.dat 2 #17 Member   James Join Date: Jul 2013 Posts: 38 Rep Power: 5 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, James

 July 7, 2014, 10:45 Updating older solvers to new version #18 Member   James Join Date: Jul 2013 Posts: 38 Rep Power: 5 Jason, 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. http://svn.code.sf.net/p/openfoam-ex...yReactingFoam/ 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, James

 Thread Tools Display Modes Linear Mode

 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 OffTrackbacks are On Pingbacks are On Refbacks are On Forum Rules

 Similar Threads Thread Thread Starter Forum Replies Last Post Anindya Main CFD Forum 25 February 27, 2016 13:58 lost.identity CFX 41 May 22, 2013 07:21 cfdmarkus OpenFOAM Running, Solving & CFD 16 November 14, 2011 05:44 Lionel S. Main CFD Forum 1 August 24, 2007 18:03 michele OpenFOAM Other Meshers: ICEM, Star, Ansys, Pointwise, GridPro, Ansa, ... 2 July 15, 2005 04:15

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