Line data Source code
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 "PertinentGeochemicalSystem.h" 13 : 14 : /** 15 : * Base class to compute activity coefficients for non-minerals and non-gases (since these species 16 : * do not have activity coefficients). Also computes the activity of water. 17 : */ 18 : class GeochemistryActivityCoefficients 19 : { 20 : public: 21 1210 : GeochemistryActivityCoefficients(){}; 22 : 23 : bool operator==(const GeochemistryActivityCoefficients & /*rhs*/) const { return true; }; 24 : 25 : /** 26 : * Sets internal parameters, such as the ionic strength and Debye-Huckel parameters, prior to 27 : * computing activity coefficients and activity of water. If using a Debye-Huckel activity model, 28 : * you must ensure the ionic strength calculator (eg, maxIonicStrength) is set appropriately 29 : * before calling this function. 30 : * @param temperature the temperature in degC 31 : * @param mgd the Model Geochemical database 32 : * @param basis_species_molality Molalities of the basis species in mgd 33 : * @param eqm_species_molality Molalities of the equilibrium species in mgd 34 : * @param kin_species_molality Molalities of the kinetic species 35 : */ 36 : virtual void setInternalParameters(Real temperature, 37 : const ModelGeochemicalDatabase & mgd, 38 : const std::vector<Real> & basis_species_molality, 39 : const std::vector<Real> & eqm_species_molality, 40 : const std::vector<Real> & kin_species_molality) = 0; 41 : 42 : /** 43 : * Computes and returns the activity of water. Note that you will probably want to call 44 : * setInternalParameters prior to calling this method 45 : * @return the activity of water 46 : */ 47 : virtual Real waterActivity() const = 0; 48 : 49 : /** 50 : * Compute the activity coefficients and store them in basis_activity_coef and eqm_activity_coef 51 : * Note: 52 : * - you will probably want to call setInternalParameters prior to calling this method 53 : * - the activity coefficient for water (basis species = 0) is not computed since it is 54 : * meaningless: use getWaterActivity() instead 55 : * - the activity coefficient for any mineral is not computed since minerals do not have activity 56 : * coefficients 57 : * - the activity coefficient for any gas is not computed since gases do not have activity 58 : * coefficients 59 : * Hence, the elements in basis_activity_coef and eqm_activity_coef corresponding to 60 : * these species will be undefined after this method returns 61 : */ 62 : virtual void buildActivityCoefficients(const ModelGeochemicalDatabase & mgd, 63 : std::vector<Real> & basis_activity_coef, 64 : std::vector<Real> & eqm_activity_coef) const = 0; 65 : };