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

ReactingFoam

Register Blogs Community New Posts Updated Threads Search

Like Tree1Likes

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
Old   September 8, 2005, 11:55
Default Hi all! I'm a new user of
  #1
vassilis
Guest
 
Posts: n/a
Hi all!

I'm a new user of openFOAM with a very limited experience in the field of CFD. I am currently trying to simulate a CH4 combustion (laminar) in a cylinder with two inlet surfaces, one for the air and one for the fuel. The chemistry etc. are to be read from a CHEMKIN file.
I've read in previous threads that the best way to do this would be by using the reactingFOAM solver. Could you please give me some general directions/instructions?

My biggest problem is in locating the entities demanded from the solver in the 0/ directory, i.e. the initial conditions. How do I make clear where the fuel is entering? Is it the ft variable that defines this? Do I need to state k and epsilon when calculating with :

turbulenceModel laminar;
turbulence off;

????

My guideline so far was the aachenbomb tutorial copied from the dieselFoam case. The geometry and the mes(s)h was imported.

Waiting for an answer,
v.p.
  Reply With Quote

Old   September 13, 2005, 03:47
Default In the 0-directory there is a
  #2
Super Moderator
 
niklas's Avatar
 
Niklas Nordin
Join Date: Mar 2009
Location: Stockholm, Sweden
Posts: 693
Rep Power: 29
niklas will become famous soon enoughniklas will become famous soon enough
In the 0-directory there is a Ydefault-file.
This file is used to set initial conditions and boundary conditions for every species, not defined at the beginning. If you want to use a different bc or initial condition you must create a CH4 file in the 0-directory, as have been done for the N2 and O2 species.
You can just copy the N2, or O2, file to CH4 and replace the N2's with CH4 in the new CH4-file.

In the CH4 file you set the values at 0.0 for the air inlet and 1.0 for the fuel inlet.

You dont need to use FoamX for this, you can just use a text-editor.

If you dont know what Im talking about I suggest you run the icoFoam cavity tutorial first and look at how the boundaries are set and defined in blockMeshDict and 0-directory.

N
niklas is offline   Reply With Quote

Old   September 13, 2005, 04:52
Default Hi Niklas, many thanx for y
  #3
vassilis
Guest
 
Posts: n/a
Hi Niklas,

many thanx for your answer. While playing around with the solver I noticed that, for the case set up at least, the files ft, fu , k and espilon are not needed in the 0-directory.

In my CHEMKIN-file I define the species: 02, N2, CH4, CO2 , CO and H20. Although I did not really understand the difference between using the Ydefault-file and creating a new one named e.g. CH4 (could you elaborate a bit on that???), I tried the second alternative but the solved does not seem to calculate. The message I recieve is:


"/*---------------------------------------------------------------------------*\
| ========= | |
| \ / F ield | OpenFOAM: The Open Source CFD Toolbox |
| \ / O peration | Version: 1.2 |
| \ / A nd | Web: http://www.openfoam.org |
| \/ M anipulation | |
\*---------------------------------------------------------------------------*/

Exec : reactingFoam . test_reactingfoam
Date : Sep 13 2005
Time : 09:07:23
PID : 12142
Root : /home/opencfd/OpenFOAM/opencfd-1.2/run/tutorials/dieselFoam
Case : test_reactingfoam
Nprocs : 1
Create time

Create mesh for time = 0

Reading chemistry properties


Reading environmentalProperties

Reading thermophysicalProperties
Selecting thermodynamics package hMixtureThermo<reactingmixture>
Selecting chemistryReader chemkinReader
Reading field U

Reading/calculating face flux field phi

Creating turbulence model.

Selecting turbulence model laminar
Creating field DpDt

Constructing chemical mechanism
Selecting ODE solver SIBS
chemistryModel::chemistryModel: Number of species = 5 and reactions = 1
Mean and max Courant Numbers = 0 3.00477e-12

Starting time loop

End

"

Can you help me out of this???

Best regards,
v.p.
  Reply With Quote

Old   September 13, 2005, 05:09
Default Imagine that you have a chemki
  #4
Super Moderator
 
niklas's Avatar
 
