CFD Online Logo CFD Online URL
www.cfd-online.com
[Sponsors]
Home > Forums > OpenFOAM Programming & Development

libOpenSMOKE

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

Like Tree128Likes

Reply
 
LinkBack Thread Tools Display Modes
Old   April 21, 2012, 13:47
Default
  #21
Senior Member
 
Tobi's Avatar
 
Tobias Holzmann
Join Date: Oct 2010
Location: Leoben (Austria)
Posts: 1,397
Blog Entries: 5
Rep Power: 24
Tobi will become famous soon enoughTobi will become famous soon enough
Send a message via ICQ to Tobi Send a message via Skype™ to Tobi
My fault,,,....

Code:
sudo apt-get install gsl-bin libgsl0-dev
I forgot it
Tobi is offline   Reply With Quote

Old   April 21, 2012, 17:01
Default transient
  #22
Senior Member
 
Tobi's Avatar
 
Tobias Holzmann
Join Date: Oct 2010
Location: Leoben (Austria)
Posts: 1,397
Blog Entries: 5
Rep Power: 24
Tobi will become famous soon enoughTobi will become famous soon enough
Send a message via ICQ to Tobi Send a message via Skype™ to Tobi
Hi all,

the solver seems to make good results with the steadyState solver and the Sandia flames. I wanna have a try in building my own transient solver for the flamelet model.

Its the first time I am doing such an integration. Building and adding new scalars to a solver is not a problem but I think that 's a challenge.


Okay I did the follow steps:

Step 1: creating a new solver and compile it

Code:
mkdir -p $HOME/OpenFOAM/shor-ty-2.1.x/applications/solvers/combustion/
cd $HOME/OpenFOAM/shor-ty-2.1.x/applications/solvers/combustion/
cp -r $FOAM_SOLVERS/compressible/rhoPimpleFoam .
mv rhoPimpleFoam flamletRhoPimpleFoam

cp -r $HOME/OpenFOAM/libOpenSMOKE/src/applications/rhoSimpleFoam_flamlet1007 .
(as reference)
So - after that I renamed the *.C file in the flameletRhoPimpleFoam solver and changed the Make/ files so that I can build the renamed rhoPimpleFoam solver.

Step 2: adding variables and pdfThermo
I did this by changing the createField.H file (added the lines need -> refer to the original)
changing the *.C file
Code:
wclean
wmake
I did this till everything was okay.
After that I changed the hEqn.H and added the missing files for csiEqn.H writeMass... etc.

Code:
wclean
wmake
Everythings working and the solver works till 4 timesteps
-> floatingpoint

Well the problem is, that the csiEqn.H is not with ddt()... so I added it with ddt(rho, csi)
Now the solver workes for more then 100 iterations with error -> floatingpoint.

I have no experiance with the turbulence modelling like the following line:
Code:
        fvScalarMatrix csiEqn
        (
                (
                        fvm::ddt(rho, csi)
                      + fvm::div(phi, csi)
                      - fvm::Sp(fvc::div(phi), csi)
                      - fvm::laplacian(turbulence->alphaEff(), csi)
                )
        );
--------------------------------------------------------------------------------------------
        fvScalarMatrix csiEqn
        (
                (
                        fvm::ddt(rho, csi)
                      + fvm::div(phi, csi)
                      - fvm::Sp(fvc::div(phi), csi)
                      - fvm::laplacian(turbulence->mut()/sigmat, csi)
                )
        );
Further more, I am not sure if the equations are right just by adding fvm::ddt(rho,csi)
I think I have to get the correct equation or?

And in which line should I add the

Code:
#include csiEqn.H
file. Within the pimple-loop?

Its a very good exercise for me and I understand more and more - but till too less for that implementation.

Any suggestions?
Is that the right way to do something like that?

Nice weekend
tobi
Tobi is offline   Reply With Quote

Old   April 21, 2012, 17:44
Default
  #23
Super Moderator
 
Bruno Santos
Join Date: Mar 2009
Location: Lisbon, Portugal
Posts: 9,531
Blog Entries: 39
Rep Power: 97
wyldckat is just really nicewyldckat is just really nicewyldckat is just really nicewyldckat is just really nicewyldckat is just really nice
Hi Tobi,

