|
[Sponsors] |
March 2, 2010, 05:54 |
FGM combustion model
|
#1 |
Member
Join Date: Dec 2009
Posts: 57
Rep Power: 17 |
Dear all,
Im looking to implement a combustion model (flamelet generated manifold) into OpenFOAM. My question is whether anyone could point me in the right direction as to where I can link a subroutine to an existing solver or where I can add an extra transport equation. Any help is greatly appreciated, Pieter |
|
March 2, 2010, 11:11 |
|
#2 |
Senior Member
Hannes Kröger
Join Date: Mar 2009
Location: Rostock, Germany
Posts: 124
Rep Power: 18 |
Hello,
I have already implemented this. The whole code is here: http://janus.fms.uni-rostock.de/view...ompositionPdf/ Best regards, Hannes |
|
March 2, 2010, 11:21 |
|
#3 |
Member
Join Date: Dec 2009
Posts: 57
Rep Power: 17 |
Wow, that would seriously save me a huge amount of time. Thanks so much!
If I were to use it, is there any article by your hand I can give reference to? You just made my day, Pieter Last edited by Graham81; March 3, 2010 at 10:05. |
|
March 2, 2010, 14:43 |
|
#4 |
Senior Member
Hannes Kröger
Join Date: Mar 2009
Location: Rostock, Germany
Posts: 124
Rep Power: 18 |
Hello Pieter,
I have presented some details of the implementation and validation results on the OpenFOAM workshop in Milan some time ago: http://www.openfoamworkshop.org/08/p...nesKroeger.pdf You might also have a look at this article: http://dx.doi.org/doi:10.1007/s10494-009-9242-y Hope this helps so far... Best regards, Hannes |
|
March 3, 2010, 10:03 |
|
#5 |
Member
Join Date: Dec 2009
Posts: 57
Rep Power: 17 |
Dear Hannes,
I read the articles and the main part of the code and this is in fact exactly what Im looking for! Any chance you can send me a zipfile with the code, and give a hint where to add/compile it to OpenFOAM? Ill start building you a statue here in Eindhoven, or maybe buy you a beer if ever you are closeby. Best regards, Pieter Last edited by Graham81; March 26, 2010 at 08:40. |
|
March 5, 2010, 15:52 |
|
#6 |
Senior Member
Hannes Kröger
Join Date: Mar 2009
Location: Rostock, Germany
Posts: 124
Rep Power: 18 |
Hi Pieter,
the code is written and tested for OpenFOAM-1.5. You can get the code via subversion. Just change to the $FOAM_SRC directory and checkout by executing the following commands: > src > svn co https://janus.fms.uni-rostock.de/svn...tockExtensions --username=gast When asked for the password just hit the return key. This will create a directory "LTTRostockExtensions" with the code for a library "libLTTRostockExtensions", for a number of solvers and utilities and some thirdparty programs (cantera and Cuba). The directory also contains a "bashrc" file. This file sets some environment variables that will be needed during the build process. It is intended to be sourced in your "~/.bashrc" just after the OF-bashrc file. To do so, just add the following line at the end of your ~/.bashrc: source $FOAM_SRC/LTTRostockExtensions/bashrc Before compiling, you need to make some changes to the LESModel-classes. The changes are in the *.diff files in the "patches" subdirectory. The "ApplyPatches"- script was intended for applying the patches, but I'm not sure if the diff-files are up-to-date and readily applicable to the current OF-1.5-dev files. Just try it. Once this is done, recompile the OF-LESModels and then execute the Allwmake script in the "LTTRostockExtensions"-directory. This should compile the thirdparty stuff, the library and the applications. Maybe, some applications will fail to compile because of errors. You can ignore the errors, provided that your relevant applications are not affected. You need Cantera and Cuba (only the libraries), the libLTTRostockExtensions.so and the solver "pdfOodles" (eventually simplePdfOodles for large timesteps) and "generateILDM" for generating the FGM tables. Maybe you are also interested in the solver thickenedFlameOodles which models combustion using the Artificially Thickened Flame Approach. This is the general outline of the build process. I'm not sure if everything will work out of the box, because I haven't touched the code for over a year (I'm not working in the combustion field any more, I'm now doing propellers). So if you encounter problems, just drop me a mail: hannes dot kr at gmx dot de. Furthermore, I will see if I can clean up some sample cases and add them to the repository. Best regards, Hannes |
|
May 16, 2011, 18:03 |
|
#7 |
Member
Join Date: Nov 2010
Posts: 54
Rep Power: 16 |
This is awesome! Are there any tutorial cases (for FGM solver) available as well ??
Thanks so much, gk |
|
July 31, 2011, 14:57 |
|
#8 |
Member
José Rodrigues
Join Date: Jun 2010
Location: IN+/IST Lisbon
Posts: 53
Rep Power: 16 |
Hi
I am trying to compile the packages on OpenFOAM-1.5.x Even though I was able to build the library libLTTRostockExtensions.so, I keep getting the same error when buiding the source for pdfOodles, for example. The error is Code:
/home/jrodrig/OpenFOAM-1.5.x/lib/linux64GccDPOpt/libLTTRostockExtensions.so: undefined reference to `Foam::incompressible::LESModel::Deff(Foam::GeometricField<double, Foam::fvPatchField, Foam::volMesh> const&) const' /home/jrodrig/OpenFOAM-1.5.x/lib/linux64GccDPOpt/libLTTRostockExtensions.so: undefined reference to `Foam::incompressible::LESModel::registerScalarField(Foam::GeometricField<double, Foam::fvPatchField, Foam::volMesh> const&, Foam::dimensioned<double> const&)' /home/jrodrig/OpenFOAM-1.5.x/lib/linux64GccDPOpt/libcompressibleLESModels.so: undefined reference to `Foam::LESfilter::New(Foam::fvMesh const&, Foam::dictionary const&)' /home/jrodrig/OpenFOAM-1.5.x/lib/linux64GccDPOpt/libLTTRostockExtensions.so: undefined reference to `Foam::compressible::LESModel::registerScalarField(Foam::GeometricField<double, Foam::fvPatchField, Foam::volMesh> const&)' /home/jrodrig/OpenFOAM-1.5.x/lib/linux64GccDPOpt/libLTTRostockExtensions.so: undefined reference to `Foam::incompressible::LESModel::sgsFlux(Foam::GeometricField<double, Foam::fvPatchField, Foam::volMesh> const&) const' /home/jrodrig/OpenFOAM-1.5.x/lib/linux64GccDPOpt/libLTTRostockExtensions.so: undefined reference to `Foam::compressible::LESModel::Deff(Foam::GeometricField<double, Foam::fvPatchField, Foam::volMesh> const&) const' /home/jrodrig/OpenFOAM-1.5.x/lib/linux64GccDPOpt/libLTTRostockExtensions.so: undefined reference to `Foam::incompressible::LESModel::divSgsFlux(Foam::GeometricField<double, Foam::fvPatchField, Foam::volMesh>&) const' collect2: ld returned 1 exit status make: *** [/home/jrodrig/OpenFOAM-1.5.x/applications/bin/linux64GccDPOpt/pdfOodles] Error 1 Regards Jose |
|
August 2, 2011, 06:40 |
|
#9 |
Member
José Rodrigues
Join Date: Jun 2010
Location: IN+/IST Lisbon
Posts: 53
Rep Power: 16 |
Hi,
Finally, I was able to compile pdfOodles solver. However, now I am struggling with the generateILDM and generateFGM applications. A) First I wanna ask which of these 2 apps is suitable to use with pdfOodles to build the flamelet tables. B) Second, when I compile the source for either app, I keep receiving errors like, Code:
Make/linux64GccDPOpt/ChemicalSystem.o: In function `ChemicalSystem': /home/jrodrig/OpenFOAM-1.5.x/src/LTTRostockExtensions/applications/generateILDM/ChemicalSystem.C:157: undefined reference to `Cantera::Constituents::elementIndex(std::basic_string<char, std::char_traits<char>, std::allocator<char> >) const' /home/jrodrig/OpenFOAM-1.5.x/src/LTTRostockExtensions/applications/generateILDM/ChemicalSystem.C:158: undefined reference to `Cantera::Constituents::elementIndex(std::basic_string<char, std::char_traits<char>, std::allocator<char> >) const' Make/linux64GccDPOpt/ChemicalSystem.o: In function `Cantera::TransportFactory::factory()': /home/jrodrig/cantera180/include/cantera/kernel/TransportFactory.h:107: undefined reference to `Cantera::TransportFactory::TransportFactory()' Make/linux64GccDPOpt/ChemicalSystem.o: In function `IdealGasMix': /home/jrodrig/cantera180/include/cantera/IdealGasMix.h:23: undefined reference to `Cantera::IdealGasPhase::IdealGasPhase()' /home/jrodrig/cantera180/include/cantera/IdealGasMix.h:23: undefined reference to `Cantera::GasKinetics::GasKinetics(Cantera::ThermoPhase*)' /home/jrodrig/cantera180/include/cantera/IdealGasMix.h:25: undefined reference to `Cantera::get_XML_File(std::basic_string<char, std::char_traits<char>, std::allocator<char> >, int)' /home/jrodrig/cantera180/include/cantera/IdealGasMix.h:29: undefined reference to `Cantera::buildSolutionFromXML(Cantera::XML_Node&, std::basic_string<char, std::char_traits<char>, std::allocator<char> >, std::basic_string<char, std::char_traits<char>, std::allocator<char> >, Cantera::ThermoPhase*, Cantera::Kinetics*)' /home/jrodrig/cantera180/include/cantera/IdealGasMix.h:31: undefined reference to `Cantera::CanteraError::CanteraError(std::basic_string<char, std::char_traits<char>, std::allocator<char> >, std::basic_string<char, std::char_traits<char>, std::allocator<char> >)' /home/jrodrig/cantera180/include/cantera/IdealGasMix.h:32: undefined reference to `Cantera::GasKinetics::~GasKinetics()' collect2: ld returned 1 exit status make: *** [/home/jrodrig/OpenFOAM-1.5.x/applications/bin/linux64GccDPOpt/generateILDM] Error 1 Also, I could not find the library -lcantera. I am using cantera-1.8 which was compiled with the BLAS and LAPACK libraries installed on my machine (so I use -llapack and -lblas instead of -lctlapack and -lctblas). Any thoughts on this? Somebody that was able to compile this source could give my a hand? I want to use this solver to test it in a case of Flameless combustion. I would really appreciate some help at this stage since I am doing this work for my thesis and time is running low. |
|
August 2, 2011, 07:50 |
|
#10 |
Senior Member
Hannes Kröger
Join Date: Mar 2009
Location: Rostock, Germany
Posts: 124
Rep Power: 18 |
Hi Jose,
A) yes, these two apps generate the chemistry tables. generateFGM was the first approach and generateILDM contains some more methods for chemistry table generation (ILDM, REDIM and FGM). I have only used FGM in my works, the other methods are still construction sites. As far as I remember, you should only need generateILDM. The table generation with FGM may become a bit cumbersome with varying mixture fraction when the flamelet computations cease to converge. You may need to play with setup parameters and restart generateILDM. Constant enthalpy and constant mixture fraction problems should be no problem. The PDF integration is then done, when pdfOodles is started (and the resulting higher dimensional table is cached in a file). When you start pdfOodles in parallel, the integration is also done parallelized. B) I have used cantera-1.7, it is in the "3rdparty" directory. I remember, there were some problems with 1.8 but I'm not sure about the differences. Best regards, Hannes |
|
August 2, 2011, 14:06 |
|
#11 |
Member
José Rodrigues
Join Date: Jun 2010
Location: IN+/IST Lisbon
Posts: 53
Rep Power: 16 |
Hi, Hannes
Thanks for your great contribution to OpenFOAM and now, also to me. I tried to workaround this compilation problem but with no success. The last error message (bellow) seams to point the error to the cantera installation, rather then to your code. Part of the error message looks like this: Code:
/home/jrodrig/OpenFOAM-1.5.x/src/LTTRostockExtensions/3rdparty/cantera-1.7.0-cvs/platforms/linux64GccDPOpt/lib/libtransport.a(LiquidTransport.o): In function `Cantera::LiquidTransport::init(Cantera::LiquidTransportParams&)': LiquidTransport.cpp:(.text+0x4abc): undefined reference to `Cantera::Phase::molecularWeights() const' LiquidTransport.cpp:(.text+0x4ac9): undefined reference to `Cantera::Phase::molecularWeights() const' LiquidTransport.cpp:(.text+0x4b3a): undefined reference to `Cantera::DenseMatrix::operator=(Cantera::DenseMatrix const&)' LiquidTransport.cpp:(.text+0x4b75): undefined reference to `Cantera::DenseMatrix::resize(int, int, double)' A) Maybe I did a mistake when building cantera. Should I add something more to the preconfig file? Can you provide your preconfig file? B) Am I supposed to have a libcantera.a (-lcantera) on my $CANTERA_INST_DIR/lib folder? C) Is there any chance that you had used a slight different version of cantera? I am using OpenFOAM-1.5.x and cantera-1.7.0-cvs (the one provided in your repository) Regards Jose |
|
August 3, 2011, 07:47 |
|
#12 |
Member
José Rodrigues
Join Date: Jun 2010
Location: IN+/IST Lisbon
Posts: 53
Rep Power: 16 |
Hi
Ok, I was able to compile finally both generateFGM and generateILDM. However, when I run either I get the message: Code:
jrodrig@pup:~/OpenFOAM-1.5.x/src/LTTRostockExtensions/applications/generateILDM/GRI1.2$ generateILDM terminate called after throwing an instance of 'std::logic_error' what(): basic_string::_S_construct NULL not valid Aborted How do I use generateILDM?? Regards Jose |
|
August 3, 2011, 09:28 |
|
#13 |
Member
José Rodrigues
Join Date: Jun 2010
Location: IN+/IST Lisbon
Posts: 53
Rep Power: 16 |
Ok,
Last problem also solved. I just corrected the input arguments code in main.C. Now I Get this: Code:
jrodrig@pup:~/OpenFOAM-1.5.x/src/LTTRostockExtensions/applications/generateILDM/GRI1.2$ generateILDM /*---------------------------------------------------------------------------*\ | ========= | | | \\ / F ield | OpenFOAM: The Open Source CFD Toolbox | | \\ / O peration | Version: 1.5.x | | \\ / A nd | Web: http://www.OpenFOAM.org | | \\/ M anipulation | | \*---------------------------------------------------------------------------*/ Exec : generateILDM Date : Aug 03 2011 Time : 13:25:44 Host : pup PID : 11938 Case : /home/jrodrig/OpenFOAM-1.5.x/src/LTTRostockExtensions/applications/generateILDM/GRI1.2 nProcs : 1 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // Create time ************************************************ Cantera Error! ************************************************ Procedure: IdealGasMix Error: Cantera::buildSolutionFromXML returned false Jose |
|
August 3, 2011, 21:11 |
|
#14 |
Member
Join Date: Nov 2010
Posts: 54
Rep Power: 16 |
Hi Jose,
I've just started looking into this code, and got a similar error: "undefined reference to `Cantera::Phase:: etc" How did you get rid of this? Thanks, gk |
|
August 4, 2011, 05:10 |
|
#15 |
Senior Member
Markus Rehm
Join Date: Mar 2009
Location: Erlangen (Germany)
Posts: 184
Rep Power: 17 |
Hi Rodrigo,
if I remember correctly this error is due to the missing input file. Cantera usually stores all relevant data (reaction mech, thermo data, transport data) in a cti file. But during execution it expects an xml file which sometimes is created automatically. Create your (xml)-input data manually I think the command should be "ct2ctml *.cti" it is situated in the bin directory of your installation. Next the xml needs to be found by the solver usually this works if you put it into the root dir of your case. Please keep us posted how it worked and maybe you can put a small docu here. Markus |
|
August 4, 2011, 07:24 |
|
#16 |
Member
José Rodrigues
Join Date: Jun 2010
Location: IN+/IST Lisbon
Posts: 53
Rep Power: 16 |
Hi gk,
This problem is happening because there are some libraries missing. The "ultimate" way to do this (for me at least) was to add the same compiler options used to build Cantera to the Make/options file, in the generateILDM folder. Depending on your configuration, the Make/options would look something like this: Code:
EXE_INC = \ -g \ -I$(CANTERA_ARCH_PATH)/include/cantera \ -I$(CANTERA_ARCH_PATH)/include \ -I$(CANTERA_ARCH_PATH)/include/cantera/kernel \ -I$(CANTERA_SRC)/equil \ -I$(OCTAVE_INC_PATH) \ -I$(OCTAVE_INC_PATH)/octave \ -I$(LTTEXT)/libLTTRostockExtensions/lnInclude \ -I$(FOAM_SRC)/finiteVolume/lnInclude \ -I$(GSL_DIR)/include \ EXE_LIBS = \ -L$(GSL_DIR)/lib \ -L$(CANTERA_ARCH_PATH)/lib \ -L/home/jrodrig/OpenFOAM-1.5.x/src/LTTRostockExtensions/3rdparty/cantera-1.7.0-cvs/build/lib/x86_64-unknown-linux-gnu \ -lLTTRostockExtensions -lfiniteVolume \ limex/LIMEX4_2_Dense.o \ limex/LIMEX4_2A1.o \ nleq1/nleq1.o \ nleq1/zibmon.o \ nleq1/zibsec.o \ nleq1/zibconst.o \ nleq1/wnorm.o \ nleq1/linalg_nleq1.o \ eulex/eulex.o \ -L/usr/lib \ -Lusr/include/sundials/lib \ -L$(OCTAVE_LIB_PATH) \ -loctave -lcruft \ -L$(CANTERA_ARCH_PATH)/lib \ -lclib -luser -loneD -lzeroD -lequil -lkinetics \ -ltransport -lthermo -lctnumerics -lctmath -ltpx \ -lctspectra -lconverters -lctbase -lsundials_cvodes \ -lsundials_nvecserial -llapack -lblas -lctf2c \ Regards Jose |
|
August 6, 2011, 23:09 |
|
#17 |
Member
José Rodrigues
Join Date: Jun 2010
Location: IN+/IST Lisbon
Posts: 53
Rep Power: 16 |
Hey Markus,
Thx for your help! I only had the time to rerun it now. Turns out the problem was that the gasId was mismatched with the .cti file and the generateILDMdict. Now it runs.... ....till it crashes again. Again, I might be setting up something badly correctly or somethings are missing. So, I run generateILDM in a case directory and after it calculates the tables, it gives the following error message: Code:
Take 40 timesteps 0.0001629 5.132 .............................................................................. Attempt Newton solution of steady-state problem... failure. .............................................................................. Take 40 timesteps 0.01374 3.385 .............................................................................. Attempt Newton solution of steady-state problem... success. Problem solved on [12] point grid(s). #0 Foam::error::printStack(Foam::Ostream&) in "/home/jrodrig/OpenFOAM-1.5.x/lib/linux64GccDPOpt/libOpenFOAM.so" #1 Foam::sigFpe::sigFpeHandler(int) in "/home/jrodrig/OpenFOAM-1.5.x/lib/linux64GccDPOpt/libOpenFOAM.so" #2 in "/lib/libc.so.6" #3 in "/home/jrodrig/OpenFOAM-1.5.x/applications/bin/linux64GccDPOpt/generateILDM" #4 in "/home/jrodrig/OpenFOAM-1.5.x/applications/bin/linux64GccDPOpt/generateILDM" #5 in "/home/jrodrig/OpenFOAM-1.5.x/applications/bin/linux64GccDPOpt/generateILDM" #6 at ~/cantera-1.8/installCantera/include/cantera/kernel/Domain1D.h:167 #7 at ~/OpenFOAM-1.5.x/src/OpenFOAM/lnInclude/autoPtrI.H:110 #8 at ~/OpenFOAM-1.5.x/src/OpenFOAM/lnInclude/autoPtrI.H:89 #9 at ~/OpenFOAM-1.5.x/src/LTTRostockExtensions/applications/generateILDM/generationLoop.C:253 #10 at ~/OpenFOAM-1.5.x/src/LTTRostockExtensions/applications/generateILDM/generationLoop.C:266 #11 at ~/OpenFOAM-1.5.x/src/LTTRostockExtensions/applications/generateILDM/main.C:141 #12 __libc_start_main in "/lib/libc.so.6" #13 in "/home/jrodrig/OpenFOAM-1.5.x/applications/bin/linux64GccDPOpt/generateILDM" Floating point exception Code:
/// Number of grid points in this domain. int nPoints() const { return m_points; } The generateILDMdict is the following: Code:
inputFile "smooke46.cti"; gasID "smooke46"; constituentsGivenAs moleNumbers; fuel 1 (CH4 1.0); oxidant 2 (O2 1.0 N2 3.76); majorProducts 2 (CO2 1.0 H2O 2.0); mixtureFractionBasedOn C; stoichiometricOxidantFuelMassRatio 17.13; defaultConservedVariables 3 (p 100000 T 300 phi 1.0); conservedVariableLoops ( { variable h; start -88000; end -84874.1; resolution 10; } { variable z; start 0.0; end 0.05997; resolution 10; } ); ILDMgeneratorType FGM; resolution 50; progressVariableName CO2; laminarFlameDomainLength 0.3; laminarFlameInitialDomainResolution 10; flsameShift 0.0; Jose |
|
November 29, 2011, 04:28 |
|
#18 |
New Member
Simon Krüger
Join Date: Nov 2011
Posts: 1
Rep Power: 0 |
Hello Hannes,
unfortunately the svn link isn't working anymore. Is there another way, I can get the files? Thanks, Simon |
|
December 16, 2011, 09:30 |
|
#19 | |
New Member
Oliver Pasqual
Join Date: May 2011
Posts: 13
Rep Power: 15 |
Quote:
the link is not avaible now, have you got these files? It will be highly apprieciated if somebody give me hint... thanks. Oliver |
||
December 20, 2011, 07:12 |
|
#20 |
New Member
Alexander Klaessen
Join Date: Sep 2011
Posts: 1
Rep Power: 0 |
||
|
|
Similar Threads | ||||
Thread | Thread Starter | Forum | Replies | Last Post |
Liquid rocket engine non-premixed combustion model | Erik | FLUENT | 2 | November 28, 2013 15:09 |
second and final question about flamelet combustion model | AdidaKK | CFX | 0 | October 17, 2009 08:25 |
Combustion Model for CAI/HCCI - AVL FIRE | Patryk | Main CFD Forum | 0 | July 24, 2009 17:43 |
How to model combustion with only methane stream? | ligang zheng | FLUENT | 2 | May 1, 2007 10:16 |
combustion model | Hennie van der Westhuizen | Siemens | 7 | February 27, 2002 03:10 |