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/)
-   -   Access the composition of species in OpenFOAM (https://www.cfd-online.com/Forums/openfoam-solving/246054-access-composition-species-openfoam.html)

adib_mohammad November 9, 2022 20:39

Access the composition of species in OpenFOAM
 
I need to determine the number of carbon and hydrogen atoms of certain species in reactingFoam. I am using hePsiThermo as thermoType.

I looked at the documentation, and I noticed that it can be accessed through chemistry.specieComp() used in DAC.C here.

However, when I use it in my code as

Code:

    const List<List<specieElement>>& specieComposition =
        chemistry.specieComp();

compiler throw an erorr saying that

Code:

./sootTest.H:44:20: error: ‘class Foam::BasicChemistryModel<Foam::psiReactionThermo>’ has no member named ‘specieComp’
  44 |          chemistry.specieComp();

This is the definition of the chemistry in my solver.

Code:

autoPtr<psiReactionThermo> pThermo(psiReactionThermo::New(mesh));

psiReactionThermo& thermo = pThermo();
thermo.validate(args.executable(), "h", "e");

autoPtr<BasicChemistryModel<psiReactionThermo>> pChemistry
(
    BasicChemistryModel<psiReactionThermo>::New(thermo)
);

BasicChemistryModel<psiReactionThermo>& chemistry = pChemistry();



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