Giter Site home page Giter Site logo

acuoci / laminarsmoke Goto Github PK

View Code? Open in Web Editor NEW
36.0 11.0 24.0 1.59 MB

CFD solver (based on OpenFOAM) for laminar reacting flow with detailed kinetic mechanisms based on OpenSMOKE++

C 11.45% C++ 87.18% Gnuplot 0.05% Objective-C 1.04% Roff 0.28%
openfoam kinetics cfd flame opensmokepp

laminarsmoke's Introduction

laminarSMOKE

CFD solver for laminar reacting flows with detailed kinetic mechanisms based on OpenFOAM and OpenSMOKE++ framework

If you use laminarSMOKE for your publications, we kindly ask you to cite the following papers:

Cuoci, A., Frassoldati, A., Faravelli, T., Ranzi, E., Numerical modeling of laminar flames with detailed kinetics based on the operator-splitting method (2013) Energy and Fuels, 27 (12), pp. 7730-7753, DOI: 10.1021/ef4016334

Cuoci, A., Frassoldati, A., Faravelli, T., Ranzi, E., A computational tool for the detailed kinetic modeling of laminar flames: Application to C2H4/CH4 coflow flames (2013) Combustion and Flame, 160 (5), pp. 870-886, DOI: 10.1016/j.combustflame.2013.01.011

Cuoci, A., Frassoldati, A., Faravelli, T., Ranzi, E., OpenSMOKE++: An object-oriented framework for the numerical modeling of reactive systems with detailed kinetic mechanisms (2015) Computer Physics Communications, 192, pp. 237-264, DOI: 10.1016/j.cpc.2015.02.014

Compulsory libraries

Optional libraries

Optional libraries (under testing)

Compilation

Three different options are available to compile the code, according to the level of support for the solution of ODE systems. The ISATLib is needed only if you want to apply the In Situ Adaptive Tabulation (ISAT) technique.

  1. Minimalist: no external, optional libraries are required. Only the native OpenSMOKE++ ODE solver can be used.

  2. Minimalist + Intel MKL: only the native OpenSMOKE++ ODE solver can be used, but linear algebra operations are managed by the Intel MKL libraries

  3. Complete: all the optional libraries are linked to the code, in order to have the possibility to work with different ODE solvers

  4. Instructions to compile the Minimalist version


  1. Open the mybashrc.minimalist, choose the version of OpenFOAM you are using (2.2, 2.3, 2.4, 3.0, 4.x, dev) and adjust the paths to the compulsory external libraries

  2. Type: source mybashrc.minimalist

  3. Go to Section 4

  4. Instructions to compile the Minimalist+MKL version


  1. Open the mybashrc.minimalist.mkl, choose the version of OpenFOAM you are using (2.2, 2.3, 2.4, 3.0, 4.x, dev) and adjust the paths to the compulsory external libraries and the paths to the Intel MKL library

  2. Type: source mybashrc.minimalist.mkl

  3. Go to Section 4

  4. Instructions to compile the Complete version


  1. Open the mybashrc.complete, choose the version of OpenFOAM you are using (2.2, 2.3, 2.4, 3.0, 4.x, dev) and adjust the paths to the compulsory external libraries and the Intel MKL library. You can choose the additional external libraries you want to add to laminarSMOKE, by modifying the EXTERNAL_ODE_SOLVERS variable: in particular 1 means that the support is requested, while 0 means that no support is requested. Obviously, for each requested library, you need to provide the correct path.

  2. Type: source mybashrc.complete

  3. Go to Section 4

  4. Compile the libraries


  1. Compile the user-defined boundary condition library: from the libs/boundaryConditionsOpenSMOKE++ folder type wmake

  2. Compile the customized radiation library: from the libs/radiationOpenSMOKE++ folder type wmake

  3. Go to Section 5

  4. Compile the solvers


  1. Compile the steady-state (accounting for buoyancy) solver: from the solver/laminarBuoyantSimpleSMOKE folder type wmake

  2. Compile the steady-state solver: from the solver/laminarSimpleSMOKE folder type wmake

  3. Compile the unsteady (accounting for buoyancy) solver: from the solver/laminarBuoyantPimpleSMOKE folder type wmake

  4. Compile the unsteady solver: from the solver/laminarPimpleSMOKE folder type wmake

  5. Compile the post-processor: from the solver/laminarSMOKEpostProcessor folder type wmake

  6. Go to Section 6

  7. Compile the CHEMKIN Pre-Processor


  1. Compile the CHEMKIN Pre-Processor utility: from the solvers/openSMOKEppCHEMKINPreProcessor folder type wmake

Preprocessing of CHEMKIN files

