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

[openSmoke] libOpenSMOKE

Register Blogs Community New Posts Updated Threads Search

Like Tree133Likes

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
Old   June 13, 2017, 08:41
Default Alpha
  #521
New Member
 
Join Date: Jan 2016
Posts: 5
Rep Power: 10
MorenoGeerts is on a distinguished road
Hi Tobi,

I have a question about the implementation of alpha (thermal conductivity) in the solver.
The general units of alpha in OpenFOAM are [kg/m/s], whereas in your solver they are [m²/s], which is a factor rho different (favre averaging). However, as far as I can see, in the pdfFlameletThermo.C file, you overwrite the alpha_ field from heThermo [kg/m/s] with the lookup alpha_favre [m²/s].

Relevant lines:

pdfFlameletThermo.C
Code:
const scalarField& alphaFavre = this->alpha_favre_.internalField();
scalarField& alphaCells 	= this->alpha_.internalField();

alphaCells[celli]	= alphaFavre[celli];

const fvPatchScalarField& palphaFavre 	= this->alpha_favre_.boundaryField()[patchi];

fvPatchScalarField& palpha 	= this->alpha_.boundaryField()[patchi];

palpha[facei] 	= palphaFavre[facei];
OpenSMOKE_PDF_Flamelet.cpp
Code:
	// alpha
	for(j=1;j<=_n_variance;j++)
		for(i=1;i<=_n_csi;i++)
			_alpha_f[j][i] = _lambda_f[j][i]/_density_r[j][i]/_cp_f[j][i];

In my application I use alpha and kappa values for heat transfer through walls, which should make it easier to change the final overwriting of alpha to [kg/m/s] to make it compatible with the other calculations of heThermo and the turbulence models.
However, I think it is strange OpenFOAM is able to overwrite the alpha_ with the alpha_favre without checking the dimensions.

So finally my questions are:
Is the alpha used for something other than reporting? In the solver you use muEff()/sigmat, resulting in the absence of alphaEff as generally applied in most solvers.
And a question related to this muEff()/sigmat implementation: why do you use muEff()/sigmat = (mu+mut)/sigmat and not mu/sigma+mut/sigmat, which is mostly used (being alphaEff in RANS turbulence models) ?
Is is because you assume mu_eff =~ mu_turbulent like you said on page 7? I would assume if you overwrite alpha_ with (which I assume are) the right units, you could just use alphaEff?
MorenoGeerts is offline   Reply With Quote

Old   March 3, 2019, 21:53
Default The result shows that psi*p is not equal to rho?
  #522
Senior Member
 
Ruiyan Chen
Join Date: Jul 2016
Location: Hangzhou, China
Posts: 162
Rep Power: 9
cryabroad is on a distinguished road
Quote:
Originally Posted by Tobi View Post
Hi,
  • The density is looked up from the table and then used in the calculation. As you can see in the thermodynamic model.
Code:
psiCells[celli] = RhoReynolds[celli]/pCells[celli];
  • The pressure is constant and therefore using the return function which is psi*p gives the density again
  • So everything is fine
  • The stuff in the thermodynamic files does not matter because we do not use any value here. Its just a dummy, we do not use it.
First of all, I would like to thank all the people that created (and discussed) this solver, it's very easy to use and the code is written in an informal way so it's not hard to follow.

