CFD Online Logo CFD Online URL
www.cfd-online.com
[Sponsors]
Home > Forums > Software User Forums > OpenFOAM > OpenFOAM Programming & Development

apply relaxation factors for chemical reaction of species in reactingFoam?

Register Blogs Community New Posts Updated Threads Search

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
Old   October 18, 2014, 09:07
Default apply relaxation factors for chemical reaction of species in reactingFoam?
  #1
Member
 
Hossein
Join Date: Apr 2010
Posts: 65
Rep Power: 16
atoof is on a distinguished road
Send a message via Yahoo to atoof
Quote:
Originally Posted by gschaider View Post
Yes. That is what I was saying with that line.

Just add "libswakChemistryModelFunctionPlugin.so" to the libs-entry in controlDict. Now if you use any swak-thing (function-object or also funkySetFields) that uses the Field-parser for the first time you see an output like this:
Code:
Creating expression field muEff ...
"Loaded plugin functions for 'FieldValueExpressionDriver':"
psiChem_RR:
"volScalarField psiChem_RR(primitive/word speciesName)"
psiChem_RRError:
"volScalarField psiChem_RRError()"
psiChem_RRSumPositive:
"volScalarField psiChem_RRSumPositive()"
psiChem_Sh:
"volScalarField psiChem_Sh()"
psiChem_dQ:
"volScalarField psiChem_dQ()"
psiChem_deltaTChem:
"volScalarField psiChem_deltaTChem()"
psiChem_tc:
"volScalarField psiChem_tc()"
psiChem_updateChemistry:
"volScalarField psiChem_updateChemistry(primitive/scalar timestep)"
Dear Bernhard,

Is it possible to apply relaxation factors for chemical reaction of species in YEqn.H of solver reactingFoam?
I'm working with OF2.1.x now.

Thank you in advance for any hint.
atoof is offline   Reply With Quote

Old   October 18, 2014, 09:29
Default
  #2
Member
 
Hossein
Join Date: Apr 2010
Posts: 65
Rep Power: 16
atoof is on a distinguished road
Send a message via Yahoo to atoof
Dears,

Is it possible to apply relaxation factors for chemical reaction of species in YEqn.H of solver reactingFoam?
I'm working with OF2.1.x now.
The things I did:
I've defined a volScalarField in createFields;
Code:
volScalarField sYi
(
    IOobject
    (
        "sYi",
        runTime.timeName(),
        mesh,
        IOobject::NO_READ,
        IOobject::NO_WRITE
    ),
    mesh,
    dimensionSet (1, -3, -1, 0, 0, 0, 0)
);
and in YEqn.H I've added the following
Code:
sYi = combustion->R(Yi);
            sYi.relax();           
            fvScalarMatrix YiEqn
            (
                fvm::ddt(rho, Yi)
              + mvConvection->fvmDiv(phi, Yi)
//              - fvm::laplacian(turbulence->muEff(), Yi)
              - fvm::laplacian(diffCo, Yi)
             ==
//                combustion->R(Yi)
                sYi
            );
but after compiling the following error appears:
Code:
In file included from reactingDymFoamModTrans.C:97:0:
YEqn.H: In function ‘int main(int, char**)’:
YEqn.H:24:35: error: no match for ‘operator=’ in ‘sYi = Foam::combustionModel::R((*(const volScalarField*)Yi))’
YEqn.H:24:35: note: candidates are:
In file included from /home/mohammad/OpenFOAM/OpenFOAM-2.1.x/src/OpenFOAM/lnInclude/GeometricField.H:583:0,
                 from /home/mohammad/OpenFOAM/OpenFOAM-2.1.x/src/OpenFOAM/lnInclude/GeometricScalarField.H:38,
                 from /home/mohammad/OpenFOAM/OpenFOAM-2.1.x/src/OpenFOAM/lnInclude/GeometricFields.H:34,
                 from /home/mohammad/OpenFOAM/OpenFOAM-2.1.x/src/finiteVolume/lnInclude/volFields.H:37,
                 from /home/mohammad/OpenFOAM/OpenFOAM-2.1.x/src/finiteVolume/lnInclude/surfaceInterpolationScheme.C:30,
                 from /home/mohammad/OpenFOAM/OpenFOAM-2.1.x/src/finiteVolume/lnInclude/surfaceInterpolationScheme.H:234,
                 from /home/mohammad/OpenFOAM/OpenFOAM-2.1.x/src/finiteVolume/lnInclude/surfaceInterpolate.H:41,
                 from /home/mohammad/OpenFOAM/OpenFOAM-2.1.x/src/finiteVolume/lnInclude/fvc.H:39,
                 from /home/mohammad/OpenFOAM/OpenFOAM-2.1.x/src/finiteVolume/lnInclude/fvCFD.H:8,
                 from reactingDymFoamModTrans.C:32:
