From 9cc06178ea9ca26595ed7451fb70042335c403b5 Mon Sep 17 00:00:00 2001 From: Grayson Gall Date: Tue, 19 Dec 2023 23:17:21 -0500 Subject: [PATCH] BCs input parameters have been updated and deprecated for all AD BCs - input parameters were made consistent with issue #223 - secondary electron emmision coefficients were made material and species dependent - secondary electron energy was moved to a BC input parameters - several test inputs were updated in order to facilitate this as well --- include/bcs/EconomouDielectricBC.h | 3 +- include/bcs/ElectronAdvectionDoNothingBC.h | 4 -- include/bcs/ElectronDiffusionDoNothingBC.h | 1 - include/bcs/FieldEmissionBC.h | 21 +++--- include/bcs/HagelaarEnergyAdvectionBC.h | 22 ++++--- include/bcs/HagelaarEnergyBC.h | 2 - include/bcs/LymberopoulosElectronBC.h | 13 ++-- include/bcs/NeumannCircuitVoltageMoles_KV.h | 2 +- .../bcs/SakiyamaEnergySecondaryElectronBC.h | 14 ++-- include/bcs/SakiyamaSecondaryElectronBC.h | 9 +-- include/bcs/SchottkyEmissionBC.h | 21 +++--- include/bcs/SecondaryElectronBC.h | 6 +- include/bcs/SecondaryElectronEnergyBC.h | 9 ++- src/bcs/EconomouDielectricBC.C | 66 ++++++++++++------- src/bcs/ElectronAdvectionDoNothingBC.C | 6 +- src/bcs/ElectronDiffusionDoNothingBC.C | 6 +- src/bcs/ElectronTemperatureDirichletBC.C | 4 +- src/bcs/FieldEmissionBC.C | 54 ++++++++++----- src/bcs/HagelaarElectronBC.C | 5 +- src/bcs/HagelaarEnergyAdvectionBC.C | 59 +++++++++++------ src/bcs/HagelaarEnergyBC.C | 5 +- src/bcs/LymberopoulosElectronBC.C | 27 ++++---- src/bcs/NeumannCircuitVoltageMoles_KV.C | 57 ++++++++++------ src/bcs/SakiyamaElectronDiffusionBC.C | 4 +- src/bcs/SakiyamaEnergyDiffusionBC.C | 4 +- src/bcs/SakiyamaEnergySecondaryElectronBC.C | 38 +++++++---- src/bcs/SakiyamaSecondaryElectronBC.C | 37 ++++++----- src/bcs/SchottkyEmissionBC.C | 51 ++++++++++---- src/bcs/SecondaryElectronBC.C | 40 ++++++----- src/bcs/SecondaryElectronEnergyBC.C | 41 +++++++----- .../1d_dc/NonlocalPotentialBCWithSchottky.i | 1 + test/tests/1d_dc/densities_mean_en.i | 2 + test/tests/1d_dc/mean_en.i | 4 ++ test/tests/1d_dc/mean_en_multi.i | 4 ++ .../DriftDiffusionAction/mean_en_actions.i | 4 ++ .../DriftDiffusionAction/mean_en_no_actions.i | 4 ++ test/tests/Schottky_emission/Example1/Input.i | 2 + test/tests/Schottky_emission/Example2/Input.i | 2 + test/tests/Schottky_emission/Example3/Input.i | 2 + test/tests/Schottky_emission/Example4/Input.i | 1 + .../Schottky_emission/PaschenLaw/Input.i | 2 + .../automatic_differentiation/ad_argon.i | 4 ++ test/tests/crane_action/townsend_units.i | 4 ++ test/tests/field_emission/field_emission.i | 1 + test/tests/reflections/Schottky/Input.i | 2 + .../reflections/Schottky_300_V_5_um/Input.i | 5 ++ .../reflections/Schottky_400_V_10_um/Input.i | 2 + test/tests/reflections/base/Input.i | 2 + test/tests/reflections/high_initial/Input.i | 2 + test/tests/reflections/low_initial/Input.i | 2 + .../DC_argon-With-Water.i | 4 ++ 51 files changed, 438 insertions(+), 249 deletions(-) diff --git a/include/bcs/EconomouDielectricBC.h b/include/bcs/EconomouDielectricBC.h index bfc2193f040..cdbbf18432e 100644 --- a/include/bcs/EconomouDielectricBC.h +++ b/include/bcs/EconomouDielectricBC.h @@ -37,12 +37,13 @@ class EconomouDielectricBC : public ADIntegratedBC std::vector *> _sgnip; std::vector *> _muip; const MaterialProperty & _massem; - Real _user_se_coeff; + std::vector _user_se_coeff; const Real & _epsilon_d; const Real & _thickness; Real _a; ADRealVectorValue _ion_flux; + ADRealVectorValue _temp_flux; ADReal _v_thermal; ADRealVectorValue _em_flux; std::string _potential_units; diff --git a/include/bcs/ElectronAdvectionDoNothingBC.h b/include/bcs/ElectronAdvectionDoNothingBC.h index 75fa18888ae..776755842c1 100644 --- a/include/bcs/ElectronAdvectionDoNothingBC.h +++ b/include/bcs/ElectronAdvectionDoNothingBC.h @@ -29,8 +29,4 @@ class ElectronAdvectionDoNothingBC : public ADIntegratedBC const ADMaterialProperty & _muem; const MaterialProperty & _sign; const ADMaterialProperty & _electric_field; - -private: - // Coupled variables - const ADVariableValue & _mean_en; }; diff --git a/include/bcs/ElectronDiffusionDoNothingBC.h b/include/bcs/ElectronDiffusionDoNothingBC.h index 50e175bd37d..908bf920aab 100644 --- a/include/bcs/ElectronDiffusionDoNothingBC.h +++ b/include/bcs/ElectronDiffusionDoNothingBC.h @@ -27,5 +27,4 @@ class ElectronDiffusionDoNothingBC : public ADIntegratedBC Real _r_units; const ADMaterialProperty & _diffem; - const ADVariableValue & _mean_en; }; diff --git a/include/bcs/FieldEmissionBC.h b/include/bcs/FieldEmissionBC.h index 0cd49a516c0..51d5a119266 100644 --- a/include/bcs/FieldEmissionBC.h +++ b/include/bcs/FieldEmissionBC.h @@ -22,22 +22,23 @@ class FieldEmissionBC : public ADIntegratedBC protected: virtual ADReal computeQpResidual() override; - Real _r_units; - Real _r; + const Real _r_units; + const Real _r; + const unsigned int _num_ions; // Coupled variables - const ADVariableValue & _mean_en; - MooseVariable & _ip_var; - const ADVariableValue & _ip; - const ADVariableGradient & _grad_ip; + + std::vector _ip_var; + std::vector _ip; + std::vector _grad_ip; const ADMaterialProperty & _muem; const MaterialProperty & _massem; const MaterialProperty & _e; - const MaterialProperty & _sgnip; - const ADMaterialProperty & _muip; - const ADMaterialProperty & _Dip; - const MaterialProperty & _se_coeff; + std::vector *> _sgnip; + std::vector *> _muip; + std::vector *> _Dip; + const std::vector _se_coeff; const MaterialProperty & _work_function; const MaterialProperty & _field_enhancement; diff --git a/include/bcs/HagelaarEnergyAdvectionBC.h b/include/bcs/HagelaarEnergyAdvectionBC.h index 05aaa0a4fc3..c1f2b17f998 100644 --- a/include/bcs/HagelaarEnergyAdvectionBC.h +++ b/include/bcs/HagelaarEnergyAdvectionBC.h @@ -24,17 +24,18 @@ class HagelaarEnergyAdvectionBC : public ADIntegratedBC Real _r_units; Real _r; - + const unsigned int _num_ions; // Coupled variables - MooseVariable & _ip_var; - const ADVariableValue & _ip; - const ADVariableGradient & _grad_ip; - - const MaterialProperty & _sgnip; - const ADMaterialProperty & _muip; - const ADMaterialProperty & _Dip; - const MaterialProperty & _se_coeff; - const MaterialProperty & _se_energy; + + std::vector _ip_var; + std::vector _ip; + std::vector _grad_ip; + + std::vector *> _sgnip; + std::vector *> _muip; + std::vector *> _Dip; + const std::vector _se_coeff; + const Real _se_energy; const ADMaterialProperty & _mumean_en; const ADMaterialProperty & _electric_field; @@ -43,4 +44,5 @@ class HagelaarEnergyAdvectionBC : public ADIntegratedBC ADRealVectorValue _ion_flux; Real _v_thermal; Real _n_gamma; + ADReal _bc_val; }; diff --git a/include/bcs/HagelaarEnergyBC.h b/include/bcs/HagelaarEnergyBC.h index daecb05a03b..c7041353066 100644 --- a/include/bcs/HagelaarEnergyBC.h +++ b/include/bcs/HagelaarEnergyBC.h @@ -29,8 +29,6 @@ class HagelaarEnergyBC : public ADIntegratedBC const MaterialProperty & _massem; const MaterialProperty & _e; - const MaterialProperty & _se_coeff; - const MaterialProperty & _se_energy; const ADMaterialProperty & _mumean_en; const ADMaterialProperty & _electric_field; diff --git a/include/bcs/LymberopoulosElectronBC.h b/include/bcs/LymberopoulosElectronBC.h index 2ffd12a918b..d4e1b2bf9a5 100644 --- a/include/bcs/LymberopoulosElectronBC.h +++ b/include/bcs/LymberopoulosElectronBC.h @@ -22,9 +22,10 @@ class LymberopoulosElectronBC : public ADIntegratedBC protected: virtual ADReal computeQpResidual() override; - Real _r_units; - Real _ks; - Real _gamma; + const Real _r_units; + const Real _ks; + const std::vector _gamma; + const unsigned int _num_ions; // Coupled variables std::vector _ion_var; @@ -32,14 +33,8 @@ class LymberopoulosElectronBC : public ADIntegratedBC const ADMaterialProperty & _electric_field; - Real _sign; - std::vector *> _sgnion; std::vector *> _muion; - unsigned int _num_ions; - unsigned int _ip_index; - std::vector::iterator _iter; - ADRealVectorValue _ion_flux; }; diff --git a/include/bcs/NeumannCircuitVoltageMoles_KV.h b/include/bcs/NeumannCircuitVoltageMoles_KV.h index b6a0e511c2e..aa1979300f0 100644 --- a/include/bcs/NeumannCircuitVoltageMoles_KV.h +++ b/include/bcs/NeumannCircuitVoltageMoles_KV.h @@ -34,7 +34,7 @@ class NeumannCircuitVoltageMoles_KV : public ADIntegratedBC const ADVariableValue & _mean_en; const ADVariableValue & _em; - const MaterialProperty & _se_coeff; + const std::vector & _se_coeff; std::vector *> _muip; const MaterialProperty & _eps; const MaterialProperty & _N_A; diff --git a/include/bcs/SakiyamaEnergySecondaryElectronBC.h b/include/bcs/SakiyamaEnergySecondaryElectronBC.h index e7b6e08c5ff..5486d08980f 100644 --- a/include/bcs/SakiyamaEnergySecondaryElectronBC.h +++ b/include/bcs/SakiyamaEnergySecondaryElectronBC.h @@ -22,9 +22,10 @@ class SakiyamaEnergySecondaryElectronBC : public ADIntegratedBC protected: virtual ADReal computeQpResidual() override; - Real _r_units; - bool Te_dependent; - + const Real _r_units; + const bool Te_dependent; + const unsigned int _num_ions; + const std::vector _se_coeff; // Coupled variables const ADVariableValue & _em; std::vector _ip_var; @@ -32,16 +33,11 @@ class SakiyamaEnergySecondaryElectronBC : public ADIntegratedBC std::vector *> _sgnip; std::vector *> _muip; - Real _se_coeff; + Real _user_se_energy; Real _a; ADReal _se_energy; ADRealVectorValue _ion_flux; - - unsigned int _num_ions; - unsigned int _ip_index; - std::vector::iterator _iter; - const ADMaterialProperty & _electric_field; }; diff --git a/include/bcs/SakiyamaSecondaryElectronBC.h b/include/bcs/SakiyamaSecondaryElectronBC.h index 9d701a24853..637636cf940 100644 --- a/include/bcs/SakiyamaSecondaryElectronBC.h +++ b/include/bcs/SakiyamaSecondaryElectronBC.h @@ -22,19 +22,16 @@ class SakiyamaSecondaryElectronBC : public ADIntegratedBC protected: virtual ADReal computeQpResidual() override; - Real _r_units; - + const Real _r_units; + const unsigned int _num_ions; + const std::vector _user_se_coeff; // Coupled variables std::vector _ip; Real _a; ADRealVectorValue _ion_flux; - Real _user_se_coeff; std::vector *> _sgnip; std::vector *> _muip; - - unsigned int _num_ions; - const ADMaterialProperty & _electric_field; }; diff --git a/include/bcs/SchottkyEmissionBC.h b/include/bcs/SchottkyEmissionBC.h index fef78c9d2ad..73884aac6fc 100644 --- a/include/bcs/SchottkyEmissionBC.h +++ b/include/bcs/SchottkyEmissionBC.h @@ -22,22 +22,23 @@ class SchottkyEmissionBC : public ADIntegratedBC protected: virtual ADReal computeQpResidual() override; - Real _r_units; - Real _r; - + const Real _r_units; + const Real _r; + const unsigned int _num_ions; + const std::vector _se_coeff; // Coupled variables const ADVariableValue & _mean_en; - MooseVariable & _ip_var; - const ADVariableValue & _ip; - const ADVariableGradient & _grad_ip; + std::vector _ip_var; + std::vector _ip; + std::vector _grad_ip; + + std::vector *> _sgnip; + std::vector *> _muip; + std::vector *> _Dip; const MaterialProperty & _massem; const MaterialProperty & _e; - const MaterialProperty & _sgnip; - const ADMaterialProperty & _muip; - const ADMaterialProperty & _Dip; - const MaterialProperty & _se_coeff; const MaterialProperty & _work_function; const MaterialProperty & _field_enhancement; const MaterialProperty & _Richardson_coefficient; diff --git a/include/bcs/SecondaryElectronBC.h b/include/bcs/SecondaryElectronBC.h index 0ac38d1d4f9..c4118505c56 100644 --- a/include/bcs/SecondaryElectronBC.h +++ b/include/bcs/SecondaryElectronBC.h @@ -26,7 +26,8 @@ class SecondaryElectronBC : public ADIntegratedBC const Real & _r; const Real & _r_ion; const MaterialProperty & _kb; - + const unsigned int _num_ions; + const std::vector _se_coeff; // Coupled variables const ADVariableValue & _mean_en; std::vector _ip; @@ -39,7 +40,6 @@ class SecondaryElectronBC : public ADIntegratedBC std::vector *> _muip; std::vector *> _Tip; std::vector *> _massip; - const MaterialProperty & _se_coeff; const ADMaterialProperty & _electric_field; @@ -48,6 +48,4 @@ class SecondaryElectronBC : public ADIntegratedBC ADReal _v_thermal; ADReal _ion_flux; ADReal _n_gamma; - - unsigned int _num_ions; }; diff --git a/include/bcs/SecondaryElectronEnergyBC.h b/include/bcs/SecondaryElectronEnergyBC.h index 3515afe3d7f..c285da38a7f 100644 --- a/include/bcs/SecondaryElectronEnergyBC.h +++ b/include/bcs/SecondaryElectronEnergyBC.h @@ -26,7 +26,8 @@ class SecondaryElectronEnergyBC : public ADIntegratedBC const Real & _r; const Real & _r_ion; const MaterialProperty & _kb; - + const unsigned int _num_ions; + const std::vector & _se_coeff; // Coupled variables const ADVariableValue & _em; std::vector _ip; @@ -39,8 +40,8 @@ class SecondaryElectronEnergyBC : public ADIntegratedBC std::vector *> _muip; std::vector *> _Tip; std::vector *> _massip; - const MaterialProperty & _se_coeff; - const MaterialProperty & _se_energy; + + const Real & _se_energy; const ADMaterialProperty & _mumean_en; const ADMaterialProperty & _electric_field; @@ -50,6 +51,4 @@ class SecondaryElectronEnergyBC : public ADIntegratedBC ADReal _v_thermal; ADReal _ion_flux; ADReal _n_gamma; - - unsigned int _num_ions; }; diff --git a/src/bcs/EconomouDielectricBC.C b/src/bcs/EconomouDielectricBC.C index f77791ad32d..2f45b020f6f 100644 --- a/src/bcs/EconomouDielectricBC.C +++ b/src/bcs/EconomouDielectricBC.C @@ -19,13 +19,29 @@ EconomouDielectricBC::validParams() params.addRequiredParam("dielectric_constant", "The dielectric constant of the material."); params.addRequiredParam("thickness", "The thickness of the material."); params.addRequiredParam("position_units", "Units of position."); + params.addRequiredCoupledVar("mean_en", "The mean energy."); + params.deprecateCoupledVar("mean_en", "electron_energy", "06/01/2024"); params.addRequiredCoupledVar("em", "The electron density."); + params.deprecateCoupledVar("em", "electrons", "06/01/2024"); params.addRequiredCoupledVar("ip", "The ion density."); + params.deprecateCoupledVar("ip", "ions", "06/01/2024"); params.addRequiredCoupledVar("potential_ion", "The ion potential"); - params.addParam("users_gamma", - "A secondary electron emission coeff. only used for this BC."); + params.deprecateCoupledVar("potential_ion", "ion_potentials", "06/01/2024"); + params.addParam>("users_gamma", + "A secondary electron emission coeff. only used for this BC."); + params.deprecateParam("users_gamma", "emission_coeffs", "06/01/2024"); + + params.addRequiredCoupledVar("electron_energy", "The mean electron energy density. In log form"); + params.addRequiredCoupledVar("electrons", "The electron density in log form"); + params.addRequiredCoupledVar("ions", "A list of ion densities in log form"); + params.addRequiredCoupledVar("ion_potentials", + "The effective potential for each ion provided in 'ions'"); + params.addParam>( + "emission_coeffs", + "The seconday electron emmision coefficient for each ion provided in `ions`"); params.addRequiredParam("potential_units", "The potential units."); + params.addClassDescription("Dielectric boundary condition" "(Based on DOI: https://doi.org/10.1116/1.579300)"); return params; @@ -35,19 +51,20 @@ EconomouDielectricBC::EconomouDielectricBC(const InputParameters & parameters) : ADIntegratedBC(parameters), _r_units(1. / getParam("position_units")), - _mean_en(adCoupledValue("mean_en")), - _em(adCoupledValue("em")), + _mean_en(adCoupledValue("electron_energy")), + _em(adCoupledValue("electrons")), _grad_u_dot(_var.gradSlnDot()), // TODO: make an AD version of this in MOOSE _u_dot(_var.adUDot()), _e(getMaterialProperty("e")), _massem(getMaterialProperty("massem")), - _user_se_coeff(getParam("users_gamma")), + _user_se_coeff(getParam>("emission_coeffs")), _epsilon_d(getParam("dielectric_constant")), _thickness(getParam("thickness")), _a(0.5), _ion_flux(0, 0, 0), + _temp_flux(0, 0, 0), _v_thermal(0), _em_flux(0, 0, 0), _potential_units(getParam("potential_units")) @@ -58,7 +75,7 @@ EconomouDielectricBC::EconomouDielectricBC(const InputParameters & parameters) else if (_potential_units.compare("kV") == 0) _voltage_scaling = 1000; - _num_ions = coupledComponents("ip"); + _num_ions = coupledComponents("ions"); _ip.resize(_num_ions); _ip_var.resize(_num_ions); @@ -75,39 +92,44 @@ EconomouDielectricBC::EconomouDielectricBC(const InputParameters & parameters) // // 2. There are no effective potentials, and potential_ion = potential. If so, ensure // potential_ion is still same size as _ip. - if (coupledComponents("potential_ion") != _num_ions) + if (coupledComponents("ion_potentials") != _num_ions) { - if ((coupledComponents("potential_ion") == 1) && - (getVar("potential_ion", 0)->number() == _var.number())) + if ((coupledComponents("ion_potentials") == 1) && + (getVar("ion_potentials", 0)->number() == _var.number())) { fill_potential_vector = true; } else { mooseError( - "EconomouDielectricBC: ip and potential_ion vectors are not same length. There are two " + "EconomouDielectricBC: `ion` and `ion_potentials` vectors are not same length. There are " + "two " "possible options: \n 1) Ions respond to an effective potential. If so, make sure each " "ion has an associated effective potential. \n 2) Ions and electrons respond to the same " "potential. If so, set potential_ion equal to this potential.\n"); } + + if (_user_se_coeff.size() != _num_ions) + mooseError( + "EconomouDielectricBC: The lengths of `ions` and `emission_coeffs` must be the same"); } for (unsigned int i = 0; i < _num_ions; ++i) { - _ip_var[i] = getVar("ip", i); - _ip[i] = &adCoupledValue("ip", i); - _muip[i] = &getADMaterialProperty("mu" + (*getVar("ip", i)).name()); - _sgnip[i] = &getMaterialProperty("sgn" + (*getVar("ip", i)).name()); + _ip_var[i] = getVar("ions", i); + _ip[i] = &adCoupledValue("ions", i); + _muip[i] = &getADMaterialProperty("mu" + (*getVar("ions", i)).name()); + _sgnip[i] = &getMaterialProperty("sgn" + (*getVar("ions", i)).name()); if (fill_potential_vector) { - _potential_ion[i] = &adCoupledValue("potential_ion", 0); - _grad_potential_ion[i] = &adCoupledGradient("potential_ion", 0); + _potential_ion[i] = &adCoupledValue("ion_potentials", 0); + _grad_potential_ion[i] = &adCoupledGradient("ion_potentials", 0); } else { - _potential_ion[i] = &adCoupledValue("potential_ion", i); - _grad_potential_ion[i] = &adCoupledGradient("potential_ion", i); + _potential_ion[i] = &adCoupledValue("ion_potentials", i); + _grad_potential_ion[i] = &adCoupledGradient("ion_potentials", i); } } } @@ -126,16 +148,16 @@ EconomouDielectricBC::computeQpResidual() { _a = 0.0; } - - _ion_flux += _a * (*_sgnip[i])[_qp] * (*_muip[i])[_qp] * -(*_grad_potential_ion[i])[_qp] * + _temp_flux = _a * (*_sgnip[i])[_qp] * (*_muip[i])[_qp] * -(*_grad_potential_ion[i])[_qp] * _r_units * std::exp((*_ip[i])[_qp]); + _ion_flux += _temp_flux; + _em_flux -= _user_se_coeff[i] * _temp_flux; } _v_thermal = std::sqrt(8 * _e[_qp] * 2.0 / 3 * std::exp(_mean_en[_qp] - _em[_qp]) / (M_PI * _massem[_qp])); - _em_flux = - (0.25 * _v_thermal * std::exp(_em[_qp]) * _normals[_qp]) - (_user_se_coeff * _ion_flux); + _em_flux += (0.25 * _v_thermal * std::exp(_em[_qp]) * _normals[_qp]); return _test[_i][_qp] * _r_units * ((_thickness / _epsilon_d) * _e[_qp] * 6.022e23 * (_ion_flux - _em_flux) * _normals[_qp] / diff --git a/src/bcs/ElectronAdvectionDoNothingBC.C b/src/bcs/ElectronAdvectionDoNothingBC.C index 006ab12129f..46d51eaf9fe 100644 --- a/src/bcs/ElectronAdvectionDoNothingBC.C +++ b/src/bcs/ElectronAdvectionDoNothingBC.C @@ -16,7 +16,6 @@ InputParameters ElectronAdvectionDoNothingBC::validParams() { InputParameters params = ADIntegratedBC::validParams(); - params.addRequiredCoupledVar("mean_en", "The log of the mean energy."); params.addRequiredParam("position_units", "The units of position."); params.addParam("field_property_name", "field_solver_interface_property", @@ -35,10 +34,7 @@ ElectronAdvectionDoNothingBC::ElectronAdvectionDoNothingBC(const InputParameters _sign(getMaterialProperty("sgnem")), _electric_field( - getADMaterialProperty(getParam("field_property_name"))), - - // Coupled variables - _mean_en(adCoupledValue("mean_en")) + getADMaterialProperty(getParam("field_property_name"))) { } diff --git a/src/bcs/ElectronDiffusionDoNothingBC.C b/src/bcs/ElectronDiffusionDoNothingBC.C index 605d004bbc8..510354b9c02 100644 --- a/src/bcs/ElectronDiffusionDoNothingBC.C +++ b/src/bcs/ElectronDiffusionDoNothingBC.C @@ -16,8 +16,6 @@ InputParameters ElectronDiffusionDoNothingBC::validParams() { InputParameters params = ADIntegratedBC::validParams(); - params.addRequiredCoupledVar("mean_en", - "The log of the product of mean energy times electron density."); params.addRequiredParam("position_units", "Units of position"); params.addClassDescription("Boundary condition where the election diffusion flux at the boundary " "is equal to the bulk election diffusion equation"); @@ -31,9 +29,7 @@ ElectronDiffusionDoNothingBC::ElectronDiffusionDoNothingBC(const InputParameters _r_units(1. / getParam("position_units")), - _diffem(getADMaterialProperty("diffem")), - - _mean_en(adCoupledValue("mean_en")) + _diffem(getADMaterialProperty("diffem")) { } diff --git a/src/bcs/ElectronTemperatureDirichletBC.C b/src/bcs/ElectronTemperatureDirichletBC.C index 704cd60a6d1..8e44077e4fd 100644 --- a/src/bcs/ElectronTemperatureDirichletBC.C +++ b/src/bcs/ElectronTemperatureDirichletBC.C @@ -18,6 +18,8 @@ ElectronTemperatureDirichletBC::validParams() InputParameters params = ADNodalBC::validParams(); params.addRequiredParam("value", "Value of the BC"); params.addRequiredCoupledVar("em", "The electron density."); + params.deprecateCoupledVar("em", "electrons", "06/01/2024"); + params.addRequiredCoupledVar("electrons", "The electron density in log form"); params.addParam("penalty_value", 1.0, "The penalty value for the Dirichlet BC."); params.addClassDescription("Electron temperature boundary condition"); return params; @@ -25,7 +27,7 @@ ElectronTemperatureDirichletBC::validParams() ElectronTemperatureDirichletBC::ElectronTemperatureDirichletBC(const InputParameters & parameters) : ADNodalBC(parameters), - _em(adCoupledValue("em")), + _em(adCoupledValue("electrons")), _value(getParam("value")), _penalty_value(getParam("penalty_value")) { diff --git a/src/bcs/FieldEmissionBC.C b/src/bcs/FieldEmissionBC.C index 2ab0ed3b149..3048bb95f30 100644 --- a/src/bcs/FieldEmissionBC.C +++ b/src/bcs/FieldEmissionBC.C @@ -17,8 +17,12 @@ FieldEmissionBC::validParams() { InputParameters params = ADIntegratedBC::validParams(); params.addRequiredParam("r", "The reflection coefficient"); - params.addRequiredCoupledVar("mean_en", "The mean energy."); params.addRequiredCoupledVar("ip", "The ion density."); + params.deprecateCoupledVar("ip", "ions", "06/01/2024"); + params.addRequiredCoupledVar("ions", "A list of ion densities in log form"); + params.addRequiredParam>( + "emission_coeffs", + "The species dependent secondary electron emmision coefficients for this boundary"); params.addRequiredParam("position_units", "Units of position."); params.addRequiredParam("potential_units", "The potential units."); params.addParam("tau", 1e-9, "The time constant for ramping the boundary condition."); @@ -34,20 +38,12 @@ FieldEmissionBC::FieldEmissionBC(const InputParameters & parameters) _r_units(1. / getParam("position_units")), _r(getParam("r")), - - // Coupled Variables - _mean_en(adCoupledValue("mean_en")), - _ip_var(*getVar("ip", 0)), - _ip(adCoupledValue("ip")), - _grad_ip(adCoupledGradient("ip")), + _num_ions(coupledComponents("ip")), _muem(getADMaterialProperty("muem")), _massem(getMaterialProperty("massem")), _e(getMaterialProperty("e")), - _sgnip(getMaterialProperty("sgn" + _ip_var.name())), - _muip(getADMaterialProperty("mu" + _ip_var.name())), - _Dip(getADMaterialProperty("diff" + _ip_var.name())), - _se_coeff(getMaterialProperty("se_coeff")), + _se_coeff(getParam>("emission_coeffs")), _work_function(getMaterialProperty("work_function")), _field_enhancement(getMaterialProperty("field_enhancement")), @@ -60,6 +56,10 @@ FieldEmissionBC::FieldEmissionBC(const InputParameters & parameters) _relax(getParam("relax")), _potential_units(getParam("potential_units")) { + + if (_se_coeff.size() != _num_ions) + mooseError("FieldEmissionBC: The lengths of `ions` and `emission_coeffs` must be the same"); + if (_potential_units.compare("V") == 0) { _voltage_scaling = 1.; @@ -70,8 +70,25 @@ FieldEmissionBC::FieldEmissionBC(const InputParameters & parameters) } FE_a = 1.541434E-6 * std::pow(_voltage_scaling, 2); // A eV/kV^2 (if _voltage_scaling == 1000) - FE_b = 6.830890E9 / _voltage_scaling; // kV/m-eV^1.5 (if _voltage_scaling == 1000) - FE_c = 1.439964E-9 * _voltage_scaling; // eV^2*m/kV (if _voltage_scaling == 1000) + FE_b = 6.830890E9 / _voltage_scaling; // kV/m-eV^1.5 (if _voltage_scaling == 1000) + FE_c = 1.439964E-9 * _voltage_scaling; // eV^2*m/kV (if _voltage_scaling == 1000) + + _ip.resize(_num_ions); + _ip_var.resize(_num_ions); + _grad_ip.resize(_num_ions); + _sgnip.resize(_num_ions); + _muip.resize(_num_ions); + _Dip.resize(_num_ions); + + for (unsigned int i = 0; i < _num_ions; ++i) + { + _ip_var[i] = getVar("ions", i); + _ip[i] = &adCoupledValue("ions", i); + _grad_ip[i] = &adCoupledGradient("ions", i); + _sgnip[i] = &getMaterialProperty("sgn" + (*getVar("ions", i)).name()); + _muip[i] = &getADMaterialProperty("mu" + (*getVar("ions", i)).name()); + _Dip[i] = &getADMaterialProperty("diff" + (*getVar("ions", i)).name()); + } } ADReal @@ -93,8 +110,14 @@ FieldEmissionBC::computeQpResidual() { _a = 0.0; - _ion_flux = _sgnip[_qp] * _muip[_qp] * _electric_field[_qp] * _r_units * std::exp(_ip[_qp]) - - _Dip[_qp] * std::exp(_ip[_qp]) * _grad_ip[_qp] * _r_units; + for (auto i = 0; i < _num_ions; ++i) + { + + _ion_flux = (*_sgnip[i])[_qp] * (*_muip[i])[_qp] * _electric_field[_qp] * _r_units * + std::exp((*_ip[i])[_qp]) - + (*_Dip[i])[_qp] * std::exp((*_ip[i])[_qp]) * (*_grad_ip[i])[_qp] * _r_units; + jSE += _e[_qp] * 6.02E23 * _normals[_qp] * _se_coeff[i] * _ion_flux; + } // Fowler-Nordheim // jFE = (a / wf) * F^2 * exp(-v(f) * b * wf^1.5 / F) @@ -111,7 +134,6 @@ FieldEmissionBC::computeQpResidual() jFE = (FE_a / (_work_function[_qp])) * std::pow(F, 2) * std::exp(-v * FE_b * std::pow(_work_function[_qp], 1.5) / F); - jSE = _e[_qp] * 6.02E23 * _se_coeff[_qp] * _ion_flux * _normals[_qp]; if (_relax == true) _relaxation_Expr = std::tanh(_t / _tau); diff --git a/src/bcs/HagelaarElectronBC.C b/src/bcs/HagelaarElectronBC.C index 042ac6513d9..326a2583809 100644 --- a/src/bcs/HagelaarElectronBC.C +++ b/src/bcs/HagelaarElectronBC.C @@ -18,6 +18,9 @@ HagelaarElectronBC::validParams() InputParameters params = ADIntegratedBC::validParams(); params.addRequiredParam("r", "The reflection coefficient"); params.addRequiredCoupledVar("mean_en", "The mean energy."); + params.deprecateCoupledVar("mean_en", "electron_energy", "06/01/2024"); + params.addRequiredCoupledVar("electron_energy", "The mean electron energy density in log form"); + params.addRequiredParam("position_units", "Units of position."); params.addParam("field_property_name", "field_solver_interface_property", @@ -33,7 +36,7 @@ HagelaarElectronBC::HagelaarElectronBC(const InputParameters & parameters) _r(getParam("r")), // Coupled Variables - _mean_en(adCoupledValue("mean_en")), + _mean_en(adCoupledValue("electron_energy")), _muem(getADMaterialProperty("muem")), _massem(getMaterialProperty("massem")), diff --git a/src/bcs/HagelaarEnergyAdvectionBC.C b/src/bcs/HagelaarEnergyAdvectionBC.C index 3fb77d65b7d..eae1a5160cb 100644 --- a/src/bcs/HagelaarEnergyAdvectionBC.C +++ b/src/bcs/HagelaarEnergyAdvectionBC.C @@ -18,10 +18,16 @@ HagelaarEnergyAdvectionBC::validParams() InputParameters params = ADIntegratedBC::validParams(); params.addRequiredParam("r", "The reflection coefficient"); params.addRequiredCoupledVar("ip", "The ion density."); + params.deprecateCoupledVar("ip", "ions", "06/01/2024"); + params.addRequiredCoupledVar("ions", "A list of ion densities in log form"); + params.addRequiredParam>( + "emission_coeffs", + "The species dependent secondary electron emmision coefficients for this boundary"); params.addRequiredParam("position_units", "Units of position."); params.addParam("field_property_name", "field_solver_interface_property", "Name of the solver interface material property."); + params.addRequiredParam("secondary_electron_energy", "The secondary electron energy in eV"); params.addClassDescription("Kinetic advective electron energy boundary condition" "(Based on DOI:https://doi.org/10.1063/1.2715745)"); return params; @@ -32,17 +38,10 @@ HagelaarEnergyAdvectionBC::HagelaarEnergyAdvectionBC(const InputParameters & par _r_units(1. / getParam("position_units")), _r(getParam("r")), - + _num_ions(coupledComponents("ions")), // Coupled Variables - _ip_var(*getVar("ip", 0)), - _ip(adCoupledValue("ip")), - _grad_ip(adCoupledGradient("ip")), - - _sgnip(getMaterialProperty("sgn" + _ip_var.name())), - _muip(getADMaterialProperty("mu" + _ip_var.name())), - _Dip(getADMaterialProperty("diff" + _ip_var.name())), - _se_coeff(getMaterialProperty("se_coeff")), - _se_energy(getMaterialProperty("se_energy")), + _se_coeff(getParam>("emission_coeffs")), + _se_energy(getParam("secondary_electron_energy")), _mumean_en(getADMaterialProperty("mumean_en")), _electric_field( @@ -51,13 +50,32 @@ HagelaarEnergyAdvectionBC::HagelaarEnergyAdvectionBC(const InputParameters & par _a(0.5), _ion_flux(0, 0, 0), _v_thermal(0), - _n_gamma(0) + _n_gamma(0), + _bc_val(0) { + _ip.resize(_num_ions); + _ip_var.resize(_num_ions); + _grad_ip.resize(_num_ions); + _sgnip.resize(_num_ions); + _muip.resize(_num_ions); + _Dip.resize(_num_ions); + + for (unsigned int i = 0; i < _num_ions; ++i) + { + _ip_var[i] = getVar("ions", i); + _ip[i] = &adCoupledValue("ions", i); + _grad_ip[i] = &adCoupledGradient("ions", i); + _sgnip[i] = &getMaterialProperty("sgn" + (*getVar("ions", i)).name()); + _muip[i] = &getADMaterialProperty("mu" + (*getVar("ions", i)).name()); + _Dip[i] = &getADMaterialProperty("diff" + (*getVar("ions", i)).name()); + } } ADReal HagelaarEnergyAdvectionBC::computeQpResidual() { + // reset this value just to be safe + _bc_val = 0; if (_normals[_qp] * -1.0 * _electric_field[_qp] > 0.0) { _a = 1.0; @@ -67,14 +85,17 @@ HagelaarEnergyAdvectionBC::computeQpResidual() _a = 0.0; } - _ion_flux = _sgnip[_qp] * _muip[_qp] * _electric_field[_qp] * _r_units * std::exp(_ip[_qp]) - - _Dip[_qp] * std::exp(_ip[_qp]) * _grad_ip[_qp] * _r_units; + for (auto i = 0; i < _num_ions; ++i) + { + _ion_flux = (*_sgnip[i])[_qp] * (*_muip[i])[_qp] * _electric_field[_qp] * _r_units * + std::exp((*_ip[i])[_qp]) - + (*_Dip[i])[_qp] * std::exp((*_ip[i])[_qp]) * (*_grad_ip[i])[_qp] * _r_units; + _bc_val += 10. * _ion_flux * _normals[_qp] * _se_energy * _se_coeff[i] * (_a - 1.) * (_r + 1.); + } return _test[_i][_qp] * _r_units / (6. * (_r + 1.)) * - (10. * _ion_flux * _normals[_qp] * _se_energy[_qp] * _se_coeff[_qp] * (_a - 1.) * - (_r + 1.) + - (_r - 1.) * (std::exp(_u[_qp]) - _se_energy[_qp] * _n_gamma) * - (6. * _electric_field[_qp] * _r_units * _normals[_qp] * _mumean_en[_qp] * - (2. * _a - 1.) - - 5. * _v_thermal)); + (_bc_val + (_r - 1.) * (std::exp(_u[_qp]) - _se_energy * _n_gamma) * + (6. * _electric_field[_qp] * _r_units * _normals[_qp] * _mumean_en[_qp] * + (2. * _a - 1.) - + 5. * _v_thermal)); } diff --git a/src/bcs/HagelaarEnergyBC.C b/src/bcs/HagelaarEnergyBC.C index 562b08bbcdd..1f65db89bbb 100644 --- a/src/bcs/HagelaarEnergyBC.C +++ b/src/bcs/HagelaarEnergyBC.C @@ -18,6 +18,8 @@ HagelaarEnergyBC::validParams() InputParameters params = ADIntegratedBC::validParams(); params.addRequiredParam("r", "The reflection coefficient"); params.addRequiredCoupledVar("em", "The electron density."); + params.deprecateCoupledVar("em", "electrons", "06/01/2024"); + params.addRequiredCoupledVar("electrons", "The electron density in log form"); params.addRequiredParam("position_units", "Units of position."); params.addParam("field_property_name", "field_solver_interface_property", @@ -35,10 +37,7 @@ HagelaarEnergyBC::HagelaarEnergyBC(const InputParameters & parameters) _massem(getMaterialProperty("massem")), _e(getMaterialProperty("e")), - _se_coeff(getMaterialProperty("se_coeff")), - _se_energy(getMaterialProperty("se_energy")), _mumean_en(getADMaterialProperty("mumean_en")), - _electric_field( getADMaterialProperty(getParam("field_property_name"))) { diff --git a/src/bcs/LymberopoulosElectronBC.C b/src/bcs/LymberopoulosElectronBC.C index c8ad39f9aa8..ad4ef60a87c 100644 --- a/src/bcs/LymberopoulosElectronBC.C +++ b/src/bcs/LymberopoulosElectronBC.C @@ -17,8 +17,14 @@ LymberopoulosElectronBC::validParams() { InputParameters params = ADIntegratedBC::validParams(); params.addRequiredParam("ks", "The recombination coefficient"); - params.addRequiredParam("gamma", "The secondary electron coefficient"); + params.addRequiredParam>("gamma", "The secondary electron coefficient"); + params.deprecateParam("gamma", "emission_coeffs", "06/01/2024"); + params.addRequiredParam>( + "emission_coeffs", "The species dependent secondary electron emmision coefficients"); params.addRequiredCoupledVar("ion", "The ion density."); + params.deprecateCoupledVar("ion", "ions", "06/01/2024"); + params.addRequiredCoupledVar("ions", "A list of ion densities in log form"); + params.addRequiredParam("position_units", "Units of position."); params.addParam("field_property_name", "field_solver_interface_property", @@ -33,14 +39,12 @@ LymberopoulosElectronBC::LymberopoulosElectronBC(const InputParameters & paramet _r_units(1. / getParam("position_units")), _ks(getParam("ks")), - _gamma(getParam("gamma")), - - _electric_field(getADMaterialProperty(getParam("field_property_name"))), - - _sign(1) + _gamma(getParam>("emission_coeffs")), + _num_ions(coupledComponents("ions")), + // Coupled Variables + _electric_field( + getADMaterialProperty(getParam("field_property_name"))) { - _num_ions = coupledComponents("ion"); - // Resize the vectors to store _num_ions values: _ion.resize(_num_ions); _ion_var.resize(_num_ions); @@ -67,11 +71,10 @@ LymberopoulosElectronBC::computeQpResidual() _ion_flux.zero(); for (unsigned int i = 0; i < _num_ions; ++i) { - _ion_flux += (*_sgnion[i])[_qp] * (*_muion[i])[_qp] * _electric_field[_qp] * _r_units * - std::exp((*_ion[i])[_qp]); + _ion_flux += _gamma[i] * (*_sgnion[i])[_qp] * (*_muion[i])[_qp] * _electric_field[_qp] * + _r_units * std::exp((*_ion[i])[_qp]); } return _test[_i][_qp] * _r_units * - (_sign * _ks * std::exp(_u[_qp]) * _normals[_qp] * _normals[_qp] - - _gamma * _ion_flux * _normals[_qp]); + (_ks * std::exp(_u[_qp]) * _normals[_qp] * _normals[_qp] - _ion_flux * _normals[_qp]); } diff --git a/src/bcs/NeumannCircuitVoltageMoles_KV.C b/src/bcs/NeumannCircuitVoltageMoles_KV.C index 02322f74a94..122e9de51ef 100644 --- a/src/bcs/NeumannCircuitVoltageMoles_KV.C +++ b/src/bcs/NeumannCircuitVoltageMoles_KV.C @@ -23,10 +23,23 @@ NeumannCircuitVoltageMoles_KV::validParams() params.addRequiredParam( "data_provider", "The name of the UserObject that can provide some data to materials, bcs, etc."); + params.addRequiredCoupledVar("ip", "The ion density."); + params.deprecateCoupledVar("ip", "ions", "06/01/2024"); + params.addRequiredCoupledVar("ions", "A list of ion densities in log-molar form"); + params.addRequiredCoupledVar("em", "The log of the electron density."); + params.deprecateCoupledVar("em", "electrons", "06/01/2024"); + params.addRequiredCoupledVar("electrons", "The electron density in log form"); + params.addRequiredCoupledVar( "mean_en", "The log of the product of the mean energy and the electron density."); + params.deprecateCoupledVar("mean_en", "electron_energy", "06/01/2024"); + params.addRequiredCoupledVar("electron_energy", "The mean electron energy density in log form"); + + params.addRequiredParam>( + "emission_coeffs", + "The seconday electron emmision coefficient for each ion provided in `ions`"); params.addRequiredParam("potential_units", "The potential units."); params.addRequiredParam("r", "The reflection coefficient applied to both electrons and ions"); @@ -40,9 +53,9 @@ NeumannCircuitVoltageMoles_KV::NeumannCircuitVoltageMoles_KV(const InputParamete _r_units(1. / getParam("position_units")), _V_bat(getFunction("function")), _data(getUserObject("data_provider")), - _mean_en(adCoupledValue("mean_en")), - _em(adCoupledValue("em")), - _se_coeff(getMaterialProperty("se_coeff")), + _mean_en(adCoupledValue("electron_energy")), + _em(adCoupledValue("electrons")), + _se_coeff(getParam>("emission_coeffs")), _eps(getMaterialProperty("eps")), _N_A(getMaterialProperty("N_A")), _muem(getADMaterialProperty("muem")), @@ -69,8 +82,11 @@ NeumannCircuitVoltageMoles_KV::NeumannCircuitVoltageMoles_KV(const InputParamete // First we need to initialize all of the ion densities and material properties. // Find the number of ions coupled into this BC: - _num_ions = coupledComponents("ip"); + _num_ions = coupledComponents("ions"); + if (_se_coeff.size() != _num_ions) + mooseError("NeumannCircuitVoltageMoles_KV: The lengths of `ions` and `emission_coeffs` must be " + "the same"); // Resize the vectors to store _num_ions values: _ip.resize(_num_ions); _grad_ip.resize(_num_ions); @@ -87,13 +103,13 @@ NeumannCircuitVoltageMoles_KV::NeumannCircuitVoltageMoles_KV(const InputParamete // refers to a single ion species. for (unsigned int i = 0; i < _ip.size(); ++i) { - _ip[i] = &adCoupledValue("ip", i); + _ip[i] = &adCoupledValue("ions", i); _grad_ip[i] = &adCoupledGradient("ip", i); - _T_heavy[i] = &getADMaterialProperty("T" + (*getVar("ip", i)).name()); - _muip[i] = &getADMaterialProperty("mu" + (*getVar("ip", i)).name()); - _Dip[i] = &getADMaterialProperty("diff" + (*getVar("ip", i)).name()); - _sgnip[i] = &getMaterialProperty("sgn" + (*getVar("ip", i)).name()); - _mass[i] = &getMaterialProperty("mass" + (*getVar("ip", i)).name()); + _T_heavy[i] = &getADMaterialProperty("T" + (*getVar("ions", i)).name()); + _muip[i] = &getADMaterialProperty("mu" + (*getVar("ions", i)).name()); + _Dip[i] = &getADMaterialProperty("diff" + (*getVar("ions", i)).name()); + _sgnip[i] = &getMaterialProperty("sgn" + (*getVar("ions", i)).name()); + _mass[i] = &getMaterialProperty("mass" + (*getVar("ions", i)).name()); } } @@ -117,16 +133,19 @@ NeumannCircuitVoltageMoles_KV::computeQpResidual() _ion_drift = 0; for (unsigned int i = 0; i < _num_ions; ++i) { - _ion_flux += - (*_sgnip[i])[_qp] * (*_muip[i])[_qp] * -_grad_u[_qp] * _r_units * std::exp((*_ip[i])[_qp]) - - (*_Dip[i])[_qp] * std::exp((*_ip[i])[_qp]) * (*_grad_ip[i])[_qp] * _r_units; + _ion_flux += _se_coeff[i] * + ((*_sgnip[i])[_qp] * (*_muip[i])[_qp] * -_grad_u[_qp] * _r_units * + std::exp((*_ip[i])[_qp]) - + (*_Dip[i])[_qp] * std::exp((*_ip[i])[_qp]) * (*_grad_ip[i])[_qp] * _r_units); - _secondary_ion += std::exp((*_ip[i])[_qp]) * (*_muip[i])[_qp]; + _secondary_ion += + (-1. + (-1. + _a) * _se_coeff[i]) * std::exp((*_ip[i])[_qp]) * (*_muip[i])[_qp]; - _ion_drift += std::sqrt(8 * _kb[_qp] * (*_T_heavy[i])[_qp] / (M_PI * (*_mass[i])[_qp])) * + _ion_drift += (-1. + (-1. + _a) * _se_coeff[i]) * + std::sqrt(8 * _kb[_qp] * (*_T_heavy[i])[_qp] / (M_PI * (*_mass[i])[_qp])) * std::exp((*_ip[i])[_qp]); } - _n_gamma = (1. - _a) * _se_coeff[_qp] * _ion_flux * _normals[_qp] / + _n_gamma = (1. - _a) * _ion_flux * _normals[_qp] / (_muem[_qp] * -_grad_u[_qp] * _r_units * _normals[_qp]); _v_e_th = std::sqrt(8 * _data.coulomb_charge() * 2.0 / 3 * std::exp(_mean_en[_qp] - _em[_qp]) / @@ -136,12 +155,10 @@ NeumannCircuitVoltageMoles_KV::computeQpResidual() (-2. * (1. + _r) * _u[_qp] - 2. * (1. + _r) * -_V_bat.value(_t, _q_point[_qp]) + _data.electrode_area() * _data.coulomb_charge() * _data.ballast_resist() / _voltage_scaling * (-1. + _r) * - ((-1. + (-1. + _a) * _se_coeff[_qp]) * _N_A[_qp] * _ion_drift + - _N_A[_qp] * (std::exp(_em[_qp]) - _n_gamma) * _v_e_th)) / + (_N_A[_qp] * _ion_drift + _N_A[_qp] * (std::exp(_em[_qp]) - _n_gamma) * _v_e_th)) / (2. * _data.electrode_area() * _data.coulomb_charge() * ((-1. + 2. * _a) * _muem[_qp] / _voltage_scaling * _N_A[_qp] * (std::exp(_em[_qp]) - _n_gamma) - - (-1. + 2. * _b) * (-1. + (-1. + _a) * _se_coeff[_qp]) * _secondary_ion / - _voltage_scaling * _N_A[_qp]) * + (-1. + 2. * _b) * _secondary_ion / _voltage_scaling * _N_A[_qp]) * _data.ballast_resist() * (-1. + _r)); } diff --git a/src/bcs/SakiyamaElectronDiffusionBC.C b/src/bcs/SakiyamaElectronDiffusionBC.C index eee0c96c180..244be0f13c2 100644 --- a/src/bcs/SakiyamaElectronDiffusionBC.C +++ b/src/bcs/SakiyamaElectronDiffusionBC.C @@ -17,6 +17,8 @@ SakiyamaElectronDiffusionBC::validParams() { InputParameters params = ADIntegratedBC::validParams(); params.addRequiredCoupledVar("mean_en", "The mean energy."); + params.deprecateCoupledVar("mean_en", "electron_energy", "06/01/2024"); + params.addRequiredCoupledVar("electron_energy", "The mean electron energy density in log form"); params.addRequiredParam("position_units", "Units of position."); params.addClassDescription("Kinetic electron boundary condition" "(Based on DOI: https://doi.org/10.1116/1.579300)"); @@ -29,7 +31,7 @@ SakiyamaElectronDiffusionBC::SakiyamaElectronDiffusionBC(const InputParameters & _r_units(1. / getParam("position_units")), // Coupled Variables - _mean_en(adCoupledValue("mean_en")), + _mean_en(adCoupledValue("electron_energy")), _massem(getMaterialProperty("massem")), _e(getMaterialProperty("e")), diff --git a/src/bcs/SakiyamaEnergyDiffusionBC.C b/src/bcs/SakiyamaEnergyDiffusionBC.C index b07ed522cb2..27f3259b0ba 100644 --- a/src/bcs/SakiyamaEnergyDiffusionBC.C +++ b/src/bcs/SakiyamaEnergyDiffusionBC.C @@ -17,6 +17,8 @@ SakiyamaEnergyDiffusionBC::validParams() { InputParameters params = ADIntegratedBC::validParams(); params.addRequiredCoupledVar("em", "The electron density."); + params.deprecateCoupledVar("em", "electrons", "06/01/2024"); + params.addRequiredCoupledVar("electrons", "The electron density in log form"); params.addRequiredParam("position_units", "Units of position."); params.addClassDescription("Kinetic advective electron energy boundary condition" "(Based on DOI: https://doi.org/10.1116/1.579300)"); @@ -29,7 +31,7 @@ SakiyamaEnergyDiffusionBC::SakiyamaEnergyDiffusionBC(const InputParameters & par _r_units(1. / getParam("position_units")), // Coupled Variables - _em(adCoupledValue("em")), + _em(adCoupledValue("electrons")), _massem(getMaterialProperty("massem")), _e(getMaterialProperty("e")), diff --git a/src/bcs/SakiyamaEnergySecondaryElectronBC.C b/src/bcs/SakiyamaEnergySecondaryElectronBC.C index 239ab56ad80..9f0d7e94aa3 100644 --- a/src/bcs/SakiyamaEnergySecondaryElectronBC.C +++ b/src/bcs/SakiyamaEnergySecondaryElectronBC.C @@ -16,13 +16,24 @@ InputParameters SakiyamaEnergySecondaryElectronBC::validParams() { InputParameters params = ADIntegratedBC::validParams(); - params.addRequiredParam("se_coeff", "The secondary electron coefficient"); + params.addRequiredParam>("se_coeff", "The secondary electron coefficient"); + params.deprecateParam("se_coeff", "emission_coeffs", "06/01/2024"); + params.addRequiredParam>( + "emission_coeffs", + "The seconday electron emmision coefficient for each ion provided in `ions`"); params.addRequiredParam( "Tse_equal_Te", "The secondary electron temperature equal the electron temperature in eV"); params.addParam( "user_se_energy", 1.0, "The user's value of the secondary electron temperature in eV"); + params.deprecateParam("user_se_energy", "secondary_electron_energy", "06/01/2024"); + params.addParam("secondary_electron_energy", "The secondary electron temperature in eV"); params.addRequiredCoupledVar("em", "The electron density."); + params.deprecateCoupledVar("em", "electrons", "06/01/2024"); + params.addRequiredCoupledVar("electrons", "The elctron density in log form"); params.addRequiredCoupledVar("ip", "The ion density."); + params.deprecateCoupledVar("ip", "ions", "06/01/2024"); + params.addRequiredCoupledVar("ions", "A list of ion densities in log form"); + params.addRequiredParam("position_units", "Units of position."); params.addParam("field_property_name", "field_solver_interface_property", @@ -39,11 +50,13 @@ SakiyamaEnergySecondaryElectronBC::SakiyamaEnergySecondaryElectronBC( _r_units(1. / getParam("position_units")), Te_dependent(getParam("Tse_equal_Te")), + _num_ions(coupledComponents("ions")), + _se_coeff(getParam>("emission_coeffs")), + // Coupled Variables _em(adCoupledValue("em")), - _se_coeff(getParam("se_coeff")), - _user_se_energy(getParam("user_se_energy")), + _user_se_energy(getParam("secondary_electron_energy")), _a(0.5), _se_energy(0), _ion_flux(0, 0, 0), @@ -51,8 +64,10 @@ SakiyamaEnergySecondaryElectronBC::SakiyamaEnergySecondaryElectronBC( _electric_field( getADMaterialProperty(getParam("field_property_name"))) { - _num_ions = coupledComponents("ip"); + if (_se_coeff.size() != _num_ions) + mooseError("SakiyamaEnergySecondaryElectronBC: The lengths of `ions` and `emission_coeffs` " + "must be the same"); _ip.resize(_num_ions); _ip_var.resize(_num_ions); _muip.resize(_num_ions); @@ -60,10 +75,10 @@ SakiyamaEnergySecondaryElectronBC::SakiyamaEnergySecondaryElectronBC( for (unsigned int i = 0; i < _num_ions; ++i) { - _ip_var[i] = getVar("ip", i); - _ip[i] = &adCoupledValue("ip", i); - _muip[i] = &getADMaterialProperty("mu" + (*getVar("ip", i)).name()); - _sgnip[i] = &getMaterialProperty("sgn" + (*getVar("ip", i)).name()); + _ip_var[i] = getVar("ions", i); + _ip[i] = &adCoupledValue("ions", i); + _muip[i] = &getADMaterialProperty("mu" + (*getVar("ions", i)).name()); + _sgnip[i] = &getMaterialProperty("sgn" + (*getVar("ions", i)).name()); } } @@ -82,8 +97,8 @@ SakiyamaEnergySecondaryElectronBC::computeQpResidual() _a = 0.0; } - _ion_flux += _a * (*_sgnip[i])[_qp] * (*_muip[i])[_qp] * _electric_field[_qp] * _r_units * - std::exp((*_ip[i])[_qp]); + _ion_flux += _se_coeff[i] * _a * (*_sgnip[i])[_qp] * (*_muip[i])[_qp] * _electric_field[_qp] * + _r_units * std::exp((*_ip[i])[_qp]); } if (Te_dependent) @@ -95,6 +110,5 @@ SakiyamaEnergySecondaryElectronBC::computeQpResidual() _se_energy = _user_se_energy; } - return -_test[_i][_qp] * _r_units * _se_coeff * (5.0 / 3.0) * _se_energy * _ion_flux * - _normals[_qp]; + return -_test[_i][_qp] * _r_units * (5.0 / 3.0) * _se_energy * _ion_flux * _normals[_qp]; } diff --git a/src/bcs/SakiyamaSecondaryElectronBC.C b/src/bcs/SakiyamaSecondaryElectronBC.C index b500bc3a118..48c380e5bf4 100644 --- a/src/bcs/SakiyamaSecondaryElectronBC.C +++ b/src/bcs/SakiyamaSecondaryElectronBC.C @@ -17,9 +17,14 @@ SakiyamaSecondaryElectronBC::validParams() { InputParameters params = ADIntegratedBC::validParams(); params.addRequiredCoupledVar("ip", "The ion density."); + params.deprecateCoupledVar("ip", "ions", "06/01/2024"); + params.addRequiredCoupledVar("ions", "A list of ion densities in log form"); params.addRequiredParam("position_units", "Units of position."); - params.addParam("users_gamma", - "A secondary electron emission coeff. only used for this BC."); + params.addRequiredParam>( + "users_gamma", "A secondary electron emission coeff. only used for this BC."); + params.deprecateParam("users_gamma", "emission_coeffs", "06/01/2024"); + params.addRequiredParam>( + "emission_coeffs", "A list of species dependent secondary electron emmisions coefficients"); params.addParam("field_property_name", "field_solver_interface_property", "Name of the solver interface material property."); @@ -32,25 +37,27 @@ SakiyamaSecondaryElectronBC::SakiyamaSecondaryElectronBC(const InputParameters & : ADIntegratedBC(parameters), _r_units(1. / getParam("position_units")), + _num_ions(coupledComponents("ions")), + _user_se_coeff(getParam>("emission_coeffs")), + // Coupled Variables + _electric_field( + getADMaterialProperty(getParam("field_property_name"))), _a(0.5), - _ion_flux(0, 0, 0), - _user_se_coeff(getParam("users_gamma")), - - _electric_field( - getADMaterialProperty(getParam("field_property_name"))) + _ion_flux(0, 0, 0) { - _num_ions = coupledComponents("ip"); - + if (_user_se_coeff.size() != _num_ions) + mooseError("SakiyamaSecondaryElectronBC: The lengths of `ions` and `emission_coeffs` must be " + "the same"); _ip.resize(_num_ions); _muip.resize(_num_ions); _sgnip.resize(_num_ions); for (unsigned int i = 0; i < _num_ions; ++i) { - _ip[i] = &adCoupledValue("ip", i); - _muip[i] = &getADMaterialProperty("mu" + (*getVar("ip", i)).name()); - _sgnip[i] = &getMaterialProperty("sgn" + (*getVar("ip", i)).name()); + _ip[i] = &adCoupledValue("ions", i); + _muip[i] = &getADMaterialProperty("mu" + (*getVar("ions", i)).name()); + _sgnip[i] = &getMaterialProperty("sgn" + (*getVar("ions", i)).name()); } } @@ -69,9 +76,9 @@ SakiyamaSecondaryElectronBC::computeQpResidual() _a = 0.0; } - _ion_flux += _a * (*_sgnip[i])[_qp] * (*_muip[i])[_qp] * _electric_field[_qp] * _r_units * - std::exp((*_ip[i])[_qp]); + _ion_flux += _user_se_coeff[i] * _a * (*_sgnip[i])[_qp] * (*_muip[i])[_qp] * + _electric_field[_qp] * _r_units * std::exp((*_ip[i])[_qp]); } - return -_test[_i][_qp] * _r_units * _a * _user_se_coeff * _ion_flux * _normals[_qp]; + return -_test[_i][_qp] * _r_units * _a * _ion_flux * _normals[_qp]; } diff --git a/src/bcs/SchottkyEmissionBC.C b/src/bcs/SchottkyEmissionBC.C index da953ada841..57cec9be5b6 100644 --- a/src/bcs/SchottkyEmissionBC.C +++ b/src/bcs/SchottkyEmissionBC.C @@ -18,7 +18,14 @@ SchottkyEmissionBC::validParams() InputParameters params = ADIntegratedBC::validParams(); params.addRequiredParam("r", "The reflection coefficient"); params.addRequiredCoupledVar("mean_en", "The mean energy."); + params.deprecateCoupledVar("mean_en", "electron_energy", "06/01/204"); + params.addRequiredCoupledVar("electron_energy", "The mean electron energy density in log form"); params.addRequiredCoupledVar("ip", "The ion density."); + params.deprecateCoupledVar("ip", "ions", "06/01/2024"); + params.addRequiredCoupledVar("ions", "A list of ion densities in log form"); + params.addRequiredParam>("emission_coeffs", + "A list of species dependent secondary electron " + "emmision coefficients for each species in `ions`"); params.addRequiredParam("position_units", "Units of position."); params.addRequiredParam("potential_units", "The potential units."); params.addParam("tau", 1e-9, "The time constant for ramping the boundary condition."); @@ -34,19 +41,13 @@ SchottkyEmissionBC::SchottkyEmissionBC(const InputParameters & parameters) _r_units(1. / getParam("position_units")), _r(getParam("r")), - + _num_ions(coupledComponents("ions")), + _se_coeff(getParam>("emission_coeffs")), // Coupled Variables - _mean_en(adCoupledValue("mean_en")), - _ip_var(*getVar("ip", 0)), - _ip(adCoupledValue("ip")), - _grad_ip(adCoupledGradient("ip")), + _mean_en(adCoupledValue("electron_energy")), _massem(getMaterialProperty("massem")), _e(getMaterialProperty("e")), - _sgnip(getMaterialProperty("sgn" + _ip_var.name())), - _muip(getADMaterialProperty("mu" + _ip_var.name())), - _Dip(getADMaterialProperty("diff" + _ip_var.name())), - _se_coeff(getMaterialProperty("se_coeff")), _work_function(getMaterialProperty("work_function")), _field_enhancement(getMaterialProperty("field_enhancement")), _Richardson_coefficient(getMaterialProperty("Richardson_coefficient")), @@ -61,6 +62,9 @@ SchottkyEmissionBC::SchottkyEmissionBC(const InputParameters & parameters) getADMaterialProperty(getParam("field_property_name"))) { + if (_se_coeff.size() != _num_ions) + mooseError("SchottkyEmissionBC: The lengths of `ions` and `emission_coeffs` must be the same"); + if (_potential_units.compare("V") == 0) { _voltage_scaling = 1.; @@ -72,6 +76,23 @@ SchottkyEmissionBC::SchottkyEmissionBC(const InputParameters & parameters) _dPhi_over_F = 3.7946865E-5 * std::sqrt(_voltage_scaling); // eV*sqrt(m/kV) (if _voltage_scaling = 1000) + + _ip.resize(_num_ions); + _ip_var.resize(_num_ions); + _grad_ip.resize(_num_ions); + _sgnip.resize(_num_ions); + _muip.resize(_num_ions); + _Dip.resize(_num_ions); + + for (unsigned int i = 0; i < _num_ions; ++i) + { + _ip_var[i] = getVar("ions", i); + _ip[i] = &adCoupledValue("ions", i); + _grad_ip[i] = &adCoupledGradient("ions", i); + _sgnip[i] = &getMaterialProperty("sgn" + (*getVar("ions", i)).name()); + _muip[i] = &getADMaterialProperty("mu" + (*getVar("ions", i)).name()); + _Dip[i] = &getADMaterialProperty("diff" + (*getVar("ions", i)).name()); + } } ADReal @@ -96,8 +117,14 @@ SchottkyEmissionBC::computeQpResidual() { _a = 0.0; - _ion_flux = _sgnip[_qp] * _muip[_qp] * _electric_field[_qp] * _r_units * std::exp(_ip[_qp]) - - _Dip[_qp] * std::exp(_ip[_qp]) * _grad_ip[_qp] * _r_units; + _ion_flux.zero(); + for (auto i = 0; i < _num_ions; ++i) + { + _ion_flux += _se_coeff[i] * + ((*_sgnip[i])[_qp] * (*_muip[i])[_qp] * _electric_field[_qp] * _r_units * + std::exp((*_ip[i])[_qp]) - + (*_Dip[i])[_qp] * std::exp((*_ip[i])[_qp]) * (*_grad_ip[i])[_qp] * _r_units); + } // Schottky emission // je = AR * T^2 * exp(-(wf - dPhi) / (kB * T)) @@ -110,7 +137,7 @@ SchottkyEmissionBC::computeQpResidual() jRD = _Richardson_coefficient[_qp] * std::pow(_cathode_temperature[_qp], 2) * std::exp(-(_work_function[_qp] - dPhi) / (kB * _cathode_temperature[_qp])); - jSE = _e[_qp] * 6.02E23 * _se_coeff[_qp] * _ion_flux * _normals[_qp]; + jSE = _e[_qp] * 6.02E23 * _ion_flux * _normals[_qp]; if (_relax) { diff --git a/src/bcs/SecondaryElectronBC.C b/src/bcs/SecondaryElectronBC.C index ee151498a9d..efd59ef094a 100644 --- a/src/bcs/SecondaryElectronBC.C +++ b/src/bcs/SecondaryElectronBC.C @@ -19,11 +19,17 @@ SecondaryElectronBC::validParams() params.addRequiredParam("r", "The reflection coefficient of the electrons."); params.addParam("r_ion", 0, "The reflection coefficient of the ions."); params.addRequiredCoupledVar("mean_en", "The mean energy."); + params.deprecateCoupledVar("mean_en", "electron_energy", "06/01/2024"); + params.addRequiredCoupledVar("electron_energy", "The mean electron energy density in log form"); params.addRequiredCoupledVar("ip", "The ion density."); + params.deprecateCoupledVar("ip", "ions", "06/01/2024"); + params.addRequiredCoupledVar("ions", "A list of ion densities in log form"); params.addRequiredParam("position_units", "Units of position."); params.addParam("field_property_name", "field_solver_interface_property", "Name of the solver interface material property."); + params.addRequiredParam>( + "emission_coeffs", "A list of species dependent secondary electron emmision coefficients"); return params; } @@ -33,17 +39,17 @@ SecondaryElectronBC::SecondaryElectronBC(const InputParameters & parameters) _r(getParam("r")), _r_ion(getParam("r_ion")), _kb(getMaterialProperty("k_boltz")), - + _num_ions(coupledComponents("ions")), + _se_coeff(getParam>("emission_coeffs")), // Coupled Variables - _mean_en(adCoupledValue("mean_en")), + _electric_field( + getADMaterialProperty(getParam("field_property_name"))), + _mean_en(adCoupledValue("electron_energy")), _muem(getADMaterialProperty("muem")), _massem(getMaterialProperty("massem")), - _e(getMaterialProperty("e")), - _se_coeff(getMaterialProperty("se_coeff")), + _e(getMaterialProperty("e")) - _electric_field( - getADMaterialProperty(getParam("field_property_name"))) { _ion_flux = 0; _a = 0.5; @@ -51,8 +57,8 @@ SecondaryElectronBC::SecondaryElectronBC(const InputParameters & parameters) _v_thermal = 0.0; _n_gamma = 0.0; - _num_ions = coupledComponents("ip"); - + if (_se_coeff.size() != _num_ions) + mooseError("SecondaryElectronBC: The lengths of `ions` and `emission_coeffs` must be the same"); // Resize the vectors to store _num_ions values: _ip.resize(_num_ions); _grad_ip.resize(_num_ions); @@ -68,12 +74,12 @@ SecondaryElectronBC::SecondaryElectronBC(const InputParameters & parameters) // refers to a single ion species. for (unsigned int i = 0; i < _num_ions; ++i) { - _ip[i] = &adCoupledValue("ip", i); - _grad_ip[i] = &adCoupledGradient("ip", i); - _muip[i] = &getADMaterialProperty("mu" + (*getVar("ip", i)).name()); - _Tip[i] = &getADMaterialProperty("T" + (*getVar("ip", i)).name()); - _massip[i] = &getMaterialProperty("mass" + (*getVar("ip", i)).name()); - _sgnip[i] = &getMaterialProperty("sgn" + (*getVar("ip", i)).name()); + _ip[i] = &adCoupledValue("ions", i); + _grad_ip[i] = &adCoupledGradient("ions", i); + _muip[i] = &getADMaterialProperty("mu" + (*getVar("ions", i)).name()); + _Tip[i] = &getADMaterialProperty("T" + (*getVar("ions", i)).name()); + _massip[i] = &getMaterialProperty("mass" + (*getVar("ions", i)).name()); + _sgnip[i] = &getMaterialProperty("sgn" + (*getVar("ions", i)).name()); } } @@ -96,14 +102,14 @@ SecondaryElectronBC::computeQpResidual() _b = 1.0; else _b = 0.0; - _ion_flux += std::exp((*_ip[i])[_qp]) * + _ion_flux += _se_coeff[i] * std::exp((*_ip[i])[_qp]) * (0.5 * std::sqrt(8 * _kb[_qp] * (*_Tip[i])[_qp] / (M_PI * (*_massip[i])[_qp])) + (2 * _b - 1) * (*_sgnip[i])[_qp] * (*_muip[i])[_qp] * _electric_field[_qp] * _r_units * _normals[_qp]); } _ion_flux *= (1.0 - _r_ion) / (1.0 + _r_ion); - _n_gamma = (1. - _a) * _se_coeff[_qp] * _ion_flux / + _n_gamma = (1. - _a) * _ion_flux / (_muem[_qp] * _electric_field[_qp] * _r_units * _normals[_qp] + std::numeric_limits::epsilon()); _v_thermal = @@ -111,5 +117,5 @@ SecondaryElectronBC::computeQpResidual() return _test[_i][_qp] * _r_units * ((1. - _r) / (1. + _r) * (-0.5 * _v_thermal * _n_gamma) - - 2. / (1. + _r) * (1. - _a) * _se_coeff[_qp] * _ion_flux); + 2. / (1. + _r) * (1. - _a) * _ion_flux); } diff --git a/src/bcs/SecondaryElectronEnergyBC.C b/src/bcs/SecondaryElectronEnergyBC.C index 138013197cd..6aee1333d40 100644 --- a/src/bcs/SecondaryElectronEnergyBC.C +++ b/src/bcs/SecondaryElectronEnergyBC.C @@ -19,11 +19,19 @@ SecondaryElectronEnergyBC::validParams() params.addRequiredParam("r", "The reflection coefficient of the electrons."); params.addParam("r_ion", 0, "The reflection coefficient of the ions."); params.addRequiredCoupledVar("em", "The electron density."); + params.deprecateCoupledVar("em", "electrons", "06/01/2024"); + params.addRequiredCoupledVar("electrons", "The electron density in log form"); + params.addRequiredCoupledVar("ip", "The ion density."); + params.deprecateCoupledVar("ip", "ions", "06/01/2024"); + params.addRequiredCoupledVar("ions", "A list of ion densities in log form"); params.addRequiredParam("position_units", "Units of position."); params.addParam("field_property_name", "field_solver_interface_property", "Name of the solver interface material property."); + params.addRequiredParam>( + "emission_coeffs", "A species dependent list of secondary electron emmision coefficients"); + params.addRequiredParam("secondary_electron_energy", "The secondary electron energy in eV"); return params; } @@ -33,15 +41,16 @@ SecondaryElectronEnergyBC::SecondaryElectronEnergyBC(const InputParameters & par _r(getParam("r")), _r_ion(getParam("r_ion")), _kb(getMaterialProperty("k_boltz")), - + _num_ions(coupledComponents("ions")), + _se_coeff(getParam>("emission_coeffs")), // Coupled Variables - _em(adCoupledValue("em")), + _em(adCoupledValue("electrons")), _muem(getADMaterialProperty("muem")), _massem(getMaterialProperty("massem")), _e(getMaterialProperty("e")), - _se_coeff(getMaterialProperty("se_coeff")), - _se_energy(getMaterialProperty("se_energy")), + + _se_energy(getParam("secondary_electron_energy")), _mumean_en(getADMaterialProperty("mumean_en")), _electric_field( getADMaterialProperty(getParam("field_property_name"))) @@ -52,7 +61,9 @@ SecondaryElectronEnergyBC::SecondaryElectronEnergyBC(const InputParameters & par _v_thermal = 0.0; _n_gamma = 0.0; - _num_ions = coupledComponents("ip"); + if (_se_coeff.size() != _num_ions) + mooseError( + "SecondaryElectronEnergyBC: The lengths of `ions` and `emission_coeffs` must be the same"); // Resize the vectors to store _num_ions values: _ip.resize(_num_ions); @@ -69,12 +80,12 @@ SecondaryElectronEnergyBC::SecondaryElectronEnergyBC(const InputParameters & par // refers to a single ion species. for (unsigned int i = 0; i < _num_ions; ++i) { - _ip[i] = &adCoupledValue("ip", i); - _grad_ip[i] = &adCoupledGradient("ip", i); - _muip[i] = &getADMaterialProperty("mu" + (*getVar("ip", i)).name()); - _Tip[i] = &getADMaterialProperty("T" + (*getVar("ip", i)).name()); - _massip[i] = &getMaterialProperty("mass" + (*getVar("ip", i)).name()); - _sgnip[i] = &getMaterialProperty("sgn" + (*getVar("ip", i)).name()); + _ip[i] = &adCoupledValue("ions", i); + _grad_ip[i] = &adCoupledGradient("ions", i); + _muip[i] = &getADMaterialProperty("mu" + (*getVar("ions", i)).name()); + _Tip[i] = &getADMaterialProperty("T" + (*getVar("ions", i)).name()); + _massip[i] = &getMaterialProperty("mass" + (*getVar("ions", i)).name()); + _sgnip[i] = &getMaterialProperty("sgn" + (*getVar("ions", i)).name()); } } @@ -97,13 +108,13 @@ SecondaryElectronEnergyBC::computeQpResidual() _b = 1.0; else _b = 0.0; - _ion_flux += std::exp((*_ip[i])[_qp]) * + _ion_flux += _se_coeff[i] * std::exp((*_ip[i])[_qp]) * (0.5 * std::sqrt(8 * _kb[_qp] * (*_Tip[i])[_qp] / (M_PI * (*_massip[i])[_qp])) + (2 * _b - 1) * (*_sgnip[i])[_qp] * (*_muip[i])[_qp] * _electric_field[_qp] * _r_units * _normals[_qp]); } - _n_gamma = (1. - _a) * _se_coeff[_qp] * _ion_flux / + _n_gamma = (1. - _a) * _ion_flux / (_muem[_qp] * _electric_field[_qp] * _r_units * _normals[_qp] + std::numeric_limits::epsilon()); @@ -111,6 +122,6 @@ SecondaryElectronEnergyBC::computeQpResidual() std::sqrt(8 * _e[_qp] * 2.0 / 3 * std::exp(_u[_qp] - _em[_qp]) / (M_PI * _massem[_qp])); return _test[_i][_qp] * _r_units * - ((1 - _r) / (1 + _r) * (-5. / 6. * _v_thermal * _n_gamma * _se_energy[_qp]) - - 5. / 3. * (2. / (1 + _r)) * _se_energy[_qp] * (1 - _a) * _se_coeff[_qp] * _ion_flux); + ((1 - _r) / (1 + _r) * (-5. / 6. * _v_thermal * _n_gamma * _se_energy) - + 5. / 3. * (2. / (1 + _r)) * _se_energy * (1 - _a) * _ion_flux); } diff --git a/test/tests/1d_dc/NonlocalPotentialBCWithSchottky.i b/test/tests/1d_dc/NonlocalPotentialBCWithSchottky.i index 85ce7aa1312..1572ae8aadc 100644 --- a/test/tests/1d_dc/NonlocalPotentialBCWithSchottky.i +++ b/test/tests/1d_dc/NonlocalPotentialBCWithSchottky.i @@ -546,6 +546,7 @@ area = 5.02e-7 # Formerly 3.14e-6 position_units = ${dom0Scale} tau = ${relaxTime} relax = true + emission_coeffs = 0.02 [] # [em_physical_left] diff --git a/test/tests/1d_dc/densities_mean_en.i b/test/tests/1d_dc/densities_mean_en.i index 4992c00d806..5663735c8f9 100644 --- a/test/tests/1d_dc/densities_mean_en.i +++ b/test/tests/1d_dc/densities_mean_en.i @@ -727,6 +727,7 @@ dom1Scale = 1e-7 mean_en = mean_en r = 0 position_units = ${dom0Scale} + emission_coeffs = 0.05 [] [potential_dirichlet_right] type = DirichletBC @@ -780,6 +781,7 @@ dom1Scale = 1e-7 mean_en = mean_en r = 0 position_units = ${dom0Scale} + emission_coeffs = 0.05 [] [Arp_physical_left_diffusion] type = HagelaarIonDiffusionBC diff --git a/test/tests/1d_dc/mean_en.i b/test/tests/1d_dc/mean_en.i index c825f23419c..31ae9c9444c 100644 --- a/test/tests/1d_dc/mean_en.i +++ b/test/tests/1d_dc/mean_en.i @@ -741,6 +741,8 @@ dom1Scale = 1e-7 em = em ip = 'Arp' r = 0 + emission_coeffs = 0.05 + secondary_electron_energy = 3 position_units = ${dom0Scale} [] @@ -755,6 +757,7 @@ dom1Scale = 1e-7 mean_en = mean_en r = 0 position_units = ${dom0Scale} + emission_coeffs = 0.05 [] [potential_dirichlet_right] type = DirichletBC @@ -802,6 +805,7 @@ dom1Scale = 1e-7 mean_en = mean_en r = 0 position_units = ${dom0Scale} + emission_coeffs = 0.05 [] [Arp_physical_left_diffusion] type = HagelaarIonDiffusionBC diff --git a/test/tests/1d_dc/mean_en_multi.i b/test/tests/1d_dc/mean_en_multi.i index 23d40bb9f35..719468570b4 100644 --- a/test/tests/1d_dc/mean_en_multi.i +++ b/test/tests/1d_dc/mean_en_multi.i @@ -811,6 +811,7 @@ dom1Scale = 1e-7 mean_en = mean_en r = 0 position_units = ${dom0Scale} + emission_coeffs = 0.05 [] [potential_dirichlet_right] type = DirichletBC @@ -864,6 +865,7 @@ dom1Scale = 1e-7 mean_en = mean_en r = 0 position_units = ${dom0Scale} + emission_coeffs = 0.05 [] [Arp_physical_left_diffusion] type = HagelaarIonDiffusionBC @@ -922,6 +924,8 @@ dom1Scale = 1e-7 em = em ip = 'Arp' r = 0 + emission_coeffs = 0.05 + secondary_electron_energy = 3 position_units = ${dom0Scale} [] [emliq_right] diff --git a/test/tests/DriftDiffusionAction/mean_en_actions.i b/test/tests/DriftDiffusionAction/mean_en_actions.i index a279958e286..518cb048b57 100644 --- a/test/tests/DriftDiffusionAction/mean_en_actions.i +++ b/test/tests/DriftDiffusionAction/mean_en_actions.i @@ -451,7 +451,9 @@ dom1Scale = 1e-7 em = em ip = 'Arp' r = 0 + emission_coeffs = 0.05 position_units = ${dom0Scale} + secondary_electron_energy = 3 [] [potential_left] @@ -465,6 +467,7 @@ dom1Scale = 1e-7 mean_en = mean_en r = 0 position_units = ${dom0Scale} + emission_coeffs = 0.05 [] [potential_dirichlet_right] type = DirichletBC @@ -511,6 +514,7 @@ dom1Scale = 1e-7 mean_en = mean_en r = 0 position_units = ${dom0Scale} + emission_coeffs = 0.05 [] [Arp_physical_left_diffusion] type = HagelaarIonDiffusionBC diff --git a/test/tests/DriftDiffusionAction/mean_en_no_actions.i b/test/tests/DriftDiffusionAction/mean_en_no_actions.i index 35a2c43b6fd..15291c846f0 100644 --- a/test/tests/DriftDiffusionAction/mean_en_no_actions.i +++ b/test/tests/DriftDiffusionAction/mean_en_no_actions.i @@ -809,6 +809,8 @@ dom1Scale = 1e-7 em = em ip = 'Arp' r = 0 + emission_coeffs = 0.05 + secondary_electron_energy = 3 position_units = ${dom0Scale} [] @@ -823,6 +825,7 @@ dom1Scale = 1e-7 mean_en = mean_en r = 0 position_units = ${dom0Scale} + emission_coeffs = 0.05 [] [potential_dirichlet_right] type = DirichletBC @@ -869,6 +872,7 @@ dom1Scale = 1e-7 mean_en = mean_en r = 0 position_units = ${dom0Scale} + emission_coeffs = 0.05 [] [Arp_physical_left_diffusion] type = HagelaarIonDiffusionBC diff --git a/test/tests/Schottky_emission/Example1/Input.i b/test/tests/Schottky_emission/Example1/Input.i index b284e9ae406..3dc4e19fe09 100644 --- a/test/tests/Schottky_emission/Example1/Input.i +++ b/test/tests/Schottky_emission/Example1/Input.i @@ -479,6 +479,7 @@ vhigh = -200E-3 #kV mean_en = mean_en r = 0 position_units = ${dom0Scale} + emission_coeffs = 0.02 [] [potential_dirichlet_right] @@ -500,6 +501,7 @@ vhigh = -200E-3 #kV position_units = ${dom0Scale} # tau = 10E-6 relax = true + emission_coeffs = 0.02 [] # [em_physical_left] diff --git a/test/tests/Schottky_emission/Example2/Input.i b/test/tests/Schottky_emission/Example2/Input.i index b2865abb496..2ad783b13f7 100644 --- a/test/tests/Schottky_emission/Example2/Input.i +++ b/test/tests/Schottky_emission/Example2/Input.i @@ -479,6 +479,7 @@ vhigh = -80E-3 #kV mean_en = mean_en r = 0 position_units = ${dom0Scale} + emission_coeffs = 0.02 [] [potential_dirichlet_right] @@ -500,6 +501,7 @@ vhigh = -80E-3 #kV position_units = ${dom0Scale} # tau = 10E-6 relax = true + emission_coeffs = 0.02 [] # [em_physical_left] diff --git a/test/tests/Schottky_emission/Example3/Input.i b/test/tests/Schottky_emission/Example3/Input.i index e851f28bc6f..9e175554add 100644 --- a/test/tests/Schottky_emission/Example3/Input.i +++ b/test/tests/Schottky_emission/Example3/Input.i @@ -482,6 +482,7 @@ threeTimesRelaxTime = 150E-6 #s mean_en = mean_en r = 0 position_units = ${dom0Scale} + emission_coeffs = 0.02 [] [potential_dirichlet_right] @@ -503,6 +504,7 @@ threeTimesRelaxTime = 150E-6 #s position_units = ${dom0Scale} # tau = ${relaxTime} relax = true + emission_coeffs = 0.02 [] # [em_physical_left] diff --git a/test/tests/Schottky_emission/Example4/Input.i b/test/tests/Schottky_emission/Example4/Input.i index 29f3c40b1d1..3c9e0e53fea 100644 --- a/test/tests/Schottky_emission/Example4/Input.i +++ b/test/tests/Schottky_emission/Example4/Input.i @@ -544,6 +544,7 @@ area = 5.02e-7 # Formerly 3.14e-6 position_units = ${dom0Scale} tau = ${relaxTime} relax = true + emission_coeffs = 0.02 [] # [em_physical_left] diff --git a/test/tests/Schottky_emission/PaschenLaw/Input.i b/test/tests/Schottky_emission/PaschenLaw/Input.i index c05a3366dcb..12d5769bca0 100644 --- a/test/tests/Schottky_emission/PaschenLaw/Input.i +++ b/test/tests/Schottky_emission/PaschenLaw/Input.i @@ -480,6 +480,7 @@ vhigh = -0.10 #kV mean_en = mean_en r = 0 position_units = ${dom0Scale} + emission_coeffs = 0.02 [] [potential_dirichlet_right] @@ -501,6 +502,7 @@ vhigh = -0.10 #kV position_units = ${dom0Scale} # tau = 5E-6 relax = true + emission_coeffs = 0.02 [] # [em_physical_left] diff --git a/test/tests/automatic_differentiation/ad_argon.i b/test/tests/automatic_differentiation/ad_argon.i index 5d79e3d5031..445e91031fc 100644 --- a/test/tests/automatic_differentiation/ad_argon.i +++ b/test/tests/automatic_differentiation/ad_argon.i @@ -495,7 +495,9 @@ dom0Scale = 1e-3 em = em ip = 'Arp Ar2p' r = 0 + emission_coeffs = '0.05 0.05' position_units = ${dom0Scale} + secondary_electron_energy = 3 [] [potential_left] @@ -509,6 +511,7 @@ dom0Scale = 1e-3 mean_en = mean_en r = 0 position_units = ${dom0Scale} + emission_coeffs = '0.05 0.05' [] [potential_dirichlet_right] type = DirichletBC @@ -570,6 +573,7 @@ dom0Scale = 1e-3 mean_en = mean_en r = 0 position_units = ${dom0Scale} + emission_coeffs = 0.05 [] [Arp_physical_left_diffusion] type = HagelaarIonDiffusionBC diff --git a/test/tests/crane_action/townsend_units.i b/test/tests/crane_action/townsend_units.i index 88f83e3974e..86482679eb1 100644 --- a/test/tests/crane_action/townsend_units.i +++ b/test/tests/crane_action/townsend_units.i @@ -687,6 +687,8 @@ dom1Scale = 1e-7 em = em ip = 'Arp' r = 0 + emission_coeffs = 0.05 + secondary_electron_energy = 3 position_units = ${dom0Scale} [] @@ -701,6 +703,7 @@ dom1Scale = 1e-7 mean_en = mean_en r = 0 position_units = ${dom0Scale} + emission_coeffs = 0.05 [] [potential_dirichlet_right] type = DirichletBC @@ -748,6 +751,7 @@ dom1Scale = 1e-7 mean_en = mean_en r = 0 position_units = ${dom0Scale} + emission_coeffs = 0.05 [] [Arp_physical_left_diffusion] type = HagelaarIonDiffusionBC diff --git a/test/tests/field_emission/field_emission.i b/test/tests/field_emission/field_emission.i index b6b887772fb..a9ad7ccaa27 100644 --- a/test/tests/field_emission/field_emission.i +++ b/test/tests/field_emission/field_emission.i @@ -480,6 +480,7 @@ vhigh = -0.15 #kV mean_en = mean_en r = 0 position_units = ${dom0Scale} + emission_coeffs = 0.05 [] [potential_dirichlet_right] type = DirichletBC diff --git a/test/tests/reflections/Schottky/Input.i b/test/tests/reflections/Schottky/Input.i index b2e89fe8b1e..294dd861e99 100644 --- a/test/tests/reflections/Schottky/Input.i +++ b/test/tests/reflections/Schottky/Input.i @@ -473,6 +473,7 @@ vhigh = -150E-3 #kV mean_en = mean_en r = 0 position_units = ${dom0Scale} + emission_coeffs = 0.02 [] [potential_dirichlet_right] @@ -492,6 +493,7 @@ vhigh = -150E-3 #kV mean_en = mean_en r = 1 position_units = ${dom0Scale} + emission_coeffs = 0.02 [] # [em_physical_left] diff --git a/test/tests/reflections/Schottky_300_V_5_um/Input.i b/test/tests/reflections/Schottky_300_V_5_um/Input.i index 0a1fc4515da..e27eadba8e8 100644 --- a/test/tests/reflections/Schottky_300_V_5_um/Input.i +++ b/test/tests/reflections/Schottky_300_V_5_um/Input.i @@ -478,6 +478,7 @@ vhigh = -400E-3 #kV mean_en = mean_en r = 0 position_units = ${dom0Scale} + emission_coeffs = 0.02 [] [potential_dirichlet_right] @@ -499,6 +500,7 @@ vhigh = -400E-3 #kV position_units = ${dom0Scale} tau = 100E-9 relax = true + emission_coeffs = 0.02 [] # [em_physical_left] @@ -557,6 +559,8 @@ vhigh = -400E-3 #kV ip = Arp r = 0 position_units = ${dom0Scale} + secondary_electron_energy = 3 + emission_coeffs = 0.02 [] [mean_en_physical_right] @@ -633,3 +637,4 @@ vhigh = -400E-3 #kV block = 0 [] [] + diff --git a/test/tests/reflections/Schottky_400_V_10_um/Input.i b/test/tests/reflections/Schottky_400_V_10_um/Input.i index 5d770956825..0384b5c50d0 100644 --- a/test/tests/reflections/Schottky_400_V_10_um/Input.i +++ b/test/tests/reflections/Schottky_400_V_10_um/Input.i @@ -475,6 +475,7 @@ vhigh = -175E-3 #kV mean_en = mean_en r = 0 position_units = ${dom0Scale} + emission_coeffs = 0.02 [] [potential_dirichlet_right] @@ -494,6 +495,7 @@ vhigh = -175E-3 #kV mean_en = mean_en r = 1 position_units = ${dom0Scale} + emission_coeffs = 0.02 [] # [em_physical_left] diff --git a/test/tests/reflections/base/Input.i b/test/tests/reflections/base/Input.i index 0243a202182..44e22f235d2 100644 --- a/test/tests/reflections/base/Input.i +++ b/test/tests/reflections/base/Input.i @@ -470,6 +470,7 @@ vhigh = -175E-3 #kV mean_en = mean_en r = 0 position_units = ${dom0Scale} + emission_coeffs = 0.01 [] [potential_dirichlet_right] @@ -488,6 +489,7 @@ vhigh = -175E-3 #kV mean_en = mean_en r = 1 position_units = ${dom0Scale} + emission_coeffs = 0.01 [] [em_physical_left] diff --git a/test/tests/reflections/high_initial/Input.i b/test/tests/reflections/high_initial/Input.i index bee47064ae9..a8cf8726597 100644 --- a/test/tests/reflections/high_initial/Input.i +++ b/test/tests/reflections/high_initial/Input.i @@ -472,6 +472,7 @@ vhigh = -175E-3 #kV mean_en = mean_en r = 0 position_units = ${dom0Scale} + emission_coeffs = 0.01 [] [potential_dirichlet_right] @@ -490,6 +491,7 @@ vhigh = -175E-3 #kV mean_en = mean_en r = 1 position_units = ${dom0Scale} + emission_coeffs = 0.01 [] [em_physical_left] diff --git a/test/tests/reflections/low_initial/Input.i b/test/tests/reflections/low_initial/Input.i index 63b79d30df8..7c81c2ab7db 100644 --- a/test/tests/reflections/low_initial/Input.i +++ b/test/tests/reflections/low_initial/Input.i @@ -472,6 +472,7 @@ vhigh = -175E-3 #kV mean_en = mean_en r = 0 position_units = ${dom0Scale} + emission_coeffs = 0.01 [] [potential_dirichlet_right] @@ -490,6 +491,7 @@ vhigh = -175E-3 #kV mean_en = mean_en r = 1 position_units = ${dom0Scale} + emission_coeffs = 0.01 [] [em_physical_left] diff --git a/tutorial/tutorial05-PlasmaWaterInterface/DC_argon-With-Water.i b/tutorial/tutorial05-PlasmaWaterInterface/DC_argon-With-Water.i index 5d989a4d470..8db070e803d 100644 --- a/tutorial/tutorial05-PlasmaWaterInterface/DC_argon-With-Water.i +++ b/tutorial/tutorial05-PlasmaWaterInterface/DC_argon-With-Water.i @@ -218,6 +218,7 @@ dom1Scale = 1e-7 mean_en = mean_en r = 0 position_units = ${dom0Scale} + emission_coeffs = 0.05 [] #Ground electrode under the water [potential_dirichlet_right] @@ -244,6 +245,7 @@ dom1Scale = 1e-7 mean_en = mean_en r = 0 position_units = ${dom0Scale} + emission_coeffs = 0.05 [] #Mean electron energy on the powered electrode @@ -263,6 +265,8 @@ dom1Scale = 1e-7 ip = 'Arp' r = 0 position_units = ${dom0Scale} + emission_coeffs = 0.05 + secondary_electron_energy = 3 [] #Argon ions on the powered electrode