I do have one question, although I'm not sure if it's related to the libOpenSMOKE solver or OpenFOAM. I tried the Sandia_COH2N2 tutorial case that comes with the solver, everything seems to be fine. (I'm using OpenFOAM-4.x btw, and this is the only tutorial case provided) Since I'm interested in learning some programming in OpenFOAM, I changed the NO_WRITE option to AUTO_WRITE for both psi_ and mu_
in the flameletThermo class constructor. The code is in thermophysicalModels/basic/flameletThermo/flameletThermo.C line 37 to 70. So basically I want psi_ and mu_ to be printed out, and their names are "thermosi" and "thermo:mu" (these names come from OpenFOAM. I don't understand why they can't just be "psi" and "mu", like other variable names). Then I recompiled the flameletThermo class, and did the tutorial case. I also set the propertyUpdate label in constant/flameletsProperties to 1, so thermophysical properties should be updated in every iteration.

In the result, now "thermosi" and "thermo:mu" are printed out (as expected). However, it seems like rho is not equal to thermosi times the pressure. Please see the attached figure, where I plot (thermosi*p-rho)/rho. As you can see, the difference is actually quite large! For the most part the difference is almost 0 (red contour in my figure), but there's no flame there. In the flame region the difference between psi*p and rho is very large, as large as 60% of the density.

This seems very strange, because in the pdfFlameletThermo class it is specified, as Tobi mentioned, rho should be equal to psi*p, for internal cells and for boundary patches. At first I thought this may be caused by the fact that thermo.correct() is called before pressure is solved (in HEqn.H) and rho = thermo.rho() is called after the pressure is solved (pEqn.H). So I tried to change where I put the thermo.correct() and rho = thermo.rho(). for example, I tried to put them in this order: UEqn.H, ZEqn.H, HEqn.H (without thermo.correct(), pEqn.H(without rho = thermo.rho()), turbulence->correct(), then thermo.correct(), then rho = thermo.rho()). But I always get something like what's in the figure, i.e., rho is not equal to thermosi * p. I feel like I'm missing some important points here but can't figure out what it is.

Any ideas is welcome!

Ruiyan
Attached Images
File Type: jpg difference.jpg (22.7 KB, 26 views)
cryabroad is offline   Reply With Quote

Old   March 16, 2019, 02:29
Default
  #523
Senior Member
 
Ruiyan Chen
Join Date: Jul 2016
Location: Hangzhou, China
Posts: 162
Rep Power: 9
cryabroad is on a distinguished road
Dear Yashar,

I noticed it has been a few years since you posted your comparison between the numerical and experimental results. I'm encountering the exact same problem as yours (that the flame lengths are quite different), have you resolved your problem? Also, you mentioned that turning to another version helps, can you talk more about it?

Thanks,

Ruiyan
cryabroad is offline   Reply With Quote

Old   August 20, 2019, 23:13
Default Setting Mixture fraction at Inlet that is neither fuel nor oxidiser
  #524
New Member
 
Thalhah
Join Date: May 2016
Posts: 15
Rep Power: 10
thalhah90 is on a distinguished road
Hi all,


I am using flameletSimpleFoam to simulate a diffusion flame from a cylindrical burner that has three inlets/gas streams.



1) Fuel (methane) flow from the centre tube of the burner
2) Oxidiser (air) flow from the outer tube
3) Pure nitrogen gas flow from the outermost tube



In the 0/ folder, there is the mixture fraction Z boundary condition that needs to be specified. I know that for the fuel and oxidiser inlet, the values of Z are 1 and 0 respectively. However, what value do I set for the nitrogen gas stream? Should I just specify zeroGradient?


Any help is appreciated.



Best regards,
Thalhah
thalhah90 is offline   Reply With Quote

Old   August 21, 2019, 09:41
Default
  #525
Super Moderator
 
Tobi's Avatar
 
Tobias Holzmann
Join Date: Oct 2010
Location: Tussenhausen
Posts: 2,708
Blog Entries: 6
Rep Power: 51
Tobi has a spectacular aura aboutTobi has a spectacular aura aboutTobi has a spectacular aura about
Send a message via ICQ to Tobi Send a message via Skype™ to Tobi
Dear Thalahl,

it is not possible to define a pure nitrogen inlet while using the flamelet library. As you already know, Z = 1 is equal to pure fuel, Z = 0 is equal to pure air/oxigen or whatever mixture you specified. If an inlet is 100 % Nitrogen, you cannot specify that as it is not specified within your flamelet tables.

So far, without changing the library, you cannot simulate your specific problem.

Kind regards,
Tobi
__________________
Keep foaming,
Tobias Holzmann
Tobi is offline   Reply With Quote

Old   October 21, 2019, 10:18
Default
  #526
New Member
 
Bah.Mah
Join Date: Jun 2016
Posts: 18
Rep Power: 9
R.Mah is on a distinguished road
Quote:
Originally Posted by Tobi View Post
Hi Bobi,

you are right. The code gives you the mass fraction. In my thesis I used the important species and the molecular weight for that to calculate the mole fraction in paraview. The problem is, that the flamelet-solver and thermodynamic is not calculating the mass fraction. The thermodynamics just look for the mass fraction into the Look-Up-Tables and there for it was not easy for me to build a new function that is calculating that.

