https://mooseframework.inl.gov
GeochemistryTimeDependentReactor.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 "GeochemicalSolver.h"
14 
19 {
20 public:
23 
26  virtual void initialize() override;
27 
28  virtual void finalize() override;
29 
30  virtual void initialSetup() override;
31  virtual void execute() override;
32 
33  virtual const GeochemicalSystem & getGeochemicalSystem(dof_id_type node_id) const override;
34  virtual const std::stringstream & getSolverOutput(dof_id_type node_id) const override;
35  virtual unsigned getSolverIterations(dof_id_type node_id) const override;
36  virtual Real getSolverResidual(dof_id_type node_id) const override;
37  virtual const DenseVector<Real> & getMoleAdditions(dof_id_type node_id) const override;
38  virtual Real getMolesDumped(dof_id_type node_id, const std::string & species) const override;
39 
40 protected:
46  const unsigned _heating_increments;
56  const unsigned _num_kin;
62  const std::vector<std::string> _source_species_names;
64  const unsigned _num_source_species;
66  const std::vector<const VariableValue *> _source_species_rates;
68  const std::vector<std::string> _remove_fixed_activity_name;
70  const std::vector<Real> _remove_fixed_activity_time;
72  const unsigned _num_removed_fixed;
74  std::vector<bool> _removed_fixed_activity;
76  const std::vector<std::string> _controlled_activity_species_names;
78  const unsigned _num_controlled_activity;
80  const std::vector<const VariableValue *> _controlled_activity_species_values;
82  DenseVector<Real> _mole_additions;
88  std::unordered_map<std::string, Real> _minerals_dumped;
90  const unsigned _ramp_subsequent;
91 
102  Real newTemperature(const DenseVector<Real> & mole_additions) const;
103 
114  void preSolveDump();
115 
126  void preSolveFlush();
127 
134  void postSolveFlowThrough();
135 
140  void removeCurrentSpecies();
141 
147  void postSolveExchanger();
148 };
virtual const std::stringstream & getSolverOutput(dof_id_type node_id) const override
const unsigned _num_source_species
Number of source species.
std::vector< bool > _removed_fixed_activity
Whether the activity or activity constraint has been removfed.
bool _closed_system
Whether the system has been closed.
void preSolveFlush()
Activate the special "flush" mode prior to solving the geochemical system:
void preSolveDump()
Activate the special "dump" mode prior to solving the geochemical system:
virtual const DenseVector< Real > & getMoleAdditions(dof_id_type node_id) const override
const std::vector< Real > _remove_fixed_activity_time
Times at which to remove the fixed activity or fugacity from the species in _remove_fixed_activity_na...
const VariableValue & _mode
Mode of the system (flush, flow-through, etc)
const unsigned _num_removed_fixed
Number of elements in the vector _remove_fixed_activity_name;.
Class that controls the time-dependent (but not space-dependent) geochemistry reactions.
GeochemistryTimeDependentReactor(const InputParameters &parameters)
void removeCurrentSpecies()
Alter _mole_additions so that it will represent the situation in which all current species are remove...
const VariableValue & _temperature
Temperature specified by user.
const std::vector< std::string > _remove_fixed_activity_name
Names of species to remove the fixed activity or fugacity constraint from.
const unsigned _num_kin
Number of kinetic species.
Real _previous_temperature
Temperature at which the _egs was last made consistent.
std::unordered_map< std::string, Real > _minerals_dumped
Moles of mineral removed by dump and flow-through.
const VariableValue & _cold_temperature
Cold temperature specified by user, which is used only when mode==4.
void postSolveFlowThrough()
Activate the special "flow-through" mode after solving the geochemical system:
const std::vector< const VariableValue * > _source_species_rates
Rates of the source species.
const std::vector< std::string > _controlled_activity_species_names
Names of the species with controlled activity or fugacity.
const std::vector< std::string > _source_species_names
Names of the source species.
virtual Real getSolverResidual(dof_id_type node_id) const override
virtual Real getMolesDumped(dof_id_type node_id, const std::string &species) const override
GeochemicalSystem _egs
The equilibrium geochemical system that holds all the molalities, activities, etc.
OutputTools< Real >::VariableValue VariableValue
DenseVector< Real > _mole_additions
Moles of each basis species added at the current timestep, along with kinetic rates.
const unsigned _num_controlled_activity
Number of species with controlled activity or fugacity.
Real _new_temperature
Temperature at which the solution is required.
static InputParameters sharedParams()
params that are shared with AddTimeDependentReactionSolverAction
DIE A HORRIBLE DEATH HERE typedef LIBMESH_DEFAULT_SCALAR_TYPE Real
virtual unsigned getSolverIterations(dof_id_type node_id) const override
This class holds information about bulk composition, molalities, activities, activity coefficients...
virtual const GeochemicalSystem & getGeochemicalSystem(dof_id_type node_id) const override
Real newTemperature(const DenseVector< Real > &mole_additions) const
Based on _temperature[0], mole_additions, the current mass of the system and the current temperature ...
const unsigned _ramp_subsequent
the ramp_max_ionic_strength to use during time-stepping
const InputParameters & parameters() const
const unsigned _heating_increments
If mode=4 then temperature is ramped from _cold_temperature to _temperature in heating_increments inc...
Base class that controls the spatio-temporal solution of geochemistry reactions.
const std::vector< const VariableValue * > _controlled_activity_species_values
Activity or fugacity of the species with controlled activity or fugacity.
void postSolveExchanger()
This is relevant for mode=4 simulations (heat-exchanger simulations).
This class contains methods to solve the algebraic system in GeochemicalSystem.
const Real _close_system_at_time
Defines the time at which to close the system.
uint8_t dof_id_type
DenseMatrix< Real > _dmole_additions
Derivative of moles_added.