In order to run a simulation with laminarSMOKE, a CHEMKIN mechanism (kinetics, thermodynamic and transport properties) has to be pre-processed using the openSMOKEppCHEMKINPreProcessor utility (see Section 6 above). Examples of mechanisms ready to be pre-processed are available in the run/kinetic-mechanisms folder. In particular, for in each mechanism folder you can find the three files corresponding to the CHEMKIN input (kinetics, thermodynamics, and transport properties) and an additional input.dic file, containing the instructions for the openSMOKEppCHEMKINPreProcessor. In order to pre-process a kinetic mechanisms, the operations to carry out are very simple. As an example, for POLIMI_H2CO_1412 mechanism:

  1. Go to the run/kinetic-mechanisms/POLIMI_H2CO_1412
  2. Type openSMOKEppCHEMKINPreProcessor
  3. If everything works correctly, a kinetics-POLIMI_H2CO_1412 folder will be created, including the preprocessed CHEMKIN files (in XML folder). This is the folder which has to be supplied to the laminarSMOKE solver.

Run your first case

The folder run/tutorials/ToroFlames/F3/ contains a simple test case (laminar coflow diffusion flame fed with hydrogen).

  1. Unsteady simulation: Open the laminarBuoyantPimpleSMOKE folder, build the mesh using the blockMesh utility, and run the case using the laminarBuoyantPimpleSMOKE solver. Even if you are interested in steady state conditions, we strongly suggest to always start with unsteady calculations to create a reasonable first-guess solution for the application of the steady state solver. In this case, you can stop the unsteady simulation after 50 ms of physical time.

  2. Steady state simuation: you can now move to the laminarBuoyantSimpleSMOKE folder. Copy the last time folder calculated by the unsteady solver (point 1 above), build the mesh using the blockMesh utility, and run the case using the laminarBuoyantSimpleSMOKE solver. In order to reach the steady state conditions, 5000-6000 iterations are enough.

laminarsmoke's People

Contributors

acuoci avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

laminarsmoke's Issues

Undefined variables: parcels and surfaceFilm

Prof Cuoci,

There is a problem when I tried to compile "solver/laminarBuoyantPimpleSMOKE" according to the README.md in section 4, I got errors regarding undefined variables:

parcels
and
surfaceFilm

I thought maybe this is a bug/problem from the original git source repository, I commented the lines 75-76 regarding the two variable "parcels" and "surfaceFilm" in the file /home/pawans76/newver/laminarSMOKE/solvers/laminarBuoyantPimpleSMOKE/pEqn.22.H
[pawans76@mike5 laminarBuoyantPimpleSMOKE]$ pwd
/home/pawans76/newver/laminarSMOKE/solvers/laminarBuoyantPimpleSMOKE
[pawans76@mike5 laminarBuoyantPimpleSMOKE]$ diff pEqn.22.H pEqn.22.H.orig 75,78c75,77
< // parcels.Srho()
< // + surfaceFilm.Srho()
< // + fvOptions(psi, p_rgh, rho.name())
< fvOptions(psi, p_rgh, rho.name())
--- (in place of)

    parcels.Srho()
  + surfaceFilm.Srho()
  + fvOptions(psi, p_rgh, rho.name())

The above changes allow the solver laminarBuoyantPimpleSMOKE to compile.

Is this a bug?

How to get Opensmoke Libraries. Adding conjugate heat transfer for solids

Dear Prof. acuoci,

I have been asking for Opensmoke++ libraries for testing current version of Laminarsmoke but it looks like you are modifying both at same time. Kindly upload the opensmoke++ libraries so that I can work on current version of Laminarsmoke.

I want to modify the current version to add conjugate heat transfer for solids.

Regards
Ratna Kishore

Issues compiling with odepack

Hello Prof.
I am trying to cmpile the code with odepack and encounter with dscal_ redifinition.
The error is:
/home/ali/Desktop/odepack/libodepack.a(opkda2.o): In function dscal_': opkda2.f:(.text+0x86b): multiple definition of dscal_'
/opt/intel/mkl/lib/intel64/libmkl_intel_lp64.a(_dscal_lp64.o):_dscal.c:(.text+0x0): first defined here
collect2: error: ld returned 1 exit status
make: *** [/home/ali/OpenFOAM/ali-4.1/platforms/linux64GccDPInt32Opt/bin/laminarPimpleSMOKE] Error 1

What is the solution for this problem?
Best regards

Fix ISAT

The current implementation of ISAT does not work, because the ISATLib was recently updated by Mauro Bracconi.
We need to update the interfaces to correctly use the most recent version of ISATLib.