Niklas Nordin
Join Date: Mar 2009
Location: Stockholm, Sweden
Posts: 693
Rep Power: 29
niklas will become famous soon enoughniklas will become famous soon enough
Imagine that you have a chemkin mechanism with over 100 species.
Since you dont want to specify bc's and initial conditions for all of them, since most of them are identical, you can define a default value in the Ydefault-file. When you start the calculation and the chemkin-reader goes through the species defined in the chemkin-file to get intitial conditions and bc's it will then use the Ydefault-file if it cannot find a file in the 0-directory with the same name as the species.

As for your problem above...
All looks good to me, but I'm guessing that your endTime is 0, which probably is not what you want.

N
niklas is offline   Reply With Quote

Old   September 13, 2005, 06:36
Default Hi (again), fisrtly, thank
  #5
vassilis
Guest
 
Posts: n/a
Hi (again),

fisrtly, thank you very much for the detailed explanation of the Ydefault.

The problem I encounter is unfortunately not so simple... My endTime is not set to 0. When I try simulating the case without creating a CH4-file and by leaving Ydefault to 0, it seems to be calculating. However, when Ydefault is assigned another value than 0 or an extra file CH4 is added, I constantly get the message I posted before.

I do not understand where the problem is. Do you have any further suggestions?

Regards,
v.p.
  Reply With Quote

Old   September 13, 2005, 07:00
Default 1. why would you define a defa
  #6
Super Moderator
 
niklas's Avatar
 
Niklas Nordin
Join Date: Mar 2009
Location: Stockholm, Sweden
Posts: 693
Rep Power: 29
niklas will become famous soon enoughniklas will become famous soon enough
1. why would you define a default-value to anything else than 0... please dont. The Ydefault file is really just necessary to get the correct bc's.

2. you said that you have 6 species: 02, N2, CH4, CO2 , CO and H20, but in your construction of
the chemical mechanism it says 5 species. Are you sure you are reading the correct chemkin-files?

3. what is your initial time step.

4. what is your mesh

5. does it run if chemistry is off

N
niklas is offline   Reply With Quote

Old   September 13, 2005, 08:14
Default So, 2. The chemkin file I w
  #7
vassilis
Guest
 
Posts: n/a
So,

2. The chemkin file I was reading was indeed the wrong one. I tried it agian with the proper file but the result was the same.

3. initial time step was set to : 1.0e-05.
startFrom : startTime (0)
stopAt : endTime (not 0).
runTimeModifiable yes;
maxCo 0.1;

4. the mesh used is a quarter of a cylinder generated in gambit and imported. The inlet face is separated in two main faces (inner face: fuel inlet, outer face:air inlet) which are separated by a small wall (constant temp???)

5. Unfortunately not....

I have set turbulentreaction to off; (if i got it right, no need for assigning a value to Cmix in this case).

what am I doing wrong???

v.p.
  Reply With Quote

Old   September 13, 2005, 08:32
Default Hmmm, its pretty difficult to
  #8
Super Moderator
 
niklas's Avatar
 
Niklas Nordin
Join Date: Mar 2009
Location: Stockholm, Sweden
Posts: 693
Rep Power: 29
niklas will become famous soon enoughniklas will become famous soon enough
Hmmm,
its pretty difficult to say really, since I dont have the case.
Your Courant number is practically zero also.
What is your inlet velocity?

Do you have an outlet, btw?

N
niklas is offline   Reply With Quote

Old   September 13, 2005, 09:34
Default Hi Niklas, firstly I have
  #9
vassilis
Guest
 
Posts: n/a
Hi Niklas,

firstly I have to say that I really appreciate your time and effort!!! Before going into details for the case I would like to ask you something.

In the file "reactingFoam.C" is described the set up of the solver. There, in my case, the variable :

runTime.run()

has the value false which then does not allow the programm to go through all this calculations placed under "while", but jumps directly to the :

Info << "End\n" << endl;

right??? Can this be also caused from the physical aspect of the problem?? In other words, what defines the value of the "runTime.run()" variable??

About the case now:

Velocity was REALLY LOW! i changed it up to a Re of about 400 and things got really better!!! However there should be something else wrong (maybe I should increase the time???) because I get only one file of results (named 8.34534 when endTime is 5) and it doesn't "look" the way I was hoping it would....

Thanx for the advice...

v.p.

p.s. If you have time and any patience left I could send you the whole case. It would really help me understand a lot more about OpenFoam
  Reply With Quote

