Skip to content

Bug with the computation of [M] with real gases #967

@rhouim

Description

@rhouim

We have been looking through the Cantera source code to examine how the activity concentrations are implemented in preparation for us to add a real-gas equation of state model.

When looking through GasKinetics.cpp and ThirdBodyCalc.h we noticed what could be a bug when computing the real-gas third body concentration. On line 63 of GasKinetics.cpp the activity concentrations are stored in m_conc and on line 64 the normal total concentration is stored in ctot. The activity concentrations, m_conc, and total molar density, ctot, is fed into 3-body update function.

On lines 36-44 of ThirdBodyCalc.h, [M] is calculated in the update function. Note: m_conc is named conc in this function. These lines of code perform:

[M] = m_default*ctot + sum(m_eff*conc_i),

where (presumably) m_default = 1 and m_eff = actual efficiency factor - 1. The portion of [M] computed using ctot does not include real gas effects, whereas the other portion includes the real gas effects. Written another way using c_i for molar concentration and a_i for the activity concentration for species i:

[M] = sum(c_i + (efficiency_factor_i - 1)*a_i)

This seems inconsistent with real gas thermodynamics. I am also pretty sure that, in general, sum(c_i) != sum(a_i).

It seems to me that ctot needs to be redefined in the computation of [M] as sum(a_i).

Perhaps this is a bug that is left over from optimizing the computation of [M] for ideal gas mixtures?

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions