Replies: 7 comments 6 replies
-
|
@mattldawson would you happen to know any of these answers? |
Beta Was this translation helpful? Give feedback.
-
|
For the first question, the answer depends on whether the equilibrium constant is temperature and/or pressure dependent. In general: where where Also, the forward (condensation) rate constant where So, long story short, if you want to do what CAMP does, you can include For the second question, CAMP uses actual Henry's Law Constants, whereas Henry's Law Constants that are labelled as being for mono- or di-protic acids, or for bases are actually "Effective" Henry's Law Constants (Mary can tell you more about these). In essence, the Effective Henry's Law Constant, say for a di-protic acid, combines the actual Henry's Law Constant with the first and second acid dissociation reactions. This treats the (typically very fast) acid-dissociation steps as being at quasi-steady-state. The advantage is that it makes the system less stiff. The disadvantage is that it requires a different treatment for each type of acid/base, and it requires that the proton concentration If David and Jiwon are still planning on implementing the DAE solver, my suggestion would be to use actual HLC equations (like in CAMP) with separate acid-base dissociation steps. You can include any/all of the acid-base dissociation reactions as algebraic constraints in the DAE solver using their equilibrium constants. (David can describe what this would look like in more detail). This way, you don't need multiple HLC equations, you don't need to estimate the Hope this helps! Let me know if anything needs more clarification or seems wrong (I'm mostly going from memory). |
Beta Was this translation helpful? Give feedback.
-
|
Hi @mattldawson, can I ask a question? This is the current implementation for carbonic acid formation based on the MIAM README example. The species listed in // Build an Effective Henry's Law PhaseTransferProcess
// (will be for a diprotic acid: CO2(g) <-> H2CO3(aq) <-> HCO3- + H+ <-> CO32- + 2H+)
// K_a1 = first acid dissociation constant
// K_a2 = second acid dissociation constant
// K_H = A * exp(C / T) = Henry's Law constant
auto hlc_co2_parms = HenrysLawCoefficientParameters{ .A_ = 32.4, .C_ = -3.2e-3, .K_a1_ = 1.0e-5, .K_a2_ = 2.0e-5 };
Process co2_phase_transfer = PhaseTransferProcessBuilder()
.SetGasSpecies(gas_phase, co2 )
.SetCondensedSpecies(aqueous_phase, { Yield(hp, 2.0), Yield(co32m) })
.SetSolvent(aqueous_phase, h2o )
.SetTransferCoefficient(HenrysLawCoefficient(hlc_co2_parms))
.Build();When you suggest "to use actual HLC equations (like in CAMP) with separate acid-base dissociation steps", this is what I had in mind. Does that look like what you were suggesting? Process co2_phase_transfer_first_dissociation =
PhaseTransferProcessBuilder()
...
.SetCondensedSpecies(aqueous_phase, { Yield(H2CO3), Yield(HCO3-), Yield(H+) });
Process co2_phase_transfer_second_dissociation =
PhaseTransferProcessBuilder()
...
.SetCondensedSpecies(aqueous_phase, { Yield(HCO3-), Yield(H+), Yield(CO32-), Yield(2H+) }); |
Beta Was this translation helpful? Give feedback.
-
|
The Two of the three are sufficient to calculate the rates |
Beta Was this translation helpful? Give feedback.
-
|
See our open PR (1/3) for the DAE constraints. PR #900 (Add constraint base classes for DAE support) can achieve mathematically equivalent results to Effective Henry's Law Constants, but through separate equilibrium constraints solved together by the DAE solver. Concrete example using For the CO2/carbonic acid system, instead of using an Effective HLC formula that requires knowing Express the acid dissociation steps as separate constraints: // First dissociation: H2CO3 <-> HCO3- + H+
// Equilibrium: K_a1 = [HCO3-][H+] / [H2CO3]
EquilibriumConstraint("Ka1",
{Yield(H2CO3, 1.0)}, // reactants
{Yield(HCO3m, 1.0), Yield(Hp, 1.0)}, // products
K_a1)
// Second dissociation: HCO3- <-> CO32- + H+
// Equilibrium: K_a2 = [CO32-][H+] / [HCO3-]
EquilibriumConstraint("Ka2",
{Yield(HCO3m, 1.0)}, // reactants
{Yield(CO32m, 1.0), Yield(Hp, 1.0)}, // products
K_a2)When both constraints are satisfied (residual = 0), total dissolved carbon is: Equivalent to an Effective HLC:
I think what we are doing is consistent with @mattldawson's recommendation to use actual HLC equations with separate acid-base dissociation steps as algebraic constraints. The |
Beta Was this translation helpful? Give feedback.
-
|
As Matt pointed out, reactants probably shouldn't be defined as // First dissociation: H2CO3 <-> HCO3- + H+
// Equilibrium: K_a1 = [HCO3-][H+] / [H2CO3]
EquilibriumConstraint("Ka1",
{Yield(H2CO3, 1.0)}, // reactants < ------ here
{Yield(HCO3m, 1.0), Yield(Hp, 1.0)}, // products
K_a1)struct StoichSpecies
{
Species species_;
double coefficient_;
}; |
Beta Was this translation helpful? Give feedback.
-
|
Hi @mattldawson, looking at your implementation of the stub aerosol model, the model would know the constraint conditions, since it determines the species within a given mode. For example, in the case of an equilibrium constraint, it could be expressed as Would it make sense for This is the current version of the solver build (still in progress), where the constraints are separate from the aerosol models. I'm wondering whether the model itself should define and own the constraint. If that is the case, the API will likely need to be revised. // Current
auto solver = builder.SetSystem(system)
.AddExternalModelProcesses(aerosol_1)
.AddExternalModelProcesses(aerosol_2)
.SetConstraints(constraints)
.SetIgnoreUnusedSpecies(true)
.Build();I'd also like to hear what you @K20shores, @dwfncar think. |
Beta Was this translation helpful? Give feedback.
Uh oh!
There was an error while loading. Please reload this page.
-
#887 brought in support for two reactions, but we have questions on both
For reference, this is the seinfeld and pandis equation, and what camp uses
Beta Was this translation helpful? Give feedback.
All reactions