Skip to content

Commit

Permalink
Enable field variables to be passed in EquilibriumBC and depricate en…
Browse files Browse the repository at this point in the history
…closure_scalar_var and replace it with enclosure_var

-Edit tests input files
  • Loading branch information
simopier committed May 17, 2024
1 parent 891986b commit b022ca9
Show file tree
Hide file tree
Showing 4 changed files with 11 additions and 4 deletions.
1 change: 1 addition & 0 deletions include/bcs/EquilibriumBC.h
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down
10 changes: 8 additions & 2 deletions src/bcs/EquilibriumBC.C
Original file line number Diff line number Diff line change
Expand Up @@ -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<Real>(
"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<Real>(
"var_scaling_factor", 1, "The number of atoms that compose our arbitrary unit for quantity");
Expand All @@ -39,7 +43,9 @@ EquilibriumBC::EquilibriumBC(const InputParameters & parameters)
_Ko(getParam<Real>("Ko")),
_Ea(getParam<Real>("activation_energy")),
_p(getParam<Real>("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<Real>("var_scaling_factor"))
{
Expand Down
2 changes: 1 addition & 1 deletion test/tests/val-2b/val-2b.i
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
2 changes: 1 addition & 1 deletion test/tests/ver-1a/ver-1a.i
Original file line number Diff line number Diff line change
Expand Up @@ -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}
Expand Down

0 comments on commit b022ca9

Please sign in to comment.