Unfortunately I'm unable to comment on changes on the equations.

But I can comment on this: did you properly modify "Make/files" on your modified solver?
More specifically, the line that starts with "EXE = ", you should use the variable "FOAM_USER_APPBIN", as shown here: https://github.com/wyldckat/libOpenS...007/Make/files

Secondly, (like I've told you before) you better have started to learn how to use git! And make good use of it, otherwise you might end up regretting it for accidentally erasing a file or a line, being then unable to go back due to not having some kind of a backup...

Best regards and good luck!
Bruno
__________________
wyldckat is offline   Reply With Quote

Old   April 21, 2012, 17:52
Default
  #24
Senior Member
 
Tobi's Avatar
 
Tobias Holzmann
Join Date: Oct 2010
Location: Leoben (Austria)
Posts: 1,397
Blog Entries: 5
Rep Power: 24
Tobi will become famous soon enoughTobi will become famous soon enough
Send a message via ICQ to Tobi Send a message via Skype™ to Tobi
Quote:
Originally Posted by wyldckat View Post
comment on this: did you properly modify "Make/files" on your modified solver?
More specifically, the line that starts with "EXE = ", you should use the variable "FOAM_USER_APPBIN", as shown here: https://github.com/wyldckat/libOpenS...007/Make/files
Bruno
yes I changed the exe to flameletRhoPimpleFoam,
Well the solver is running and using the flamelet library
Code:
OpenSMOKE_PDF_NonAdiabaticFlamelet_Library
File name:                         PDF-Library/LookUpTable.out
Number of Enthalpy defects:        1
Minimum enthalpy defect:           0 kJ/kg
Maximum enthalpy defect:           0 kJ/kg
Adiabatic flamelets:               1
Temperature fuel:                  292 K
Temperature oxidizer:              290 K
Density fuel:                      0.843587 kg/m3
Density oxidizer:                  1.206918 kg/m3
Enthalpy fuel:                     -2196299.457 J/kg
Enthalpy oxidizer:                 -109289.5676 J/kg

Initialize basic fields... 
Initialize enthalpy field (field)... 
pdfThermo h(const scalarField& T, const label patchi)... end..
pdfThermo h(const scalarField& T, const label patchi)... end..
pdfThermo h(const scalarField& T, const label patchi)... end..
pdfThermo h(const scalarField& T, const label patchi)... end..
pdfThermo h(const scalarField& T, const label patchi)... end..
pdfThermo h(const scalarField& T, const label patchi)... end..
pdfThermo h(const scalarField& T, const label patchi)... end..
pdfThermo h(const scalarField& T, const label patchi)... end..
Calculate (first time)... 
 Fuel  enthalpy:    -2196299.457 J/kg
 Oxid. enthalpy:    -109289.5676 J/kg
 Fuel  temperature: 292 K
 Oxid. temperature: 290 K
Preparing additional scalar fields (references)

Reading field U

Reading/calculating face flux field phi

Creating turbulence model

Selecting RAS turbulence model kEpsilon
kEpsilonCoeffs
{
    Cmu             0.09;
    C1              1.47;
    C2              1.92;
    C3              -0.33;
    alphah          1;
    alphak          1;
    alphaEps        0.76923;
    muLimiter       on;
    Lsgs            0.0002;
    sigmak          1;
    sigmaEps        1.3;
    Prt             1;
}

Reading flamelet dictionary

Preparing field Qrad (radiative heat transfer)

Creating field dpdt

Creating field kinetic energy K


Starting time loop

Courant Number mean: 8.44541524e-07 max: 2.911575313e-05
Time = 1e-08

diagonal:  Solving for rho, Initial residual = 0, Final residual = 0, No Iterations 0
DILUPBiCG:  Solving for Ux, Initial residual = 1, Final residual = 1.708306365e-14, No Iterations 2
DILUPBiCG:  Solving for Uy, Initial residual = 0.9999999911, Final residual = 5.36071748e-09, No Iterations 1
DILUPBiCG:  Solving for Uz, Initial residual = 0.9999999879, Final residual = 1.929270108e-15, No Iterations 2
DILUPBiCG:  Solving for H, Initial residual = 0.9999999378, Final residual = 1.912266547e-08, No Iterations 1
Correct thermodynamics
Updating look-up table extractions...
Updating mass fraction extractions...
DILUPBiCG:  Solving for csi, Initial residual = 1, Final residual = 1.93099693e-08, No Iterations 1
Algebraic equation for csiv2... 
csiv2 max/min : 1502.115168 0
DICPCG:  Solving for p, Initial residual = 0.9999987876, Final residual = 2.299981717e-12, No Iterations 1
diagonal:  Solving for rho, Initial residual = 0, Final residual = 0, No Iterations 0
time step continuity errors : sum local = 1.351669305e-16, global = 7.808351117e-17, cumulative = 7.808351117e-17
rho max/min : 1.206986433 0.8436347068
DICPCG:  Solving for p, Initial residual = 7.611717111e-08, Final residual = 1.20032573e-19, No Iterations 1
diagonal:  Solving for rho, Initial residual = 0, Final residual = 0, No Iterations 0
time step continuity errors : sum local = 1.272683967e-16, global = 7.714220478e-17, cumulative = 1.55225716e-16
rho max/min : 1.206986436 0.8436347095
DILUPBiCG:  Solving for epsilon, Initial residual = 7.774178526e-06, Final residual = 1.096653757e-13, No Iterations 1
DILUPBiCG:  Solving for k, Initial residual = 1, Final residual = 7.314882102e-09, No Iterations 1
    Calculating massFlow
ExecutionTime = 0.23 s  ClockTime = 0 s

Courant Number mean: 8.445415785e-07 max: 2.916317493e-05
Time = 2e-08

diagonal:  Solving for rho, Initial residual = 0, Final residual = 0, No Iterations 0
DILUPBiCG:  Solving for Ux, Initial residual = 7.9735332e-06, Final residual = 8.601544082e-14, No Iterations 1
DILUPBiCG:  Solving for Uy, Initial residual = 0.2414552065, Final residual = 1.260364316e-09, No Iterations 1
DILUPBiCG:  Solving for Uz, Initial residual = 0.001292184778, Final residual = 6.911558089e-14, No Iterations 1
DILUPBiCG:  Solving for H, Initial residual = 0.001240166818, Final residual = 1.676567063e-13, No Iterations 1
Correct thermodynamics
Updating look-up table extractions...
DILUPBiCG:  Solving for csi, Initial residual = 0.001293280751, Final residual = 3.408964691e-14, No Iterations 1
Algebraic equation for csiv2... 
csiv2 max/min : 0.03973394674 0
DICPCG:  Solving for p, Initial residual = 0.003765993377, Final residual = 7.857355414e-15, No Iterations 1
diagonal:  Solving for rho, Initial residual = 0, Final residual = 0, No Iterations 0
time step continuity errors : sum local = 1.28577143e-16, global = 7.288222584e-17, cumulative = 2.281079418e-16
rho max/min : 1.207054867 0.843722596
DICPCG:  Solving for p, Initial residual = 5.596609331e-08, Final residual = 8.830044552e-20, No Iterations 1
diagonal:  Solving for rho, Initial residual = 0, Final residual = 0, No Iterations 0
time step continuity errors : sum local = 1.225076996e-16, global = 7.161084698e-17, cumulative = 2.997187888e-16
rho max/min : 1.207054878 0.8437226037
DILUPBiCG:  Solving for epsilon, Initial residual = 5.762029595e-06, Final residual = 5.398702051e-15, No Iterations 1
DILUPBiCG:  Solving for k, Initial residual = 0.001755283888, Final residual = 3.878694754e-13, No Iterations 1
    Calculating massFlow
ExecutionTime = 0.3 s  ClockTime = 0 s

Courant Number mean: 8.445415844e-07 max: 2.916591386e-05
Time = 3e-08
So its my new solver working now.
But you are right. I should make use of git to get back to older files or so on
But for today I am very tired.
Tobi is offline   Reply With Quote

Old   May 3, 2012, 09:17
Default
  #25
Senior Member
 
Tobi's Avatar
 
Tobias Holzmann
Join Date: Oct 2010
Location: Leoben (Austria)
Posts: 1,397
Blog Entries: 5
Rep Power: 24
Tobi will become famous soon enoughTobi will become famous soon enough
Send a message via ICQ to Tobi Send a message via Skype™ to Tobi
Hi Tom,

are you still testing the flamelet solver and are you using the standard 2006 transport and thermodynamic files? I used the newer one but there is an error while executing the chemkinInterpreter. Well I contact the authors but they are not writing back

And further more, do you know what the
Code:
SOLVE
CYCLE
REFINELEANSIDE
are good for? I do not understand the user guide
Tobi
Tobi is offline   Reply With Quote

Old   May 3, 2012, 10:08
Default
  #26
Senior Member
 
Tom Fahner
Join Date: Mar 2009
Location: Delft, Netherlands
Posts: 311
Rep Power: 12
tomf is on a distinguished road
Send a message via MSN to tomf Send a message via Skype™ to tomf
Hi Tobi.

In fact I am still looking at it from time to time. I have started looking at the GRI3.0 mechanism, and I managed to use that in order to create a flamelet library to redo the project I mentioned earlier, checking if I can get similar results, or maybe improve the result.

Maybe you can check the validity of the Chemkin files with the standard OpenFOAM tools, like chemkinToFoam?

About the refineleanside, solve and cycle I am also not entirely sure, but it seems to me that it represents some numerical integration parameters in order to solve the flamelet equations and adaptively refine the grid based on the result that was obtained. For my library I just used the default setup from the tutorial and I got a result for the GRI3.0 mechanism, transport and thermodynamic data, which at least seems to give appropriate intermediate results, but I am not yet far enough to comment on the accuracy.

If it is possible to comment on it I will let you know.

I Hope you will receive some more information from the original authors.

Regards,
Tom
tomf is offline   Reply With Quote

Old   May 3, 2012, 16:10
Default
  #27
Super Moderator
 
Bruno Santos
Join Date: Mar 2009
Location: Lisbon, Portugal
Posts: 9,531
Blog Entries: 39
Rep Power: 97
wyldckat is just really nicewyldckat is just really nicewyldckat is just really nicewyldckat is just really nicewyldckat is just really nice
Hi Tobi and Tom,

It looks to me like the authors might be very busy with the project(s) related to their presentation(s) this year at OFW7 - http://extend-project.de/ofw7-technical-program:
Quote:
Coupling between microkinetic modeling and CFD: towards a fully first-principle catalytic chemical reaction engineering; A. Cuoci, M. Maestri

laminarSMOKE: A computational framework for the modeling of laminar flows with detailed kinetic mechanisms; A. Cuoci, A. Frassoldati, T. Faravelli, E. Ranzi
So if either one of you is going this year to this workshop, then it might be a good chance to poke A. Cuoci

Best regards,
Bruno
__________________

Last edited by wyldckat; May 29, 2012 at 15:20. Reason: fix broken link
wyldckat is offline   Reply With Quote

Old   May 3, 2012, 16:17
Default
  #28
Senior Member
 
Tobi's Avatar
 
Tobias Holzmann
Join Date: Oct 2010
Location: Leoben (Austria)
Posts: 1,397
Blog Entries: 5
Rep Power: 24
Tobi will become famous soon enoughTobi will become famous soon enough
Send a message via ICQ to Tobi Send a message via Skype™ to Tobi
Quote:
Originally Posted by wyldckat View Post
Hi Tobi and Tom,

It looks to me like the authors might be very busy with the project(s) related to their presentation(s) this year at OFW7 - http://extend-project.de/ofw7-technical-program:
So if either one of you is going this year to this workshop, then it might be a good chance to poke A. Cuoci

Best regards,
Bruno

Yes that would be very nice, but I think my english is too bad to discuss with the guys and there is no time for me - shit!
Tobi is offline   Reply With Quote

Old   May 3, 2012, 17:12
Default
  #29
Senior Member
 
Tom Fahner
Join Date: Mar 2009
Location: Delft, Netherlands
Posts: 311
Rep Power: 12
tomf is on a distinguished road
Send a message via MSN to tomf Send a message via Skype™ to tomf
Hi Bruno,

Thanks a lot for the information. I will be there, so I think I will go and have a chat with him/them. I compiled the library on our cluster today, just have some problem reading the flamelets while running the solver there, which is a shame since it means a large reduction in computational resources, but have to investigate on that.

Tom
tomf is offline   Reply With Quote

Old   May 3, 2012, 17:13
Default
  #30
Super Moderator
 
Bruno Santos
Join Date: Mar 2009
Location: Lisbon, Portugal
Posts: 9,531
Blog Entries: 39
Rep Power: 97
wyldckat is just really nicewyldckat is just really nicewyldckat is just really nicewyldckat is just really nicewyldckat is just really nice
Quick post - I'm searching for projects on sourceforge.net that are somehow related to OpenFOAM and I tripped on this one: http://sourceforge.net/p/ofca/code/ - although it looks like it's for the variant 1.6-ext only...
tomf likes this.
__________________
wyldckat is offline   Reply With Quote

Old   May 3, 2012, 17:20
Default
  #31
Senior Member
 
Tobi's Avatar
 
Tobias Holzmann
Join Date: Oct 2010
Location: Leoben (Austria)
Posts: 1,397
Blog Entries: 5
Rep Power: 24
Tobi will become famous soon enoughTobi will become famous soon enough
Send a message via ICQ to Tobi Send a message via Skype™ to Tobi
Quote:
Originally Posted by tomf View Post
Hi Bruno,

Thanks a lot for the information. I will be there, so I think I will go and have a chat with him/them. I compiled the library on our cluster today, just have some problem reading the flamelets while running the solver there, which is a shame since it means a large reduction in computational resources, but have to investigate on that.

Tom
Hi Tom,
i am very interessted in your chat! It would be very nice if you report me some details about your chat.

Thx tobi
Tobi is offline   Reply With Quote

Old   May 3, 2012, 17:41
Default
  #32
Senior Member
 
Tom Fahner
Join Date: Mar 2009
Location: Delft, Netherlands
Posts: 311
Rep Power: 12
tomf is on a distinguished road
Send a message via MSN to tomf Send a message via Skype™ to tomf
Well I wonder if I can get something out of the chat. I'll see.

The edcSimpleFoam also sounds interesting. No problem if it is 1.6-ext, we have at least 1.5-2.1 and 1.5-dev/1.6-ext still lying around in some dusty old harddrive, just in case.

More stuff on the to-do-list.
tomf is offline   Reply With Quote

Old   May 29, 2012, 09:18
Default
  #33
Senior Member
 
Tobi's Avatar
 
Tobias Holzmann
Join Date: Oct 2010
Location: Leoben (Austria)
Posts: 1,397
Blog Entries: 5
Rep Power: 24
Tobi will become famous soon enoughTobi will become famous soon enough
Send a message via ICQ to Tobi Send a message via Skype™ to Tobi
Hi all,

just one question.
Is it possible to get the source code for LibOpenSMOKE using doxygen?
I am reading a few days in the code but it would be easier to use doxygen and get graphics for the classes and functions.

Is that possible?
tobi


I SOLVED IT!

Last edited by Tobi; May 29, 2012 at 09:39.
Tobi is offline   Reply With Quote

Old   May 29, 2012, 11:41
Default
  #34
Senior Member
 
Tobi's Avatar
 
Tobias Holzmann
Join Date: Oct 2010
Location: Leoben (Austria)
Posts: 1,397
Blog Entries: 5
Rep Power: 24
Tobi will become famous soon enoughTobi will become famous soon enough
Send a message via ICQ to Tobi Send a message via Skype™ to Tobi
Quote:
Originally Posted by wyldckat View Post
Hi Tobi and Tom,

It looks to me like the authors might be very busy with the project(s) related to their presentation(s) this year at OFW7 - http://extend-project.de/ofw7-technical-program:
So if either one of you is going this year to this workshop, then it might be a good chance to poke A. Cuoci

Best regards,
Bruno

Hi bruno, i can not open the link! Is that event in Darmstadt?

Tobi

PS: Tom did you tried the binarys for other kinetic schemes ?
Tobi is offline   Reply With Quote

Old   May 29, 2012, 11:55
Default
  #35
Senior Member
 
Tom Fahner
Join Date: Mar 2009
Location: Delft, Netherlands
Posts: 311
Rep Power: 12
tomf is on a distinguished road
Send a message via MSN to tomf Send a message via Skype™ to tomf
Hi Tobi,

You mean the tools (shell scripts) to generate different flamelet libraries from alternative kinetic/thermophysical databases? Than yes, I used those, following the recipe from the user guide for libOpenSMOKE. However, I am not entirely sure about the validity of the resulting library from the scripts. Qualitatively it is satisfying however.

Regards,
Tom
tomf is offline   Reply With Quote

Old   May 29, 2012, 12:16
Default
  #36
Senior Member
 
Tobi's Avatar
 
Tobias Holzmann
Join Date: Oct 2010
Location: Leoben (Austria)
Posts: 1,397
Blog Entries: 5
Rep Power: 24
Tobi will become famous soon enoughTobi will become famous soon enough
Send a message via ICQ to Tobi Send a message via Skype™ to Tobi
Quote:
Originally Posted by tomf View Post
Hi Tobi,

You mean the tools (shell scripts) to generate different flamelet libraries from alternative kinetic/thermophysical databases? Than yes, I used those, following the recipe from the user guide for libOpenSMOKE. However, I am not entirely sure about the validity of the resulting library from the scripts. Qualitatively it is satisfying however.

Regards,
Tom

Hi tom,

i mean the other files you can download from CRECK. Like a kinetic scheme for biomass combustion or sth. like that.

I created a bash-script for generating flamelets very simply but I am not able to use other schemes, thermodynamics and transportProperties
Tobi is offline   Reply With Quote

Old   May 29, 2012, 15:24
Default
  #37
Super Moderator
 
Bruno Santos
Join Date: Mar 2009
Location: Lisbon, Portugal
Posts: 9,531
Blog Entries: 39
Rep Power: 97
wyldckat is just really nicewyldckat is just really nicewyldckat is just really nicewyldckat is just really nicewyldckat is just really nice
Hi Tobi and Tom,

Quote:
Originally Posted by Tobi View Post
Hi bruno, i can not open the link! Is that event in Darmstadt?
I've fixed the link. Here it is once again: http://extend-project.de/ofw7-technical-program

As for the location:
Quote:
Originally Posted by http://www.extend-project.de/7th-openfoam-workshop
Venue: Darmstadtium - Darmstadt, Germany (next to Frankfurt)
The registrations are almost closing - see: 7th OpenFOAM Workshop post #12

Best regards,
Bruno
__________________
wyldckat is offline   Reply With Quote

Old   May 29, 2012, 15:28
Default
  #38
Senior Member
 
Tobi's Avatar
 
Tobias Holzmann
Join Date: Oct 2010
Location: Leoben (Austria)
Posts: 1,397
Blog Entries: 5
Rep Power: 24
Tobi will become famous soon enoughTobi will become famous soon enough
Send a message via ICQ to Tobi Send a message via Skype™ to Tobi
shit ,... i am next to darmstadt
Tobi is offline   Reply With Quote

Old   May 30, 2012, 02:53
Default
  #39
Senior Member
 
Tom Fahner
Join Date: Mar 2009
Location: Delft, Netherlands
Posts: 311
Rep Power: 12
tomf is on a distinguished road
Send a message via MSN to tomf Send a message via Skype™ to tomf
Hi Tobi,

I have not checked those files, however I did manage to get a flamelet library based on the GRI 3.0 mechanism, so in principle it should work I guess. I do not know about the details however.
tomf is offline   Reply With Quote

Old   May 30, 2012, 05:00
Default
  #40
Senior Member
 
Tobi's Avatar
 
Tobias Holzmann
Join Date: Oct 2010
Location: Leoben (Austria)
Posts: 1,397
Blog Entries: 5
Rep Power: 24
Tobi will become famous soon enoughTobi will become famous soon enough
Send a message via ICQ to Tobi Send a message via Skype™ to Tobi
Hi Tom,

yea i thought that too, couse the files are the same,... just having more species in it. Well in two weeks when I have my new flat I ll be able to try around with the files at home. Its a pitty that I am too late for the 7th Workshop. It would be very nice to meet you too, tom.

Tobi
Tobi is offline   Reply With Quote

Reply

Thread Tools
Display Modes

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



All times are GMT -4. The time now is 22:28.