Open sashahafner opened 1 year ago
Added in fed7a4a9fca8486f01afd39d97b8f682f0681824
Note that I used
alpha = 1 / (1 + 10**(pKa - pH))
Not ...pH - pKa
from the Onda function.
I also corrected the Onda function in 8d3dca59067feddee2d82742737613e5c7a04b50
Oops, I see alpha was "alpha0", fraction in free (uncharged, volatile) form. So Onda function was originally correct. Switched function and corrected model in c9da34167eaf57f7d73557c830c1e0a8abb552cd and 23461909d74b18241fd99563f7f2c9157c560986
I've renamed alpha
alpha0
for clarity (I think this is what Snoeyink and Jenkins use in Water Chemistry).
We need to consider whether reaction should apply equally to both species. Presently it does.
I'm leaving this open for now because we might want to consider different reaction rates for the two species (charged and uncharged) in the future. But the ionization should be functional.
I think we should allow for a missing pKa value in the inputs, where the volatile concentration is total concentration.
For example a gas that doesn't react.
@AnneMortensen I am moving this discussion from #21 here.
2. I will erase L237, I had a feeling I had misunderstood something (and I probably need to brush up on the definitions of Daw and Kaw anyways).
Actually it would be good to define these variables in the model script or better, to create a proper help file.
Both Daw
and Kaw
are distribution coefficients.
Kaw
is the more "thermodynamic" one, based on the dissolved species that is actually in equilibrium with gas/vapor phase species.
Daw
includes all dissolved species.
So for H2S, Kaw
= conc. H2S in gas phase / conc. dissolved H2S, Daw
= conc. H2S in gas phase / (conc. H2S + conc.
You can find more details on the difference searching for partition versus distribution coefficient.
What we called Kaw
is called a partition coefficient in places (like this good Wikipedia summary: https://en.wikipedia.org/wiki/Partition_coefficient).
Note that the term "partition coefficient" is often used for the same thing.
But technically that is based on chemical activity and not concentrations.
In this model and many places we probably assume activities = concentrations, assuming we use values for Henry's law constant.
So it is largely a matter of language.
So model will need pH and Ka as inputs as in Kga_onda.