It 's possible to do that in the thermodynamics, so that you build new functions or stuff like that.

The problem is here, that you have do many things:

1. the thermodynamics just realize the species you want to output:
Code:
//- Initialise the wanted mass fraction fields
        omega_.setSize(flamelets_library.number_of_species()+1);

        for (int j=0;j<flamelets_library.number_of_species()+1;j++)
        {
            if(j < flamelets_library.number_of_species())
            {
                std::string name_of_species = "omega_" + flamelets_library.species()[j+1];

                omega_.set
                (
                    j,
                    new volScalarField
                    (
                        IOobject
                        (
                            name_of_species,
                            mesh.time().timeName(),
                            mesh,
                            IOobject::NO_READ,
                            IOobject::AUTO_WRITE),
                            mesh,
                            dimensionedScalar("zero", dimensionSet(0,0,0,0,0,0,0),
                            0.0
                        )
                    )
                );
            }
        }
2. you have no molecular weights in the thermodynamics
3. its annoying that we have no chance to have a look into the flamelet generatin code


So what you have to do is:

1. set up a function that get all involved species for you case
2. set up a list of constants (molecular weights of ALL species)
3. building a new function calculate_molefraction() (the simplest thing)



Well maybe the mole fraction is also avaiable in the look-up-table but I dont know how to have a look into that. If there are the mole fractions included, it would be the easiest way to get the values.
But as I told befor... its annoying that we dont have the chance to have a look into the flamelet generation!

I would build a own free one but I have no time for that.
Dear Tobias,


Would you please tell me how did you calculate the mole fraction from mass fraction in Paraview?
And another question please ? Did you build a new function helping on converting mass fraction to mole fraction?
I know that the post above is 9 years old now but I would appreciate your help a lot. thanks
R.Mah is offline   Reply With Quote

Old   October 21, 2019, 12:01
Default
  #527
Super Moderator
 
Tobi's Avatar
 
Tobias Holzmann
Join Date: Oct 2010
Location: Tussenhausen
Posts: 2,708
Blog Entries: 6
Rep Power: 51
Tobi has a spectacular aura aboutTobi has a spectacular aura aboutTobi has a spectacular aura about
Send a message via ICQ to Tobi Send a message via Skype™ to Tobi
Hi, never built a function to convert mass into mole. Sorry.
__________________
Keep foaming,
Tobias Holzmann
Tobi is offline   Reply With Quote

Old   October 21, 2019, 13:09
Default
  #528
New Member
 
Bah.Mah
Join Date: Jun 2016
Posts: 18
Rep Power: 9
R.Mah is on a distinguished road
Quote:
Originally Posted by Tobi View Post
Hi, never built a function to convert mass into mole. Sorry.
Thanks for the answer.
Then what about paraview calculation ? Was it with a specific filter? In case not then how please?
Thank you in advance.
R.Mah is offline   Reply With Quote

Old   October 21, 2019, 15:18
Default
  #529
Super Moderator
 
Tobi's Avatar
 
Tobias Holzmann
Join Date: Oct 2010
Location: Tussenhausen
Posts: 2,708
Blog Entries: 6
Rep Power: 51
Tobi has a spectacular aura aboutTobi has a spectacular aura aboutTobi has a spectacular aura about
Send a message via ICQ to Tobi Send a message via Skype™ to Tobi
Sure, you can calculate the mole fraction out of the mass fraction. You should be aware of the formulation. So you can use the calculator to do that.
__________________
Keep foaming,
Tobias Holzmann
Tobi is offline   Reply With Quote

Old   January 27, 2020, 14:53
Default
  #530
Senior Member
 
Freedom
Join Date: May 2014
Posts: 209
Rep Power: 13
wenxu is on a distinguished road
Is there anyone here using libOpenSMOKE to predict soot formation?
wenxu is offline   Reply With Quote

Old   January 27, 2020, 14:54
Default
  #531
Super Moderator
 
Tobi's Avatar
 
Tobias Holzmann
Join Date: Oct 2010
Location: Tussenhausen
Posts: 2,708
Blog Entries: 6
Rep Power: 51
Tobi has a spectacular aura aboutTobi has a spectacular aura aboutTobi has a spectacular aura about
Send a message via ICQ to Tobi Send a message via Skype™ to Tobi
I am sorry but I never used it for soot. But there are other people using it.
__________________
Keep foaming,
Tobias Holzmann
Tobi is offline   Reply With Quote

