www.mooseframework.org
PHAux.C
Go to the documentation of this file.
1 //* This file is part of the MOOSE framework
2 //* https://www.mooseframework.org
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 #include "PHAux.h"
11 
12 registerMooseObject("ChemicalReactionsApp", PHAux);
13 
16 {
18  params.addRequiredCoupledVar("h_conc", "The molar concentration of free H+ ions in solution");
19  params.addCoupledVar("activity_coeff", 1.0, "Activity coefficient of H+. Default is 1");
20  params.addClassDescription("pH of solution");
21  return params;
22 }
23 
24 PHAux::PHAux(const InputParameters & parameters)
25  : AuxKernel(parameters), _hplus(coupledValue("h_conc")), _gamma(coupledValue("activity_coeff"))
26 {
27 }
28 
29 Real
31 {
32  mooseAssert(_gamma[_qp] * _hplus[_qp] > 0.0, "Negative activity in pH is not possible");
33  return -std::log10(_gamma[_qp] * _hplus[_qp]);
34 }
PHAux(const InputParameters &parameters)
Definition: PHAux.C:24
The pH of the solution is defined as.
Definition: PHAux.h:26
const VariableValue & _gamma
Activity coefficient of H+ ions.
Definition: PHAux.h:39
virtual Real computeValue() override
Definition: PHAux.C:30
const VariableValue & _hplus
Free molar concentration of H+ ions.
Definition: PHAux.h:37
void addCoupledVar(const std::string &name, const std::string &doc_string)
void addRequiredCoupledVar(const std::string &name, const std::string &doc_string)
DIE A HORRIBLE DEATH HERE typedef LIBMESH_DEFAULT_SCALAR_TYPE Real
registerMooseObject("ChemicalReactionsApp", PHAux)
static InputParameters validParams()
Definition: PHAux.C:15
void addClassDescription(const std::string &doc_string)
static InputParameters validParams()