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/)
-   -   what is 'useReactionRate' in reactingFoam ?? (https://www.cfd-online.com/Forums/openfoam-solving/142226-what-usereactionrate-reactingfoam.html)

harshad88 September 25, 2014 14:47

what is 'useReactionRate' in reactingFoam ??
 
Hello all,

I am still a newbie with OpenFoam. I want to know what does the boolean statement useReactionRate TRUE achieve when using the reactingFoam solver ??

Any help would be greatly appreciated. Thanks! :)

harshad88 September 28, 2014 14:38

Anyone who can help?

alexeym September 30, 2014 03:44

Hi,

Assuming that you mean useReactionRate in PaSRCoeffs dictionary in constant/combustionProperties file (though it was non-trivial to figure this out), it has no direct connection with reactingFoam but it's a property of combustoin model.

If you go to src/combustionModels/PaSR and look as PaSR.C, you'll find there:

Code:

template<class Type>
void Foam::combustionModels::PaSR<Type>::correct()
{
    if (this->active())
    {
        ...
        if (!useReactionRate_)
        {
            this->chemistryPtr_->solve(t - dt, dt);
        }
        else
        {
            this->chemistryPtr_->calculate();
        }
...
}

there type is defined by the line "combustionModel PaSR<psiChemistryCombustion>" in combustionProperties. Properties of psiChemistryCombustion are defined in chemistryProperties dictionary. If you then go to src/thermophysicalModels/chemistryModel/chemistryModel/basicChemistryModel and open basicChemistryModel.H file, you'll find the following code and comments:

Code:

            // Chemistry solution
               
                //- Calculates the reaction rates
                virtual void calculate() = 0;

                //- Solve the reaction system for the given start time and
                //  timestep and return the characteristic time
                virtual scalar solve(const scalar t0, const scalar deltaT) = 0;

Now you can use Doxygen generated documentation and sources to find concrete implementations of these methods.

Howard March 18, 2015 10:10

How to know the detail of the models and parameters? in reactingFoam
 
Quote:

Originally Posted by alexeym (Post 512404)
Hi,

Assuming that you mean useReactionRate in PaSRCoeffs dictionary in constant/combustionProperties file (though it was non-trivial to figure this out), it has no direct connection with reactingFoam but it's a property of combustoin model.

If you go to src/combustionModels/PaSR and look as PaSR.C, you'll find there:

Code:

template<class Type>
void Foam::combustionModels::PaSR<Type>::correct()
{
    if (this->active())
    {
        ...
        if (!useReactionRate_)
        {
            this->chemistryPtr_->solve(t - dt, dt);
        }
        else
        {
            this->chemistryPtr_->calculate();
        }
...
}

there type is defined by the line "combustionModel PaSR<psiChemistryCombustion>" in combustionProperties. Properties of psiChemistryCombustion are defined in chemistryProperties dictionary. If you then go to src/thermophysicalModels/chemistryModel/chemistryModel/basicChemistryModel and open basicChemistryModel.H file, you'll find the following code and comments:

Code:

            // Chemistry solution
 
                //- Calculates the reaction rates
                virtual void calculate() = 0;
 
                //- Solve the reaction system for the given start time and
                //  timestep and return the characteristic time
                virtual scalar solve(const scalar t0, const scalar deltaT) = 0;

Now you can use Doxygen generated documentation and sources to find concrete implementations of these methods.

Thank you very much for your answer. I am new user of OpenFoam and I also try to understand the parametersn and the model uses in the reactiongFoam. Could you explain how to see the detail thing by 'Doxygen generated documentation and sources', I am not quite clear.

amin_jalalian February 27, 2016 11:05

reply
 
Hi
the "useReactionRate" has been removed in OF301. It is not in src's files or other folder's, but it is in some tutorial files which is not true and their programmers forgot to remove that phrase from tutorials.
regards.

amin_jalalian May 7, 2016 04:39

Quote:

Originally Posted by amin_jalalian (Post 587138)
Hi
the "useReactionRate" has been removed in OF301. It is not in src's files or other folder's, but it is in some tutorial files which is not true and their programmers forgot to remove that phrase from tutorials.
regards.


better:

Hi
the "useReactionRate" in has been removed in OF301. It is not in src's files or other folder's, but it is still in 3 tutorial files (file: combustionProperties) which is not right and it seems its programmers forgot to remove "useReactionRate" from tutorials.
regards.

lx882211 June 2, 2016 11:27

Quote:

Originally Posted by alexeym (Post 512404)
Hi,

Assuming that you mean useReactionRate in PaSRCoeffs dictionary in constant/combustionProperties file (though it was non-trivial to figure this out), it has no direct connection with reactingFoam but it's a property of combustoin model.

If you go to src/combustionModels/PaSR and look as PaSR.C, you'll find there:

Code:

template<class Type>
void Foam::combustionModels::PaSR<Type>::correct()
{
    if (this->active())
    {
        ...
        if (!useReactionRate_)
        {
            this->chemistryPtr_->solve(t - dt, dt);
        }
        else
        {
            this->chemistryPtr_->calculate();
        }
...
}

there type is defined by the line "combustionModel PaSR<psiChemistryCombustion>" in combustionProperties. Properties of psiChemistryCombustion are defined in chemistryProperties dictionary. If you then go to src/thermophysicalModels/chemistryModel/chemistryModel/basicChemistryModel and open basicChemistryModel.H file, you'll find the following code and comments:

Code:

            // Chemistry solution
               
                //- Calculates the reaction rates
                virtual void calculate() = 0;

                //- Solve the reaction system for the given start time and
                //  timestep and return the characteristic time
                virtual scalar solve(const scalar t0, const scalar deltaT) = 0;

Now you can use Doxygen generated documentation and sources to find concrete implementations of these methods.

I meet a problem in Openfoam 2.3.0, reactingFoam, i need the data of CH4 reaction rate, but i failed to autowrite it like U or Yi.

First i added this code in the CreatField.H,

volScalarField Rrate
(
IOobject
(
"Rrate",
runTime.timeName(),
mesh,
IOobject::NO_READ,
IOobject::AUTO_WRITE
),
mesh,
dimensionedScalar("Rrate", dimMass/dimVolume/dimTime, 0.0)
);

Then, i added this code in YEqn,

forAll(Y, i)
{
if (Y[i].name() != "CH4")
RR = reaction->R(Yi);
}

After wmake, it shows

YEqn.H:26:14: error: no match for ‘operator=’ (operand types are ‘Foam::volScalarField {aka Foam::GeometricField<double, Foam::fvPatchField, Foam::volMesh>}’ and ‘Foam::tmp<Foam::fvMatrix<double> >’)
Rrate = reaction->R(Yi);

Can you tell me how to do that? Thank you very much.


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