www.mooseframework.org
Public Member Functions | Protected Member Functions | Protected Attributes | List of all members
PorousFlowAqueousPreDisMineral Class Reference

Material designed to form a std::vector of mass fractions of mineral concentrations from reaction rates for an equilibrium precipitation-dissolution chemistry reaction system. More...

#include <PorousFlowAqueousPreDisMineral.h>

Inheritance diagram for PorousFlowAqueousPreDisMineral:
[legend]

Public Member Functions

 PorousFlowAqueousPreDisMineral (const InputParameters &parameters)
 

Protected Member Functions

void initQpStatefulProperties () override
 
void computeQpProperties () override
 

Protected Attributes

const unsigned int _num_reactions
 Number of equations in the aqueous geochemistry system. More...
 
const unsigned int _aq_ph
 Aqueous phase number. More...
 
const MaterialProperty< std::vector< Real > > & _saturation
 Saturation. More...
 
MaterialProperty< std::vector< Real > > & _sec_conc
 Mineral concentrations at quadpoint or nodes. More...
 
const MaterialProperty< Real > & _porosity_old
 Porosity. More...
 
const MaterialProperty< std::vector< Real > > & _sec_conc_old
 Old values of the mineral species concentrations. More...
 
const MaterialProperty< std::vector< Real > > & _reaction_rate
 Reaction rate of mineralisation. More...
 
const bool _initial_conc_supplied
 Whether the initial values of the secondary species concentrations have been supplied by the user. More...
 
const unsigned _num_initial_conc
 Number of secondary species concentrations supplied by the user. More...
 
std::vector< const VariableValue * > _initial_conc
 Initial values of the secondary species concentrations. More...
 
const unsigned int _num_phases
 Number of phases. More...
 
const unsigned int _num_components
 Number of fluid components. More...
 
const unsigned int _num_var
 Number of PorousFlow variables. More...
 

Detailed Description

Material designed to form a std::vector of mass fractions of mineral concentrations from reaction rates for an equilibrium precipitation-dissolution chemistry reaction system.

Definition at line 25 of file PorousFlowAqueousPreDisMineral.h.

Constructor & Destructor Documentation

◆ PorousFlowAqueousPreDisMineral()

PorousFlowAqueousPreDisMineral::PorousFlowAqueousPreDisMineral ( const InputParameters &  parameters)

Definition at line 29 of file PorousFlowAqueousPreDisMineral.C.