Old   January 28, 2020, 03:17
Default
  #532
Senior Member
 
Freedom
Join Date: May 2014
Posts: 209
Rep Power: 13
wenxu is on a distinguished road
Please give me a shout if you (anyone in this thread) are also using LibOpenSMOKE to predict soot. We can have further discussions.
wenxu is offline   Reply With Quote

Old   February 3, 2020, 09:55
Default About scalar dissipation rates ...
  #533
New Member
 
Join Date: Nov 2019
Posts: 3
Rep Power: 6
azu037 is on a distinguished road
Greetings,


how do I choose the scalar dissipation rates for my flamelet library?
If I understand it correctly, I have to create flamelets corresponding to scalar dissipation rates ranging from zero to extinction to create an accurate representation of the flame.
The wikipage for Hagen Müller's flameletFoam ist the most thorough explanation I found but it describes the process using Cantera. What I took from there is the insight that the process seems to be of iterative nature.

I presume there is no way to calculate the quenching scalar dissipation rate directly, is there? So how do I create a fitting library with flameletSimpleFoam?
Any insights would be highly appreciated.


Best regards,
azu037


Edit: In the end I used a range of scalar dissipation rates loosely based on the rates in the tutorial. It works but I don't know if this is a sensible way of doing it ...


I also have another question: has anyone used the flameletSimpleFoam solver in conjunction with cyclicAMI boundaries? My goal is to simulate only a quarter of my geometry but with this setup the mixture fraction Z takes on values larger than 1; this wasn't a problem with the full geometry. On a side note: the divergence scheme limitedLimitedLinear 1 0 1 shouldn't allow such values or am I mistaken? I'm also unsure about the order of the values; is limitedLimitedLinear 1 0 1 or
limitedLimitedLinear 0 1 1 correct if I want to limit the value between 0 and 1 with the limiter set to 100 percent?

I already tried confining the two cyclicAMI boundaries on one CPU core with the singleProcessorFaceSets option but this didn't fix the problem. Any hint would be appreciated!


Another edit: After investigating the problem more thoroughly using Paraview's Threshold filter I noticed that only a few cells have values for Z and Zvar larger than the specified bounds. These cells are located in a highly problematic area of the mesh. I am going to remesh my geometry with altered settings and see if the problem persists. I'll report back.

Last edited by azu037; February 27, 2020 at 09:43.
azu037 is offline   Reply With Quote

Old   April 19, 2020, 15:06
Default Simulation of Ethylene diffusion flame
  #534
New Member
 
Thalhah
Join Date: May 2016
Posts: 15
Rep Power: 10
thalhah90 is on a distinguished road
I am trying to simulate an ethylene C2H4 diffusion flame using flameletSimpleFOAM. The given tutorial for this solver uses methane as fuel. I simply replaced methane fuel with C2H4 in Data.inp file during flamelet generation stage. At post-processing stage, C2H4 contour shows no flow, though there exists CH4 flow. Can anybody suggest what could have been wrong? Files for Data.inp and resulting C2H4 and CH4 contours are attached.

Any help is much appreciated.

Regards,
Thalhah
Attached Images
File Type: jpg C2H4contour1.jpg (48.2 KB, 3 views)
File Type: jpg CH4contour1.jpg (63.5 KB, 3 views)
Attached Files
File Type: txt Data.inp.txt (792 Bytes, 2 views)
thalhah90 is offline   Reply With Quote

Old   April 19, 2020, 15:13
Default
  #535
Super Moderator
 
Tobi's Avatar
 
Tobias Holzmann
Join Date: Oct 2010
Location: Tussenhausen
Posts: 2,708
Blog Entries: 6
Rep Power: 51
Tobi has a spectacular aura aboutTobi has a spectacular aura aboutTobi has a spectacular aura about
Send a message via ICQ to Tobi Send a message via Skype™ to Tobi
Did you create the flamelet? Just changing the Data.inp will not change anything regarding the cfd calculation.
__________________
Keep foaming,
Tobias Holzmann
Tobi is offline   Reply With Quote

Old   April 19, 2020, 15:30
Default
  #536
New Member
 