1D case error? : “MoleFractions_From_MassFractions” fails when mass fractions are all zero.

Dear developers and contributors,

I try to simulate a 1D premixed flame to get the laminar flame speed.
So I made 1D shape as below.

report2

Boundary Conditions
Inlet: fixedValue for mass fractions
Outlet: InletOutlet for mass fractions
Sides: empty (to achieve 1D simulation)

Here is a problem. When I run this case, this error appears.

report3

I checked ~laminarSMOKE/solvers/laminarSMOKE/properties.H, and it seems to be caused by some boundary faces that have zero mass fractions initially. “MoleFractions_From_MassFractions” does not work if all input mass fractions are zero.

for(int i=0;i<thermodynamicsMapXML->NumberOfSpecies();i++)
massFractions[i+1] = Y[i].boundaryField()[patchi][facei];
thermodynamicsMapXML->MoleFractions_From_MassFractions(moleFractions.GetHandle(),pMWmix[facei],massFractions.GetHandle());

My trial solutions)

  1. Run reactingFoam by one timestep and restart with a new initial solution, so that zero mass fractions does not appear at boundary faces.
  2. Or edit properties.H; (ex, If all mass fractions are zero, omit above lines.)

Two ways seem to work.
If there are better ways, please let me know.
It would be grateful if properties.H could work for this kind of situation.

Thank you

Best regards,
Daeyoung Jun

Fix DRG

The DRG must be adjusted because of the recent changes in the interfaces provided by OpenSMOKE++ library.

CVODE compiling issue

Except the already known declaration problems, there are also some problems which seems from interface.
Screenshot from 2019-03-28 20-32-01
Screenshot from 2019-03-28 20-32-28
I tried several version of sundials package, none of them worked.
Current set up for sundials-4.1.0.
Screenshot from 2019-03-28 20-33-40

Compilation Errors

Hello Professor Antonio,
Sir, I am working on laminar methane flames. I am using ubuntu 14..04 and OpenFOAM 2.4. I had followed all the instructions given in Readme file of Laminar SMOKE. I am following mybashrc.minimalist. When I am compiling I am getting these errors as shown in the screenshot below. These errors are obtained during compilation of laminarBuoyantPimpleFoam. Is it a bug or error due to non-installation of libraries like(INTEL MKL).

Thanxs in Advance

Selection_002
Selection_003

Remove memory corruption error

After the introduction of the customized radiation library, in case of wrong input data from the user, the solvers report the error message but an additional, annoying, error message about memory corruption.
This is not a big issue, because in any case the solver would abort, but it is better to remove it.

FOAM exiting

*** glibc detected *** laminarBuoyantPimpleSMOKE: double free or corruption (!prev): 0x0000000001bcde60 ***
======= Backtrace: =========
/lib64/libc.so.6[0x3b71276166]
/lib64/libc.so.6[0x3b71278c93]
/lib64/libc.so.6(__cxa_finalize+0x9d)[0x3b712361bd]
/software/OpenFOAM/OpenFOAM-2.4.x/platforms/linux64GccDPOpt/lib/libradiationModels.so(+0x4ca06)[0x7fac8b997a06]
======= Memory map: ========
00400000-00ec0000 r-xp 00000000 00:13 17218158037 /home/chimica2/cuoci/OpenFOAM/cuoci-2.4.x/platforms/linux64GccDPOpt/bin/laminarBuoyantPimpleSMOKE
010c0000-010e2000 rw-p 00ac0000 00:13 17218158037 /home/chimica2/cuoci/OpenFOAM/cuoci-2.4.x/platforms/linux64GccDPOpt/bin/laminarBuoyantPimpleSMOKE
010e2000-01126000 rw-p 00000000 00:00 0
01a21000-021b2000 rw-p 00000000 00:00 0 [heap]

Code exits with 'rapidxml::parse_error'

Hi,
I was able to get the code to compile successfully with the minimalist settings.
I'm trying to get the packaged tutorial case "MethaneCoflowFlame" to work for a CH4 global mechanism. At the first time step, the code exits with the following error:

Starting time loop

Courant Number mean: 6.41183184969e-05 max: 0.000150895373491
deltaT = 1.19999040008e-06
Time = 1.1999904e-06

diagonal:  Solving for rho, Initial residual = 0, Final residual = 0, No Iterations 0
DILUPBiCGStab:  Solving for Ux, Initial residual = 1, Final residual = 9.59486949027e-12, No Iterations 1
DILUPBiCGStab:  Solving for Uy, Initial residual = 0.0201082144937, Final residual = 4.2849627155e-11, No Iterations 1
DILUPBiCGStab:  Solving for Uz, Initial residual = 0.999999999844, Final residual = 3.69112647038e-10, No Iterations 1
 Umin: (-3.3731055518e-06 -6.95967895832e-06 0) Umax: (0.000159554715889 6.95967895832e-06 0.15)
