CFD Online Discussion Forums

CFD Online Discussion Forums (https://www.cfd-online.com/Forums/)
-   OpenFOAM Programming & Development (https://www.cfd-online.com/Forums/openfoam-programming-development/)
-   -   Firefoam fuel consumption rate? (https://www.cfd-online.com/Forums/openfoam-programming-development/116203-firefoam-fuel-consumption-rate.html)

c_dowd April 15, 2013 06:43

Firefoam fuel consumption rate?
 
Hi all.
I've been playing around with the firefoam solver, and have noticed the fuel seems to be dispersing too quickly. This doesn't seem to be due to the diffusion rate alphaEff, and as far as I can tell it results from the combustion->R(Yi) term for the species equation. However, all I can find out about this term is that it represents the fuel consumption rate. I can't find where this is calculated in the combustion models, and I don't understand exactly how it works. Can anyone explain exactly what this term is, and how it works?

c_dowd April 15, 2013 07:26

It seems that commenting this term out results in less fuel dispersion, as I'd expect, however it also results in the temperature going through the roof, which I can't work out at all, as the species equation shouldn't be affecting the energy equation directly and the fuel is still at a reasonable concentration.

raunakbardia June 6, 2018 17:14

Using OpenFoam v5.0
 
This is an old thread but in case anyone else is struggling with this.

reaction->R is called in the YEqn.H

If you look at it closely, the evaluation of R is dependent on the 'combustionProperties' file in the constant directory, where the combustionModel is specified.
  • 1.
All the combustion models calculate a mixing factor and then use it along with the default laminar combustionModel to calculate the fuel consumption rate.
  • 2.
Hence, I looked at $FOAM_SRC/combustionModels/laminar/laminar.C and you can easily locate the R function.

template<class Type>
Foam::tmp<Foam::fvScalarMatrix>
Foam::combustionModels::laminar<Type>::R(volScalar Field& Y) const
{
tmp<fvScalarMatrix> tSu(new fvScalarMatrix(Y, dimMass/dimTime));

fvScalarMatrix& Su = tSu.ref();

if (this->active())
{
const label specieI =
this->thermo().composition().species()[Y.member()];

Su += this->chemistryPtr_->RR(specieI);
}

return tSu;
}
  • 3.
The chemistryPtr_ is defined again in the combustion model, for eg: $FOAM_SRC/combustionModels/psiCombustionModel/psiChemistryCombustion/

protected:

// Protected data

//- Pointer to chemistry model
autoPtr<psiChemistryModel> chemistryPtr_;
  • 4.
Consequently, you would expect that RR function will be in the psiChemistryModel library. When you go to $FOAM_SRC/thermophysicalModels/chemistryModel/chemistryModel/psiChemistryModel/psiChemistryModel.H, we can find that another class "basicChemistryModel" is inherited by that.
  • 5.
Unfortunately the trail seems to end at $FOAM_SRC/thermophysicalModels/chemistryModel/chemistryModel/basicChemistryModel/basicChemistryModel.H.
All the functions we seek for are listed out in this class definition

// Functions to be derived in derived classes

// Fields

//- Return const access to chemical source terms [kg/m3/s]
virtual const volScalarField::Internal& RR
(
const label i
) const = 0;

//- Return access to chemical source terms [kg/m3/s]
virtual volScalarField::Internal& RR
(
const label i
) = 0;

//- Return reaction rate of the speciei in reactioni
virtual tmp<volScalarField::Internal> calculateRR
(
const label reactioni,
const label speciei
) const = 0;

but they are evaluated in some derived class that I am not able to locate.
  • 6.
However, on doing a grep on the entire SRC directory, I find that calculateRR only evaluates in one file: $FOAM_SRC/thermophysicalModels/chemistryModel/chemistryModel/chemistryModel/chemistryModel.C.
I do not know how we end up from basicChemistryModel to this library but it does give a lot of insight into how the stoichiometric coefficients of the reactions for each species are stored. I still have to understand it completely to be able to access these values directly from my solver.

Hope that will be of some help to the lost souls who have been struggling just like me.


All times are GMT -4. The time now is 12:32.