//---------------------------------------------------------------------- // This file contains the definition of the chemical equilibrium system. //---------------------------------------------------------------------- // include the object file that contains the defintions of the component // species, davies objects @include: ..\..\bin\objects2003.txt // First we define two system phases. // A phase is a part of the system for which each "entity" will have a separate mass balance. // The "tot" phase contains the total mass balances. (e.g. Cd2+.tot.sum) @phase(tot) // Now we define a "diss" phase which represents the dissolved part of the system // This phase is part of the tot phase, with a constant conversion factor of 1. // In case of a variable water volume we could replace the 1 with a variable e.g. watervolume. @Var: watervolume 1 @phase(diss, tot, watervolume) // We use ion activity correction for dissolved species according to Davies, with a fixed ionic strength. @davies() // Now we can define the system components with their (name and charge) @component(Cd2+, 2) // For cadmium we have got an unknown activity and a given total amount in the dissolved phase. // So we set up an unknown equation pair (Uneq:) // unknown, not used, equation, not used, relative convergence criterion, absolute convergence criterion @Uneq: Cd2+.act 1e-7 Cd2+.diss.sum 1e-3 1e-8 1e-15 // An example of a literal calculation, in this case to calculate the // H+ activity from the pH. // Components normally use their activity as input, but for H+ we would like to // use the pH as input. // This can be done by adding an expression that calculates the proton activity from the pH. // This should be done before the component is defined // Define pH as a variable @Var: pH 4 // Define the expression that calculates H+.act from the pH @Calc:(1,"H+.act = 10^-pH") @component(H+, 1) // Next we define the OH- species, with its k-value and its charge @species(OH-, 1e-14, -1, -1, H+) // Note that it is possible to define species in terms of species that are not components themselves! // So you can define CdOH+ in terms of OH-, or if you like in H+ (using the correct formation constant) @species(CdOH+, 8.317e11, 1, 1, OH-, 1, Cd2+)