DILUPBiCGStab:  Solving for CH4, Initial residual = 1, Final residual = 3.23802485131e-16, No Iterations 1
DILUPBiCGStab:  Solving for O2, Initial residual = 0.999932492575, Final residual = 1.33812383028e-16, No Iterations 1
DILUPBiCGStab:  Solving for CO2:  solution singularity
DILUPBiCGStab:  Solving for H2O:  solution singularity
Inert species is N2 with local index equal to 4
Transport equations of species solved in 0.004862 s 
DILUPBiCGStab:  Solving for T, Initial residual = 0.542046994922, Final residual = 2.76226339329e-10, No Iterations 1
 * T gas min/max (after transport)   = 300, 300
 * Solving homogeneous chemistry (OpenSMOKE++ solver, Direct integration)... 
terminate called after throwing an instance of 'rapidxml::parse_error'
  what():  unexpected end of data

Any idea about what this is due to? I am using the latest version of rapidxml and gcc on OpenFOAM-6.

Thanks!

Issues compiling with OpenFoam 4.1

Hi Alberto:

I am having difficulties compiling laminarSMOKE with OpenFOAM 4.1. The issue pertains to both laminarPimpleSMOKE and laminarSimpleSMOKE. I discuss the latter only.

Note that the rest of the solvers (i.e. laminarBuoyantPimpleSMOKE, laminarBuoyantSimpleSMOKE, and laminarSMOKEpostProcessor) compile correctly.

The compilation fails on solvers/laminarSimpleSMOKE as below.

It seems that laminarSimpleSMOKE.C requires pressureControl.H, which is available in OpenFoam-dev, but not in 4.1

g++ -std=c++0x -m64 -Dlinux64 -DWM_ARCH_OPTION=64 -DWM_DP -DWM_LABEL_SIZE=32 -Wall -Wextra -Wold-style-cast -Wnon-virtual-dtor -Wno-unused-parameter -Wno-invalid-offsetof -O3 -DNoRepository -ftemplate-depth-100 -DOPENFOAM_VERSION=40 -w -DOPENSMOKE_USE_MKL=0 -DOPENSMOKE_USE_ISAT=0 -DDEVVERSION=0 -I../laminarSMOKE -I../laminarSMOKE/steady -I../../libs/radiationOpenSMOKE++/lnInclude -I../openSMOKEpp4laminarSMOKE/ -I/usr/lib64/include -I/usr/include/eigen3 -I/home/fbisetti/OpenFOAM/thirdparty-polimi/rapidxml-1.13 -I/include -I/include -I/ -I/apps/openfoam/4.1/gcc/system/openmpi-2.1.0/OpenFOAM-4.1/src/finiteVolume/lnInclude -I/apps/openfoam/4.1/gcc/system/openmpi-2.1.0/OpenFOAM-4.1/src/fvOptions/lnInclude -I/apps/openfoam/4.1/gcc/system/openmpi-2.1.0/OpenFOAM-4.1/src/meshTools/lnInclude -I/apps/openfoam/4.1/gcc/system/openmpi-2.1.0/OpenFOAM-4.1/src/sampling/lnInclude -I/apps/openfoam/4.1/gcc/system/openmpi-2.1.0/OpenFOAM-4.1/src/thermophysicalModels/basic/lnInclude -IlnInclude -I. -I/apps/openfoam/4.1/gcc/system/openmpi-2.1.0/OpenFOAM-4.1/src/OpenFOAM/lnInclude -I/apps/openfoam/4.1/gcc/system/openmpi-2.1.0/OpenFOAM-4.1/src/OSspecific/POSIX/lnInclude -fPIC -c laminarSimpleSMOKE.C -o Make/linux64GccDPInt32Opt/laminarSimpleSMOKE.o
laminarSimpleSMOKE.C:66:30: fatal error: pressureControl.H: No such file or directory
#include "pressureControl.H"
^
compilation terminated.
make: *** [Make/linux64GccDPInt32Opt/laminarSimpleSMOKE.o] Error 1

I am not sure how to fix this!

Thanks
Fabrizio

Running flux + chemical part

<> Is it possible to simulate a case in a similar way to SandiaD (OpenFoam/combustion/reactingFoam), in which the flow develops at an initial time and then, the chemical part begins?

Help with sundials package

Hi
I encounterd a problem when trying to make pimple branches with sundials package.
There is no problem with Simple packages.
Please help me with this problem.
Best regards

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.