https://mooseframework.inl.gov
Loading...
Searching...
No Matches
GeochemistryReactorBase.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
13#include "GeochemicalSystem.h"
14#include "NodalUserObject.h"
15
20{
21public:
24
27 virtual void initialize() override {}
28 virtual void threadJoin(const UserObject & /*uo*/) override {}
29 virtual void finalize() override {}
30 virtual void execute() override {}
31
36 virtual const GeochemicalSystem & getGeochemicalSystem(dof_id_type node_id) const = 0;
37
43 virtual const std::stringstream & getSolverOutput(dof_id_type node_id) const = 0;
44
49 virtual unsigned getSolverIterations(dof_id_type node_id) const = 0;
50
55 virtual Real getSolverResidual(dof_id_type node_id) const = 0;
56
63 virtual const DenseVector<Real> & getMoleAdditions(dof_id_type node_id) const = 0;
64
70 virtual Real getMolesDumped(dof_id_type node_id, const std::string & species) const = 0;
71
74
75protected:
77 const unsigned _num_my_nodes;
83 const unsigned _num_basis;
85 const unsigned _num_eqm;
93 const unsigned _max_swaps_allowed;
97 const Real _small_molality;
99 std::vector<std::stringstream> _solver_output;
101 std::vector<unsigned> _tot_iter;
103 std::vector<Real> _abs_residual;
104};
This class holds information about bulk composition, molalities, activities, activity coefficients,...
Computes activity coefficients for non-minerals and non-gases (since these species do not have activi...
Calculators to compute ionic strength and stoichiometric ionic strength.
Base class that controls the spatio-temporal solution of geochemistry reactions.
virtual const GeochemicalSystem & getGeochemicalSystem(dof_id_type node_id) const =0
virtual Real getSolverResidual(dof_id_type node_id) const =0
virtual void finalize() override
std::vector< unsigned > _tot_iter
Number of iterations used by the solver at each node.
virtual const DenseVector< Real > & getMoleAdditions(dof_id_type node_id) const =0
virtual void initialize() override
static InputParameters validParams()
GeochemistryIonicStrength _is
The ionic strength calculator.
const unsigned _num_my_nodes
Number of nodes handled by this processor (will need to be made un-const when mesh adaptivity is hand...
std::vector< Real > _abs_residual
L1norm of the solver residual at each node.
static InputParameters sharedParams()
contains params that are shared with AddGeochemistrySolverAction and its children
virtual void execute() override
const unsigned _num_basis
number of basis species
const unsigned _max_swaps_allowed
Maximum number of swaps allowed during a single solve.
const unsigned _num_eqm
number of equilibrium species
const Real _initial_max_ionic_str
Initial value of maximum ionic strength.
GeochemistryActivityCoefficientsDebyeHuckel _gac
The activity calculator.
ModelGeochemicalDatabase _mgd
my copy of the underlying ModelGeochemicalDatabase
std::vector< std::stringstream > _solver_output
The solver output at each node.
const PertinentGeochemicalSystem & getPertinentGeochemicalSystem() const
returns a reference to the PertinentGeochemicalSystem used to creat the ModelGeochemicalDatabase
virtual const std::stringstream & getSolverOutput(dof_id_type node_id) const =0
GeochemistrySpeciesSwapper _swapper
The species swapper.
virtual unsigned getSolverIterations(dof_id_type node_id) const =0
virtual Real getMolesDumped(dof_id_type node_id, const std::string &species) const =0
const Real _small_molality
A small value of molality.
virtual void threadJoin(const UserObject &) override
const PertinentGeochemicalSystem & _pgs
Reference to the original PertinentGeochemicalSystem used to create the ModelGeochemicalDatabase.
Class to swap basis species with equilibrium species.
const InputParameters & parameters() const
Constructs and stores a minimal amount of information that is pertinent to the user-defined geochemic...
Data structure to hold all relevant information from the database file.