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

Computes the total concentration of given primary species, including its free concentration and its stoichiometric contribution to all secondary equilibrium species that it is involved in. More...

#include <TotalConcentrationAux.h>

Inheritance diagram for TotalConcentrationAux:
[legend]

Public Member Functions

 TotalConcentrationAux (const InputParameters &parameters)
 

Protected Member Functions

virtual Real computeValue () override
 

Protected Attributes

const VariableValue & _primary_species
 Primary species that this AuxKernel acts on. More...
 
const std::vector< Real > _sto_v
 Stoichiometric coefficients for primary species in coupled secondary species. More...
 
std::vector< const VariableValue * > _secondary_species
 Coupled secondary species concentration. More...
 

Detailed Description

Computes the total concentration of given primary species, including its free concentration and its stoichiometric contribution to all secondary equilibrium species that it is involved in.

Definition at line 22 of file TotalConcentrationAux.h.

Constructor & Destructor Documentation

◆ TotalConcentrationAux()

TotalConcentrationAux::TotalConcentrationAux ( const InputParameters &  parameters)

Definition at line 27 of file TotalConcentrationAux.C.

28  : AuxKernel(parameters),
29  _primary_species(coupledValue("primary_species")),
30  _sto_v(getParam<std::vector<Real>>("sto_v"))
31 {
32  const unsigned int n = coupledComponents("v");
33  _secondary_species.resize(n);
34 
35  for (unsigned int i = 0; i < n; ++i)
36  _secondary_species[i] = &coupledValue("v", i);
37 
38  // Check that the correct number of stoichiometric coefficients have been included
39  if (_sto_v.size() != n)
40  mooseError("The number of stoichiometric coefficients and coupled species must be equal in ",
41  _name);
42 }
const VariableValue & _primary_species
Primary species that this AuxKernel acts on.
std::vector< const VariableValue * > _secondary_species
Coupled secondary species concentration.
const std::vector< Real > _sto_v
Stoichiometric coefficients for primary species in coupled secondary species.

Member Function Documentation

◆ computeValue()

Real TotalConcentrationAux::computeValue ( )
overrideprotectedvirtual

Definition at line 45 of file TotalConcentrationAux.C.

46 {
47  Real total_concentration = _primary_species[_qp];
48 
49  for (unsigned int i = 0; i < _secondary_species.size(); ++i)
50  total_concentration += _sto_v[i] * (*_secondary_species[i])[_qp];
51 
52  return total_concentration;
53 }
const VariableValue & _primary_species
Primary species that this AuxKernel acts on.
std::vector< const VariableValue * > _secondary_species
Coupled secondary species concentration.
const std::vector< Real > _sto_v
Stoichiometric coefficients for primary species in coupled secondary species.

Member Data Documentation

◆ _primary_species

const VariableValue& TotalConcentrationAux::_primary_species
protected

Primary species that this AuxKernel acts on.

Definition at line 31 of file TotalConcentrationAux.h.

Referenced by computeValue().

◆ _secondary_species

std::vector<const VariableValue *> TotalConcentrationAux::_secondary_species
protected

Coupled secondary species concentration.

Definition at line 35 of file TotalConcentrationAux.h.

Referenced by computeValue(), and TotalConcentrationAux().

◆ _sto_v

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

Stoichiometric coefficients for primary species in coupled secondary species.

Definition at line 33 of file TotalConcentrationAux.h.

Referenced by computeValue(), and TotalConcentrationAux().


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