CFD Online Discussion Forums

CFD Online Discussion Forums (https://www.cfd-online.com/Forums/)
-   OpenFOAM Running, Solving & CFD (https://www.cfd-online.com/Forums/openfoam-solving/)
-   -   Cantera (https://www.cfd-online.com/Forums/openfoam-solving/64841-cantera.html)

TBO August 7, 2013 10:58

Quote:

Originally Posted by gschaider (Post 443395)
Which SVN is not available? I tried the cantera-link and the two in section 2 ("Install ...") work too ... just not in the browser. Remove the svn:// and they will too


Thank you for the answer. Some people mention that is is also possible to modify the solver of later openfoam versions to run steady state chemistry. For me this is the preferred solution, since we are already running two different OpenFOAM versions (1.6 and 2.1.1), so we like to avoid using a third one. Can anyone tell me which steps are required to change reactingFoam into steadyreactingFoam (or even better, does anyone already have this solver).

I already had a quite extensive look on different fora, but I didn't find a clear answer yet ...

ni-openfoam-user June 6, 2014 06:53

reactingFoam to steadyState
 
Hi,

Did you ever get an answer to your question: "Can anyone tell me which steps are required to change reactingFoam into steadyreactingFoam (or even better, does anyone already have this solver)?. "

I am also looking to run reactingFOAM in steady state. I am concerned at the moment with a high pressure release, I have switched off combustion and chemistry. What else do I need to modify to run in steady state.

Many thanks,

James

TBO June 6, 2014 10:50

Dear James,

I never got a reply to this question, I did some tries with changing to pseudo-steady state solvers by changing the ddt schemes, however I was not succesfull with that (see also steady state combustion posts). Later I moved to the FGM based solver libOpenSmoke. This one works very well as steady state combustion solver.

Regards

Stefano Puggelli March 18, 2015 06:10

Hi TBO,
I am working on the FGM combustion modeling in OpenFOAM and I find the only one already available by Kroger. I am testing it and I having some problems with the flamelet generator based on Cantera.
You say that you moved to the FGM model based on the libOpenSmoke and I also had this idea, but is there an FGM model already available with libOpenSmoke (because I see that it can be used only for non premixed combustion with only the equations for mixture fraction) or did you build on your own?

TBO March 18, 2015 09:11

Hi Stefano,
I used this model for non premixed combustion, so the libOpenSmoke based solver was suitable for my simulations. Maybe repost the question on the libOpenSmoke forum to see if someone else has experience with using this solver for premixed combustion.

Regards,
TBO

Stefano Puggelli March 18, 2015 09:36

Ok,
maybe I will ask on the libOpenSmoke forum.
Thank you,
Stefano

flowAlways April 15, 2015 11:51

Hello everyone,

has there been any new development on alternateSteadyReactingFoam which is now compatible only with old versions of OpenFOAM.
The transient solver reactingFoam is good but is not very appropriate considering the computational costs.
Is there any new development for a steady state combustion solver in OpenFOAM. ?

These are the related thread
http://www.cfd-online.com/Forums/ope...te-solver.html
http://www.cfd-online.com/Forums/ope...chemistry.html
https://github.com/Unofficial-Extend...rnateChemistry

TBO April 16, 2015 02:29

Quote:

Originally Posted by flowAlways (Post 541906)
Is there any new development for a steady state combustion solver in OpenFOAM. ?

Hi Ali,

Yes, there are some developments. By default OpenFoam has now the solver LTSReactingFoam, which is a steady state version of reactingFoam (available in OF 2.3).

Besides that, also e.g. the solvers based on libOpenSmoke might be worth considering

Regards,
TBO

flowAlways April 17, 2015 02:47

Thank you for pointing that. I did test runs using the LTSreactingFoam, but unfortunately it fails(after 27 time iterations) with the following error(attached).
It runs perfectly ok with reactingFoam and I get good results.
I could not understand the parameters in the PIMPLE Algorithm too.
What are alphaTemp, rDeltaTSmoothingCoeff, rDeltaTDampingCoeff.
and why there is no relaxation ?

I think I will have to look at the code to understand what they are doing and what is the idea of local time stepping(LTS). I know that if you want to go fast in time you have to solve more pressure-velocity couplings per iteration i.e. nOuterCorrectors > 1 with under-relaxation(idea behind SIMPLE). But they are not doing that!!. Whats the idea behind LTS ?

Any ideas would be really helpful !!

Code:

PIMPLE
{
    momentumPredictor no;
    nOuterCorrectors  1;
    nCorrectors    1;
    nNonOrthogonalCorrectors 0;

    maxDeltaT      1e-2;
    maxCo          1;
    alphaTemp      0.05;
    rDeltaTSmoothingCoeff 1;
    rDeltaTDampingCoeff 1;
}

relaxationFactors
{
    fields
    {
    }
    equations
    {
        ".*" 1;
    }
}

Code:

Time = 26

Time scales min/max:
    Flow        = 1.28808e-05, 0.01
    Temperature = 6.78274e-06, 1e+300
    Overall    = 6.78274e-06, 0.01
diagonal:  Solving for rho, Initial residual = 0, Final residual = 0, No Iterations 0
DILUPBiCG:  Solving for O2, Initial residual = 0.075075, Final residual = 0.00549963, No Iterations 4
DILUPBiCG:  Solving for H2O, Initial residual = 0.963064, Final residual = 0.075786, No Iterations 3
DILUPBiCG:  Solving for CH4, Initial residual = 0.978202, Final residual = 0.0737773, No Iterations 3
DILUPBiCG:  Solving for CO2, Initial residual = 0.962777, Final residual = 0.0756163, No Iterations 3
DILUPBiCG:  Solving for h, Initial residual = 0.996642, Final residual = 0.0833314, No Iterations 2
min/max(T) = 297.502, 2074.17
DICPCG:  Solving for p, Initial residual = 0.846321, Final residual = 9.13219e-07, No Iterations 226
diagonal:  Solving for rho, Initial residual = 0, Final residual = 0, No Iterations 0
time step continuity errors : sum local = 1.14244e-05, global = -5.85091e-08, cumulative = 1.33362e-08
DILUPBiCG:  Solving for epsilon, Initial residual = 0.000435871, Final residual = 2.96746e-07, No Iterations 1
bounding epsilon, min: -45699 max: 4.85026e+08 average: 332153
DILUPBiCG:  Solving for k, Initial residual = 8.21421e-09, Final residual = 8.21421e-09, No Iterations 0
ExecutionTime = 32.79 s  ClockTime = 34 s

cellSource volumeTemperature output:
    average(sampledSurface) for T = 1285.89

faceSource faceTemperature output:
    average(outlet) for T = 1113.5

Time = 27

Time scales min/max:
    Flow        = 6.88187e-06, 0.01
    Temperature = -6.73481e+07, 1e+300
    Overall    = 6.88187e-06, 0.01
diagonal:  Solving for rho, Initial residual = 0, Final residual = 0, No Iterations 0
#0  Foam::error::printStack(Foam::Ostream&) in "/opt/openfoam230/platforms/linux64GccDPOpt/lib/libOpenFOAM.so"
#1  Foam::sigFpe::sigHandler(int) in "/opt/openfoam230/platforms/linux64GccDPOpt/lib/libOpenFOAM.so"
#2  in "/lib/x86_64-linux-gnu/libc.so.6"
#3  Foam::EulerImplicit<Foam::chemistryModel<Foam::psiChemistryModel, Foam::sutherlandTransport<Foam::species::thermo<Foam::janafThermo<Foam::perfectGas<Foam::specie> >, Foam::sensibleEnthalpy> > > >::solve(Foam::Field<double>&, double&, double&, double&, double&) const in "/opt/openfoam230/platforms/linux64GccDPOpt/lib/libchemistryModel.so"
#4  double Foam::chemistryModel<Foam::psiChemistryModel, Foam::sutherlandTransport<Foam::species::thermo<Foam::janafThermo<Foam::perfectGas<Foam::specie> >, Foam::sensibleEnthalpy> > >::solve<Foam::Field<double> >(Foam::Field<double> const&) in "/opt/openfoam230/platforms/linux64GccDPOpt/lib/libchemistryModel.so"
#5  Foam::combustionModels::laminar<Foam::combustionModels::psiChemistryCombustion>::correct() in "/opt/openfoam230/platforms/linux64GccDPOpt/lib/libcombustionModels.so"
#6  Foam::combustionModels::PaSR<Foam::combustionModels::psiChemistryCombustion>::correct() in "/opt/openfoam230/platforms/linux64GccDPOpt/lib/libcombustionModels.so"
#7 
 at /home/opencfd/OpenFOAM/OpenFOAM-2.3.0/src/OpenFOAM/lnInclude/autoPtrI.H:174
#8  __libc_start_main in "/lib/x86_64-linux-gnu/libc.so.6"
#9 
 in "/opt/openfoam230/platforms/linux64GccDPOpt/bin/LTSReactingFoam"
Floating point exception (core dumped)


wyldckat September 20, 2015 15:13

Greetings to all!

@Ali:
Quote:

Originally Posted by flowAlways (Post 542221)
What are alphaTemp, rDeltaTSmoothingCoeff, rDeltaTDampingCoeff.
and why there is no relaxation ?

I think I will have to look at the code to understand what they are doing and what is the idea of local time stepping(LTS). I know that if you want to go fast in time you have to solve more pressure-velocity couplings per iteration i.e. nOuterCorrectors > 1 with under-relaxation(idea behind SIMPLE). But they are not doing that!!. Whats the idea behind LTS ?

The original release of the LTS feature is described in the following pages:
"Relaxation" is mostly used with the SIMPLE loop, even when included in PIMPLE:


As far as I can understand (I am not an expert on this), the LTS modelling strategy uses an adaptive time step depending on the Courant Number in each cell (or small region of cells) and then uses a smoothing/damping strategy for making the flow compatible between regions that have different time steps. That's why the parameters "rDeltaTSmoothingCoeff, rDeltaTDampingCoeff" are needed, so that it can sort-of have a fast-forward feature for the regions that require a small local time step, when compared with other regions.

This strategy is sometimes preferable to using explicit steady-state modelling, because this method still preserves some time accuracy, which usually is not preserved in steady-state modelling... and time accuracy is important for certain simulations, such as chemical reactions, heat transfer and multiphase flows.

Best regards,
Bruno

freeman_68 May 14, 2016 08:56

Quote:

Originally Posted by markusrehm (Post 217387)
Hi Rishi,

the presentation is the only documentation up to now. We need to add something to the Wiki, too.

So there are 2 parts:
1.) alternateChemistryModel A Library that allows the inclusion of alternate chemistry engines in solvers (allowing still to use OF chemistryModel)
2.) canteraThermosChemistry A Library that makes it possible to use Cantera in OpenFOAM

The libraries can be used by the solvers alternateSteadyReactingFoam and alternateReactingFoam. There are also examples included.

We had some issues to get Cantera running properly. I used the 1.7-CVS version. If you encounter problems with the standard version we can put a tarball of a running Cantera version onto the SVN, too. But Cantera 2.0 was announced and so we try to avoid unnecessary work ;)

