# libOpenSMOKE

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

February 4, 2013, 07:55
#121
Super Moderator

Tobias Holzmann
Join Date: Oct 2010
Location: Leoben (Austria)
Posts: 1,806
Blog Entries: 6
Rep Power: 32
Quote:
 Originally Posted by babakflame Dear Tobi Hi Would u plz hint me that in the Sandia CH4H2N2 2D case, How does the values for k & epsilon be calculated for the inlet air and fuel? (Forexample the following lines inletfuel { type turbulentIntensityKineticEnergyInlet; intensity 0.2; U U; phi phi; value uniform 239.65; } For instance, If I change the fuel from CH4 to C3H8 without any changes in velocity magnitude, Does these values change? Regards Bobi
Hi Bobi,

this value is calculated with the cfd-online calculation tool: http://www.cfd-online.com/Tools/turbulence.php

For that you know the free-stream velocity and the turbulent length scale (d_hyd * 0.07). At least you have to set the intensity. 20% for high turbulent inlets.

Then you get the values for k epsilon and omega.

 February 12, 2013, 13:28 #122 Senior Member   Bobi Join Date: Oct 2012 Location: Chicago, Illinois Posts: 414 Rep Power: 8 Dear Tobi Hi I am trying to understand the mixture fraction and it's variance in the code: Mixture Fraction: ( fvm::div(phi, csi) - fvm::Sp(fvc::div(phi), csi) - fvm::laplacian(turbulence->muEff()/sigmat, csi) ) The equation has different forms in different references, lets start with your equation: Thanks buddy , I got a problem with internet, I mean exactly what you have written, would u plz tell me that how exactly each term in the code is related to the equation, I have read the openFoam user guide , However I can not derive in openFoam format exactly as it is written in the code, I have problem with sigmat (How does it appear) and also fvm::SP() Last edited by babakflame; February 12, 2013 at 13:44.

 February 12, 2013, 13:32 #123 Super Moderator     Tobias Holzmann Join Date: Oct 2010 Location: Leoben (Austria) Posts: 1,806 Blog Entries: 6 Rep Power: 32 Hi, is your sentence complete ? That equation is a normal conserved scalar euqation? What do you need an where are the differences? But that Code is like that one: The term on the RHS is the diffusion term and is modelled in RANS with the viscosity turbulence model. So the turbulent diffusion term is: now it follows that the diffusion term on the RHS is: Most references neglect the molecular diffusivity couse it has no influence: it follows: But I implemented it with the molecular diffusion so you get the following line: Then your equation is (with no time derivation -steady state): and that equation is that one I (and Alberto) implemented in the flamelet solver. Alberto use the mu_t for that. I am using the mu_eff couse I was developing an laminar flamelet solver that uses the molecular diffusion. Thats the reason for it. That flamelet solver is build for turbulent flows so mu_lam <<<< mu_turbulent and therefor mu_eff =~ mu_turbulent TrII4d and babakflame like this. Last edited by Tobi; February 16, 2013 at 09:56. Reason: forgot rho

 February 12, 2013, 14:24 #124 Senior Member   Bobi Join Date: Oct 2012 Location: Chicago, Illinois Posts: 414 Rep Power: 8 Many thanks Tobi , for ur detailed explanations, I got exactly what happens to the R.H.S. , However can I ask to explain me how does ρ (V . grad Z) is divided in to fvm::div(phi, csi) - fvm::Sp(fvc::div(phi), csi) I think we can use this tensor expression: ∂_i (ρ〖V)〗_i=ρ ∂_i V_i+ V_i ∂_i ρ However, I am still trying to write it in OpenFoam format Thanks Bobi Last edited by babakflame; February 12, 2013 at 15:21.

February 12, 2013, 15:16
#125
Super Moderator

Tobias Holzmann
Join Date: Oct 2010
Location: Leoben (Austria)
Posts: 1,806
Blog Entries: 6
Rep Power: 32
Quote:
 Originally Posted by babakflame Many thanks Tobi , for ur detailed explanations, I got exactly what happens to the R.H.S. , However can I ask to explain me how does ρ (V . grad Z) is divided in to fvm::div(phi, csi) + fvm::Sp(fvc::div(phi), csi) Thanks Bobi
Hi Bobi,

no problem - its my topic and want to help everyone. Step by step:

is

Code:
fvm::div(phi, csi)      // its the convection term
fvm is standing in the programmers guide:
Code:
Implicit / Explicit    ::::   fvm:: / fvc::
I think thats clear. So the convection term is treated implicit.

The diffusion term:

is

Code:
fvm::laplacian(turbulence->muEff()/sigmat, csi)
Thats it. The other term:
Code:
fvm::Sp(fvc::div(phi), csi)
is a numerical trick for stabilisation.
Lets consider the following equation:

The underlined variables are matrixes. Okay if you use the eulerian procedure to solve that problem you get (explicit):

You want to know U^(n), then you get:

You calculate U^n with the known variables. That method (explicit) is in some cases very instable so that you use an implicit method for the matrix B (implicit) :

after transform that equation you get:

Now its possible to make a stabilisation for explicit source terms (here the matrix A). We go back to the first equation:

You can see that the matrix A is multiplyed by 1. So now the trick:

Go back to the implicit eulerian procedure:

Now you see that the matrix A is not mulitplyed by 1 anymore but with a complete different value. That gives you the possibility to linearize explicit source terms (and thats the trick).

If you reach steady state conditions U^n/U^n-1 = 1 and everything is fine again

And thats what the following line is doing:
Code:
fvm::Sp(fvc::div(phi), csi)
Tobi

PS: sigmat = turbulent prandtl number

Last edited by Tobi; February 12, 2013 at 15:35. Reason: Adding desciripton of sigmat

 February 16, 2013, 07:53 #126 Senior Member   Bobi Join Date: Oct 2012 Location: Chicago, Illinois Posts: 414 Rep Power: 8 Dear My friend Tobi Hi Many Thanks for all your earlier helps. I have started changing the code to LES . In the csiEqn.H file I need to rewrite the stoichiometric scalar dissipation rate formula for LES. In LES we have: chi= 2(Dm+Dt) (GradZ)^2 Cause I am still novice with openFOAM format , would you plz check out that I have written the mentioned formula right? // Updating stoichiometric scalar dissipation rate chi_st = 2*(turbulence->muEff()/(sigmat*rho))*magSqr(fvc::grad(csi)); Regards Bobi

 February 16, 2013, 09:59 #127 Super Moderator     Tobias Holzmann Join Date: Oct 2010 Location: Leoben (Austria) Posts: 1,806 Blog Entries: 6 Rep Power: 32 Hi, I had a look at my first equations. I think I missed the rho in the turbulent diffusion (i corrected it now but I am not 100% sure). I ll have a look at my litrature. To you. Why do you use (sigmat * rho) ? And magSqr is wrong... you need POW()

 February 17, 2013, 06:00 #128 Senior Member   Bobi Join Date: Oct 2012 Location: Chicago, Illinois Posts: 414 Rep Power: 8 Dear Tobi Hi Thanks For POW() About Rho: (would u plz check out my relation) As we have (Dm+Dt) = (Deff) = (mu-eff)/(rho* Schmidt) = (if we cosider Le =1, then we have) = (mu-eff) / (rho * Prandtl) Tobi likes this.

 February 18, 2013, 07:28 #129 Super Moderator     Tobias Holzmann Join Date: Oct 2010 Location: Leoben (Austria) Posts: 1,806 Blog Entries: 6 Rep Power: 32 Hi Bobi, I had a look into the reference: B. Cuenot: The Flamelet Model for Non-Premixed Combustion, Springer Science+Business Media B.V (2011) and into my masterthesis (references Ferziger and Peric). Due to the RANS turbulence modelling you get the following for the navier stokes eqn (Ferziger): Now you can see the same "molecular and turbulent diffusion" there. The diffusion term is modeled by: where k is the turbulent kinematic energy. Now you have to know that mu_t is calculated by: As you can see in the variable "mu_t" there is rho. So if you are using mu_t you have already rho. If you neglegt the molecluar diffusion: So if you are using mu_eff I think the rho is invoken in the calculation of mu_eff. You should have a look into the file where mu_eff is calculated. As far as I know the following equation should be right: babakflame likes this. Last edited by Tobi; February 18, 2013 at 17:10.

 February 18, 2013, 07:44 #130 Senior Member   Bobi Join Date: Oct 2012 Location: Chicago, Illinois Posts: 414 Rep Power: 8 Dear Tobi I will look into the references You have mentioned, very soon. Thanks For all buddy.

February 18, 2013, 07:51
#131
Super Moderator

Tobias Holzmann
Join Date: Oct 2010
Location: Leoben (Austria)
Posts: 1,806
Blog Entries: 6
Rep Power: 32
Quote:
 Originally Posted by babakflame Dear Tobi I will look into the references You have mentioned, very soon. Thanks For all buddy.

Ferziger Page: 346 - 349
The Paper of Cuenot:

Varianz Z'' of the mixture fraction:

Compared with the c++ code in alberto cuocis flamelet model you can see that the term:

is modelled with

Page 49. In that section you can read the following sentence: "The molecular diffusivity is often neglected as it is much smaller than the turbulent diffusivity D_t" (like I told befor). Hope it helps you.
Tobi

February 22, 2013, 12:04
#132
Senior Member

Bobi
Join Date: Oct 2012
Location: Chicago, Illinois
Posts: 414
Rep Power: 8
Dear Tobi
I have made the midifications needed for your code to be changed into LES. However , when I run the code in serial, I got this strange error:

Quote:
 Creating turbulence model Selecting turbulence model type LESModel Selecting LES turbulence model oneEqEddy oneEqEddyCoeffs { ce 1.048; Prt 1; ck 0.094; } Creating field dpdt Creating field kinetic energy K Reading flamelet dictionary Preparing field Qrad (radiative heat transfer) Courant Number mean: 3.01006e-05 max: 0.0379248 PIMPLE: Operating solver in PISO mode Starting time loop Reading/calculating field UMean Reading/calculating field pMean Reading/calculating field UPrime2Mean Reading/calculating field pPrime2Mean fieldAverage: starting averaging at time 0 Courant Number mean: 3.01006e-05 max: 0.0379248 deltaT = 1.2e-06 Time = 1.2e-06 #0 Foam::error:rintStack(Foam::Ostream&) in "/home/babak/OpenFOAM/OpenFOAM-2.1.x/platforms/linux64GccDPOpt/lib/libOpenFOAM.so" #1 Foam::sigFpe::sigHandler(int) in "/home/babak/OpenFOAM/OpenFOAM-2.1.x/platforms/linux64GccDPOpt/lib/libOpenFOAM.so" #2 in "/lib/x86_64-linux-gnu/libc.so.6" #3 Foam::divide(Foam::Field&, Foam::UList const&, Foam::UList const&) in "/home/babak/OpenFOAM/OpenFOAM-2.1.x/platforms/linux64GccDPOpt/lib/libOpenFOAM.so" #4 Foam:perator/(Foam::UList const&, Foam::UList const&) in "/home/babak/OpenFOAM/OpenFOAM-2.1.x/platforms/linux64GccDPOpt/lib/libOpenFOAM.so" #5 Foam::diagonalSolver::solve(Foam::Field&, Foam::Field const&, unsigned char) const in "/home/babak/OpenFOAM/OpenFOAM-2.1.x/platforms/linux64GccDPOpt/lib/libOpenFOAM.so" #6 Foam::fvMatrix::solve(Foam::dictionary const&) in "/home/babak/OpenFOAM/OpenFOAM-2.1.x/platforms/linux64GccDPOpt/lib/libfiniteVolume.so" #7 Foam::fvMatrix::solve() in "/home/babak/OpenFOAM/babak-2.1.x/platforms/linux64GccDPOpt/bin/turbulentFlameletRhoPimpleFoam" #8 in "/home/babak/OpenFOAM/babak-2.1.x/platforms/linux64GccDPOpt/bin/turbulentFlameletRhoPimpleFoam" #9 __libc_start_main in "/lib/x86_64-linux-gnu/libc.so.6" #10 in "/home/babak/OpenFOAM/babak-2.1.x/platforms/linux64GccDPOpt/bin/turbulentFlameletRhoPimpleFoam" Floating point exception rm: cannot remove `pro*': No such file or directory

I should note that , I am trying to run your SANDIA_3D case in LES.
Have you ever experienced this error?

Regards
Bobi

 February 22, 2013, 12:16 #133 Super Moderator     Tobias Holzmann Join Date: Oct 2010 Location: Leoben (Austria) Posts: 1,806 Blog Entries: 6 Rep Power: 32 Hi Bobi, hmmmm ... I got a similar error for my transient flamelet solver. Till now I am not sure how to solve that but I am not working on that solver anymore. Did you implement your time-derivation in all equations? Further more you have to refine the mesh (but I think you know that) Error #3 seems to be a division with zero so you get the floating point exeption (but I am not sure) I think gschaider or bruno knows more about the numbered outputs.

 February 22, 2013, 14:13 #134 Senior Member   Bobi Join Date: Oct 2012 Location: Chicago, Illinois Posts: 414 Rep Power: 8 Hi Tobi I will contact Bernhard and Bruno soon. However, I have a conceptual problem with the issue. Why should I need the time derivatives of mixture fraction and it's variance? I have seen lots of papers, like Prof. Kempf's ones that he has combined steady flamelet (Equations without time-derivatives) with LES (that needs transient solvers like Pimple). If we import time-derivatives, then it will be unsteady flamelet. Although with unsteady flamelet we have more accuracy due to widespread libraries, But I think that we can still combine steady flamelet with LES solvers. The problem is in the fvSolution file Tobi, Cause I made some changes in that file and the error changed. I think I should coincide solvers for pimple algorithm. I will try my best to solve it. Regards Bobi Last edited by babakflame; February 22, 2013 at 15:23.

February 25, 2013, 04:25
#135
Super Moderator

Tobias Holzmann
Join Date: Oct 2010
Location: Leoben (Austria)
Posts: 1,806
Blog Entries: 6
Rep Power: 32
Quote:
 Originally Posted by babakflame Hi Tobi I will contact Bernhard and Bruno soon. However, I have a conceptual problem with the issue. Why should I need the time derivatives of mixture fraction and it's variance? I have seen lots of papers, like Prof. Kempf's ones that he has combined steady flamelet (Equations without time-derivatives) with LES (that needs transient solvers like Pimple). If we import time-derivatives, then it will be unsteady flamelet. Although with unsteady flamelet we have more accuracy due to widespread libraries, But I think that we can still combine steady flamelet with LES solvers. The problem is in the fvSolution file Tobi, Cause I made some changes in that file and the error changed. I think I should coincide solvers for pimple algorithm. I will try my best to solve it. Regards Bobi
I think that there are differences between | calculating flamelets steady state and solving the flow structur.

If you wanna make steady state flamelets (like Albertos tool does) you have to neglect the time derivations. BUT in the flow structure you should use the time derivation (in my opinion).

 March 6, 2013, 13:30 #136 New Member   Join Date: Feb 2013 Posts: 6 Rep Power: 6 Hi Tobi, I'm doing my master thesis in the field of flamelet models. The problem is that I already read so many papers and I do not know how to generate the flamelet libraries (computational technic). Can you help me by giving to me some basic ideas or plan to do that? Best

 March 6, 2013, 15:31 #137 Super Moderator     Tobias Holzmann Join Date: Oct 2010 Location: Leoben (Austria) Posts: 1,806 Blog Entries: 6 Rep Power: 32 Hi Danz, you mean the calculation of the flamelet libs ? Do you want to build your flamelets by your own or programming your own flamelet calculator? To generate the flamelets you first have to solve the flamelet quations! After that you have all physical and chemical variable as a function of Z You can use that libraries only for diffusion flames couse the flamelet model is build on the diffusion flames. After that and if you want to use the flamelet model for turbulent RANS eqn. you have to expand your flamelets to the variance. For that you have to use propability distribution functions (PDF) depend on the variables. For chi you have to use the log-normal function, for the enthalpy defect you should use the dirac delta function and for the rest you have to use the beta-pdf. Then you have every value phi depend on the following: In my master thesis I wanted to calculate flamelets by my own but there was no time to build a programm The reason was due to alberto cuocis flamelet calculator. There are just two binarys to execute and I had no ability to get through the code But I hope it helps you a bit. IF you build a own flamelet - calculater it would be very nice to get involved there. If you are searching for a Flamelet calculator you can use Pitsch´s calculator. There you can have a look into the whole c++ code but the code is annoying Tobi

 March 7, 2013, 04:40 #138 New Member   Join Date: Feb 2013 Posts: 6 Rep Power: 6 Hi, Thank you for your reply. Actually I just start my master thesis but the goal is to generate my own flamelet libraries So that why I am asking to you how did you do that ...

 March 7, 2013, 05:13 #139 Super Moderator     Tobias Holzmann Join Date: Oct 2010 Location: Leoben (Austria) Posts: 1,806 Blog Entries: 6 Rep Power: 32 Hi, i build my flamelets with the binarys included in the libOpenSmoke libraries

 March 12, 2013, 14:23 #140 Super Moderator     Tobias Holzmann Join Date: Oct 2010 Location: Leoben (Austria) Posts: 1,806 Blog Entries: 6 Rep Power: 32 Hi danz, are you working on a creator for flamelets now ? Would you like to use c++ ? I know a few good libraries for that. If you wanna do that I want to be involved if its okay ? After that it would be a greate expansion to the flamelet tool by using a compilable flamelet generator which everyone can modify.

 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

All times are GMT -4. The time now is 15:46.