30  : PorousFlowMaterialVectorBase(parameters),
31  _num_reactions(_dictator.numAqueousKinetic()),
32  _aq_ph(_dictator.aqueousPhaseNumber()),
33  _saturation(_nodal_material
34  ? getMaterialProperty<std::vector<Real>>("PorousFlow_saturation_nodal")
35  : getMaterialProperty<std::vector<Real>>("PorousFlow_saturation_qp")),
36  _sec_conc(_nodal_material
37  ? declareProperty<std::vector<Real>>("PorousFlow_mineral_concentration_nodal")
38  : declareProperty<std::vector<Real>>("PorousFlow_mineral_concentration_qp")),
39 
40  _porosity_old(_nodal_material ? getMaterialPropertyOld<Real>("PorousFlow_porosity_nodal")
41  : getMaterialPropertyOld<Real>("PorousFlow_porosity_qp")),
43  _nodal_material
44  ? getMaterialPropertyOld<std::vector<Real>>("PorousFlow_mineral_concentration_nodal")
45  : getMaterialPropertyOld<std::vector<Real>>("PorousFlow_mineral_concentration_qp")),
47  _nodal_material
48  ? getMaterialProperty<std::vector<Real>>("PorousFlow_mineral_reaction_rate_nodal")
49  : getMaterialProperty<std::vector<Real>>("PorousFlow_mineral_reaction_rate_qp")),
50 
51  _initial_conc_supplied(isParamValid("initial_concentrations")),
52  _num_initial_conc(_initial_conc_supplied ? coupledComponents("initial_concentrations")
54 {
55  /* Not needed due to PorousFlow_mineral_reaction_rate already checking this condition
56  if (_dictator.numPhases() < 1)
57  mooseError("PorousFlowAqueousPreDisMineral: The number of fluid phases must not be zero");
58  */
59 
60  if (_num_initial_conc != _dictator.numAqueousKinetic())
61  mooseError("PorousFlowAqueousPreDisMineral: The number of initial concentrations is ",
63  " but the Dictator knows that the number of aqueous kinetic "
64  "(precipitation-dissolution) reactions is ",
65  _dictator.numAqueousKinetic());
66 
69  for (unsigned r = 0; r < _num_reactions; ++r)
70  _initial_conc[r] = (_nodal_material ? &coupledNodalValue("initial_concentrations", r)
71  : &coupledValue("initial_concentrations", r));
72 }
std::vector< const VariableValue * > _initial_conc
Initial values of the secondary species concentrations.
const unsigned int _aq_ph
Aqueous phase number.
const MaterialProperty< Real > & _porosity_old
Porosity.
const bool _initial_conc_supplied
Whether the initial values of the secondary species concentrations have been supplied by the user...
const MaterialProperty< std::vector< Real > > & _saturation
Saturation.
MaterialProperty< std::vector< Real > > & _sec_conc
Mineral concentrations at quadpoint or nodes.
const unsigned _num_initial_conc
Number of secondary species concentrations supplied by the user.
PorousFlowMaterialVectorBase(const InputParameters &parameters)
const MaterialProperty< std::vector< Real > > & _reaction_rate
Reaction rate of mineralisation.
const unsigned int _num_reactions
Number of equations in the aqueous geochemistry system.
const MaterialProperty< std::vector< Real > > & _sec_conc_old
Old values of the mineral species concentrations.

Member Function Documentation

◆ computeQpProperties()

void PorousFlowAqueousPreDisMineral::computeQpProperties ( )
overrideprotected

Definition at line 84 of file PorousFlowAqueousPreDisMineral.C.

85 {
86  _sec_conc[_qp].resize(_num_reactions);
87 
88  /*
89  *
90  * Note the use of the OLD value of porosity here.
91  * This strategy, which breaks the cyclic dependency between porosity
92  * and mineral concentration, is used in
93  * Kernel: PorousFlowPreDis
94  * Material: PorousFlowPorosity
95  * Material: PorousFlowAqueousPreDisChemistry
96  * Material: PorousFlowAqueousPreDisMineral
97  *
98  */
99  for (unsigned r = 0; r < _num_reactions; ++r)
100  _sec_conc[_qp][r] = _sec_conc_old[_qp][r] + _porosity_old[_qp] * _reaction_rate[_qp][r] *
101  _saturation[_qp][_aq_ph] * _dt;
102 }
const unsigned int _aq_ph
Aqueous phase number.
const MaterialProperty< Real > & _porosity_old
Porosity.
const MaterialProperty< std::vector< Real > > & _saturation
Saturation.
MaterialProperty< std::vector< Real > > & _sec_conc
Mineral concentrations at quadpoint or nodes.
const MaterialProperty< std::vector< Real > > & _reaction_rate
Reaction rate of mineralisation.
const unsigned int _num_reactions
Number of equations in the aqueous geochemistry system.
const MaterialProperty< std::vector< Real > > & _sec_conc_old
Old values of the mineral species concentrations.

◆ initQpStatefulProperties()

void PorousFlowAqueousPreDisMineral::initQpStatefulProperties ( )
overrideprotected

Definition at line 75 of file PorousFlowAqueousPreDisMineral.C.

76 {
77  _sec_conc[_qp].assign(_num_reactions, 0.0);
79  for (unsigned r = 0; r < _num_reactions; ++r)
80  _sec_conc[_qp][r] = (*_initial_conc[r])[_qp];
81 }
std::vector< const VariableValue * > _initial_conc
Initial values of the secondary species concentrations.
const bool _initial_conc_supplied
Whether the initial values of the secondary species concentrations have been supplied by the user...
MaterialProperty< std::vector< Real > > & _sec_conc
Mineral concentrations at quadpoint or nodes.
const unsigned int _num_reactions
Number of equations in the aqueous geochemistry system.

Member Data Documentation

◆ _aq_ph

const unsigned int PorousFlowAqueousPreDisMineral::_aq_ph
protected

Aqueous phase number.

Definition at line 38 of file PorousFlowAqueousPreDisMineral.h.

Referenced by computeQpProperties().

◆ _initial_conc

std::vector<const VariableValue *> PorousFlowAqueousPreDisMineral::_initial_conc
protected

Initial values of the secondary species concentrations.

Definition at line 63 of file PorousFlowAqueousPreDisMineral.h.

Referenced by initQpStatefulProperties(), and PorousFlowAqueousPreDisMineral().

◆ _initial_conc_supplied

const bool PorousFlowAqueousPreDisMineral::_initial_conc_supplied
protected

Whether the initial values of the secondary species concentrations have been supplied by the user.

Definition at line 57 of file PorousFlowAqueousPreDisMineral.h.

Referenced by initQpStatefulProperties(), and PorousFlowAqueousPreDisMineral().

◆ _num_components

const unsigned int PorousFlowMaterialVectorBase::_num_components
protectedinherited

◆ _num_initial_conc

const unsigned PorousFlowAqueousPreDisMineral::_num_initial_conc
protected

Number of secondary species concentrations supplied by the user.

Definition at line 60 of file PorousFlowAqueousPreDisMineral.h.

Referenced by PorousFlowAqueousPreDisMineral().

◆ _num_phases

const unsigned int PorousFlowMaterialVectorBase::_num_phases
protectedinherited

◆ _num_reactions

const unsigned int PorousFlowAqueousPreDisMineral::_num_reactions
protected

Number of equations in the aqueous geochemistry system.

Definition at line 35 of file PorousFlowAqueousPreDisMineral.h.

Referenced by computeQpProperties(), initQpStatefulProperties(), and PorousFlowAqueousPreDisMineral().

◆ _num_var

const unsigned int PorousFlowMaterialVectorBase::_num_var
protectedinherited

◆ _porosity_old

const MaterialProperty<Real>& PorousFlowAqueousPreDisMineral::_porosity_old
protected

Porosity.

Definition at line 47 of file PorousFlowAqueousPreDisMineral.h.

Referenced by computeQpProperties().

◆ _reaction_rate

const MaterialProperty<std::vector<Real> >& PorousFlowAqueousPreDisMineral::_reaction_rate
protected

Reaction rate of mineralisation.

Definition at line 53 of file PorousFlowAqueousPreDisMineral.h.

Referenced by computeQpProperties().

◆ _saturation

const MaterialProperty<std::vector<Real> >& PorousFlowAqueousPreDisMineral::_saturation
protected

Saturation.

Definition at line 41 of file PorousFlowAqueousPreDisMineral.h.

Referenced by computeQpProperties().

◆ _sec_conc

MaterialProperty<std::vector<Real> >& PorousFlowAqueousPreDisMineral::_sec_conc
protected

Mineral concentrations at quadpoint or nodes.

Definition at line 44 of file PorousFlowAqueousPreDisMineral.h.

Referenced by computeQpProperties(), and initQpStatefulProperties().

◆ _sec_conc_old

const MaterialProperty<std::vector<Real> >& PorousFlowAqueousPreDisMineral::_sec_conc_old
protected

Old values of the mineral species concentrations.

Definition at line 50 of file PorousFlowAqueousPreDisMineral.h.

Referenced by computeQpProperties().


The documentation for this class was generated from the following files: