https://mooseframework.inl.gov
Loading...
Searching...
No Matches
GeochemistryKineticRateCalculator.h
Go to the documentation of this file.
1//* This file is part of the MOOSE framework
2//* https://mooseframework.inl.gov
3//*
4//* All rights reserved, see COPYRIGHT for full restrictions
5//* https://github.com/idaholab/moose/blob/master/COPYRIGHT
6//*
7//* Licensed under LGPL 2.1, please see LICENSE for details
8//* https://www.gnu.org/licenses/lgpl-2.1.html
9
10#pragma once
11
12#include "MooseTypes.h"
13#include "DenseMatrix.h"
15
36
76{
79 Real area_quantity,
84 const std::vector<std::string> & promoting_species,
85 const std::vector<Real> & promoting_indices,
86 const std::vector<Real> & promoting_monod_indices,
87 const std::vector<Real> & promoting_half_saturation,
88 Real theta,
89 Real eta,
91 Real one_over_T0,
93 std::string progeny,
96 Real energy_captured)
108 theta(theta),
109 eta(eta),
117 {
118 if (promoting_species.size() != promoting_indices.size())
119 mooseError("The promoting_species and promoting_indices vectors must be the same size");
120 if (promoting_species.size() != promoting_monod_indices.size())
121 mooseError("The promoting_species and promoting_monod_indices vectors must be the same size");
122 if (promoting_species.size() != promoting_half_saturation.size())
124 "The promoting_species and promoting_half_saturation vectors must be the same size");
125 std::unordered_map<std::string, int> check_for_repeats;
126 for (const std::string & name : promoting_species)
127 if (check_for_repeats.count(name) == 1)
128 mooseError("Promoting species ", name, " has already been provided with an exponent");
129 else
130 check_for_repeats[name] = 1;
131 };
132
151
159 std::vector<std::string> promoting_species;
160 std::vector<Real> promoting_indices;
161 std::vector<Real> promoting_monod_indices;
162 std::vector<Real> promoting_half_saturation;
163 Real theta;
164 Real eta;
168 std::string progeny;
172};
173
233{
275void calculateRate(const std::vector<Real> & promoting_indices,
276 const std::vector<Real> & promoting_monod_indices,
277 const std::vector<Real> & promoting_half_saturation,
278 const KineticRateUserDescription & description,
279 const std::vector<std::string> & basis_species_name,
280 const std::vector<bool> & basis_species_gas,
281 const std::vector<Real> & basis_molality,
282 const std::vector<Real> & basis_activity,
283 const std::vector<bool> & basis_activity_known,
284 const std::vector<std::string> & eqm_species_name,
285 const std::vector<bool> & eqm_species_gas,
286 const std::vector<Real> & eqm_molality,
287 const std::vector<Real> & eqm_activity,
288 const DenseMatrix<Real> & eqm_stoichiometry,
289 Real kin_moles,
290 Real kin_species_molecular_weight,
291 Real log10K,
292 Real log10_activity_product,
293 const DenseMatrix<Real> & kin_stoichiometry,
294 unsigned kin,
295 Real temp_degC,
296 Real & rate,
297 Real & drate_dkin,
298 std::vector<Real> & drate_dmol);
299}
DirectionChoiceEnum
This controls the direction of a kinetic rate BOTH: both dissolution and precipitation are allowed PR...
void mooseError(Args &&... args)
const std::string name
Definition Setup.h:21
Provides a parametric description of a general kinetic rate.
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.
Holds a user-specified description of a kinetic rate.
KineticRateUserDescription(const std::string &kinetic_species_name, Real intrinsic_rate_constant, Real area_quantity, bool multiply_by_mass, Real kinetic_molal_index, Real kinetic_monod_index, Real kinetic_half_saturation, const std::vector< std::string > &promoting_species, const std::vector< Real > &promoting_indices, const std::vector< Real > &promoting_monod_indices, const std::vector< Real > &promoting_half_saturation, Real theta, Real eta, Real activation_energy, Real one_over_T0, DirectionChoiceEnum direction, std::string progeny, Real progeny_efficiency, Real kinetic_bio_efficiency, Real energy_captured)
bool operator==(const KineticRateUserDescription &rhs) const