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

Define the AuxKernel for the output of equilibrium species concentrations according to mass action law. More...

#include <AqueousEquilibriumRxnAux.h>

Inheritance diagram for AqueousEquilibriumRxnAux:
[legend]

Public Member Functions

 AqueousEquilibriumRxnAux (const InputParameters &parameters)
 
virtual ~AqueousEquilibriumRxnAux ()
 

Protected Member Functions

virtual Real computeValue () override
 

Protected Attributes

const Real _log_k
 Equilibrium constant. More...
 
const std::vector< Real > _sto_v
 Stoichiometric coefficients for coupled primary species. More...
 
std::vector< const VariableValue * > _vals
 Coupled primary species. More...
 

Detailed Description

Define the AuxKernel for the output of equilibrium species concentrations according to mass action law.

Definition at line 22 of file AqueousEquilibriumRxnAux.h.

Constructor & Destructor Documentation

AqueousEquilibriumRxnAux::AqueousEquilibriumRxnAux ( const InputParameters &  parameters)

Definition at line 23 of file AqueousEquilibriumRxnAux.C.

24  : AuxKernel(parameters),
25  _log_k(getParam<Real>("log_k")),
26  _sto_v(getParam<std::vector<Real>>("sto_v"))
27 {
28  int n = coupledComponents("v");
29  _vals.resize(n);
30  for (unsigned int i = 0; i < _vals.size(); ++i)
31  _vals[i] = &coupledValue("v", i);
32 }
const std::vector< Real > _sto_v
Stoichiometric coefficients for coupled primary species.
const Real _log_k
Equilibrium constant.
std::vector< const VariableValue * > _vals
Coupled primary species.
virtual AqueousEquilibriumRxnAux::~AqueousEquilibriumRxnAux ( )
inlinevirtual

Definition at line 27 of file AqueousEquilibriumRxnAux.h.

27 {}

Member Function Documentation

Real AqueousEquilibriumRxnAux::computeValue ( )
overrideprotectedvirtual

Definition at line 35 of file AqueousEquilibriumRxnAux.C.

Referenced by ~AqueousEquilibriumRxnAux().

36 {
37  Real conc_product = 1.0;
38 
39  for (unsigned int i = 0; i < _vals.size(); ++i)
40  conc_product *= std::pow((*_vals[i])[_qp], _sto_v[i]);
41 
42  return std::pow(10.0, _log_k) * conc_product;
43 }
const std::vector< Real > _sto_v
Stoichiometric coefficients for coupled primary species.
const Real _log_k
Equilibrium constant.
ExpressionBuilder::EBTerm pow(const ExpressionBuilder::EBTerm &left, T exponent)
std::vector< const VariableValue * > _vals
Coupled primary species.

Member Data Documentation

const Real AqueousEquilibriumRxnAux::_log_k
protected

Equilibrium constant.

Definition at line 33 of file AqueousEquilibriumRxnAux.h.

Referenced by computeValue().

const std::vector<Real> AqueousEquilibriumRxnAux::_sto_v
protected

Stoichiometric coefficients for coupled primary species.

Definition at line 36 of file AqueousEquilibriumRxnAux.h.

Referenced by computeValue().

std::vector<const VariableValue *> AqueousEquilibriumRxnAux::_vals
protected

Coupled primary species.

Definition at line 39 of file AqueousEquilibriumRxnAux.h.

Referenced by AqueousEquilibriumRxnAux(), and computeValue().


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