Old   September 13, 2005, 09:35
Default I forgot something... the
  #10
vassilis
Guest
 
Posts: n/a
I forgot something...

the outlet is the other end of the cylinder...
  Reply With Quote

Old   September 13, 2005, 09:42
Default OK, I think I know what is goi
  #11
Super Moderator
 
niklas's Avatar
 
Niklas Nordin
Join Date: Mar 2009
Location: Stockholm, Sweden
Posts: 693
Rep Power: 29
niklas will become famous soon enoughniklas will become famous soon enough
OK, I think I know what is going on.

Can you copy/paste your controlDict.
I suspect you have mixed up the meaning of
the writeControl and writeInterval values.

N
niklas is offline   Reply With Quote

Old   September 13, 2005, 09:45
Default /*----------------------------
  #12
vassilis
Guest
 
Posts: n/a
/*---------------------------------------------------------------------------*\
| ========= | |
| \ / F ield | OpenFOAM: The Open Source CFD Toolbox |
| \ / O peration | Version: 1.0 |
| \ / A nd | Web: http://www.openfoam.org |
| \/ M anipulation | |
\*---------------------------------------------------------------------------*/

FoamFile
{
version 2.0;
format ascii;

root "";
case "";
instance "";
local "";

class dictionary;
object controlDict;
}

// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //

application reactingFoam;

startFrom startTime;

startTime 0;

stopAt endTime;

endTime 500;

deltaT 1.0e-05;

writeControl runTime;

writeInterval 5.0e-5;

purgeWrite 0;

writeFormat binary;

writePrecision 6;

writeCompression uncompressed;

timeFormat general;

timePrecision 6;

adjustTimeStep yes;

maxCo 0.05;

runTimeModifiable yes;

// ************************************************** *********************** //
  Reply With Quote

Old   September 13, 2005, 10:05
Default That looks fine. Should work.
  #13
Super Moderator
 
niklas's Avatar
 
Niklas Nordin
Join Date: Mar 2009
Location: Stockholm, Sweden
Posts: 693
Rep Power: 29
niklas will become famous soon enoughniklas will become famous soon enough
That looks fine. Should work.
Have you tried to set

adjustTimeStep off;
runTimeModifiable off;

otherwise, you can mail me the case and I'll take a look at it (if it is smaller than 10MB).
(nordin at chalmers dot se)
If larger than 10MB, you have to place it on an ftp/http server for me to pick it up.
niklas is offline   Reply With Quote

Old   September 26, 2005, 11:35
Default Hi Vasileios why are you si
  #14
New Member
 
Max
Join Date: Mar 2009
Posts: 24
Rep Power: 17
didomenico is on a distinguished road
Hi Vasileios
why are you simulating a quarter of a cylinder if, as I suppose, the geometry is axialsymmetric?
You can just create a 5-degree sector with one cell in tangential direction. NOTE: the wedge faces have to be symmetric respect to the plane z=0, otherwise strange things will happen
Let us know
Massimiliano
didomenico is offline   Reply With Quote

Old   September 27, 2005, 08:55
Default Ciao Massimo, I finally ma
  #15
vassilis
Guest
 
Posts: n/a
Ciao Massimo,

I finally managed to finish the new geometry in Gambit. I had never heard of the constraint with the z=0 plane, i.e. I witnessed the strange things.

I have another question though... The surface surrounding the cylinder in my case is a wall. Assuming that I assign it the "wall" boundary type, what should be the type of the pressure in the initial conditions file alongside the wall??? I also have a small wall separating the two inlet faces. What do I assign there ??? Up to now the small wall has been really torturing me, since something flows through it alhtough it is clearly stated that the velocity should be zero!!!

Do I define pressure in the inlet AND at the outlet or do I leave one as "zeroGradient" ?

I'm new in this and I don't know what's going wrong...

Regards

v.p.
  Reply With Quote

Old   September 27, 2005, 10:53
Default Hi Vasileios I are right, t
  #16
New Member
 
Max
Join Date: Mar 2009
Posts: 24
Rep Power: 17
didomenico is on a distinguished road
Hi Vasileios
I are right, the inlet and wall pressure BCs have to be "zeroGradient" as follows (in p file)