Thalhah
Join Date: May 2016
Posts: 15
Rep Power: 10
thalhah90 is on a distinguished road
Quote:
Originally Posted by Tobi View Post
Did you create the flamelet? Just changing the Data.inp will not change anything regarding the cfd calculation.
Dear Tobi,

Thanks for the prompt response. Yes, I have generated the flamelet. After changing the Data.inp, I ran the script for flamelet generation (runFlameletGeneration.sh), copied the PDF file to the case folder and ran the simulation. Please advise.

Regards,
Thalhah
thalhah90 is offline   Reply With Quote

Old   April 19, 2020, 17:20
Default
  #537
Super Moderator
 
Tobi's Avatar
 
Tobias Holzmann
Join Date: Oct 2010
Location: Tussenhausen
Posts: 2,708
Blog Entries: 6
Rep Power: 51
Tobi has a spectacular aura aboutTobi has a spectacular aura aboutTobi has a spectacular aura about
Send a message via ICQ to Tobi Send a message via Skype™ to Tobi
You should get txt files during the flamelet generation. Please check if you do have your fuel there too. Please share the Data.inp file.
__________________
Keep foaming,
Tobias Holzmann
Tobi is offline   Reply With Quote

Old   April 20, 2020, 03:49
Default
  #538
New Member
 
Thalhah
Join Date: May 2016
Posts: 15
Rep Power: 10
thalhah90 is on a distinguished road
Quote:
Originally Posted by Tobi View Post
You should get txt files during the flamelet generation. Please check if you do have your fuel there too. Please share the Data.inp file.
Dear Tobi,

Please find attached Data.inp file. The log file from the flamelet generation shows the fuel is C2H4-also attached, should it be of any help. Thank you.

Regards,
Thalhah
Attached Files
File Type: txt Data.inp.txt (792 Bytes, 5 views)
File Type: txt Log-Enthalpydefect_0.txt (63.8 KB, 6 views)
File Type: txt Log-LookUpTable0.txt (31.2 KB, 5 views)
thalhah90 is offline   Reply With Quote

Old   April 20, 2020, 09:40
Default
  #539
Super Moderator
 
Tobi's Avatar
 
Tobias Holzmann
Join Date: Oct 2010
Location: Tussenhausen
Posts: 2,708
Blog Entries: 6
Rep Power: 51
Tobi has a spectacular aura aboutTobi has a spectacular aura aboutTobi has a spectacular aura about
Send a message via ICQ to Tobi Send a message via Skype™ to Tobi
Everything seems correct.
__________________
Keep foaming,
Tobias Holzmann
Tobi is offline   Reply With Quote

Old   April 25, 2020, 04:29
Default
  #540
New Member
 
Thalhah
Join Date: May 2016
Posts: 15
Rep Power: 10
thalhah90 is on a distinguished road
Quote:
Originally Posted by Tobi View Post
Everything seems correct.
After reading this thread from the early years, I realized that H in 0/ folder should be specified based on the following; run flamelet generation, abort, obtain H values for fuel and oxidiser from the log file, and insert in 0/H. Seems like after doing that, there appears to be some flow of C2H4 in the domain (fig. attached). Anyhow, I think because the fuel flow rate in my case is very low (U_fuel=0.002m/s), the C2H4 flow does not go too further downstream. (I did tested using higher flow rates of 1-2 order magnitude higher (fig. attached) and C2H4 can be clearly seen flowing downstream).

Thank you Tobi for inputs.
Attached Images
File Type: jpg c2h4_ori.jpg (48.2 KB, 2 views)
File Type: jpg c2h4_1orderMagnitude.jpg (51.9 KB, 2 views)
thalhah90 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
Numerical treatment of the source term in combustion equations Tobi Main CFD Forum 37 September 15, 2020 13:42
[openSmoke] flameletSmoke + new ODESolver (by Alberto Cuoci) Tobi OpenFOAM Community Contributions 1 November 21, 2017 18:24
Unsteady solver with Flamelet Model (libOpenSMOKE) francesco_capuano OpenFOAM Running, Solving & CFD 11 November 26, 2013 04:50
LibOpenSmoke, getting the species in ParaFoam Christoph_84 OpenFOAM 1 May 31, 2012 14:42


All times are GMT -4. The time now is 10:44.