Provides a parametric description of a general kinetic rate. More...
Functions | |
void | calculateRate (const std::vector< Real > &promoting_indices, const std::vector< Real > &promoting_monod_indices, const std::vector< Real > &promoting_half_saturation, const KineticRateUserDescription &description, const std::vector< std::string > &basis_species_name, const std::vector< bool > &basis_species_gas, const std::vector< Real > &basis_molality, const std::vector< Real > &basis_activity, const std::vector< bool > &basis_activity_known, const std::vector< std::string > &eqm_species_name, const std::vector< bool > &eqm_species_gas, const std::vector< Real > &eqm_molality, const std::vector< Real > &eqm_activity, const DenseMatrix< Real > &eqm_stoichiometry, Real kin_moles, Real kin_species_molecular_weight, Real log10K, Real log10_activity_product, const DenseMatrix< Real > &kin_stoichiometry, unsigned kin, Real temp_degC, Real &rate, Real &drate_dkin, std::vector< Real > &drate_dmol) |
Calclates a kinetic rate and its derivative. More... | |
Provides a parametric description of a general kinetic rate.
This is a separate class with very little functionality partly so that it can be used by multiple other classes (PertinentGeochemicalSystem, GeochemistryKineticRate) but also so that it can be easily added to if more general kinetic rates are ever required.
The rate is a product of the following terms:
intrinsic_rate_constant area_quantity mass of the kinetic_species, measured in grams, if multiply_by_mass is true (molality of kinetic_species)^kinetic_molal_index 1 / ((molality of kinetic_species)^kinetic_molal_index + kinetic_half_saturation^kinetic_molal_index)^kinetic_monod_index product over the promoting_species of m^(promoting_index) / (m^(promoting_index) + half_saturation^(promoting_index))^(promoting_monod_index) |1 - (Q/K)^theta|^eta, where K = eqm_constant_in_database * exp(- energy_captured / R / TK) exp(activation_energy / R * (1/T0 - 1/T)) D(1 - (Q/K))
Some explanation may be useful:
intrinsic_rate_constant * area_quantity * [mass of kinetic_species] has units mol.s^-1. This allows for the following common possibilities:
The "m" in the promoting species product is:
Q is the activity product, defined by the kinetic_species reaction (defined in the database file). K is the reaction's equilibrium constant (defined in the database file) multiplied by exp(-energy_captured / (RT)). R = 8.314472 m^2.kg.s^-2.K^-1.mol^-1 = 8.314472 J.K^-1.mol^-1 is the gas constant. T is the temperature in Kelvin. T0 is a reference temperature, in Kelvin. It is inputted as 1/T0 so that 1/T0 = 0 is possible.
D(x) depends on direction. If direction == BOTH then D(x) = sgn(x). If direction == DISSOLUTION then D(x) = (x>0)?1:0. If direction == PRECIPITATION then D(x) = (x<0)?-1:0. If direction == RAW then D=1. If direction == DEATH then D=1.
The amount of kinetic species that is generated is kinetic_bio_efficiency * rate. Note that rate
0 for dissolution of the kinetic species, so kinetic_bio_efficiency defaults to -1. However,
for biogeochemistry, it is appropriate to set kinetic_bio_efficiency > 0, so that "dissolution" of the biomass (with rate > 0) generates further biomass
void GeochemistryKineticRateCalculator::calculateRate | ( | const std::vector< Real > & | promoting_indices, |
const std::vector< Real > & | promoting_monod_indices, | ||
const std::vector< Real > & | promoting_half_saturation, | ||
const KineticRateUserDescription & | description, | ||
const std::vector< std::string > & | basis_species_name, | ||
const std::vector< bool > & | basis_species_gas, | ||
const std::vector< Real > & | basis_molality, | ||
const std::vector< Real > & | basis_activity, | ||
const std::vector< bool > & | basis_activity_known, | ||
const std::vector< std::string > & | eqm_species_name, | ||
const std::vector< bool > & | eqm_species_gas, | ||
const std::vector< Real > & | eqm_molality, | ||
const std::vector< Real > & | eqm_activity, | ||
const DenseMatrix< Real > & | eqm_stoichiometry, | ||
Real | kin_moles, | ||
Real | kin_species_molecular_weight, | ||
Real | log10K, | ||
Real | log10_activity_product, | ||
const DenseMatrix< Real > & | kin_stoichiometry, | ||
unsigned | kin, | ||
Real | temp_degC, | ||
Real & | rate, | ||
Real & | drate_dkin, | ||
std::vector< Real > & | drate_dmol | ||
) |
Calclates a kinetic rate and its derivative.
The rate is a product of the following terms:
intrinsic_rate_constant area_quantity mass of the kinetic_species, measured in grams, if multiply_by_mass is true product over the promoting_species of m^(promoting_index) |1 - (Q/K)^theta|^eta exp(activation_energy / R * (1/T0 - 1/T)) D(1 - (Q/K))
promoting_indices | of the basis species and equilibrium species. Note that this is different from description.promoting_indices (which is paired with description.promoting_species) because it is the promoting indices for the current basis and equilibrium. For computational efficiency promoting_indices[0:num_basis-1] are the promoting indices for the current basis species while promoting_indices[num_basis:] are the promoting indices for the current eqm species | |
description | contains definition of intrinsic_rate_constant, area_quantity, etc | |
basis_species_name | vector of basis species names | |
basis_species_gas | i^th element is true if the i^th basis species is a gas | |
basis_molality | vector of the basis molalities (zeroth element is kg of solvent water, and this is mole number for mineral species) | |
basis_activity | vector of basis activities | |
basis_activity_known | i^th element is true if the activity for the i^th basis species has been constrained by the user | |
eqm_species_name | vector of eqm species names | |
eqm_species_gas | i^th element is true if the i^th eqm species is a gas | |
eqm_molality | vector of the eqm molalities (zeroth element is kg of solvent water, and this is mole number for mineral species) | |
eqm_activity | vector of eqm activities | |
eqm_stoichiometry | matrix of stoichiometric coefficient | |
kin_moles | moles of the kinetic species | |
kin_species_molecular_weight | molecular weight (g/mol) of the kinetic species | |
kin_stoichiometry | kinetic stoichiometry matrix (only row=kin is used) | |
kin | the row of kin_stoichiometry that corresponds to the kinetic species | |
log10K | log10(equilibrium constant) of the kinetic species | |
log10_activity_product | log10(activity product) of the kinetic species | |
temp_deg | temperature in degC | |
[out] | rate | the rate computed by this method |
[out] | drate_dkin | d(rate)/d(mole number of the kinetic species) |
[out] | drate_dmol | d(rate)/d(basis molality[i]) |
Definition at line 15 of file GeochemistryKineticRateCalculator.C.
Referenced by GeochemicalSystem::addKineticRates(), and TEST().