boundaryField
{
....
inlet
{
type zeroGradient;
}

outlet
{
type fixedValue;
value uniform 1e5; // operating pressure
}

wall
{
type zeroGradient;
}
...
}


For the velocity (U file) you should have

boundaryField
{
....
inlet
{
type fixedValue;
value uniform (10 0 0);
}

wall1
{
type fixedValue;
value uniform (0 0 0);
}
...
}


where U and p files are located in your startTime directory. If everything is correct, it may be you are plotting with Paraview an interpolated U value, so try to look directly inside the solution files...
Good luck

Massimiliano
didomenico is offline   Reply With Quote

Old   September 27, 2005, 13:57
Default Hi Massimiliano, > NOTE: t
  #17
vassilis
Guest
 
Posts: n/a
Hi Massimiliano,

> NOTE: the wedge faces have to be symmetric respect to the plane z=0.

I assume that with this you mean that the axis of symmetry of the geometry is on the x-y level ,e.g. the y-axis or x-axis, right?

Then when I assign the "wedge" type to two surfaces I get the following :

--> FOAM FATAL ERROR: wedge does not allign with a coordinate plane

So, at least one of the wedges should lie on a plane ,z ,y or x. Right?

Does it actually make a difference if I simulate a 5° "slice" or 20°, apart from the computational effort required? I got some problems with the meshing with such a thin slice.

Regards,
v.p.
  Reply With Quote

Old   September 28, 2005, 03:54
Default I read "the wedge faces have t
  #18
New Member
 
Ron W Cresswell
Join Date: Mar 2009
Posts: 18
Rep Power: 17
roncresswell is on a distinguished road
I read "the wedge faces have to be symmetric respect to the plane z=0" to mean that one should be xy-plabe + 2.5 degrees and the other should be xy-plane - 2.5 degrees. That way the average is exactly on the xy-plane.

Just a thought. Haven't got that far myself ;^)

Ron
roncresswell is offline   Reply With Quote

Old   September 28, 2005, 04:44
Default Hi Vasileios, from OpenFoam
  #19
New Member
 
Max
Join Date: Mar 2009
Posts: 24
Rep Power: 17
didomenico is on a distinguished road
Hi Vasileios,
from OpenFoam user guide, page U-143: "For 2 dimensional axi-symmetric cases, e.g. a cylinder, the geometry is specified as a wedge of 5 degree angle and 1 cell thick running along the plane of symmetry, straddling one of the coordinate planes..."
I think you can generate your mesh with the blockMesh utility instead of Gambit. Three blocks should be enough. I know that Gambit has some problems in handling small sectors, and I do not know what openFoam does if you put more than one cell between two wedges. An answer from OpenFoam developers would be nice
Regards
Max
didomenico is offline   Reply With Quote

Old   September 28, 2005, 04:54
Default A common mistake when creating
  #20
Super Moderator
 
niklas's Avatar
 
Niklas Nordin
Join Date: Mar 2009
Location: Stockholm, Sweden
Posts: 693
Rep Power: 29
niklas will become famous soon enoughniklas will become famous soon enough
A common mistake when creating wedge-meshes is that one creates a wedges where the different wedge have different lengths. This is what usually happens when you set one plane along the axis and then copy/paste the point and just change the y-value. You thus create a mesh like this


<pre>
/
b/
/
/
----- -> x
a
</pre>
This is clearly not a wedge since the b side is longer than a.

If you instead make the wedges symmetric around the x-axis you just have to change the signs. Like this
<pre>
/
/
/
/ -> x
\
\
\
\
</pre>
Then you have a 'real' wedge.
I dont know if this is what you're doing.

N
niklas is offline   Reply With Quote

Reply


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
mvConvection in reactingFoam smehdi609 OpenFOAM Running, Solving & CFD 7 April 16, 2019 11:22
DieselFoam and ReactingFoam matteo_rosa_sentinella OpenFOAM Pre-Processing 4 September 28, 2009 11:35
ReactingFoam solver muthukaalai OpenFOAM Running, Solving & CFD 1 June 16, 2008 14:36
ReactingFoam without reactions lasb OpenFOAM Running, Solving & CFD 5 June 10, 2008 09:50
ReactingFoam error prashant24983 OpenFOAM Running, Solving & CFD 3 October 4, 2007 05:54


All times are GMT -4. The time now is 14:54.