https://mooseframework.inl.gov
Loading...
Searching...
No Matches
PHAux.C
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#include "PHAux.h"
11
12registerMooseObject("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
24PHAux::PHAux(const InputParameters & parameters)
25 : AuxKernel(parameters), _hplus(coupledValue("h_conc")), _gamma(coupledValue("activity_coeff"))
26{
27}
28
29Real
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}
registerMooseObject("ChemicalReactionsApp", PHAux)
static InputParameters validParams()
void addRequiredCoupledVar(const std::string &name, const std::string &doc_string)
void addClassDescription(const std::string &doc_string)
void addCoupledVar(const std::string &name, const std::string &doc_string)
The pH of the solution is defined as.
Definition PHAux.h:27
virtual Real computeValue() override
Definition PHAux.C:30
const VariableValue & _gamma
Activity coefficient of H+ ions.
Definition PHAux.h:39
static InputParameters validParams()
Definition PHAux.C:15
PHAux(const InputParameters &parameters)
Definition PHAux.C:24
const VariableValue & _hplus
Free molar concentration of H+ ions.
Definition PHAux.h:37