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