https://mooseframework.inl.gov
Loading...
Searching...
No Matches
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{
20public:
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
40protected:
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;
80 const std::vector<const VariableValue *> _controlled_activity_species_values;
82 DenseVector<Real> _mole_additions;
84 DenseMatrix<Real> _dmole_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
135
141
147 void postSolveExchanger();
148};
This class contains methods to solve the algebraic system in GeochemicalSystem.
This class holds information about bulk composition, molalities, activities, activity coefficients,...
Base class that controls the spatio-temporal solution of geochemistry reactions.
Class that controls the time-dependent (but not space-dependent) geochemistry reactions.
const unsigned _ramp_subsequent
the ramp_max_ionic_strength to use during time-stepping
const VariableValue & _cold_temperature
Cold temperature specified by user, which is used only when mode==4.
const unsigned _heating_increments
If mode=4 then temperature is ramped from _cold_temperature to _temperature in heating_increments inc...
virtual const GeochemicalSystem & getGeochemicalSystem(dof_id_type node_id) const override
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.
void postSolveExchanger()
This is relevant for mode=4 simulations (heat-exchanger simulations).
const unsigned _num_controlled_activity
Number of species with controlled activity or fugacity.
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 std::vector< const VariableValue * > _source_species_rates
Rates of the source species.
const unsigned _num_source_species
Number of source species.
DenseMatrix< Real > _dmole_additions
Derivative of moles_added.
void preSolveFlush()
Activate the special "flush" mode prior to solving the geochemical system:
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 & _temperature
Temperature specified by user.
void postSolveFlowThrough()
Activate the special "flow-through" mode after solving the geochemical system:
static InputParameters sharedParams()
params that are shared with AddTimeDependentReactionSolverAction
const std::vector< std::string > _controlled_activity_species_names
Names of the species with controlled activity or fugacity.
virtual const DenseVector< Real > & getMoleAdditions(dof_id_type node_id) const override
void removeCurrentSpecies()
Alter _mole_additions so that it will represent the situation in which all current species are remove...
const std::vector< std::string > _remove_fixed_activity_name
Names of species to remove the fixed activity or fugacity constraint from.
virtual Real getMolesDumped(dof_id_type node_id, const std::string &species) const override
const unsigned _num_kin
Number of kinetic species.
const unsigned _num_removed_fixed
Number of elements in the vector _remove_fixed_activity_name;.
bool _closed_system
Whether the system has been closed.
DenseVector< Real > _mole_additions
Moles of each basis species added at the current timestep, along with kinetic rates.
const Real _close_system_at_time
Defines the time at which to close the system.
virtual const std::stringstream & getSolverOutput(dof_id_type node_id) const override
virtual unsigned getSolverIterations(dof_id_type node_id) const override
const std::vector< std::string > _source_species_names
Names of the source species.
void preSolveDump()
Activate the special "dump" mode prior to solving the geochemical system:
std::vector< bool > _removed_fixed_activity
Whether the activity or activity constraint has been removfed.
const VariableValue & _mode
Mode of the system (flush, flow-through, etc)
const std::vector< const VariableValue * > _controlled_activity_species_values
Activity or fugacity of the species with controlled activity or fugacity.
Real _new_temperature
Temperature at which the solution is required.
virtual Real getSolverResidual(dof_id_type node_id) const override
GeochemicalSystem _egs
The equilibrium geochemical system that holds all the molalities, activities, etc.
const InputParameters & parameters() const
VariableValueTempl< false > VariableValue