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/)
-   -   [openSmoke] libOpenSMOKE (https://www.cfd-online.com/Forums/openfoam-community-contributions/99645-libopensmoke.html)

wenxu July 23, 2015 10:49

Hello, everyone,

Could anyone tell me how can the variance of mixture fraction be normalized by this:
Code:

            Zvar_normalized = Zvar[celli] / (Z[celli]*(1.-Z[celli]));
I want to know how to deduce this normalization equation. Could anyone give me some hints?

Thank you in advance!

Best regards,
Wen

Tobi July 23, 2015 12:35

Its Not the mixture fraction, it's its Varianz ... Zvar is defined between 0 and 0.25 (parabolic profile). No area weight ed interpolation possible.
See also http://www.holzmann-cfd.de/index.php...ameletModel2.2

wenxu July 23, 2015 21:14

Thank you for your reply. And sorry for my mistake. I have corrected it.

Regards,
Wen

wenxu September 19, 2015 08:24

Dear Tobi,

May I kindly ask two questions about the libOpenSMOKE:

(1) About the enthalpy defect: I do not know how you generate the flamelet library with different enthalpy defects, that means do you modify the boundary condition of the temperature flamelet equation or add a source term to the that equation?

(2) About the actual enthalpy (H): How to calculate the actual enthalpy at the inlet as that in the H initial file?
Quote:

dimensions [ 0 2 -2 0 0 0 0 ];

internalField uniform -17992.9;

boundaryField
{
coal_air
{
type fixedValue;
value uniform -2.19608e+06;
}

ch4
{
type fixedValue;
value uniform -17992.9;
}

co_flow
{
type fixedValue;
value uniform -17992.9;
}

As I already know, we can calculate the actual enthalpy as: H = phi + Hfuel (fuel side); H = phi + Hoxidizer (Oxidizer side). Here, the Hfuel and the Hoxidizer can be looked up from the flamelet library. But how to evaluate the phi value at these two different inlets? (I have this confusion because I think the enthalpy is the variable should be calculated but not a already calculated variable in the solver.)

Best,
Wen

Tobi September 28, 2015 05:10

Dear Wen,

(1) the enthalpy defect is a source term added in the flamelet equations (not in the openFOAM solver). The flamelet equations are not solved in openFOAM. These eqn are solved within the binary files and you can add a defect, that means a delta enthalpy to the adiabatic condition.

(2) The actual enthalpy at some cell is calculated using a passive scalar transport equation (not what you mentioned). The equation is (in SIMPLE):

Code:

fvScalarMatrix hEqn
                (
    fvm::div(phi, H)
  - fvm::laplacian(turbulence->muEff()/sigmat, H)
                );

If you solve non-adiabatic systems a radiation term is included. Check the H.Eqn file. The equation with phi is the calculation of the enthalpy defect that is caluclated using the mixture fraction (it is Z and not phi) and the adiabatic enthalpy of fuel and oxidzer. Check the thermodynamic lib.

The adiabatic values of the inlet are the adiabatic enthalpies of fuel and oxidizer and is shown at the beginning of the libOpenSMOKE solver. Run it once, abort, get the values of the adiabatic enthalpy, insert them into the H file and restart.

wenxu September 28, 2015 05:25

I do not know whether the enthalpy defect is set as a source term or as the boundary condition in the fuel and oxidizer sides (the common choice), because it is a binary file. But I know that the total enthalpy on the fuel and oxidizer side is a calculated value if we use FlameMaster solver. Of course, the method you implemented is right.

Thank you for you hints, I already know that.

Best regards,
Wen

Tobi September 28, 2015 06:07

Dear Wenxu,

you ment the enthalpy defect within the flamelet equations (so flame-master, binaries of libOpenSMOKE, cantera)?

I think it is a source term and not a boundary condition because if you compare flamelets of the same scalar dissipation rates and different enthalpy defects you can see that the temperature profile is moved (somehow with a defined value --> delta distribiution).

Therefore I think its not a boundary condition

Tobi March 4, 2016 04:30

Hey all,

I am really working hard on my flamelet generator and I programmed more than 10.000 lines till now. For me the binarys of libOpenSMOKE are in gerneral somehow a comparison of my calculations. However I found some problems in the binary code.

  • The calculated strain rate (at the beginning) is in my opinion wrong. The calculation is done using this equation:
\chi_{st} = \frac{as \cdot \mathrm{exp}(-2 \cdot (\mathrm{erfc}^{-1}(2\cdot Z_{st}))^2)}{\pi}

During the flamelet calculation we use the stochiometric scalar dissipation rate and we also know the stochiometric mixture fraction. Therefore we can calculate the strain rate as that we will use for modeling the scalar dissipation rate across the flamelet.

After a few hours of debuging, because my code is not giving the same strain rate, I figured out that in libOpenSMOKE the strain rate is calculated using the c++ function erfc. This function is the complimentary error function but in the function above, we have the inverse complimentary error function. Using this, we get different values of as. I am not sure how much this will influence the calculation but it is in my opinion a wrong calculation.

FInally, I am not sure about the stochiometric mixture fraction calculation. For pure fuel's I am getting the same results but if I add some inert gas to the fuel, my calculation differs from that of lib-open-smoke.

It would be very nice if someone could check this with fluent or some other software.

Example:
Code:

Fuel:  Y_H2 = 0.3  Y_N2  = 0.7
Oxi:  Y_O2 = 1

  • The calculation of the stochiometric mixture fraction is given by:
Z_{st} = \left[1 + \frac{\nu Y_{F,1}}{Y_{O_2, 2}}\right]^{-1}

Y_{O_2,2} is the mass fraction of O2 in the oxidizer stream
Y_{F,1} is the mass fraction of fuel in the fuel stream
\nu is the stochiometric fraction and is related to the needed oxigen o_{min}to burn the fuel completely (stochiometric mixture).

The needed oxigen can be calculated using the mass fraction of the elements.

In this way I am calculating the stochiometric mixture fraction. Can someone proof the way I am calculating that? Thanks in advance.

Tobi

Adlak December 26, 2016 07:14

Hello everyone,
i have compiled flamelet model in openfoam-4.x but while running the tutorial case i am getting the following error :

Code:

--> FOAM FATAL ERROR:
Not implemented

    From function flameletThermo::Z()
    in file flameletThermo/flameletThermo.C at line 160.

FOAM aborting

#0  Foam::error::printStack(Foam::Ostream&) at ??:?
#1  Foam::error::abort() at ??:?
#2  Foam::flameletThermo::Z() at ??:?
#3  ? at ??:?
#4  __libc_start_main in "/lib/x86_64-linux-gnu/libc.so.6"
#5  ? at ??:?
Aborted (core dumped)


Adlak January 13, 2017 05:28

Hi Tobi, Hope your holidays were awesome,

I have compiled flamelet model in openfoam-4.x but while running the tutorial case i am getting the following error :

--> FOAM FATAL ERROR:
Not implemented

From function flameletThermo::Z()
in file flameletThermo/flameletThermo.C at line 160.

FOAM aborting

#0 Foam::error:rintStack(Foam::Ostream&) at ??:?
#1 Foam::error::abort() at ??:?
#2 Foam::flameletThermo::Z() at ??:?
#3 ? at ??:?
#4 __libc_start_main in "/lib/x86_64-linux-gnu/libc.so.6"
#5 ? at ??:?
Aborted (core dumped)

Tobi January 13, 2017 07:45

You do not have to post it everywhere - I already got the notification ;)

Adlak February 6, 2017 01:37

Hi Tobi,
I am using ur flameletPimplefoam in openfoam-2.3.x for supersonic combustion but after some iterations it is diverging. Z and Zvar values go in thousands. Can u help me out ?

Tobi February 6, 2017 01:40

Maybe it is based on the fact that the solver has no supersonic implementation or it is based on your mesh, boundary conditions or whatever. In addition I do not support old versions anymore.

If it is not possible, try the flameletFoam from Hagen Müller.

MorenoGeerts March 31, 2017 03:48

Density calculation
 
Hi Tobi,

First of all: thank you for all the work you have done on the flamelet solver!

I have a question about the rho calculation in the thermophysical model.
Am I correct in assuming that rho is looked up in the flamelet table?

I am a bit confused due to the "flameletThermo.C" file in which rho is returned as p*psi() and psi is calculated as 1/RT in the perfect gas equation of state. But in pdfFlameletThermo.C "density_reynolds" is looked up and used in calculations for psi. However, I do not seem to be able to determine the place where the rho-field is connected to the looked up value.

A related question: in the validation syngas flame you use the following values for the pure mixture:

mixture
{
specie
{
nMoles 1;
molWeight 28.9;
}
thermodynamics
{
Cp 1005;
Hf 0;
}
transport
{
As 1.67212e-06;
Ts 170.672;
}
}

How did you determine the molWeight and Cp value? Or are they not used in the simulation at all?

Tobi March 31, 2017 05:31

Hi,
  • The density is looked up from the table and then used in the calculation. As you can see in the thermodynamic model.
Code:


psiCells[celli] = RhoReynolds[celli]/pCells[celli];

  • The pressure is constant and therefore using the return function which is psi*p gives the density again
  • So everything is fine
  • The stuff in the thermodynamic files does not matter because we do not use any value here. Its just a dummy, we do not use it.

MorenoGeerts March 31, 2017 05:49

Thank you for the clarification!

So that means that also none of the following parameters of thermotype matter, except "type pdfFlameletThermo;"

thermoType
{
type pdfFlameletThermo;
mixture pureMixture;
transport sutherland;
thermo hConst;
equationOfState perfectGas;
specie specie;
energy sensibleEnthalpy;
}

Tobi March 31, 2017 06:21

Correct.
It is just needed for the object we construct but in the new thermodynamic we made in that model, everything is based on the Look-Up-Table:
  • cp
  • mu
  • rho
  • lambda
  • species mass fractoin
I hope I didn't forget anything. Since 3 years I am programming on a flamelet creator. The last few month I did not do anything but maybe in a few centuries :D I will finish it ;)

MorenoGeerts May 23, 2017 12:02

Wall boundary condition
 
Hi Tobi,

I have a question about the implemented boundary conditions in the pdfFlameletThermo.C file.
I don't get why the boundary condition for fixed temperature should coïncide with a fixed enthalpy BC with value 0 as the following error message suggests:

FatalErrorIn
(
"pdfFlameletThermo<BasicFlameletThermo, MixtureType>::update()"
)
<< "Boundary conditions are wrong: "
<< "fixed temperature BC must be fixed enthaplie BC with value 0;"
<< abort(FatalError);

I think that a wall would have a zero gradient BC for H and a fixedValue one for T, because the enthalpy H is not necessarily 0 at a wall. It is an easy alteration (for me/you/...) to change/add this condition, but maybe I'm overseeing something.

What do you think about this requirement?

Thank you!

Tobi May 23, 2017 16:51

Hi,

it was my implementation. The reason for that is very easy. It is based on the fact that libOpenSMOKE has some special treatment for fixedValue BC for the temperature. Based on the temperature the application calculates an enthalpydefect and thus choose the appropriate LUT. It was not working in the official one so I debugged a few things here. The enthalpy fixed value = 0 does not influence the solution. it is just a dummy for further treatment in the code.

I have everything in my thesis. Unfortunately it is in german. Even the usage of the log-normal in the properties will change a lot of things :). To make it short:

Fixed T: With T, Z, Z'', chi at face find enthalpy defect at face.

Based on the enthalpy defect, calculate the enthalpy at the face.

Tobi May 23, 2017 16:53

1 Attachment(s)
Attachment 56210

Sent from my HTC One mini using CFD Online Forum mobile app


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