The main reasons for using Cantera are:
-easy access to thermochemical data and functions
-cantera has an excellent lexer for Chemkin-input
-you can use all transport data (viscosity, diffsion, heat transfer) from transport data which is often available with reaction mechanisms (e.g GRI-3.0)
-ideal reactor networks can be constructed and solved efficiently and stable with the CVODE stiff ODE solver package

I hope that helps and you find the tools valuable.

Regards, Markus.


Related Links:
Cantera:
http://sourceforge.net/projects/cantera

alternateChemistryModel:
https://openfoam-extend.svn.sourcefo...emistryModels/

canteraThermosChemistry:
https://openfoam-extend.svn.sourcefo...ermosChemistry

Solvers and examples:
https://openfoam-extend.svn.sourcefo...nateChemistry/

hi bodies
there are tutarial and or learning about cantera!?

freeman_68 May 14, 2016 09:00

cantera
 
hi bodies
are there any tutarial and or teaching about cantera!?

lavdwall September 28, 2016 08:57

Cantera linking with OpenFOAM 3.0
 
Hi everybody,

I was wondering if anyone did the effort to link Cantera to OpenFOAM-3.0 (or OpenFOAM-2.x would be OK as well). The original libraries alternateChemistryModel and canteraThermosChemistry look very interesting, but it's quite hard to translate them into something compatible with later OpenFOAM versions. Any help would be appreciated :)

Kind regards,
Laurien


All times are GMT -4. The time now is 05:43.