/home/mohammad/OpenFOAM/OpenFOAM-2.1.x/src/OpenFOAM/lnInclude/GeometricField.C:1083:6: note: void Foam::GeometricField<Type, PatchField, GeoMesh>::operator=(const Foam::GeometricField<Type, PatchField, GeoMesh>&) [with Type = double; PatchField = Foam::fvPatchField; GeoMesh = Foam::volMesh]
/home/mohammad/OpenFOAM/OpenFOAM-2.1.x/src/OpenFOAM/lnInclude/GeometricField.C:1083:6: note:   no known conversion for argument 1 from ‘Foam::tmp<Foam::fvMatrix<double> >’ to ‘const Foam::GeometricField<double, Foam::fvPatchField, Foam::volMesh>&’
/home/mohammad/OpenFOAM/OpenFOAM-2.1.x/src/OpenFOAM/lnInclude/GeometricField.C:1108:6: note: void Foam::GeometricField<Type, PatchField, GeoMesh>::operator=(const Foam::tmp<Foam::GeometricField<Type, PatchField, GeoMesh> >&) [with Type = double; PatchField = Foam::fvPatchField; GeoMesh = Foam::volMesh]
/home/mohammad/OpenFOAM/OpenFOAM-2.1.x/src/OpenFOAM/lnInclude/GeometricField.C:1108:6: note:   no known conversion for argument 1 from ‘Foam::tmp<Foam::fvMatrix<double> >’ to ‘const Foam::tmp<Foam::GeometricField<double, Foam::fvPatchField, Foam::volMesh> >&’
/home/mohammad/OpenFOAM/OpenFOAM-2.1.x/src/OpenFOAM/lnInclude/GeometricField.C:1144:6: note: void Foam::GeometricField<Type, PatchField, GeoMesh>::operator=(const Foam::dimensioned<Form>&) [with Type = double; PatchField = Foam::fvPatchField; GeoMesh = Foam::volMesh]
/home/mohammad/OpenFOAM/OpenFOAM-2.1.x/src/OpenFOAM/lnInclude/GeometricField.C:1144:6: note:   no known conversion for argument 1 from ‘Foam::tmp<Foam::fvMatrix<double> >’ to ‘const Foam::dimensioned<double>&’
In file included from reactingDymFoamModTrans.C:51:0:
/home/mohammad/OpenFOAM/OpenFOAM-2.1.x/src/finiteVolume/lnInclude/readTimeControls.H:38:8: warning: unused variable ‘maxDeltaT’ [-Wunused-variable]
make: *** [Make/linuxGccDPOpt/reactingDymFoamModTrans.o] Error 1
How can I remove the error?
Thank you in advance for any hint.
atoof is offline   Reply With Quote

Old   October 18, 2014, 10:14
Default
  #3
Assistant Moderator
 
Bernhard Gschaider
Join Date: Mar 2009
Posts: 4,225
Rep Power: 51
gschaider will become famous soon enoughgschaider will become famous soon enough
Quote:
Originally Posted by atoof View Post
Dear Bernhard,

Is it possible to apply relaxation factors for chemical reaction of species in YEqn.H of solver reactingFoam?
I'm working with OF2.1.x now.

Thank you in advance for any hint.
No. But the Y-Eqn in the standard OF-solvers (reactingFoam for instance) already has relaxation built in
__________________
Note: I don't use "Friend"-feature on this forum out of principle. Ah. And by the way: I'm not on Facebook either. So don't be offended if I don't accept your invitation/friend request
gschaider is offline   Reply With Quote

Old   October 18, 2014, 10:35
Default
  #4
Member
 
Hossein
Join Date: Apr 2010
Posts: 65
Rep Power: 16
atoof is on a distinguished road
Send a message via Yahoo to atoof
Quote:
Originally Posted by gschaider View Post
No. But the Y-Eqn in the standard OF-solvers (reactingFoam for instance) already has relaxation built in
Thanks Bernhard,

During running reactinFoam, I noticed that the iterations for one of species reaches to 1001 and has no convergence for that species. Therefore, the heat source value in some cells is calculated so that the temperatures in that cells are below 200 or above 3000K. So I decided to apply a relaxation factor on the chemical source term of all species. I've even run the cases with Courant No. equal to 0.2 and a relation factor equals to 0.5 for Yi with no success for standard reactingfoam.

Any Hint?

Hossein
atoof is offline   Reply With Quote

Reply


Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are Off
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
Question about reaction mechanism in ReactingFoam Dan1788 OpenFOAM Running, Solving & CFD 6 December 13, 2016 06:09
[OpenFOAM.org] Compile OF 2.3 on Mac OS X .... the patch gschaider OpenFOAM Installation 225 August 25, 2015 20:43
Reaction Source Term in Steady Species transport equation cfdvenkatesh Main CFD Forum 0 August 19, 2010 10:28
species source term reaction Andrew FLUENT 3 May 27, 2005 13:35
relaxation factors and time accuracy Mike Main CFD Forum 7 May 21, 2005 13:41


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