CFD Online Discussion Forums

CFD Online Discussion Forums (http://www.cfd-online.com/Forums/)
-   OpenFOAM Programming & Development (http://www.cfd-online.com/Forums/openfoam-programming-development/)
-   -   Adding a new member function to SingleStepCombustion (http://www.cfd-online.com/Forums/openfoam-programming-development/113223-adding-new-member-function-singlestepcombustion.html)

tatu February 15, 2013 04:37

Adding a new member function to SingleStepCombustion
 
Hi!

I'm trying to add a new method to singleStepCombustion. The goal is to output reaction rate matrix for a specie transport equation, where the solved field is rho*Yi, instead of bare Yi (mass fraction of specie i). This is done for a modified rhoCentralFoam to handle specie transport. I thought this could be done by simply implementing the member function in singleStepCombustion.C as follows:
Code:

template<class CombThermoType, class ThermoType>
Foam::tmp<Foam::fvScalarMatrix>
singleStepCombustion<CombThermoType, ThermoType>::Rrho
(
    const volScalarField& Y,
    const volScalarField& rhoY
) const
{
    const label specieI = this->thermo_->composition().species()[Y.name()];

    const volScalarField wSpecie
    (
        wFuel_*singleMixture_.specieStoichCoeffs()[specieI]
    );

    return wSpecie + fvm::Sp(0.0*wSpecie, rhoY);
}

Then I would add the function definition to singleStepCombustion.H:
Code:

virtual tmp<fvScalarMatrix> Rrho(const volScalarField& Y, const volScalarField& rhoY) const;
And finally add the definition to combustionModel.H:
Code:

virtual tmp<fvScalarMatrix> Rrho(const volScalarField& Y, const volScalarField& rhoY) const = 0;
I understand that this is all I have to do: I can't find other dependencies where the member function should be defined. Then I compile the combustionModel folder (wmake libso), and no errors or warnings are produced. If I then try to call the new member function with combustion->Rrho(Yi,rhoYi) inside the solver (analogically to working call combustion->R(Yi) ), and compile (wmake), I get the following error:
Code:

YEqn.H: In function ‘int main(int, char**)’:
YEqn.H:73:30: error: ‘class Foam::combustionModels::psiCombustionModel’ has no member named ‘Rrho’

I don't understand why the new member function isn't recognized. Did I forgot to add the member function definition somewhere? I've tried to look through everywhere I think it might be missing. I'm using OF 2.1.1, but the files from 2.1.x I added should be pretty much identical.

Tatu

Thamali January 9, 2014 00:54

Hi tatu,
Did you solve your problem,although it is a long time to keep a problem?
If so I have a question for you.
Thanks.
Thamali


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