From b022ca9ea814effe126b7cd075528b5241da48c7 Mon Sep 17 00:00:00 2001 From: Pierre-Clement Simon Date: Thu, 16 May 2024 17:59:42 -0600 Subject: [PATCH] Enable field variables to be passed in EquilibriumBC and depricate enclosure_scalar_var and replace it with enclosure_var -Edit tests input files --- include/bcs/EquilibriumBC.h | 1 + src/bcs/EquilibriumBC.C | 10 ++++++++-- test/tests/val-2b/val-2b.i | 2 +- test/tests/ver-1a/ver-1a.i | 2 +- 4 files changed, 11 insertions(+), 4 deletions(-) diff --git a/include/bcs/EquilibriumBC.h b/include/bcs/EquilibriumBC.h index e00dd8e7..a9570e6e 100644 --- a/include/bcs/EquilibriumBC.h +++ b/include/bcs/EquilibriumBC.h @@ -30,6 +30,7 @@ class EquilibriumBC : public ADNodalBC const Real _p; /// The enclosure variable + const bool _enclosure_var_bool_scalar; const ADVariableValue & _enclosure_var; /// The temperature (K) diff --git a/src/bcs/EquilibriumBC.C b/src/bcs/EquilibriumBC.C index 3ef34755..43bad765 100644 --- a/src/bcs/EquilibriumBC.C +++ b/src/bcs/EquilibriumBC.C @@ -25,9 +25,13 @@ EquilibriumBC::validParams() "The activation energy $Ea$ for the relationship $C_i = Ko exp{-Ea/RT} P_i^p$ (J/mol)"); params.addParam( "p", 1.0, "The exponent $p$ in the relationship $C_i = Ko exp{-Ea/RT} P_i^p$"); - params.addRequiredCoupledVar( + params.addRequiredCoupledVar("enclosure_var", + "The coupled enclosure variable $P_i$ in the relationship $C_i = Ko " + "exp{-Ea/RT} P_i^p$. Can be a either a field or scalar variable."); + params.addCoupledVar( "enclosure_scalar_var", "The coupled enclosure variable $P_i$ in the relationship $C_i = Ko exp{-Ea/RT} P_i^p$"); + params.deprecateCoupledVar("enclosure_scalar_var", "enclosure_var", "12/30/2024"); params.addRequiredCoupledVar("temperature", "The temperature"); params.addParam( "var_scaling_factor", 1, "The number of atoms that compose our arbitrary unit for quantity"); @@ -39,7 +43,9 @@ EquilibriumBC::EquilibriumBC(const InputParameters & parameters) _Ko(getParam("Ko")), _Ea(getParam("activation_energy")), _p(getParam("p")), - _enclosure_var(adCoupledScalarValue("enclosure_scalar_var")), + _enclosure_var_bool_scalar(isCoupledScalar("enclosure_var")), + _enclosure_var(_enclosure_var_bool_scalar ? adCoupledScalarValue("enclosure_var") + : adCoupledValue("enclosure_var")), _T(adCoupledValue("temperature")), _var_scaling_factor(getParam("var_scaling_factor")) { diff --git a/test/tests/val-2b/val-2b.i b/test/tests/val-2b/val-2b.i index 5e9e135a..58842e2c 100644 --- a/test/tests/val-2b/val-2b.i +++ b/test/tests/val-2b/val-2b.i @@ -140,7 +140,7 @@ scale = 1e20 Ko = 5.0 activation_energy = -77966.2 boundary = left - enclosure_scalar_var = enclosure_pressure + enclosure_var = enclosure_pressure temperature = temp variable = conc_BeO p = 0.5 diff --git a/test/tests/ver-1a/ver-1a.i b/test/tests/ver-1a/ver-1a.i index 21c29f22..bfc655e1 100644 --- a/test/tests/ver-1a/ver-1a.i +++ b/test/tests/ver-1a/ver-1a.i @@ -79,7 +79,7 @@ concentration_to_pressure_conversion_factor = '${fparse kb*temperature*length_un [left] type = EquilibriumBC variable = u - enclosure_scalar_var = v + enclosure_var = v boundary = 'left' Ko = '${solubility_constant}' temperature = ${temperature}