CFD Online Discussion Forums

CFD Online Discussion Forums (https://www.cfd-online.com/Forums/)
-   OpenFOAM Community Contributions (https://www.cfd-online.com/Forums/openfoam-community-contributions/)
-   -   [flameletFoam] flameletFoam (by Hagen Müller) (https://www.cfd-online.com/Forums/openfoam-community-contributions/145761-flameletfoam-hagen-mueller.html)

Hagen December 11, 2014 12:19

flameletFoam (by Hagen Müller)
 
Dear all,

I would like to open a thread for the flameletFoam package we recently developed. This is a package to use the steady laminar flamelet model for turbulent non-premixed combustion in OpenFOAM.
The package consists of a cantera tool to calculate the laminar flamelets, an utility to integrate them with a beta-PDF and a solver for RANS and LES. Two versions are available - one for OF-2.3 and one for OF-2.1.

Download: https://github.com/flameletFoam/
Documentation: https://openfoamwiki.net/index.php/E...n/flameletFoam

Greetings, Hagen

wenxu December 19, 2014 20:03

Quote:

We Can use any reaction mechanism in cantera. We just need to provide it in The mechanism folder ans select it in The input.txt.
------by Hagen Müller

wenxu December 20, 2014 02:56

Dear Hagen,
http://www.et.byu.edu/~Tom/classes/6...ningphases.pdf we can get Cantera as the instructions, but can not be used by OF.
Now i want to get CO mechanism of .xml file as gri30.xml in the mechanisms folder, how can i get it? I have no idea. Please give me some hints, Thank you in advance!

Best regards,
wenxu

Hagen December 21, 2014 13:02

Dear Wenxu,

which mechanism do you want to use?
There are some provided in the cantera installation folder (cantera-2.0.0/data/).
If you have your mechanism in chemkin format, there is a converter ck2cti. I haven't tried it though.

Hope this helps a bit,
Hagen

aat December 21, 2014 18:14

problem installing flameletFoam on OpenFOAM-2.3.x
 
Quote:

Originally Posted by Hagen (Post 523521)
Dear all,

I would like to open a thread for the flameletFoam package we recently developed. This is a package to use the steady laminar flamelet model for turbulent non-premixed combustion in OpenFOAM.
The package consists of a cantera tool to calculate the laminar flamelets, an utility to integrate them with a beta-PDF and a solver for RANS and LES. Two versions are available - one for OF-2.3 and one for OF-2.1.

Download: https://github.com/flameletFoam/
Documentation: https://openfoamwiki.net/index.php/E...n/flameletFoam

Greetings, Hagen

Hello Hagen,

A big thanks to you and your colleagues for authoring and making flameletFoam available to us. I am really interested in trying it for some gas phase combustion tests.

I was able to successfully install Cantera-2.0.0 and Cantera-CounterflameFlow per the instructions. However, I ran into a problem trying to install flamelet-2.3.x on my machine under a working OpenFOAM-2.3.x installatoin. I assume the flamelet version will work with OF2.3.x builds (since the flamelet folder also has a 2.3.x naming). Could you confirm?

Here are the error log details.

During the installation, the library FlameletfvOptions was not built. Here is the last line of the build log:

---------error message-------------
Code:

/usr/bin/ld: cannot find -lFlameletfvOptions
looking into the log file where the lib was being generated, I saw these error messages :


--------------error messages--------------------------------
Code:

fvOptions/fvOption.C: In member function ‘void Foam::fv::option::setCellSet()’:
fvOptions/fvOption.C:116:13: error: ‘IInfo’ was not declared in this scope
            IInfo<< "- selecting cells using points" << endl;
            ^
fvOptions/fvOption.C:144:13: error: ‘IInfo’ was not declared in this scope
            IInfo<< "- selecting cells using cellSet " << cellSetName_ << endl;
            ^
fvOptions/fvOption.C:153:13: error: ‘IInfo’ was not declared in this scope
            IInfo<< "- selecting cells using cellZone " << cellSetName_ << endl;
            ^
fvOptions/fvOption.C:171:17: error: ‘IInfo’ was not declared in this scope
                IInfo<< "- selecting inter region mapping" << endl;
                ^
fvOptions/fvOption.C:216:13: error: ‘IInfo’ was not declared in this scope
            IInfo<< "- selecting all cells" << endl;
            ^
fvOptions/fvOption.C:241:9: error: ‘IInfo’ was not declared in this scope
        IInfo<< "- selected " << returnReduce(cells_.size(), sumOp<label>())
        ^
fvOptions/fvOption.C: In constructor ‘Foam::fv::option::option(const Foam::word&, const Foam::word&, const Foam::dictionary&, const Foam::fvMesh&, bool)’:
fvOptions/fvOption.C:280:9: error: ‘IInfo’ was not declared in this scope
        IInfo<< "- applying source at time " << timeStart_
        ^
fvOptions/fvOption.C:285:9: error: ‘IInfo’ was not declared in this scope
        IInfo<< "- applying source for all time" << endl;
        ^
fvOptions/fvOption.C: In static member function ‘static Foam::autoPtr<Foam::fv::option> Foam::fv::option::New(const Foam::word&, const Foam::dictionary&, const Foam::fvMesh&)’:
fvOptions/fvOption.C:307:5: error: ‘IInfo’ was not declared in this scope
    IInfo<< "Selecting finite volume options model type " << modelType << endl;
    ^
make: *** [Make/linux64GccDPOpt/fvOption.o] Error 1

Is this some missing or corrupted header file on my installation?

Thanks!

-Amish

[PS: Moderator, my apologies if I posted installation related questions in a wrong thread, please let me know if so]

wenxu December 22, 2014 04:48

The different versions were used, i think. The first version fvOptions was not added, but the latter one, fvOptions was added to adjusted to OF230.

-------------------

Dear Hagen,
Yes, i have found that the ck2cti can transfer .inp file to .cti file, which can be used in cantera. But my problems as follows:
  1. I want use gri30 for CO reaction, but i'm not sure if that ok.(gri30 if for natural gas, but the CO is the intermediate specie, so i think it ok, if i'm wrong, please correct me.)
  2. If the first one is ok, then i set the input.txt as follows for CO:
    Quote:

    1.013e5 // operating pressure in Pa
    294 // Temperature at the left boundary in K
    294 // Temperature at the right boundary in K
    294 // Temperature for equilibrium solution calculation
    0.05 // mass flow in kg/(s m^2)
    0.287 // Stoichiometric Mixture fraction Zst
    CO:0.99999,AR:0.00001 // Species at the left side (in mole fractions)
    O2:0.21,N2:0.79 // Species at the right side (in mole fractions)
    mechanisms/gri30.xml // Location of the chemical mechanism
    0.2 // domain lenght [m]
    50 // Initial number of grid point
    100 // Maximum number of grid points (applies only for grid refinement)
    1 // Refine grid? (1 = true , 0 = false)
    If i use the initial solution file (this file is actually for CH4),then it will give the :
    Quote:

    .................................................. ............................
    Take 5 timesteps 6.407e-05 3.603
    .................................................. ............................

    Attempt Newton solution of steady-state problem... failure.

    which means that the counterflow has been extincted? Then i change the mass flow to very low, such as 0.0001, then the output is as something like above:
    Quote:

    .................................................. ............................
    Take 10 timesteps 0.001847 3.423
    .................................................. ............................

    Attempt Newton solution of steady-state problem... failure.

    .
  3. If i do not use the initial solution file, then it ask me to set the equivalence ratio phi (0 - 1), but the equivalence ratio of CO is 2.48, which is not within (0-1),then it will ask me to put the name of the fuel (only CH4 and H2 can be selected.): if now i put CO, as excepted, the error is as follows:
    Quote:

    Your fuel/oxidizer selection is not available
    Please add your combination in the source code
So it seems that CO can not be used by ./flamelet, please help me?

PS: the flamelet.cpp file in src folder should be changed in order to use CO mechanism. If that true, then it will be tough... Sorry, this question is some one like the first, because i am not understand the first time you answer me.

regards,
wenxu

rolloblues December 22, 2014 07:46

Quote:

Originally Posted by wenxu (Post 524909)
The different versions were used, i think. The first version fvOptions was not added, but the latter one, fvOptions was added to adjusted to OF230.

I'm experiencing the same problem highlighted by aat.
I'm running OF 2.3.1 and I installed flameletFoam 2.3.x

How can I solve this?

Hagen December 22, 2014 15:09

Dear Amish, Dear Rolloblues,

thank you for this hint! Apparently, fvOptions was changed in 2.3.x and is not compatible anymore with that used in 2.3.0 and vice versa.

The repo flameletFoam-2.3.x is updated now and should work with the current version of OpenFOAM-2.3.x.
For those who are using OpenFOAM-2.3.0, there is a new repo flameletFoam-2.3.0. The only difference is the fvOptions.

Best wishes,
Hagen

aat December 22, 2014 16:53

Thanks Hagen,

I can confirm that it compiled fine on OF2.3.x and I was able to complete the tutorial (ras).

-Amish

rolloblues December 23, 2014 07:13

I also confirm that everything is now working just fine.

Thanks

wenxu December 23, 2014 08:31

Then no one help me?!

Hagen January 5, 2015 06:36

Dear Wenxu,

your cantera run does not converge with these settings. If you are using one of the solution files in the examples folder, you can try to change the boundary conditions in the input.txt in small steps. In your case, if you are using the Sandia example, slowly increase the CO mass fraction and decrease mass fraction of the other species at the fuel boundary until you reach the conditions of your flame.

Hagen

Uyan April 7, 2015 12:32

flameletFoam compilation problem
 
I am using openfoam-2.3.x [ on ubuntu 1.204] and i tried to install flameletFoam. when i try to compile OpenFOAM

i get an error about cycilcAMILduInterface

Code:

finiteVolume/lnInclude/cyclicAMIFvPatch.H:39:35: fatal error: cyclicAMILduInterface.H: No such file or directory
compilation terminated.
make: *** [Make/linux64GccDPOpt/flameletFoamPost.o] Error 1


Has anyone come across something like that and solved it?

Uyan April 7, 2015 16:13

cycilcAMILduInterface.H error
 
Well i managed to get it compiled, but did not test yet.

I had to replace few Make/options files

src/combustionModels/Make/options
applications/utilities/preProcessing/canteraToFoam/Make/options
applications/utilities/postProcessing/flameletFoamPost/Make/options

I added the following include directory

Code:

EXE_INC = \

    -I$(LIB_SRC)/meshTools/lnInclude \


Hagen April 13, 2015 06:47

Hi Uyan,

thank you! I changed the source in the git repository.

Regards, Hagen

Lisandro Maders July 25, 2015 16:42

Error after "make"
 
Ps: I edited it because I had put I had an error when compiling Cantera. Actually, I compiled Cantera successfully, I had an error when compiling flameletFoam solver..

Hello guys,

I am installing Cantera aiming use it with OpenFOAM. However, when I tried to compile the flameletFoam solver (after "make" command), I received the following error:

g++ -g -Wall -fpermissive -c StFlow_2.cpp -I/usr/local/include
In file included from StFlow_2.h:10:0,
from StFlow_2.cpp:15:
TransportBase_2.h:344:57: error: ‘virtual’ outside class declaration
DEPRECATED(virtual void mobilityRatio(double* mobRat)) {
^
TransportBase_2.h:344:58: warning: ISO C++ forbids declaration of ‘DEPRECATED’ with no type [-fpermissive]
DEPRECATED(virtual void mobilityRatio(double* mobRat)) {
^
TransportBase_2.h: In member function ‘int Cantera::Transport::DEPRECATED(void (*)(double*))’:
TransportBase_2.h:346:5: warning: no return statement in function returning non-void [-Wreturn-type]
}
^
In file included from StFlow_2.cpp:15:0:
StFlow_2.h: At global scope:
StFlow_2.h:195:18: error: conflicting return type specified for ‘virtual void Cantera::StFlow::save(Cantera::XML_Node&, const doublereal*)’
virtual void save(XML_Node& o, const doublereal* const sol);
^
In file included from StFlow_2.h:11:0,
from StFlow_2.cpp:15:
/usr/local/include/cantera/oneD/Domain1D.h:413:23: error: overriding ‘virtual Cantera::XML_Node& Cantera::Domain1D::save(Cantera::XML_Node&, const doublereal*)’
virtual XML_Node& save(XML_Node& o, const doublereal* const sol);
^
make: *** [StFlow_2.o] Error 1



Does anyone have any idea what could be causing this?

Thanks in advance!

Lisandro

federicafer July 26, 2015 14:28

Hi Lisandro,

If you are using cantera-2.0.0 you should not have any problem.

that is my output to make:
g++ -g -Wall -fpermissive -c StFlow_2.cpp -I/opt/cantera/include
g++ -g -Wall -fpermissive -c TransportFactory_2.cpp -I/opt/cantera/include
g++ -g -Wall -fpermissive -c Lewis1Transport.cpp -I/opt/cantera/include
g++ -c -g -Wall -fpermissive flamelet.cpp -I/opt/cantera/include
g++ flamelet.o StFlow_2.o TransportFactory_2.o Lewis1Transport.o -lf2c -pthread -L/opt/cantera/lib -lcantera -lcvode -lblas -llapack -o flamelet

the paths to cantera's include and libraries (in bold) are different for you.. this can probably cause the error..

Check if the first line in the Makefile contains the path to your cantera build directory that for me is
include ~/cantera-2.0.0/build/platform/Cantera.mak

Regards,
Federica

Lisandro Maders July 26, 2015 18:05

Sorted the old problem, a new one appeared..
 
Federica,

thanks for your reply! I was really making a mistake regarding to the path.

Also, I wrote my thread badly. My error happened when I compiled the flameletFoam solver, not Cantera. I sorted it out by updating the pip through easy_install. It seems that for Ubuntu 12.04 (which I am using) the pip (for python packages) has some bugs (see it on http://stackoverflow.com/questions/2...-on-pip-freeze)

So I uninstalled Cantera, updated pip, reinstalled Cantera and then the flameletFoam compiled well.

The only thin weird was when I runned scons test after building, it shown me this error:

* Running test 'diamondSurf-cti'... Comparing 'diamond_blessed.xml' with 'diamond.xml' scons: *** [test_problems/diamondSurf/.passed-diamondSurf-cti] /private/tmp/cantera-OaWCVw/cantera-2.1.2/test_problems/diamondSurf/diamond.xml: No such file or directory scons: building terminated because of errors.


However, as it was running everything ok (apparently) I did not fixed it. Do you know if this is really an error or just a test stuff bug? Could I keep using Cantera with this error?


Regards,

Lisandro

knuckles September 10, 2015 20:40

Can anyone explain to me why the steady laminar flamelet model class is templated as YSLFModel<class CombThermoType, class ThermoType>? It seems to me that the second template variable is completely irrelevant. I was able to remove it by:
  1. eliminating the second template variable from YSLFModel.H and .C
  2. changing the macro call in YSLFModels.C to makeCombustionTypes() rather than makeCombustionTypesThermo(), and removing the third macro argument
  3. changing the combustionModel entry in constant/combustionProperties of the case file to YSLFModel<rhoThermoCombustion> - i.e., removing the second template variable
This compiled and ran successfully. Have I unknowingly introduced an error?

Edit: this was for OpenFOAM 2.3.0

Hagen September 23, 2015 04:26

Quote:

Originally Posted by knuckles (Post 563413)
Can anyone explain to me why the steady laminar flamelet model class is templated as YSLFModel<class CombThermoType, class ThermoType>? It seems to me that the second template variable is completely irrelevant. I was able to remove it by:
  1. eliminating the second template variable from YSLFModel.H and .C
  2. changing the macro call in YSLFModels.C to makeCombustionTypes() rather than makeCombustionTypesThermo(), and removing the third macro argument
  3. changing the combustionModel entry in constant/combustionProperties of the case file to YSLFModel<rhoThermoCombustion> - i.e., removing the second template variable
This compiled and ran successfully. Have I unknowingly introduced an error?

Edit: this was for OpenFOAM 2.3.0

Thanks for this hint! The ThermoType template is indeed a remnant of an older version and is not needed anymore. I changed the code as you suggested and pushed it to the git repository.


All times are GMT -4. The time now is 21:19.