You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
There are several places in gas_chem.hpp and gas_chem_mechanism.hpp that appear to have inconsistent units (e.g., additions of 2 quantities with differing units). This is based on comments specifying the following units for arrays containing chemical species qoi and reaction rates (paraphrased):
solution := species volume mixing ratio [kmol species/kmol dry air]
rxt := reaction rates in 1D array [1/cm^3/s]
het_rates := washout rates [1/s]
It's entirely possible, if not likely, that the calculations are correct and only comments need to be updated, but we do need to investigate and reconcile this. Additionally, I would argue in favor of separating different physical quantities into separate arrays for the sake of clarity.
Just to follow up on this some -- I went through the Fortran version of the code more carefully (specifically subroutine gas_phase_chemdr, variable reaction_rates), tracking down the origin of the relevant equations. I found the following: 1) at least all of the chemical reaction elements of this array seem to have the same units with each other at any given time; 2) however, the units of all these elements do change multiple times over the coarse of this subroutine. Specifically, they start off (after the call to setrxt) as cm^3 / (molecule -- s) (i.e., like a reaction rate constant for a second-order reaction), but after the call to adjrxt they become s^{-1}; then during the call to rate_diags_calc they become molecules / (cm^3 - s).
Thank you for looking into this, Brian! That certainly provides some peace of mind.
And, based on this, it appears that the arrays carrying quantities and rates likely contain entries with heterogeneous units. As such, this should be looked into after porting is complete/validated and we can modify/improve the code.
There are several places in
gas_chem.hpp
andgas_chem_mechanism.hpp
that appear to have inconsistent units (e.g., additions of 2 quantities with differing units). This is based on comments specifying the following units for arrays containing chemical species qoi and reaction rates (paraphrased):It's entirely possible, if not likely, that the calculations are correct and only comments need to be updated, but we do need to investigate and reconcile this. Additionally, I would argue in favor of separating different physical quantities into separate arrays for the sake of clarity.
Related to #229.
@odiazib @brigaudet @singhbalwinder @jeff-cohere
The text was updated successfully, but these errors were encountered: