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/)
-   -   Reacting rate depending on a field other than pressure or temperature (https://www.cfd-online.com/Forums/openfoam-programming-development/236220-reacting-rate-depending-field-other-than-pressure-temperature.html)

lumpor May 19, 2021 18:17

Reacting rate depending on a field other than pressure or temperature
 
Hi. I'm trying to add a new reacting rate to rhoReactingFoam that depends on the solar exposure of a cell. I'm able to write that field into the time folders of my case, but I'm unsure of how to add it as a parameter to the function that calculates the reacting rate of a reaction.


Looking at the function that calculates the reacting rate (in irreversibleReaction.H):

Code:

template<class ReactionThermo>
 
 Foam::scalar Foam::Reaction<ReactionThermo>::kf
 
 (
 
    const scalar p,
 
    const scalar T,
 
    const scalarField& c
 
 ) const
 
 {
 
    return 0.0;
 
 }virtual scalar kf
            (
 
                const scalar p,
 
                const scalar T,
 
                const scalarField& c
 
            ) const;

It seems to only have access to pressure and temperature. I want it to also have access to the field I created (called J).
However, I don't know from where this kf function is called from, so I don't know where I can pass the J value to the reacting rate class.
I'm thinking it happens somewhere in reactingThermo or combustionModels, but trying to look through these huge classes is daunting.

What would be your best way of adding the J field as a parameter to the kf function? Any help would be appreciated :D


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