Incorrect mixture density in heRhoThermo
The mixture density is calculated incorrectly in heRhoThermo when using multiComponentMixture. The mixture density is being calculated as sum of Y_i*rho_i. Whilst correct for most material properties, this formula is not correct for density.
Steps to reproduce
To help demonstrate this I have provided a test application and case. rhoReactionThermoTest.tar.gz Compile the provided application Test-rhoReactionThermo and execute using the provided test case.
A simple test case is provided to use with the provided application. cavity.tar.gz A simple mixture of Air (Y=0.99) and H2O (Y=0.01). The density of the mixture as calculated by multiComponentMixture is reported.
What is the current bug behaviour?
The mixture density is calculated as 0.011188
What is the expected correct behavior?
The correct mixture density is 0.00121211. The mass fraction of Air and H2O is 0.99 and 0.01 respectively. The component densities are specified as 0.0012 and 1 for Air and H2O respectively.
Build : b45f8f6f-20200629 OPENFOAM=2006 Arch : "LSB;label=32;scalar=64" Operating system : ubuntu 18.04
The fix for this is to change the mixture density calculation in heRhoThermo to use cellVolMixture instead of cellMixture. A patch containing the suggested fix is attached. fix_mixture_density.patch