- position_unitsUnits of position.
C++ Type:double
Unit:(no unit assumed)
Controllable:No
Description:Units of position.
- ux-Effective Efield
C++ Type:std::vector<VariableName>
Unit:(no unit assumed)
Controllable:No
Description:x-Effective Efield
- variableThe name of the variable that this residual object operates on
C++ Type:NonlinearVariableName
Unit:(no unit assumed)
Controllable:No
Description:The name of the variable that this residual object operates on
EffectiveEFieldAdvection
Effective electric field driven advection term. The effective electric field is supplied as scalar components of the field. (Densities must be in logarithmic form.)
Overview
EffectiveEFieldAdvection
is the effective electric field driven advection term used for variables in logarithmic form. The effective electric field is supplied as scalar componets of the field.
The strong form for an advection term is usually defined as
where
is the advection component of a species' flux,
indicates the advection behavior ( for positively charged species and for negatively charged species)
is the mobility coefficient, is the density, and
is the effective electric field acting on the ions.
Where is the molar density of the species in logarithmic form and is the scaling factor of the mesh.
Example Input File Syntax
[Kernels]
[ion_advection]
type = EffectiveEFieldAdvection
variable = ion
u = Ex
v = Ey
position_units = 1.0
[]
[]
(test/tests/mms/continuity_equations/2D_Coupling_Electons_Potential_Ions_MeanEnergy_Einstein_Relation_EffEfield.i)Input Parameters
- blockThe list of blocks (ids or names) that this object will be applied
C++ Type:std::vector<SubdomainName>
Controllable:No
Description:The list of blocks (ids or names) that this object will be applied
- displacementsThe displacements
C++ Type:std::vector<VariableName>
Unit:(no unit assumed)
Controllable:No
Description:The displacements
- vy-Effective Efield
C++ Type:std::vector<VariableName>
Unit:(no unit assumed)
Controllable:No
Description:y-Effective Efield
- wz-Effective Efield
C++ Type:std::vector<VariableName>
Unit:(no unit assumed)
Controllable:No
Description:z-Effective Efield
Optional Parameters
- absolute_value_vector_tagsThe tags for the vectors this residual object should fill with the absolute value of the residual contribution
C++ Type:std::vector<TagName>
Controllable:No
Description:The tags for the vectors this residual object should fill with the absolute value of the residual contribution
- extra_matrix_tagsThe extra tags for the matrices this Kernel should fill
C++ Type:std::vector<TagName>
Controllable:No
Description:The extra tags for the matrices this Kernel should fill
- extra_vector_tagsThe extra tags for the vectors this Kernel should fill
C++ Type:std::vector<TagName>
Controllable:No
Description:The extra tags for the vectors this Kernel should fill
- matrix_tagssystemThe tag for the matrices this Kernel should fill
Default:system
C++ Type:MultiMooseEnum
Options:nontime, system
Controllable:No
Description:The tag for the matrices this Kernel should fill
- vector_tagsnontimeThe tag for the vectors this Kernel should fill
Default:nontime
C++ Type:MultiMooseEnum
Options:nontime, time
Controllable:No
Description:The tag for the vectors this Kernel should fill
Contribution To Tagged Field Data Parameters
- control_tagsAdds user-defined labels for accessing object parameters via control logic.
C++ Type:std::vector<std::string>
Controllable:No
Description:Adds user-defined labels for accessing object parameters via control logic.
- diag_save_inThe name of auxiliary variables to save this Kernel's diagonal Jacobian contributions to. Everything about that variable must match everything about this variable (the type, what blocks it's on, etc.)
C++ Type:std::vector<AuxVariableName>
Unit:(no unit assumed)
Controllable:No
Description:The name of auxiliary variables to save this Kernel's diagonal Jacobian contributions to. Everything about that variable must match everything about this variable (the type, what blocks it's on, etc.)
- enableTrueSet the enabled status of the MooseObject.
Default:True
C++ Type:bool
Controllable:Yes
Description:Set the enabled status of the MooseObject.
- implicitTrueDetermines whether this object is calculated using an implicit or explicit form
Default:True
C++ Type:bool
Controllable:No
Description:Determines whether this object is calculated using an implicit or explicit form
- save_inThe name of auxiliary variables to save this Kernel's residual contributions to. Everything about that variable must match everything about this variable (the type, what blocks it's on, etc.)
C++ Type:std::vector<AuxVariableName>
Unit:(no unit assumed)
Controllable:No
Description:The name of auxiliary variables to save this Kernel's residual contributions to. Everything about that variable must match everything about this variable (the type, what blocks it's on, etc.)
- seed0The seed for the master random number generator
Default:0
C++ Type:unsigned int
Controllable:No
Description:The seed for the master random number generator
- use_displaced_meshFalseWhether or not this object should use the displaced mesh for computation. Note that in the case this is true but no displacements are provided in the Mesh block the undisplaced mesh will still be used.
Default:False
C++ Type:bool
Controllable:No
Description:Whether or not this object should use the displaced mesh for computation. Note that in the case this is true but no displacements are provided in the Mesh block the undisplaced mesh will still be used.
Advanced Parameters
- prop_getter_suffixAn optional suffix parameter that can be appended to any attempt to retrieve/get material properties. The suffix will be prepended with a '_' character.
C++ Type:MaterialPropertyName
Unit:(no unit assumed)
Controllable:No
Description:An optional suffix parameter that can be appended to any attempt to retrieve/get material properties. The suffix will be prepended with a '_' character.
- use_interpolated_stateFalseFor the old and older state use projected material properties interpolated at the quadrature points. To set up projection use the ProjectedStatefulMaterialStorageAction.
Default:False
C++ Type:bool
Controllable:No
Description:For the old and older state use projected material properties interpolated at the quadrature points. To set up projection use the ProjectedStatefulMaterialStorageAction.
Material Property Retrieval Parameters
Input Files
- (test/tests/mms/bcs/2D_ElectronBC_NegivateOutWardFacingEfield.i)
- (test/tests/mms/continuity_equations/2D_Coupling_Electons_Potential_Ions_MeanEnergy_Einstein_Relation_EffEfield.i)
- (test/tests/mms/bcs/2D_EnergyBC.i)
- (test/tests/mms/bcs/2D_DielectricBCWithEffEfield.i)
- (test/tests/mms/bcs/2D_ElectronBC.i)
- (test/tests/mms/bcs/2D_EnergyBC_NegivateOutWardFacingEfield.i)
- (test/tests/mms/bcs/2D_IonBC.i)
- (test/tests/mms/bcs/2D_IonBC_NegivateOutWardFacingEfield.i)
(test/tests/mms/continuity_equations/2D_Coupling_Electons_Potential_Ions_MeanEnergy_Einstein_Relation_EffEfield.i)
[Mesh]
[geo]
type = FileMeshGenerator
file = '2D_Coupling_Electons_Potential_Ions_MeanEnergy_Einstein_Relation_EffEfield_IC_out.e'
use_for_exodus_restart = true
[]
[]
[Problem]
type = FEProblem
[]
[Variables]
[em]
initial_from_file_var = em
[]
[potential]
initial_from_file_var = potential
[]
[ion]
initial_from_file_var = ion
[]
[mean_en]
initial_from_file_var = mean_en
[]
[Ex]
initial_from_file_var = Ex
[]
[Ey]
initial_from_file_var = Ey
[]
[]
[Kernels]
#Electron Equations
[em_time_derivative]
type = TimeDerivativeLog
variable = em
[]
[em_diffusion]
type = CoeffDiffusion
variable = em
position_units = 1.0
[]
[em_advection]
type = EFieldAdvection
variable = em
position_units = 1.0
[]
[em_source]
type = BodyForce
variable = em
function = 'em_source'
[]
#Ion Equations
[ion_time_derivative]
type = TimeDerivativeLog
variable = ion
[]
[ion_diffusion]
type = CoeffDiffusion
variable = ion
position_units = 1.0
[]
[ion_advection]
type = EffectiveEFieldAdvection
variable = ion
u = Ex
v = Ey
position_units = 1.0
[]
[ion_source]
type = BodyForce
variable = ion
function = 'ion_source'
[]
#Potential Equations
[potential_diffusion]
type = CoeffDiffusionLin
variable = potential
position_units = 1.0
[]
[ion_charge_source]
type = ChargeSourceMoles_KV
variable = potential
charged = ion
potential_units = V
[]
[em_charge_source]
type = ChargeSourceMoles_KV
variable = potential
charged = em
potential_units = V
[]
#Eff. Efield
[EffEfield_X_time_deriv]
type = TimeDerivative
variable = Ex
[]
[EffEfield_X_ForceBody]
type = EffectiveEField
variable = Ex
nu = 5.0
component = 0
position_units = 1.0
[]
[EffEfield_Y_time_deriv]
type = TimeDerivative
variable = Ey
[]
[EffEfield_Y_ForceBody]
type = EffectiveEField
variable = Ey
nu = 5.0
component = 1
position_units = 1.0
[]
#Electron Energy Equations
[mean_en_time_deriv]
type = TimeDerivativeLog
variable = mean_en
[]
[mean_en_advection]
type = EFieldAdvection
variable = mean_en
position_units = 1.0
[]
[mean_en_diffusion]
type = CoeffDiffusion
variable = mean_en
position_units = 1.0
[]
[mean_en_diffusion_correction]
type = ThermalConductivityDiffusion
variable = mean_en
em = em
position_units = 1.0
[]
[mean_en_joule_heating]
type = JouleHeating
variable = mean_en
em = em
position_units = 1.0
potential_units = V
[]
[mean_en_source]
type = BodyForce
variable = mean_en
function = 'energy_source'
[]
[]
[AuxVariables]
[potential_sol]
[]
[mean_en_sol]
[]
[em_sol]
[]
[ion_sol]
[]
[Ex_sol]
[]
[Ey_sol]
[]
[]
[AuxKernels]
[potential_sol]
type = FunctionAux
variable = potential_sol
function = potential_fun
[]
[mean_en_sol]
type = FunctionAux
variable = mean_en_sol
function = mean_en_fun
[]
[em_sol]
type = FunctionAux
variable = em_sol
function = em_fun
[]
[ion_sol]
type = FunctionAux
variable = ion_sol
function = ion_fun
[]
[Ex_sol]
type = FunctionAux
variable = Ex_sol
function = Ex_fun
[]
[Ey_sol]
type = FunctionAux
variable = Ey_sol
function = Ey_fun
[]
[]
[Functions]
#Material Variables
#Electron diffusion coeff.
[diffem_coeff]
type = ConstantFunction
value = 0.05
[]
#Electron mobility coeff.
[muem_coeff]
type = ConstantFunction
value = 0.01
[]
#Electron energy diffusion coeff.
[diffmean_en_coeff]
type = ParsedFunction
vars = 'diffem_coeff'
vals = 'diffem_coeff'
value = '5.0 / 3.0 * diffem_coeff'
[]
#Electron energy mobility coeff.
[mumean_en_coeff]
type = ParsedFunction
vars = 'muem_coeff'
vals = 'muem_coeff'
value = '5.0 / 3.0 * muem_coeff'
[]
#Ion diffusion coeff.
[diffion]
type = ConstantFunction
value = 0.1
[]
#Ion mobility coeff.
[muion]
type = ConstantFunction
value = 0.025
[]
[N_A]
type = ConstantFunction
value = 1.0
[]
[ee]
type = ConstantFunction
value = 1.0
[]
[diffpotential]
type = ConstantFunction
value = 0.01
[]
#Manufactured Solutions
#The manufactured electron density solution
[em_fun]
type = ParsedFunction
vars = 'N_A'
vals = 'N_A'
value = 'log((sin(pi*y) + 0.2*sin(2*pi*t)*cos(pi*y) + 1.0 + cos(pi/2*x)) / N_A)'
[]
#The manufactured ion density solution
[ion_fun]
type = ParsedFunction
vars = 'N_A'
vals = 'N_A'
value = 'log((sin(pi*y) + 1.0 + 0.9*cos(pi/2*x)) / N_A)'
[]
#The manufactured electron density solution
[potential_fun]
type = ParsedFunction
vars = 'ee diffpotential'
vals = 'ee diffpotential'
value = '-(ee*(2*cos((pi*x)/2) + cos(pi*y)*sin(2*pi*t)))/(5*diffpotential*pi^2)'
[]
#The manufactured electron energy solution
[energy_fun]
type = ParsedFunction
vars = 'N_A'
vals = 'N_A'
value = 'sin(pi*y) + sin(2*pi*t)*cos(pi*y)*sin(pi*y) + 0.75 + cos(pi/2*x)'
[]
[mean_en_fun]
type = ParsedFunction
vars = 'energy_fun em_fun'
vals = 'energy_fun em_fun'
value = 'log(energy_fun) + em_fun'
[]
#The manufactured eff. Efield solution
[Ex_fun]
type = ParsedFunction
vars = 'ee diffpotential'
vals = 'ee diffpotential'
value = '-(ee*exp(-5*t)*sin((pi*x)/2)*(exp(5*t) - 1))/(5*diffpotential*pi)'
[]
[Ey_fun]
type = ParsedFunction
vars = 'ee diffpotential'
vals = 'ee diffpotential'
value = '-(2*ee*exp(-5*t)*sin(pi*y))/(4*diffpotential*pi^2 + 25*diffpotential) -
(ee*sin(pi*y)*(5*sin(2*pi*t) - 2*pi*cos(2*pi*t)))/(diffpotential*pi*(4*pi^2 + 25))'
[]
#Electron diffusion coeff.
[diffem]
type = ParsedFunction
vars = 'diffem_coeff energy_fun'
vals = 'diffem_coeff energy_fun'
value = 'diffem_coeff * energy_fun'
[]
#Electron mobility coeff.
[muem]
type = ParsedFunction
vars = 'muem_coeff energy_fun'
vals = 'muem_coeff energy_fun'
value = 'muem_coeff * energy_fun'
[]
#Electron energy diffusion coeff.
[diffmean_en]
type = ParsedFunction
vars = 'diffmean_en_coeff energy_fun'
vals = 'diffmean_en_coeff energy_fun'
value = 'diffmean_en_coeff * energy_fun'
[]
#Electron energy mobility coeff.
[mumean_en]
type = ParsedFunction
vars = 'mumean_en_coeff energy_fun'
vals = 'mumean_en_coeff energy_fun'
value = 'mumean_en_coeff * energy_fun'
[]
#Source Terms in moles
#The electron source term.
[em_source]
type = ParsedFunction
vars = 'ee diffpotential diffem_coeff muem_coeff N_A'
vals = 'ee diffpotential diffem_coeff muem_coeff N_A'
value = '((2*pi*cos(2*pi*t)*cos(pi*y))/5 - (diffem_coeff*pi^2*sin((pi*x)/2)^2)/4 -
diffem_coeff*pi*(pi*cos(pi*y) - (pi*sin(2*pi*t)*sin(pi*y))/5)*(cos(pi*y) -
sin(2*pi*t) + 2*cos(pi*y)^2*sin(2*pi*t)) + (diffem_coeff*pi^2*cos((pi*x)/2)*(cos((pi*x)/2) +
sin(pi*y) + cos(pi*y)*sin(2*pi*t)*sin(pi*y) + 3/4))/4 + (diffem_coeff*pi^2*(5*sin(pi*y) +
cos(pi*y)*sin(2*pi*t))*(cos((pi*x)/2) + sin(pi*y) + cos(pi*y)*sin(2*pi*t)*sin(pi*y) + 3/4))/5 -
(ee*muem_coeff*sin((pi*x)/2)^2*(cos((pi*x)/2) + sin(pi*y) +
cos(pi*y)*sin(2*pi*t)*sin(pi*y) + 3/4))/(10*diffpotential) -
(ee*muem_coeff*sin((pi*x)/2)^2*(cos((pi*x)/2) + sin(pi*y) + (cos(pi*y)*sin(2*pi*t))/5 + 1))/(10*diffpotential) +
(ee*muem_coeff*cos((pi*x)/2)*(cos((pi*x)/2) + sin(pi*y) +
(cos(pi*y)*sin(2*pi*t))/5 + 1)*(cos((pi*x)/2) + sin(pi*y) + cos(pi*y)*sin(2*pi*t)*sin(pi*y) + 3/4))/(10*diffpotential) +
(ee*muem_coeff*cos(pi*y)*sin(2*pi*t)*(cos((pi*x)/2) + sin(pi*y) + (cos(pi*y)*sin(2*pi*t))/5 + 1)*(cos((pi*x)/2) +
sin(pi*y) + cos(pi*y)*sin(2*pi*t)*sin(pi*y) + 3/4))/(5*diffpotential) + (ee*muem_coeff*sin(2*pi*t)*sin(pi*y)*(cos(pi*y) -
sin(2*pi*t) + 2*cos(pi*y)^2*sin(2*pi*t))*(cos((pi*x)/2) + sin(pi*y) + (cos(pi*y)*sin(2*pi*t))/5 + 1))/(5*diffpotential) +
(ee*muem_coeff*sin(2*pi*t)*sin(pi*y)*(pi*cos(pi*y) - (pi*sin(2*pi*t)*sin(pi*y))/5)*(cos((pi*x)/2) + sin(pi*y) +
cos(pi*y)*sin(2*pi*t)*sin(pi*y) + 3/4))/(5*diffpotential*pi)) / N_A'
[]
#The ion source term.
[ion_source]
type = ParsedFunction
vars = 'ee diffpotential diffion muion N_A'
vals = 'ee diffpotential diffion muion N_A'
value = '((diffion*pi^2*(9*cos((pi*x)/2) + 40*sin(pi*y)))/40 +
(9*ee*muion*exp(-5*t)*sin((pi*x)/2)^2*(exp(5*t) - 1))/(100*diffpotential) -
(ee*muion*exp(-5*t)*cos((pi*x)/2)*(exp(5*t) - 1)*((9*cos((pi*x)/2))/10 + sin(pi*y) + 1))/(10*diffpotential) -
(ee*muion*exp(-5*t)*cos(pi*y)*(2*pi + 5*exp(5*t)*sin(2*pi*t) -
2*pi*exp(5*t)*cos(2*pi*t))*((9*cos((pi*x)/2))/10 + sin(pi*y) + 1))/(diffpotential*(4*pi^2 + 25)) -
(ee*muion*exp(-5*t)*cos(pi*y)*sin(pi*y)*(2*pi + 5*exp(5*t)*sin(2*pi*t) -
2*pi*exp(5*t)*cos(2*pi*t)))/(diffpotential*(4*pi^2 + 25))) / N_A'
[]
[energy_source]
type = ParsedFunction
vars = 'ee diffpotential diffem_coeff muem_coeff N_A'
vals = 'ee diffpotential diffem_coeff muem_coeff N_A'
value = '(((4*cos((pi*x)/2) + 4*sin(pi*y) + 4*cos(pi*y)*sin(2*pi*t)*sin(pi*y) + 3)*(172*ee*muem_coeff*cos(2*pi*t)^2 -
282*ee*muem_coeff + 180*ee*muem_coeff*cos((pi*x)/2)^2 + 160*ee*muem_coeff*cos((pi*x)/2)^3 +
664*ee*muem_coeff*cos(pi*y)^2 - 480*ee*muem_coeff*cos(pi*y)^4 -
66*ee*muem_coeff*cos((pi*x)/2) - 296*ee*muem_coeff*sin(pi*y) +
200*diffem_coeff*diffpotential*pi^2 - 664*ee*muem_coeff*cos(2*pi*t)^2*cos(pi*y)^2 +
480*ee*muem_coeff*cos(2*pi*t)^2*cos(pi*y)^4 + 364*ee*muem_coeff*cos(pi*y)*sin(2*pi*t) -
90*ee*muem_coeff*cos((pi*x)/2)*sin(pi*y) + 75*diffem_coeff*diffpotential*pi^2*cos((pi*x)/2) +
140*diffem_coeff*diffpotential*pi^2*sin(pi*y) + 16*ee*muem_coeff*cos(2*pi*t)^2*cos((pi*x)/2) -
8*ee*muem_coeff*cos((pi*x)/2)*cos(pi*y)^2 + 176*ee*muem_coeff*cos(2*pi*t)^2*sin(pi*y) -
320*ee*muem_coeff*cos(pi*y)^3*sin(2*pi*t) + 200*ee*muem_coeff*cos((pi*x)/2)^2*sin(pi*y) +
464*ee*muem_coeff*cos(pi*y)^2*sin(pi*y) + 300*diffem_coeff*diffpotential*pi^2*cos((pi*x)/2)^2 -
1200*diffem_coeff*diffpotential*pi^2*cos(pi*y)^2 + 160*ee*muem_coeff*cos(2*pi*t)^2*cos((pi*x)/2)*sin(pi*y) +
104*ee*muem_coeff*cos((pi*x)/2)^2*cos(pi*y)*sin(2*pi*t) - 40*ee*muem_coeff*cos((pi*x)/2)*cos(pi*y)^3*sin(2*pi*t) +
408*ee*muem_coeff*cos((pi*x)/2)*cos(pi*y)^2*sin(pi*y) + 96*ee*muem_coeff*cos(pi*y)^3*sin(2*pi*t)*sin(pi*y) +
160*diffem_coeff*diffpotential*pi^2*cos(2*pi*t)^2*sin(pi*y) -
2000*diffem_coeff*diffpotential*pi^2*cos(pi*y)^3*sin(2*pi*t) + 400*diffem_coeff*diffpotential*pi^2*cos(pi*y)^2*sin(pi*y) -
32*ee*muem_coeff*cos(2*pi*t)^2*cos((pi*x)/2)*cos(pi*y)^2 - 464*ee*muem_coeff*cos(2*pi*t)^2*cos(pi*y)^2*sin(pi*y) +
186*ee*muem_coeff*cos((pi*x)/2)*cos(pi*y)*sin(2*pi*t) + 272*ee*muem_coeff*cos(pi*y)*sin(2*pi*t)*sin(pi*y) +
1260*diffem_coeff*diffpotential*pi^2*cos(pi*y)*sin(2*pi*t) + 500*diffem_coeff*diffpotential*pi^2*cos((pi*x)/2)*sin(pi*y) -
408*ee*muem_coeff*cos(2*pi*t)^2*cos((pi*x)/2)*cos(pi*y)^2*sin(pi*y) -
96*ee*muem_coeff*cos(2*pi*t)^2*cos(pi*y)^3*sin(2*pi*t)*sin(pi*y) -
400*diffem_coeff*diffpotential*pi^2*cos(2*pi*t)^2*cos(pi*y)^2*sin(pi*y) +
448*ee*muem_coeff*cos((pi*x)/2)*cos(pi*y)*sin(2*pi*t)*sin(pi*y) +
80*diffem_coeff*diffpotential*pi^2*cos((pi*x)/2)*cos(pi*y)*sin(2*pi*t) +
240*diffem_coeff*diffpotential*pi^2*cos(pi*y)*sin(2*pi*t)*sin(pi*y) +
48*ee*muem_coeff*cos(2*pi*t)^2*cos(pi*y)*sin(2*pi*t)*sin(pi*y) + 80*ee*muem_coeff*cos((pi*x)/2)^2*cos(pi*y)*sin(2*pi*t)*sin(pi*y) +
100*diffem_coeff*diffpotential*pi^2*cos((pi*x)/2)*cos(pi*y)*sin(2*pi*t)*sin(pi*y)))/(960*diffpotential) +
(pi*cos(2*pi*t)*cos(pi*y)*(4*cos((pi*x)/2) + 24*sin(pi*y) + 20*cos((pi*x)/2)*sin(pi*y) + 20*sin(pi*y)^2 +
8*cos(pi*y)*sin(2*pi*t)*sin(pi*y) + 3))/10 - (diffem_coeff*pi^2*sin((pi*x)/2)^2*(cos((pi*x)/2) + sin(pi*y) +
cos(pi*y)*sin(2*pi*t)*sin(pi*y) + 3/4))/4 - (diffem_coeff*pi^2*sin((pi*x)/2)^2*(cos((pi*x)/2) + sin(pi*y) +
(cos(pi*y)*sin(2*pi*t))/5 + 1))/4 - diffem_coeff*pi^2*(cos(pi*y) - sin(2*pi*t) +
2*cos(pi*y)^2*sin(2*pi*t))^2*(cos((pi*x)/2) + sin(pi*y) + (cos(pi*y)*sin(2*pi*t))/5 + 1) +
(diffem_coeff*pi^2*cos((pi*x)/2)*(cos((pi*x)/2) + sin(pi*y) + (cos(pi*y)*sin(2*pi*t))/5 + 1)*(cos((pi*x)/2) + sin(pi*y) +
cos(pi*y)*sin(2*pi*t)*sin(pi*y) + 3/4))/4 - diffem_coeff*pi*(pi*cos(pi*y) - (pi*sin(2*pi*t)*sin(pi*y))/5)*(cos(pi*y) -
sin(2*pi*t) + 2*cos(pi*y)^2*sin(2*pi*t))*(cos((pi*x)/2) + sin(pi*y) + cos(pi*y)*sin(2*pi*t)*sin(pi*y) + 3/4) +
(ee*sin(2*pi*t)*sin(pi*y)*(diffem_coeff*(pi*cos(pi*y) - (pi*sin(2*pi*t)*sin(pi*y))/5)*(cos((pi*x)/2) +
sin(pi*y) + cos(pi*y)*sin(2*pi*t)*sin(pi*y) + 3/4) - (ee*muem_coeff*sin(2*pi*t)*sin(pi*y)*(cos((pi*x)/2) +
sin(pi*y) + (cos(pi*y)*sin(2*pi*t))/5 + 1)*(cos((pi*x)/2) + sin(pi*y) +
cos(pi*y)*sin(2*pi*t)*sin(pi*y) + 3/4))/(5*diffpotential*pi)))/(5*diffpotential*pi) +
diffem_coeff*pi^2*sin(pi*y)*(4*cos(pi*y)*sin(2*pi*t) + 1)*(cos((pi*x)/2) + sin(pi*y) +
(cos(pi*y)*sin(2*pi*t))/5 + 1)*(cos((pi*x)/2) + sin(pi*y) + cos(pi*y)*sin(2*pi*t)*sin(pi*y) + 3/4) -
(ee*sin((pi*x)/2)^2*(4*cos((pi*x)/2) + 4*sin(pi*y) +
4*cos(pi*y)*sin(2*pi*t)*sin(pi*y) + 3)*(10*ee*muem_coeff + 10*ee*muem_coeff*cos((pi*x)/2) +
10*ee*muem_coeff*sin(pi*y) + 25*diffem_coeff*diffpotential*pi^2 +
2*ee*muem_coeff*cos(pi*y)*sin(2*pi*t)))/(1000*diffpotential^2*pi^2)) / N_A'
[]
[em_ICs]
type = ParsedFunction
vars = 'N_A'
vals = 'N_A'
value = 'log((3.0 + cos(pi/2*x)) / N_A)'
[]
[ion_ICs]
type = ParsedFunction
vars = 'N_A'
vals = 'N_A'
value = 'log((3.0 + 0.9*cos(pi/2*x)) / N_A)'
[]
[mean_en_ICs]
type = ParsedFunction
vars = 'em_ICs'
vals = 'em_ICs'
value = 'log(32. + cos(pi/2*x)) + em_ICs'
[]
[]
[BCs]
[potential_BC]
type = FunctionDirichletBC
variable = potential
function = 'potential_fun'
boundary = '0 1 2 3'
preset = true
[]
[em_BC]
type = FunctionDirichletBC
variable = em
function = 'em_fun'
boundary = '0 1 2 3'
preset = true
[]
[ion_BC]
type = FunctionDirichletBC
variable = ion
function = 'ion_fun'
boundary = '0 1 2 3'
preset = true
[]
[energy_BC]
type = FunctionDirichletBC
variable = mean_en
function = 'mean_en_fun'
boundary = '0 1 2 3'
preset = true
[]
[Ex_BC]
type = FunctionDirichletBC
variable = Ex
function = 'Ex_fun'
boundary = '0 1 2 3'
preset = true
[]
[Ey_BC]
type = FunctionDirichletBC
variable = Ey
function = 'Ey_fun'
boundary = '0 1 2 3'
preset = true
[]
[]
[Materials]
[field_solver]
type = FieldSolverMaterial
potential = potential
[]
[Material_Coeff]
type = GenericFunctionMaterial
prop_names = 'e N_A'
prop_values = 'ee N_A'
[]
[ADMaterial_Coeff_Set1]
type = ADGenericFunctionMaterial
prop_names = 'diffpotential diffion muion'
prop_values = 'diffpotential diffion muion'
[]
[Material_Coeff_Set2]
type = ADMMSEEDFRates
electrons = em
mean_energy = mean_en
prop_names = 'diffem muem diffmean_en mumean_en'
prop_values = 'diffem muem diffmean_en mumean_en'
d_prop_d_actual_mean_en = 'diffem_coeff muem_coeff diffmean_en_coeff mumean_en_coeff'
[]
[Charge_Signs]
type = GenericConstantMaterial
prop_names = 'sgnem sgnion sgnmean_en'
prop_values = '-1.0 1.0 -1.0'
[]
[]
[Postprocessors]
[em_l2Error]
type = ElementL2Error
variable = em
function = em_fun
[]
[ion_l2Error]
type = ElementL2Error
variable = ion
function = ion_fun
[]
[potential_l2Error]
type = ElementL2Error
variable = potential
function = potential_fun
[]
[mean_en_l2Error]
type = ElementL2Error
variable = mean_en
function = mean_en_fun
[]
[Ex_l2Error]
type = ElementL2Error
variable = Ex
function = Ex_fun
[]
[Ey_l2Error]
type = ElementL2Error
variable = Ey
function = Ey_fun
[]
[h]
type = AverageElementSize
[]
[]
[Preconditioning]
active = 'smp'
[smp]
type = SMP
full = true
[]
[fdp]
type = FDP
full = true
[]
[]
[Executioner]
type = Transient
start_time = 50
end_time = 51
# dt = 0.008
dt = 0.02
automatic_scaling = true
compute_scaling_once = false
petsc_options = '-snes_converged_reason -snes_linesearch_monitor'
solve_type = NEWTON
line_search = none
petsc_options_iname = '-pc_type -pc_factor_shift_type -pc_factor_shift_amount'
petsc_options_value = 'lu NONZERO 1.e-10'
scheme = bdf2
nl_abs_tol = 1e-13
[]
[Outputs]
perf_graph = true
[out]
type = Exodus
interval = 10
[]
[]
(test/tests/mms/bcs/2D_ElectronBC_NegivateOutWardFacingEfield.i)
[Mesh]
[geo]
type = FileMeshGenerator
file = '2D_ElectronBC_NegivateOutWardFacingEfield_IC_out.e'
use_for_exodus_restart = true
[]
[]
[Problem]
type = FEProblem
[]
[Variables]
[em]
initial_from_file_var = em
[]
[ion]
initial_from_file_var = ion
[]
[mean_en]
initial_from_file_var = mean_en
[]
[Ex]
initial_from_file_var = Ex
[]
[Ey]
initial_from_file_var = Ey
[]
[potential]
initial_from_file_var = potential
[]
[]
[Kernels]
#Electron Equations
[em_time_derivative]
type = TimeDerivativeLog
variable = em
[]
[em_diffusion]
type = CoeffDiffusion
variable = em
position_units = 1.0
[]
[em_advection]
type = EFieldAdvection
variable = em
position_units = 1.0
[]
[em_source]
type = BodyForce
variable = em
function = 'em_source'
[]
#Ion Equations
[ion_time_derivative]
type = TimeDerivativeLog
variable = ion
[]
[ion_diffusion]
type = CoeffDiffusion
variable = ion
position_units = 1.0
[]
[ion_advection]
type = EffectiveEFieldAdvection
variable = ion
u = Ex
v = Ey
position_units = 1.0
[]
[ion_source]
type = BodyForce
variable = ion
function = 'ion_source'
[]
#Eff. Efield
[EffEfield_X_time_deriv]
type = TimeDerivative
variable = Ex
[]
[EffEfield_X_diffusion]
type = MatDiffusion
diffusivity = diffEx
variable = Ex
[]
[EffEfield_X_source]
type = BodyForce
variable = Ex
function = 'Ex_source'
[]
[EffEfield_Y_time_deriv]
type = TimeDerivative
variable = Ey
[]
[EffEfield_Y_diffusion]
type = MatDiffusion
diffusivity = diffEy
variable = Ey
[]
[EffEfield_Y_source]
type = BodyForce
variable = Ey
function = 'Ey_source'
[]
#Potential
[Potential_time_deriv]
type = TimeDerivative
variable = potential
[]
[Potential_diffusion]
type = MatDiffusion
diffusivity = diffpotential
variable = potential
[]
[Potential_source]
type = BodyForce
variable = potential
function = 'potential_source'
[]
#Electron Energy Equations
[mean_en_time_deriv]
type = TimeDerivativeLog
variable = mean_en
[]
[mean_en_diffusion]
type = CoeffDiffusion
variable = mean_en
position_units = 1.0
[]
[mean_en_source]
type = BodyForce
variable = mean_en
function = 'energy_source'
[]
[]
[AuxVariables]
[mean_en_sol]
[]
[em_sol]
[]
[ion_sol]
[]
[Ex_sol]
[]
[Ey_sol]
[]
[potential_sol]
[]
[]
[AuxKernels]
[mean_en_sol]
type = FunctionAux
variable = mean_en_sol
function = mean_en_fun
[]
[em_sol]
type = FunctionAux
variable = em_sol
function = em_fun
[]
[ion_sol]
type = FunctionAux
variable = ion_sol
function = ion_fun
[]
[Ex_sol]
type = FunctionAux
variable = Ex_sol
function = Ex_fun
[]
[Ey_sol]
type = FunctionAux
variable = Ey_sol
function = Ey_fun
[]
[potential_sol]
type = FunctionAux
variable = potential_sol
function = potential_fun
[]
[]
[Functions]
#Material Variables
[massem]
type = ConstantFunction
value = 1.0
[]
#Electron diffusion coeff.
[diffem]
type = ConstantFunction
value = 0.05
[]
[muem]
type = ConstantFunction
value = 0.01
[]
#Electron energy mobility coeff.
[diffmean_en]
type = ConstantFunction
value = 0.05
[]
#Ion diffusion coeff.
[diffion]
type = ParsedFunction
vars = diffem
vals = diffem
value = diffem
[]
[muion]
type = ParsedFunction
vars = muem
vals = muem
value = muem
[]
[N_A]
type = ConstantFunction
value = 1.0
[]
[ee]
type = ConstantFunction
value = 1.0
[]
[diffpotential]
type = ConstantFunction
value = 0.25
[]
#Manufactured Solutions
#The manufactured electron density solution
[em_fun]
type = ParsedFunction
vars = 'N_A'
vals = 'N_A'
value = 'log((sin(pi*y) + 0.2*sin(2*pi*t)*cos(pi*y) + 1.0 + sin(pi*x)) / N_A)'
[]
#The manufactured ion density solution
[ion_fun]
type = ParsedFunction
vars = 'N_A'
vals = 'N_A'
value = 'log((sin(pi*y) + 0.2*sin(2*pi*t)*cos(pi*y) + 1.0 + sin(pi*x)) / N_A)'
[]
#The manufactured electron energy solution
[mean_en_fun]
type = ParsedFunction
vars = 'ee N_A diffpotential diffem muem massem diffmean_en diffion muion'
vals = 'ee N_A diffpotential diffem muem massem diffmean_en diffion muion'
value = 'log(((3*massem*pi*(4*pi*diffem + 4*muem*pi*(sin(pi*t) + 1)*(sin(pi*x) +
sin(pi*y) + (cos(pi*y)*sin(2*pi*t))/5 + 1))^2)/(16*ee*(sin(pi*x) +
sin(pi*y) + (cos(pi*y)*sin(2*pi*t))/5 + 1))) / N_A)'
[]
#The manufactured eff. Efield solution
[Ex_fun]
type = ParsedFunction
vars = 'ee N_A diffpotential diffem muem massem diffmean_en diffion muion'
vals = 'ee N_A diffpotential diffem muem massem diffmean_en diffion muion'
value = 'pi*cos(pi*x)*(sin(pi*t) + 1)'
[]
[Ey_fun]
type = ParsedFunction
vars = 'ee N_A diffpotential diffem muem massem diffmean_en diffion muion'
vals = 'ee N_A diffpotential diffem muem massem diffmean_en diffion muion'
value = 'pi*cos(pi*y)*(sin(pi*t) + 1)'
[]
#The manufactured potential solution
[potential_fun]
type = ParsedFunction
vars = 'ee N_A diffpotential diffem muem massem diffmean_en diffion muion'
vals = 'ee N_A diffpotential diffem muem massem diffmean_en diffion muion'
value = '-(sin(pi*t) + 1.0)*(sin(pi*y) + sin(pi*x))'
[]
#Source Terms in moles
#The electron source term.
[em_source]
type = ParsedFunction
vars = 'ee N_A diffpotential diffem muem massem diffmean_en diffion muion'
vals = 'ee N_A diffpotential diffem muem massem diffmean_en diffion muion'
value = '(diffem*pi^2*sin(pi*x) + (diffem*pi^2*(5*sin(pi*y) +
cos(pi*y)*sin(2*pi*t)))/5 + (2*pi*cos(2*pi*t)*cos(pi*y))/5 +
(muem*pi^2*(sin(pi*t) + 1)*(5*sin(pi*x) + 5*sin(pi*y) +
10*sin(pi*x)*sin(pi*y) - 10*cos(pi*x)^2 - 10*cos(pi*y)^2 +
cos(pi*y)*sin(2*pi*t)*sin(pi*x) + 2*cos(pi*y)*sin(2*pi*t)*sin(pi*y) + 10))/5) / N_A'
[]
#The ion source term.
[ion_source]
type = ParsedFunction
vars = 'ee N_A diffpotential diffem muem massem diffmean_en diffion muion'
vals = 'ee N_A diffpotential diffem muem massem diffmean_en diffion muion'
value = '(diffion*pi^2*sin(pi*x) + (diffion*pi^2*(5*sin(pi*y) + cos(pi*y)*sin(2*pi*t)))/5 +
(2*pi*cos(2*pi*t)*cos(pi*y))/5 - (muion*pi^2*(sin(pi*t) + 1)*(5*sin(pi*x) +
5*sin(pi*y) + 10*sin(pi*x)*sin(pi*y) - 10*cos(pi*x)^2 -
10*cos(pi*y)^2 + cos(pi*y)*sin(2*pi*t)*sin(pi*x) +
2*cos(pi*y)*sin(2*pi*t)*sin(pi*y) + 10))/5) / N_A'
[]
[energy_source]
type = ParsedFunction
vars = 'ee N_A diffpotential diffem muem massem diffmean_en diffion muion'
vals = 'ee N_A diffpotential diffem muem massem diffmean_en diffion muion'
value = '((3*massem*pi*(4*muem*pi^2*cos(pi*t)*(sin(pi*x) + sin(pi*y) +
(cos(pi*y)*sin(2*pi*t))/5 + 1) + (8*muem*pi^2*cos(2*pi*t)*cos(pi*y)*(sin(pi*t) +
1))/5)*(4*pi*diffem + 4*muem*pi*(sin(pi*t) + 1)*(sin(pi*x) + sin(pi*y) +
(cos(pi*y)*sin(2*pi*t))/5 + 1)))/(8*ee*(sin(pi*x) + sin(pi*y) + (cos(pi*y)*sin(2*pi*t))/5 + 1)) -
diffmean_en*((3*massem*pi^3*sin(pi*x)*(4*pi*diffem + 4*muem*pi*(sin(pi*t) + 1)*(sin(pi*x) +
sin(pi*y) + (cos(pi*y)*sin(2*pi*t))/5 + 1))^2)/(16*ee*(sin(x*pi) + sin(y*pi) +
(cos(y*pi)*sin(2*t*pi))/5 + 1)^2) + (3*massem*pi^3*cos(pi*x)^2*(4*pi*diffem +
4*muem*pi*(sin(pi*t) + 1)*(sin(pi*x) + sin(pi*y) + (cos(pi*y)*sin(2*pi*t))/5 +
1))^2)/(8*ee*(sin(x*pi) + sin(y*pi) + (cos(y*pi)*sin(2*t*pi))/5 + 1)^3) +
(6*massem*muem^2*pi^5*cos(pi*x)^2*(sin(pi*t) + 1)^2)/(ee*(sin(pi*x) + sin(pi*y) +
(cos(pi*y)*sin(2*pi*t))/5 + 1)) - (3*massem*muem*pi^4*sin(pi*x)*(4*pi*diffem +
4*muem*pi*(sin(pi*t) + 1)*(sin(pi*x) + sin(pi*y) + (cos(pi*y)*sin(2*pi*t))/5 +
1))*(sin(pi*t) + 1))/(2*ee*(sin(pi*x) + sin(pi*y) + (cos(pi*y)*sin(2*pi*t))/5 + 1)) -
(3*massem*muem*pi^4*cos(pi*x)^2*(4*pi*diffem + 4*muem*pi*(sin(pi*t) + 1)*(sin(pi*x) +
sin(pi*y) + (cos(pi*y)*sin(2*pi*t))/5 + 1))*(sin(pi*t) + 1))/(ee*(sin(x*pi) +
sin(y*pi) + (cos(y*pi)*sin(2*t*pi))/5 + 1)^2)) - diffmean_en*((3*massem*pi*(pi*cos(pi*y) -
(pi*sin(2*pi*t)*sin(pi*y))/5)^2*(4*pi*diffem + 4*muem*pi*(sin(pi*t) + 1)*(sin(pi*x) +
sin(pi*y) + (cos(pi*y)*sin(2*pi*t))/5 + 1))^2)/(8*ee*(sin(x*pi) + sin(y*pi) +
(cos(y*pi)*sin(2*t*pi))/5 + 1)^3) + (3*massem*pi*(pi^2*sin(pi*y) +
(pi^2*cos(pi*y)*sin(2*pi*t))/5)*(4*pi*diffem + 4*muem*pi*(sin(pi*t) + 1)*(sin(pi*x) +
sin(pi*y) + (cos(pi*y)*sin(2*pi*t))/5 + 1))^2)/(16*ee*(sin(x*pi) + sin(y*pi) +
(cos(y*pi)*sin(2*t*pi))/5 + 1)^2) + (6*massem*muem^2*pi^3*(pi*cos(pi*y) -
(pi*sin(2*pi*t)*sin(pi*y))/5)^2*(sin(pi*t) + 1)^2)/(ee*(sin(pi*x) + sin(pi*y) +
(cos(pi*y)*sin(2*pi*t))/5 + 1)) - (3*massem*muem*pi^2*(pi*cos(pi*y) -
(pi*sin(2*pi*t)*sin(pi*y))/5)^2*(4*pi*diffem + 4*muem*pi*(sin(pi*t) + 1)*(sin(pi*x) +
sin(pi*y) + (cos(pi*y)*sin(2*pi*t))/5 + 1))*(sin(pi*t) + 1))/(ee*(sin(x*pi) +
sin(y*pi) + (cos(y*pi)*sin(2*t*pi))/5 + 1)^2) - (3*massem*muem*pi^2*(pi^2*sin(pi*y) +
(pi^2*cos(pi*y)*sin(2*pi*t))/5)*(4*pi*diffem + 4*muem*pi*(sin(pi*t) + 1)*(sin(pi*x) +
sin(pi*y) + (cos(pi*y)*sin(2*pi*t))/5 + 1))*(sin(pi*t) + 1))/(2*ee*(sin(pi*x) +
sin(pi*y) + (cos(pi*y)*sin(2*pi*t))/5 + 1))) -
(3*massem*pi^2*cos(2*pi*t)*cos(pi*y)*(4*pi*diffem + 4*muem*pi*(sin(pi*t) + 1)*(sin(pi*x) +
sin(pi*y) + (cos(pi*y)*sin(2*pi*t))/5 + 1))^2)/(40*ee*(sin(x*pi) + sin(y*pi) +
(cos(y*pi)*sin(2*t*pi))/5 + 1)^2)) / N_A'
[]
#The Ex source term.
[Ex_source]
type = ParsedFunction
vars = 'ee N_A diffpotential diffem muem massem diffmean_en diffion muion'
vals = 'ee N_A diffpotential diffem muem massem diffmean_en diffion muion'
value = 'pi^2*cos(pi*t)*cos(pi*x) + diffpotential*pi^3*cos(pi*x)*(sin(pi*t) + 1)'
[]
[Ey_source]
type = ParsedFunction
vars = 'ee N_A diffpotential diffem muem massem diffmean_en diffion muion'
vals = 'ee N_A diffpotential diffem muem massem diffmean_en diffion muion'
value = 'pi^2*cos(pi*t)*cos(pi*y) + diffpotential*pi^3*cos(pi*y)*(sin(pi*t) + 1)'
[]
[potential_source]
type = ParsedFunction
vars = 'ee N_A diffpotential diffem muem massem diffmean_en diffion muion'
vals = 'ee N_A diffpotential diffem muem massem diffmean_en diffion muion'
value = '-pi*cos(pi*t)*(sin(pi*x) + sin(pi*y)) -
diffpotential*pi^2*sin(pi*x)*(sin(pi*t) + 1) -
diffpotential*pi^2*sin(pi*y)*(sin(pi*t) + 1)'
[]
[em_ICs]
type = ParsedFunction
vars = 'N_A'
vals = 'N_A'
value = 'log((3.0 + sin(pi/2*x)) / N_A)'
[]
[ion_ICs]
type = ParsedFunction
vars = 'N_A'
vals = 'N_A'
value = 'log((3.0 + sin(pi/2*x)) / N_A)'
[]
[mean_en_ICs]
type = ParsedFunction
vars = 'em_ICs'
vals = 'em_ICs'
value = 'log(32.) + em_ICs'
[]
[em_left_Flux_BC]
type = ParsedFunction
vars = 'ee N_A diffpotential diffem muem massem diffmean_en diffion muion'
vals = 'ee N_A diffpotential diffem muem massem diffmean_en diffion muion'
value = '(-diffem*pi*cos(pi*x) - muem*pi*cos(pi*x)*(sin(pi*t) + 1)*(sin(pi*x) +
sin(pi*y) + (cos(pi*y)*sin(2*pi*t))/5 + 1)) / N_A'
[]
[em_down_Flux_BC]
type = ParsedFunction
vars = 'ee N_A diffpotential diffem muem massem diffmean_en diffion muion'
vals = 'ee N_A diffpotential diffem muem massem diffmean_en diffion muion'
value = '(-(diffem*pi*(5*cos(pi*y) - sin(2*pi*t)*sin(pi*y)))/5 -
muem*pi*cos(pi*y)*(sin(pi*t) + 1)*(sin(pi*x) + sin(pi*y) +
(cos(pi*y)*sin(2*pi*t))/5 + 1)) / N_A'
[]
[]
[BCs]
#[em_left_BC]
# type = FunctionDirichletBC
# variable = em
# function = 'em_fun'
# boundary = 3
# preset = true
#[]
#[em_left_BC]
# type = FunctionNeumannBC
# variable = em
# function = 'em_left_Flux_BC'
# boundary = 3
# preset = true
#[]
[em_physical_diffusion_left]
type = SakiyamaElectronDiffusionBC
variable = em
electron_energy = mean_en
boundary = 3
position_units = 1.0
[]
[em_Ar+_second_emissions_left]
type = SakiyamaSecondaryElectronWithEffEfieldBC
variable = em
Ex = Ex
Ey = Ey
ions = ion
emission_coeffs = 'users_gamma'
boundary = 3
position_units = 1.0
[]
[em_right_BC]
type = FunctionDirichletBC
variable = em
function = 'em_fun'
boundary = 1
preset = true
[]
#[em_down_BC]
# type = FunctionDirichletBC
# variable = em
# function = 'em_fun'
# boundary = 0
# preset = true
#[]
#[em_down_BC]
# type = FunctionNeumannBC
# variable = em
# function = 'em_down_Flux_BC'
# boundary = 0
# preset = true
#[]
[em_physical_diffusion_down]
type = SakiyamaElectronDiffusionBC
variable = em
electron_energy = mean_en
boundary = 0
position_units = 1.0
[]
[em_Ar+_second_emissions_down]
type = SakiyamaSecondaryElectronWithEffEfieldBC
variable = em
Ex = Ex
Ey = Ey
ions = ion
emission_coeffs = 'users_gamma'
boundary = 0
position_units = 1.0
[]
[em_up_BC]
type = FunctionDirichletBC
variable = em
function = 'em_fun'
boundary = 2
preset = true
[]
[ion_BC]
type = FunctionDirichletBC
variable = ion
function = 'ion_fun'
boundary = '0 1 2 3'
preset = true
[]
[energy_BC]
type = FunctionDirichletBC
variable = mean_en
function = 'mean_en_fun'
boundary = '0 1 2 3'
preset = true
[]
[Ex_BC]
type = FunctionDirichletBC
variable = Ex
function = 'Ex_fun'
boundary = '0 1 2 3'
preset = true
[]
[Ey_BC]
type = FunctionDirichletBC
variable = Ey
function = 'Ey_fun'
boundary = '0 1 2 3'
preset = true
[]
[potential_BC]
type = FunctionDirichletBC
variable = potential
function = 'potential_fun'
boundary = '0 1 2 3'
preset = true
[]
[]
[Materials]
[field_solver]
type = FieldSolverMaterial
potential = potential
[]
[Material_Coeff]
type = GenericFunctionMaterial
prop_names = 'e N_A massem diffpotential diffEx diffEy'
prop_values = 'ee N_A massem diffpotential diffpotential diffpotential '
[]
[ADMaterial_Coeff_Set1]
type = ADGenericFunctionMaterial
prop_names = 'diffion muion diffem muem diffmean_en'
prop_values = 'diffion muion diffem muem diffmean_en'
[]
[Charge_Signs]
type = GenericConstantMaterial
prop_names = 'sgnem sgnion sgnmean_en'
prop_values = '-1.0 1.0 -1.0'
[]
[emission_coeffs]
type = ADGenericConstantMaterial
prop_names = 'users_gamma'
prop_values = '1.0'
[]
[]
[Postprocessors]
[em_l2Error]
type = ElementL2Error
variable = em
function = em_fun
[]
[ion_l2Error]
type = ElementL2Error
variable = ion
function = ion_fun
[]
[mean_en_l2Error]
type = ElementL2Error
variable = mean_en
function = mean_en_fun
[]
[Ex_l2Error]
type = ElementL2Error
variable = Ex
function = Ex_fun
[]
[Ey_l2Error]
type = ElementL2Error
variable = Ey
function = Ey_fun
[]
[potential_l2Error]
type = ElementL2Error
variable = potential
function = potential_fun
[]
[h]
type = AverageElementSize
[]
[]
[Preconditioning]
active = 'smp'
[smp]
type = SMP
full = true
[]
[fdp]
type = FDP
full = true
[]
[]
[Executioner]
type = Transient
start_time = 50
end_time = 51
# dt = 0.008
dt = 0.02
automatic_scaling = true
compute_scaling_once = false
petsc_options = '-snes_converged_reason -snes_linesearch_monitor'
solve_type = NEWTON
line_search = none
petsc_options_iname = '-pc_type -pc_factor_shift_type -pc_factor_shift_amount'
petsc_options_value = 'lu NONZERO 1.e-10'
scheme = bdf2
nl_abs_tol = 1e-13
[]
[Outputs]
perf_graph = true
[out]
type = Exodus
interval = 10
[]
[]
(test/tests/mms/continuity_equations/2D_Coupling_Electons_Potential_Ions_MeanEnergy_Einstein_Relation_EffEfield.i)
[Mesh]
[geo]
type = FileMeshGenerator
file = '2D_Coupling_Electons_Potential_Ions_MeanEnergy_Einstein_Relation_EffEfield_IC_out.e'
use_for_exodus_restart = true
[]
[]
[Problem]
type = FEProblem
[]
[Variables]
[em]
initial_from_file_var = em
[]
[potential]
initial_from_file_var = potential
[]
[ion]
initial_from_file_var = ion
[]
[mean_en]
initial_from_file_var = mean_en
[]
[Ex]
initial_from_file_var = Ex
[]
[Ey]
initial_from_file_var = Ey
[]
[]
[Kernels]
#Electron Equations
[em_time_derivative]
type = TimeDerivativeLog
variable = em
[]
[em_diffusion]
type = CoeffDiffusion
variable = em
position_units = 1.0
[]
[em_advection]
type = EFieldAdvection
variable = em
position_units = 1.0
[]
[em_source]
type = BodyForce
variable = em
function = 'em_source'
[]
#Ion Equations
[ion_time_derivative]
type = TimeDerivativeLog
variable = ion
[]
[ion_diffusion]
type = CoeffDiffusion
variable = ion
position_units = 1.0
[]
[ion_advection]
type = EffectiveEFieldAdvection
variable = ion
u = Ex
v = Ey
position_units = 1.0
[]
[ion_source]
type = BodyForce
variable = ion
function = 'ion_source'
[]
#Potential Equations
[potential_diffusion]
type = CoeffDiffusionLin
variable = potential
position_units = 1.0
[]
[ion_charge_source]
type = ChargeSourceMoles_KV
variable = potential
charged = ion
potential_units = V
[]
[em_charge_source]
type = ChargeSourceMoles_KV
variable = potential
charged = em
potential_units = V
[]
#Eff. Efield
[EffEfield_X_time_deriv]
type = TimeDerivative
variable = Ex
[]
[EffEfield_X_ForceBody]
type = EffectiveEField
variable = Ex
nu = 5.0
component = 0
position_units = 1.0
[]
[EffEfield_Y_time_deriv]
type = TimeDerivative
variable = Ey
[]
[EffEfield_Y_ForceBody]
type = EffectiveEField
variable = Ey
nu = 5.0
component = 1
position_units = 1.0
[]
#Electron Energy Equations
[mean_en_time_deriv]
type = TimeDerivativeLog
variable = mean_en
[]
[mean_en_advection]
type = EFieldAdvection
variable = mean_en
position_units = 1.0
[]
[mean_en_diffusion]
type = CoeffDiffusion
variable = mean_en
position_units = 1.0
[]
[mean_en_diffusion_correction]
type = ThermalConductivityDiffusion
variable = mean_en
em = em
position_units = 1.0
[]
[mean_en_joule_heating]
type = JouleHeating
variable = mean_en
em = em
position_units = 1.0
potential_units = V
[]
[mean_en_source]
type = BodyForce
variable = mean_en
function = 'energy_source'
[]
[]
[AuxVariables]
[potential_sol]
[]
[mean_en_sol]
[]
[em_sol]
[]
[ion_sol]
[]
[Ex_sol]
[]
[Ey_sol]
[]
[]
[AuxKernels]
[potential_sol]
type = FunctionAux
variable = potential_sol
function = potential_fun
[]
[mean_en_sol]
type = FunctionAux
variable = mean_en_sol
function = mean_en_fun
[]
[em_sol]
type = FunctionAux
variable = em_sol
function = em_fun
[]
[ion_sol]
type = FunctionAux
variable = ion_sol
function = ion_fun
[]
[Ex_sol]
type = FunctionAux
variable = Ex_sol
function = Ex_fun
[]
[Ey_sol]
type = FunctionAux
variable = Ey_sol
function = Ey_fun
[]
[]
[Functions]
#Material Variables
#Electron diffusion coeff.
[diffem_coeff]
type = ConstantFunction
value = 0.05
[]
#Electron mobility coeff.
[muem_coeff]
type = ConstantFunction
value = 0.01
[]
#Electron energy diffusion coeff.
[diffmean_en_coeff]
type = ParsedFunction
vars = 'diffem_coeff'
vals = 'diffem_coeff'
value = '5.0 / 3.0 * diffem_coeff'
[]
#Electron energy mobility coeff.
[mumean_en_coeff]
type = ParsedFunction
vars = 'muem_coeff'
vals = 'muem_coeff'
value = '5.0 / 3.0 * muem_coeff'
[]
#Ion diffusion coeff.
[diffion]
type = ConstantFunction
value = 0.1
[]
#Ion mobility coeff.
[muion]
type = ConstantFunction
value = 0.025
[]
[N_A]
type = ConstantFunction
value = 1.0
[]
[ee]
type = ConstantFunction
value = 1.0
[]
[diffpotential]
type = ConstantFunction
value = 0.01
[]
#Manufactured Solutions
#The manufactured electron density solution
[em_fun]
type = ParsedFunction
vars = 'N_A'
vals = 'N_A'
value = 'log((sin(pi*y) + 0.2*sin(2*pi*t)*cos(pi*y) + 1.0 + cos(pi/2*x)) / N_A)'
[]
#The manufactured ion density solution
[ion_fun]
type = ParsedFunction
vars = 'N_A'
vals = 'N_A'
value = 'log((sin(pi*y) + 1.0 + 0.9*cos(pi/2*x)) / N_A)'
[]
#The manufactured electron density solution
[potential_fun]
type = ParsedFunction
vars = 'ee diffpotential'
vals = 'ee diffpotential'
value = '-(ee*(2*cos((pi*x)/2) + cos(pi*y)*sin(2*pi*t)))/(5*diffpotential*pi^2)'
[]
#The manufactured electron energy solution
[energy_fun]
type = ParsedFunction
vars = 'N_A'
vals = 'N_A'
value = 'sin(pi*y) + sin(2*pi*t)*cos(pi*y)*sin(pi*y) + 0.75 + cos(pi/2*x)'
[]
[mean_en_fun]
type = ParsedFunction
vars = 'energy_fun em_fun'
vals = 'energy_fun em_fun'
value = 'log(energy_fun) + em_fun'
[]
#The manufactured eff. Efield solution
[Ex_fun]
type = ParsedFunction
vars = 'ee diffpotential'
vals = 'ee diffpotential'
value = '-(ee*exp(-5*t)*sin((pi*x)/2)*(exp(5*t) - 1))/(5*diffpotential*pi)'
[]
[Ey_fun]
type = ParsedFunction
vars = 'ee diffpotential'
vals = 'ee diffpotential'
value = '-(2*ee*exp(-5*t)*sin(pi*y))/(4*diffpotential*pi^2 + 25*diffpotential) -
(ee*sin(pi*y)*(5*sin(2*pi*t) - 2*pi*cos(2*pi*t)))/(diffpotential*pi*(4*pi^2 + 25))'
[]
#Electron diffusion coeff.
[diffem]
type = ParsedFunction
vars = 'diffem_coeff energy_fun'
vals = 'diffem_coeff energy_fun'
value = 'diffem_coeff * energy_fun'
[]
#Electron mobility coeff.
[muem]
type = ParsedFunction
vars = 'muem_coeff energy_fun'
vals = 'muem_coeff energy_fun'
value = 'muem_coeff * energy_fun'
[]
#Electron energy diffusion coeff.
[diffmean_en]
type = ParsedFunction
vars = 'diffmean_en_coeff energy_fun'
vals = 'diffmean_en_coeff energy_fun'
value = 'diffmean_en_coeff * energy_fun'
[]
#Electron energy mobility coeff.
[mumean_en]
type = ParsedFunction
vars = 'mumean_en_coeff energy_fun'
vals = 'mumean_en_coeff energy_fun'
value = 'mumean_en_coeff * energy_fun'
[]
#Source Terms in moles
#The electron source term.
[em_source]
type = ParsedFunction
vars = 'ee diffpotential diffem_coeff muem_coeff N_A'
vals = 'ee diffpotential diffem_coeff muem_coeff N_A'
value = '((2*pi*cos(2*pi*t)*cos(pi*y))/5 - (diffem_coeff*pi^2*sin((pi*x)/2)^2)/4 -
diffem_coeff*pi*(pi*cos(pi*y) - (pi*sin(2*pi*t)*sin(pi*y))/5)*(cos(pi*y) -
sin(2*pi*t) + 2*cos(pi*y)^2*sin(2*pi*t)) + (diffem_coeff*pi^2*cos((pi*x)/2)*(cos((pi*x)/2) +
sin(pi*y) + cos(pi*y)*sin(2*pi*t)*sin(pi*y) + 3/4))/4 + (diffem_coeff*pi^2*(5*sin(pi*y) +
cos(pi*y)*sin(2*pi*t))*(cos((pi*x)/2) + sin(pi*y) + cos(pi*y)*sin(2*pi*t)*sin(pi*y) + 3/4))/5 -
(ee*muem_coeff*sin((pi*x)/2)^2*(cos((pi*x)/2) + sin(pi*y) +
cos(pi*y)*sin(2*pi*t)*sin(pi*y) + 3/4))/(10*diffpotential) -
(ee*muem_coeff*sin((pi*x)/2)^2*(cos((pi*x)/2) + sin(pi*y) + (cos(pi*y)*sin(2*pi*t))/5 + 1))/(10*diffpotential) +
(ee*muem_coeff*cos((pi*x)/2)*(cos((pi*x)/2) + sin(pi*y) +
(cos(pi*y)*sin(2*pi*t))/5 + 1)*(cos((pi*x)/2) + sin(pi*y) + cos(pi*y)*sin(2*pi*t)*sin(pi*y) + 3/4))/(10*diffpotential) +
(ee*muem_coeff*cos(pi*y)*sin(2*pi*t)*(cos((pi*x)/2) + sin(pi*y) + (cos(pi*y)*sin(2*pi*t))/5 + 1)*(cos((pi*x)/2) +
sin(pi*y) + cos(pi*y)*sin(2*pi*t)*sin(pi*y) + 3/4))/(5*diffpotential) + (ee*muem_coeff*sin(2*pi*t)*sin(pi*y)*(cos(pi*y) -
sin(2*pi*t) + 2*cos(pi*y)^2*sin(2*pi*t))*(cos((pi*x)/2) + sin(pi*y) + (cos(pi*y)*sin(2*pi*t))/5 + 1))/(5*diffpotential) +
(ee*muem_coeff*sin(2*pi*t)*sin(pi*y)*(pi*cos(pi*y) - (pi*sin(2*pi*t)*sin(pi*y))/5)*(cos((pi*x)/2) + sin(pi*y) +
cos(pi*y)*sin(2*pi*t)*sin(pi*y) + 3/4))/(5*diffpotential*pi)) / N_A'
[]
#The ion source term.
[ion_source]
type = ParsedFunction
vars = 'ee diffpotential diffion muion N_A'
vals = 'ee diffpotential diffion muion N_A'
value = '((diffion*pi^2*(9*cos((pi*x)/2) + 40*sin(pi*y)))/40 +
(9*ee*muion*exp(-5*t)*sin((pi*x)/2)^2*(exp(5*t) - 1))/(100*diffpotential) -
(ee*muion*exp(-5*t)*cos((pi*x)/2)*(exp(5*t) - 1)*((9*cos((pi*x)/2))/10 + sin(pi*y) + 1))/(10*diffpotential) -
(ee*muion*exp(-5*t)*cos(pi*y)*(2*pi + 5*exp(5*t)*sin(2*pi*t) -
2*pi*exp(5*t)*cos(2*pi*t))*((9*cos((pi*x)/2))/10 + sin(pi*y) + 1))/(diffpotential*(4*pi^2 + 25)) -
(ee*muion*exp(-5*t)*cos(pi*y)*sin(pi*y)*(2*pi + 5*exp(5*t)*sin(2*pi*t) -
2*pi*exp(5*t)*cos(2*pi*t)))/(diffpotential*(4*pi^2 + 25))) / N_A'
[]
[energy_source]
type = ParsedFunction
vars = 'ee diffpotential diffem_coeff muem_coeff N_A'
vals = 'ee diffpotential diffem_coeff muem_coeff N_A'
value = '(((4*cos((pi*x)/2) + 4*sin(pi*y) + 4*cos(pi*y)*sin(2*pi*t)*sin(pi*y) + 3)*(172*ee*muem_coeff*cos(2*pi*t)^2 -
282*ee*muem_coeff + 180*ee*muem_coeff*cos((pi*x)/2)^2 + 160*ee*muem_coeff*cos((pi*x)/2)^3 +
664*ee*muem_coeff*cos(pi*y)^2 - 480*ee*muem_coeff*cos(pi*y)^4 -
66*ee*muem_coeff*cos((pi*x)/2) - 296*ee*muem_coeff*sin(pi*y) +
200*diffem_coeff*diffpotential*pi^2 - 664*ee*muem_coeff*cos(2*pi*t)^2*cos(pi*y)^2 +
480*ee*muem_coeff*cos(2*pi*t)^2*cos(pi*y)^4 + 364*ee*muem_coeff*cos(pi*y)*sin(2*pi*t) -
90*ee*muem_coeff*cos((pi*x)/2)*sin(pi*y) + 75*diffem_coeff*diffpotential*pi^2*cos((pi*x)/2) +
140*diffem_coeff*diffpotential*pi^2*sin(pi*y) + 16*ee*muem_coeff*cos(2*pi*t)^2*cos((pi*x)/2) -
8*ee*muem_coeff*cos((pi*x)/2)*cos(pi*y)^2 + 176*ee*muem_coeff*cos(2*pi*t)^2*sin(pi*y) -
320*ee*muem_coeff*cos(pi*y)^3*sin(2*pi*t) + 200*ee*muem_coeff*cos((pi*x)/2)^2*sin(pi*y) +
464*ee*muem_coeff*cos(pi*y)^2*sin(pi*y) + 300*diffem_coeff*diffpotential*pi^2*cos((pi*x)/2)^2 -
1200*diffem_coeff*diffpotential*pi^2*cos(pi*y)^2 + 160*ee*muem_coeff*cos(2*pi*t)^2*cos((pi*x)/2)*sin(pi*y) +
104*ee*muem_coeff*cos((pi*x)/2)^2*cos(pi*y)*sin(2*pi*t) - 40*ee*muem_coeff*cos((pi*x)/2)*cos(pi*y)^3*sin(2*pi*t) +
408*ee*muem_coeff*cos((pi*x)/2)*cos(pi*y)^2*sin(pi*y) + 96*ee*muem_coeff*cos(pi*y)^3*sin(2*pi*t)*sin(pi*y) +
160*diffem_coeff*diffpotential*pi^2*cos(2*pi*t)^2*sin(pi*y) -
2000*diffem_coeff*diffpotential*pi^2*cos(pi*y)^3*sin(2*pi*t) + 400*diffem_coeff*diffpotential*pi^2*cos(pi*y)^2*sin(pi*y) -
32*ee*muem_coeff*cos(2*pi*t)^2*cos((pi*x)/2)*cos(pi*y)^2 - 464*ee*muem_coeff*cos(2*pi*t)^2*cos(pi*y)^2*sin(pi*y) +
186*ee*muem_coeff*cos((pi*x)/2)*cos(pi*y)*sin(2*pi*t) + 272*ee*muem_coeff*cos(pi*y)*sin(2*pi*t)*sin(pi*y) +
1260*diffem_coeff*diffpotential*pi^2*cos(pi*y)*sin(2*pi*t) + 500*diffem_coeff*diffpotential*pi^2*cos((pi*x)/2)*sin(pi*y) -
408*ee*muem_coeff*cos(2*pi*t)^2*cos((pi*x)/2)*cos(pi*y)^2*sin(pi*y) -
96*ee*muem_coeff*cos(2*pi*t)^2*cos(pi*y)^3*sin(2*pi*t)*sin(pi*y) -
400*diffem_coeff*diffpotential*pi^2*cos(2*pi*t)^2*cos(pi*y)^2*sin(pi*y) +
448*ee*muem_coeff*cos((pi*x)/2)*cos(pi*y)*sin(2*pi*t)*sin(pi*y) +
80*diffem_coeff*diffpotential*pi^2*cos((pi*x)/2)*cos(pi*y)*sin(2*pi*t) +
240*diffem_coeff*diffpotential*pi^2*cos(pi*y)*sin(2*pi*t)*sin(pi*y) +
48*ee*muem_coeff*cos(2*pi*t)^2*cos(pi*y)*sin(2*pi*t)*sin(pi*y) + 80*ee*muem_coeff*cos((pi*x)/2)^2*cos(pi*y)*sin(2*pi*t)*sin(pi*y) +
100*diffem_coeff*diffpotential*pi^2*cos((pi*x)/2)*cos(pi*y)*sin(2*pi*t)*sin(pi*y)))/(960*diffpotential) +
(pi*cos(2*pi*t)*cos(pi*y)*(4*cos((pi*x)/2) + 24*sin(pi*y) + 20*cos((pi*x)/2)*sin(pi*y) + 20*sin(pi*y)^2 +
8*cos(pi*y)*sin(2*pi*t)*sin(pi*y) + 3))/10 - (diffem_coeff*pi^2*sin((pi*x)/2)^2*(cos((pi*x)/2) + sin(pi*y) +
cos(pi*y)*sin(2*pi*t)*sin(pi*y) + 3/4))/4 - (diffem_coeff*pi^2*sin((pi*x)/2)^2*(cos((pi*x)/2) + sin(pi*y) +
(cos(pi*y)*sin(2*pi*t))/5 + 1))/4 - diffem_coeff*pi^2*(cos(pi*y) - sin(2*pi*t) +
2*cos(pi*y)^2*sin(2*pi*t))^2*(cos((pi*x)/2) + sin(pi*y) + (cos(pi*y)*sin(2*pi*t))/5 + 1) +
(diffem_coeff*pi^2*cos((pi*x)/2)*(cos((pi*x)/2) + sin(pi*y) + (cos(pi*y)*sin(2*pi*t))/5 + 1)*(cos((pi*x)/2) + sin(pi*y) +
cos(pi*y)*sin(2*pi*t)*sin(pi*y) + 3/4))/4 - diffem_coeff*pi*(pi*cos(pi*y) - (pi*sin(2*pi*t)*sin(pi*y))/5)*(cos(pi*y) -
sin(2*pi*t) + 2*cos(pi*y)^2*sin(2*pi*t))*(cos((pi*x)/2) + sin(pi*y) + cos(pi*y)*sin(2*pi*t)*sin(pi*y) + 3/4) +
(ee*sin(2*pi*t)*sin(pi*y)*(diffem_coeff*(pi*cos(pi*y) - (pi*sin(2*pi*t)*sin(pi*y))/5)*(cos((pi*x)/2) +
sin(pi*y) + cos(pi*y)*sin(2*pi*t)*sin(pi*y) + 3/4) - (ee*muem_coeff*sin(2*pi*t)*sin(pi*y)*(cos((pi*x)/2) +
sin(pi*y) + (cos(pi*y)*sin(2*pi*t))/5 + 1)*(cos((pi*x)/2) + sin(pi*y) +
cos(pi*y)*sin(2*pi*t)*sin(pi*y) + 3/4))/(5*diffpotential*pi)))/(5*diffpotential*pi) +
diffem_coeff*pi^2*sin(pi*y)*(4*cos(pi*y)*sin(2*pi*t) + 1)*(cos((pi*x)/2) + sin(pi*y) +
(cos(pi*y)*sin(2*pi*t))/5 + 1)*(cos((pi*x)/2) + sin(pi*y) + cos(pi*y)*sin(2*pi*t)*sin(pi*y) + 3/4) -
(ee*sin((pi*x)/2)^2*(4*cos((pi*x)/2) + 4*sin(pi*y) +
4*cos(pi*y)*sin(2*pi*t)*sin(pi*y) + 3)*(10*ee*muem_coeff + 10*ee*muem_coeff*cos((pi*x)/2) +
10*ee*muem_coeff*sin(pi*y) + 25*diffem_coeff*diffpotential*pi^2 +
2*ee*muem_coeff*cos(pi*y)*sin(2*pi*t)))/(1000*diffpotential^2*pi^2)) / N_A'
[]
[em_ICs]
type = ParsedFunction
vars = 'N_A'
vals = 'N_A'
value = 'log((3.0 + cos(pi/2*x)) / N_A)'
[]
[ion_ICs]
type = ParsedFunction
vars = 'N_A'
vals = 'N_A'
value = 'log((3.0 + 0.9*cos(pi/2*x)) / N_A)'
[]
[mean_en_ICs]
type = ParsedFunction
vars = 'em_ICs'
vals = 'em_ICs'
value = 'log(32. + cos(pi/2*x)) + em_ICs'
[]
[]
[BCs]
[potential_BC]
type = FunctionDirichletBC
variable = potential
function = 'potential_fun'
boundary = '0 1 2 3'
preset = true
[]
[em_BC]
type = FunctionDirichletBC
variable = em
function = 'em_fun'
boundary = '0 1 2 3'
preset = true
[]
[ion_BC]
type = FunctionDirichletBC
variable = ion
function = 'ion_fun'
boundary = '0 1 2 3'
preset = true
[]
[energy_BC]
type = FunctionDirichletBC
variable = mean_en
function = 'mean_en_fun'
boundary = '0 1 2 3'
preset = true
[]
[Ex_BC]
type = FunctionDirichletBC
variable = Ex
function = 'Ex_fun'
boundary = '0 1 2 3'
preset = true
[]
[Ey_BC]
type = FunctionDirichletBC
variable = Ey
function = 'Ey_fun'
boundary = '0 1 2 3'
preset = true
[]
[]
[Materials]
[field_solver]
type = FieldSolverMaterial
potential = potential
[]
[Material_Coeff]
type = GenericFunctionMaterial
prop_names = 'e N_A'
prop_values = 'ee N_A'
[]
[ADMaterial_Coeff_Set1]
type = ADGenericFunctionMaterial
prop_names = 'diffpotential diffion muion'
prop_values = 'diffpotential diffion muion'
[]
[Material_Coeff_Set2]
type = ADMMSEEDFRates
electrons = em
mean_energy = mean_en
prop_names = 'diffem muem diffmean_en mumean_en'
prop_values = 'diffem muem diffmean_en mumean_en'
d_prop_d_actual_mean_en = 'diffem_coeff muem_coeff diffmean_en_coeff mumean_en_coeff'
[]
[Charge_Signs]
type = GenericConstantMaterial
prop_names = 'sgnem sgnion sgnmean_en'
prop_values = '-1.0 1.0 -1.0'
[]
[]
[Postprocessors]
[em_l2Error]
type = ElementL2Error
variable = em
function = em_fun
[]
[ion_l2Error]
type = ElementL2Error
variable = ion
function = ion_fun
[]
[potential_l2Error]
type = ElementL2Error
variable = potential
function = potential_fun
[]
[mean_en_l2Error]
type = ElementL2Error
variable = mean_en
function = mean_en_fun
[]
[Ex_l2Error]
type = ElementL2Error
variable = Ex
function = Ex_fun
[]
[Ey_l2Error]
type = ElementL2Error
variable = Ey
function = Ey_fun
[]
[h]
type = AverageElementSize
[]
[]
[Preconditioning]
active = 'smp'
[smp]
type = SMP
full = true
[]
[fdp]
type = FDP
full = true
[]
[]
[Executioner]
type = Transient
start_time = 50
end_time = 51
# dt = 0.008
dt = 0.02
automatic_scaling = true
compute_scaling_once = false
petsc_options = '-snes_converged_reason -snes_linesearch_monitor'
solve_type = NEWTON
line_search = none
petsc_options_iname = '-pc_type -pc_factor_shift_type -pc_factor_shift_amount'
petsc_options_value = 'lu NONZERO 1.e-10'
scheme = bdf2
nl_abs_tol = 1e-13
[]
[Outputs]
perf_graph = true
[out]
type = Exodus
interval = 10
[]
[]
(test/tests/mms/bcs/2D_EnergyBC.i)
[Mesh]
[geo]
type = FileMeshGenerator
file = '2D_EnergyBC_IC_out.e'
use_for_exodus_restart = true
[]
[]
[Problem]
type = FEProblem
[]
[Variables]
[em]
initial_from_file_var = em
[]
[ion]
initial_from_file_var = ion
[]
[mean_en]
initial_from_file_var = mean_en
[]
[Ex]
initial_from_file_var = Ex
[]
[Ey]
initial_from_file_var = Ey
[]
[potential]
initial_from_file_var = potential
[]
[]
[Kernels]
#Electron Equations
[em_time_derivative]
type = TimeDerivativeLog
variable = em
[]
[em_diffusion]
type = CoeffDiffusion
variable = em
position_units = 1.0
[]
[em_source]
type = BodyForce
variable = em
function = 'em_source'
[]
#Ion Equations
[ion_time_derivative]
type = TimeDerivativeLog
variable = ion
[]
[ion_diffusion]
type = CoeffDiffusion
variable = ion
position_units = 1.0
[]
[ion_advection]
type = EffectiveEFieldAdvection
variable = ion
u = Ex
v = Ey
position_units = 1.0
[]
[ion_source]
type = BodyForce
variable = ion
function = 'ion_source'
[]
#Eff. Efield
[EffEfield_X_time_deriv]
type = TimeDerivative
variable = Ex
[]
[EffEfield_X_diffusion]
type = MatDiffusion
diffusivity = diffEx
variable = Ex
[]
[EffEfield_X_source]
type = BodyForce
variable = Ex
function = 'Ex_source'
[]
[EffEfield_Y_time_deriv]
type = TimeDerivative
variable = Ey
[]
[EffEfield_Y_diffusion]
type = MatDiffusion
diffusivity = diffEy
variable = Ey
[]
[EffEfield_Y_source]
type = BodyForce
variable = Ey
function = 'Ey_source'
[]
#Potential
[Potential_time_deriv]
type = TimeDerivative
variable = potential
[]
[Potential_diffusion]
type = MatDiffusion
diffusivity = diffpotential
variable = potential
[]
[Potential_source]
type = BodyForce
variable = potential
function = 'potential_source'
[]
#Electron Energy Equations
[mean_en_time_deriv]
type = TimeDerivativeLog
variable = mean_en
[]
[mean_en_diffusion]
type = CoeffDiffusion
variable = mean_en
position_units = 1.0
[]
[mean_en_advection]
type = EFieldAdvection
variable = mean_en
position_units = 1.0
[]
[mean_en_source]
type = BodyForce
variable = mean_en
function = 'energy_source'
[]
[]
[AuxVariables]
[mean_en_sol]
[]
[em_sol]
[]
[ion_sol]
[]
[Ex_sol]
[]
[Ey_sol]
[]
[potential_sol]
[]
[]
[AuxKernels]
[mean_en_sol]
type = FunctionAux
variable = mean_en_sol
function = mean_en_fun
[]
[em_sol]
type = FunctionAux
variable = em_sol
function = em_fun
[]
[ion_sol]
type = FunctionAux
variable = ion_sol
function = ion_fun
[]
[Ex_sol]
type = FunctionAux
variable = Ex_sol
function = Ex_fun
[]
[Ey_sol]
type = FunctionAux
variable = Ey_sol
function = Ey_fun
[]
[potential_sol]
type = FunctionAux
variable = potential_sol
function = potential_fun
[]
[]
[Functions]
#Material Variables
[massem]
type = ConstantFunction
value = 1.0
[]
#Electron diffusion coeff.
[diffem]
type = ConstantFunction
value = 0.05
[]
[muem]
type = ConstantFunction
value = 0.01
[]
#Electron energy mobility coeff.
[diffmean_en]
type = ConstantFunction
value = 0.05
[]
[mumean_en]
type = ConstantFunction
value = 0.01
[]
#Ion diffusion coeff.
[diffion]
type = ParsedFunction
vars = diffmean_en
vals = diffmean_en
value = diffmean_en
[]
[muion]
type = ParsedFunction
vars = mumean_en
vals = mumean_en
value = mumean_en
[]
[N_A]
type = ConstantFunction
value = 1.0
[]
[ee]
type = ConstantFunction
value = 1.0
[]
[diffpotential]
type = ConstantFunction
value = 0.25
[]
#Manufactured Solutions
#The manufactured electron density solution
[em_fun]
type = ParsedFunction
vars = 'ee N_A diffpotential diffem muem massem diffmean_en mumean_en diffion muion'
vals = 'ee N_A diffpotential diffem muem massem diffmean_en mumean_en diffion muion'
value = 'log(((16*ee*(sin(pi*x) + sin(pi*y) + (cos(pi*y)*sin(2*pi*t))/5 + 1)^3)/(3*massem*pi*((12*diffmean_en*pi)/5 +
(32*mumean_en*pi*(sin(t*pi) + 1)*(sin(x*pi) + sin(y*pi) + (cos(y*pi)*sin(2*t*pi))/5 + 1))/5)^2)) / N_A)'
[]
#The manufactured ion density solution
[ion_fun]
type = ParsedFunction
vars = 'N_A'
vals = 'N_A'
value = 'log((sin(pi*y) + 0.2*sin(2*pi*t)*cos(pi*y) + 1.0 + sin(pi*x)) / N_A)'
[]
#The manufactured electron energy solution
[mean_en_fun]
type = ParsedFunction
vars = 'ee N_A diffpotential diffem muem massem diffmean_en mumean_en diffion muion'
vals = 'ee N_A diffpotential diffem muem massem diffmean_en mumean_en diffion muion'
value = 'log((sin(pi*y) + 0.2*sin(2*pi*t)*cos(pi*y) + 1.0 + sin(pi*x)) / N_A)'
[]
#The manufactured eff. Efield solution
[Ex_fun]
type = ParsedFunction
vars = 'ee N_A diffpotential diffem muem massem diffmean_en mumean_en diffion muion'
vals = 'ee N_A diffpotential diffem muem massem diffmean_en mumean_en diffion muion'
value = '-pi*cos(pi*x)*(sin(pi*t) + 1)'
[]
[Ey_fun]
type = ParsedFunction
vars = 'ee N_A diffpotential diffem muem massem diffmean_en mumean_en diffion muion'
vals = 'ee N_A diffpotential diffem muem massem diffmean_en mumean_en diffion muion'
value = '-pi*cos(pi*y)*(sin(pi*t) + 1)'
[]
#The manufactured potential solution
[potential_fun]
type = ParsedFunction
vars = 'ee N_A diffpotential diffem muem massem diffmean_en mumean_en diffion muion'
vals = 'ee N_A diffpotential diffem muem massem diffmean_en mumean_en diffion muion'
value = '-(sin(pi*t) + 1.0)*(sin(pi*y) + sin(pi*x))'
[]
#Source Terms in moles
#The electron source term.
[em_source]
type = ParsedFunction
vars = 'ee N_A diffpotential diffem muem massem diffmean_en mumean_en diffion muion'
vals = 'ee N_A diffpotential diffem muem massem diffmean_en mumean_en diffion muion'
value = '((32*ee*cos(2*pi*t)*cos(pi*y)*(sin(pi*x) + sin(pi*y) + (cos(pi*y)*sin(2*pi*t))/5 + 1)^2)/(5*massem*((12*diffmean_en*pi)/5 +
(32*mumean_en*pi*(sin(t*pi) + 1)*(sin(x*pi) + sin(y*pi) + (cos(y*pi)*sin(2*t*pi))/5 + 1))/5)^2) -
diffem*((32*ee*(pi*cos(pi*y) - (pi*sin(2*pi*t)*sin(pi*y))/5)^2*(sin(pi*x) + sin(pi*y) +
(cos(pi*y)*sin(2*pi*t))/5 + 1))/(massem*pi*((12*diffmean_en*pi)/5 +
(32*mumean_en*pi*(sin(t*pi) + 1)*(sin(x*pi) + sin(y*pi) + (cos(y*pi)*sin(2*t*pi))/5 + 1))/5)^2) -
(16*ee*(pi^2*sin(pi*y) + (pi^2*cos(pi*y)*sin(2*pi*t))/5)*(sin(pi*x) + sin(pi*y) +
(cos(pi*y)*sin(2*pi*t))/5 + 1)^2)/(massem*pi*((12*diffmean_en*pi)/5 + (32*mumean_en*pi*(sin(t*pi) + 1)*(sin(x*pi) +
sin(y*pi) + (cos(y*pi)*sin(2*t*pi))/5 + 1))/5)^2) - (2048*ee*mumean_en*(pi*cos(pi*y) -
(pi*sin(2*pi*t)*sin(pi*y))/5)^2*(sin(pi*t) + 1)*(sin(pi*x) + sin(pi*y) + (cos(pi*y)*sin(2*pi*t))/5 + 1)^2)/(5*massem*((12*diffmean_en*pi)/5 +
(32*mumean_en*pi*(sin(t*pi) + 1)*(sin(x*pi) + sin(y*pi) + (cos(y*pi)*sin(2*t*pi))/5 + 1))/5)^3) + (1024*ee*mumean_en*(pi^2*sin(pi*y) +
(pi^2*cos(pi*y)*sin(2*pi*t))/5)*(sin(pi*t) + 1)*(sin(pi*x) + sin(pi*y) + (cos(pi*y)*sin(2*pi*t))/5 + 1)^3)/(15*massem*((12*diffmean_en*pi)/5 +
(32*mumean_en*pi*(sin(t*pi) + 1)*(sin(x*pi) + sin(y*pi) + (cos(y*pi)*sin(2*t*pi))/5 + 1))/5)^3) + (32768*ee*mumean_en^2*pi*(pi*cos(pi*y) -
(pi*sin(2*pi*t)*sin(pi*y))/5)^2*(sin(pi*t) + 1)^2*(sin(pi*x) + sin(pi*y) + (cos(pi*y)*sin(2*pi*t))/5 +
1)^3)/(25*massem*((12*diffmean_en*pi)/5 + (32*mumean_en*pi*(sin(t*pi) + 1)*(sin(x*pi) + sin(y*pi) + (cos(y*pi)*sin(2*t*pi))/5 + 1))/5)^4)) -
diffem*((32*ee*pi*cos(pi*x)^2*(sin(pi*x) + sin(pi*y) + (cos(pi*y)*sin(2*pi*t))/5 + 1))/(massem*((12*diffmean_en*pi)/5 +
(32*mumean_en*pi*(sin(t*pi) + 1)*(sin(x*pi) + sin(y*pi) + (cos(y*pi)*sin(2*t*pi))/5 + 1))/5)^2) - (16*ee*pi*sin(pi*x)*(sin(pi*x) +
sin(pi*y) + (cos(pi*y)*sin(2*pi*t))/5 + 1)^2)/(massem*((12*diffmean_en*pi)/5 + (32*mumean_en*pi*(sin(t*pi) + 1)*(sin(x*pi) +
sin(y*pi) + (cos(y*pi)*sin(2*t*pi))/5 + 1))/5)^2) - (2048*ee*mumean_en*pi^2*cos(pi*x)^2*(sin(pi*t) + 1)*(sin(pi*x) + sin(pi*y) +
(cos(pi*y)*sin(2*pi*t))/5 + 1)^2)/(5*massem*((12*diffmean_en*pi)/5 + (32*mumean_en*pi*(sin(t*pi) + 1)*(sin(x*pi) + sin(y*pi) +
(cos(y*pi)*sin(2*t*pi))/5 + 1))/5)^3) + (1024*ee*mumean_en*pi^2*sin(pi*x)*(sin(pi*t) + 1)*(sin(pi*x) + sin(pi*y) +
(cos(pi*y)*sin(2*pi*t))/5 + 1)^3)/(15*massem*((12*diffmean_en*pi)/5 + (32*mumean_en*pi*(sin(t*pi) + 1)*(sin(x*pi) + sin(y*pi) +
(cos(y*pi)*sin(2*t*pi))/5 + 1))/5)^3) + (32768*ee*mumean_en^2*pi^3*cos(pi*x)^2*(sin(pi*t) + 1)^2*(sin(pi*x) + sin(pi*y) +
(cos(pi*y)*sin(2*pi*t))/5 + 1)^3)/(25*massem*((12*diffmean_en*pi)/5 + (32*mumean_en*pi*(sin(t*pi) + 1)*(sin(x*pi) + sin(y*pi) +
(cos(y*pi)*sin(2*t*pi))/5 + 1))/5)^4)) - (32*ee*((32*mumean_en*pi^2*cos(pi*t)*(sin(pi*x) + sin(pi*y) +
(cos(pi*y)*sin(2*pi*t))/5 + 1))/5 + (64*mumean_en*pi^2*cos(2*pi*t)*cos(pi*y)*(sin(pi*t) + 1))/25)*(sin(pi*x) + sin(pi*y) +
(cos(pi*y)*sin(2*pi*t))/5 + 1)^3)/(3*massem*pi*((12*diffmean_en*pi)/5 + (32*mumean_en*pi*(sin(t*pi) + 1)*(sin(x*pi) +
sin(y*pi) + (cos(y*pi)*sin(2*t*pi))/5 + 1))/5)^3)) / N_A'
[]
#The ion source term.
[ion_source]
type = ParsedFunction
vars = 'ee N_A diffpotential diffem muem massem diffmean_en mumean_en diffion muion'
vals = 'ee N_A diffpotential diffem muem massem diffmean_en mumean_en diffion muion'
value = '(diffion*pi^2*sin(pi*x) + (diffion*pi^2*(5*sin(pi*y) + cos(pi*y)*sin(2*pi*t)))/5 +
(2*pi*cos(2*pi*t)*cos(pi*y))/5 + (muion*pi^2*(sin(pi*t) + 1)*(5*sin(pi*x) + 5*sin(pi*y) +
10*sin(pi*x)*sin(pi*y) - 10*cos(pi*x)^2 - 10*cos(pi*y)^2 + cos(pi*y)*sin(2*pi*t)*sin(pi*x) +
2*cos(pi*y)*sin(2*pi*t)*sin(pi*y) + 10))/5) / N_A'
[]
[energy_source]
type = ParsedFunction
vars = 'ee N_A diffpotential diffem muem massem diffmean_en mumean_en diffion muion'
vals = 'ee N_A diffpotential diffem muem massem diffmean_en mumean_en diffion muion'
value = '(diffmean_en*pi^2*sin(pi*x) + (diffmean_en*pi^2*(5*sin(pi*y) + cos(pi*y)*sin(2*pi*t)))/5 +
(2*pi*cos(2*pi*t)*cos(pi*y))/5 + (mumean_en*pi^2*(sin(pi*t) + 1)*(5*sin(pi*x) + 5*sin(pi*y) +
10*sin(pi*x)*sin(pi*y) - 10*cos(pi*x)^2 - 10*cos(pi*y)^2 + cos(pi*y)*sin(2*pi*t)*sin(pi*x) +
2*cos(pi*y)*sin(2*pi*t)*sin(pi*y) + 10))/5) / N_A'
[]
#The Ex source term.
[Ex_source]
type = ParsedFunction
vars = 'ee N_A diffpotential diffem muem massem diffmean_en mumean_en diffion muion'
vals = 'ee N_A diffpotential diffem muem massem diffmean_en mumean_en diffion muion'
value = '-pi^2*cos(pi*t)*cos(pi*x) - diffpotential*pi^3*cos(pi*x)*(sin(pi*t) + 1)'
[]
[Ey_source]
type = ParsedFunction
vars = 'ee N_A diffpotential diffem muem massem diffmean_en mumean_en diffion muion'
vals = 'ee N_A diffpotential diffem muem massem diffmean_en mumean_en diffion muion'
value = '-pi^2*cos(pi*t)*cos(pi*y) - diffpotential*pi^3*cos(pi*y)*(sin(pi*t) + 1)'
[]
[potential_source]
type = ParsedFunction
vars = 'ee N_A diffpotential diffem muem massem diffmean_en mumean_en diffion muion'
vals = 'ee N_A diffpotential diffem muem massem diffmean_en mumean_en diffion muion'
value = '-pi*cos(pi*t)*(sin(pi*x) + sin(pi*y)) -
diffpotential*pi^2*sin(pi*x)*(sin(pi*t) + 1) -
diffpotential*pi^2*sin(pi*y)*(sin(pi*t) + 1)'
[]
[em_ICs]
type = ParsedFunction
vars = 'N_A'
vals = 'N_A'
value = '4.0'
[]
[ion_ICs]
type = ParsedFunction
vars = 'N_A'
vals = 'N_A'
value = 'log((3.0 + sin(pi/2*x)) / N_A)'
[]
[mean_en_ICs]
type = ParsedFunction
vars = 'em_ICs'
vals = 'em_ICs'
value = '1.0'
[]
[em_left_Flux_BC]
type = ParsedFunction
vars = 'ee N_A diffpotential diffem muem massem diffmean_en mumean_en diffion muion'
vals = 'ee N_A diffpotential diffem muem massem diffmean_en mumean_en diffion muion'
value = '(-diffmean_en*pi*cos(pi*x) - mumean_en*pi*cos(pi*x)*(sin(pi*t) + 1)*(sin(pi*x) +
sin(pi*y) + (cos(pi*y)*sin(2*pi*t))/5 + 1)) / N_A'
[]
[em_down_Flux_BC]
type = ParsedFunction
vars = 'ee N_A diffpotential diffem muem massem diffmean_en mumean_en diffion muion'
vals = 'ee N_A diffpotential diffem muem massem diffmean_en mumean_en diffion muion'
value = '(-(diffmean_en*pi*(5*cos(pi*y) - sin(2*pi*t)*sin(pi*y)))/5 -
mumean_en*pi*cos(pi*y)*(sin(pi*t) + 1)*(sin(pi*x) + sin(pi*y) + (cos(pi*y)*sin(2*pi*t))/5 + 1)) / N_A'
[]
[]
[BCs]
[em_BC]
type = FunctionDirichletBC
variable = em
function = 'em_fun'
boundary = '0 1 2 3'
preset = true
[]
[ion_BC]
type = FunctionDirichletBC
variable = ion
function = 'ion_fun'
boundary = '0 1 2 3'
preset = true
[]
#[energy_left_BC]
# type = FunctionDirichletBC
# variable = mean_en
# function = 'mean_en_fun'
# boundary = 3
# preset = true
#[]
[energy_left_physical_diffusion]
type = SakiyamaEnergyDiffusionBC
variable = mean_en
electrons = em
boundary = 3
position_units = 1.0
[]
[energy_left_second_emissions]
type = SakiyamaEnergySecondaryElectronWithEffEfieldBC
variable = mean_en
em = em
ions = ion
Ex = Ex
Ey = Ey
Tse_equal_Te = false
user_se_energy = 1.0
emission_coeffs = 'users_gamma'
boundary = 3
position_units = 1.0
[]
[energy_right_BC]
type = FunctionDirichletBC
variable = mean_en
function = 'mean_en_fun'
boundary = 1
preset = true
[]
#[energy_down_BC]
# type = FunctionDirichletBC
# variable = mean_en
# function = 'mean_en_fun'
# boundary = 0
# preset = true
#[]
[energy_down_physical_diffusion]
type = SakiyamaEnergyDiffusionBC
variable = mean_en
electrons = em
boundary = 0
position_units = 1.0
[]
[energy_down_second_emissions]
type = SakiyamaEnergySecondaryElectronWithEffEfieldBC
variable = mean_en
em = em
ions = ion
Ex = Ex
Ey = Ey
Tse_equal_Te = false
user_se_energy = 1.0
emission_coeffs = 'users_gamma'
boundary = 0
position_units = 1.0
[]
[energy_up_BC]
type = FunctionDirichletBC
variable = mean_en
function = 'mean_en_fun'
boundary = 2
preset = true
[]
[Ex_BC]
type = FunctionDirichletBC
variable = Ex
function = 'Ex_fun'
boundary = '0 1 2 3'
preset = true
[]
[Ey_BC]
type = FunctionDirichletBC
variable = Ey
function = 'Ey_fun'
boundary = '0 1 2 3'
preset = true
[]
[potentialt_BC]
type = FunctionDirichletBC
variable = potential
function = 'potential_fun'
boundary = '0 1 2 3'
preset = true
[]
[]
[Materials]
[field_solver]
type = FieldSolverMaterial
potential = potential
[]
[Material_Coeff]
type = GenericFunctionMaterial
prop_names = 'e N_A massem diffpotential diffEx diffEy'
prop_values = 'ee N_A massem diffpotential diffpotential diffpotential '
[]
[ADMaterial_Coeff_Set1]
type = ADGenericFunctionMaterial
prop_names = 'diffion muion diffem muem diffmean_en mumean_en'
prop_values = 'diffion muion diffem muem diffmean_en mumean_en'
[]
[Charge_Signs]
type = GenericConstantMaterial
prop_names = 'sgnem sgnion sgnmean_en'
prop_values = '-1.0 1.0 -1.0'
[]
[emission_coeffs]
type = ADGenericConstantMaterial
prop_names = 'users_gamma'
prop_values = '1.0'
[]
[]
[Postprocessors]
[em_l2Error]
type = ElementL2Error
variable = em
function = em_fun
[]
[ion_l2Error]
type = ElementL2Error
variable = ion
function = ion_fun
[]
[mean_en_l2Error]
type = ElementL2Error
variable = mean_en
function = mean_en_fun
[]
[Ex_l2Error]
type = ElementL2Error
variable = Ex
function = Ex_fun
[]
[Ey_l2Error]
type = ElementL2Error
variable = Ey
function = Ey_fun
[]
[potential_l2Error]
type = ElementL2Error
variable = potential
function = potential_fun
[]
[h]
type = AverageElementSize
[]
[]
[Preconditioning]
active = 'smp'
[smp]
type = SMP
full = true
[]
[fdp]
type = FDP
full = true
[]
[]
[Executioner]
type = Transient
start_time = 50
end_time = 51
# dt = 0.008
dt = 0.02
automatic_scaling = true
compute_scaling_once = false
petsc_options = '-snes_converged_reason -snes_linesearch_monitor'
solve_type = NEWTON
line_search = none
petsc_options_iname = '-pc_type -pc_factor_shift_type -pc_factor_shift_amount'
petsc_options_value = 'lu NONZERO 1.e-10'
scheme = bdf2
nl_abs_tol = 1e-13
[]
[Outputs]
perf_graph = true
[out]
type = Exodus
interval = 10
[]
[]
(test/tests/mms/bcs/2D_DielectricBCWithEffEfield.i)
[Mesh]
[geo]
type = FileMeshGenerator
file = '2D_DielectricBCWithEffEfield_IC_out.e'
use_for_exodus_restart = true
[]
[]
[Problem]
type = FEProblem
[]
[Variables]
[em]
initial_from_file_var = em
[]
[ion]
initial_from_file_var = ion
[]
[mean_en]
initial_from_file_var = mean_en
[]
[Ex]
initial_from_file_var = Ex
[]
[Ey]
initial_from_file_var = Ey
[]
[potential]
initial_from_file_var = potential
[]
[]
# [ICs]
# [em_IC]
# type = FunctionIC
# variable = em
# function = 'em_ICs'
# []
# [ion_IC]
# type = FunctionIC
# variable = ion
# function = 'ion_ICs'
# []
# [mean_en_IC]
# type = FunctionIC
# variable = mean_en
# function = 'mean_en_ICs'
# []
# []
[Kernels]
#Electron Equations
[em_time_derivative]
type = ElectronTimeDerivative
variable = em
[]
[em_diffusion]
type = CoeffDiffusion
variable = em
position_units = 1.0
[]
[em_advection]
type = EFieldAdvection
variable = em
position_units = 1.0
[]
[em_source]
type = BodyForce
variable = em
function = 'em_source'
[]
#Ion Equations
[ion_time_derivative]
type = ElectronTimeDerivative
variable = ion
[]
[ion_diffusion]
type = CoeffDiffusion
variable = ion
position_units = 1.0
[]
[ion_advection]
type = EffectiveEFieldAdvection
variable = ion
u = Ex
v = Ey
position_units = 1.0
[]
[ion_source]
type = BodyForce
variable = ion
function = 'ion_source'
[]
#Eff. Efield
[EffEfield_X_time_deriv]
type = ADTimeDerivative
variable = Ex
[]
[EffEfield_X_diffusion]
type = MatDiffusion
D_name = diffEx
variable = Ex
[]
[EffEfield_X_source]
type = BodyForce
variable = Ex
function = 'Ex_source'
[]
[EffEfield_Y_time_deriv]
type = ADTimeDerivative
variable = Ey
[]
[EffEfield_Y_diffusion]
type = MatDiffusion
D_name = diffEy
variable = Ey
[]
[EffEfield_Y_source]
type = BodyForce
variable = Ey
function = 'Ey_source'
[]
#Potential
[Potential_time_deriv]
type = ADTimeDerivative
variable = potential
[]
[Potential_diffusion]
type = CoeffDiffusionLin
variable = potential
position_units = 1.0
[]
[Potential_source]
type = BodyForce
variable = potential
function = 'potential_source'
[]
#Electron Energy Equations
[mean_en_time_deriv]
type = ElectronTimeDerivative
variable = mean_en
[]
[mean_en_diffusion]
type = CoeffDiffusion
variable = mean_en
position_units = 1.0
[]
[mean_en_source]
type = BodyForce
variable = mean_en
function = 'energy_source'
[]
[]
[AuxVariables]
[mean_en_sol]
[]
[em_sol]
[]
[ion_sol]
[]
[Ex_sol]
[]
[Ey_sol]
[]
[potential_sol]
[]
[]
[AuxKernels]
[mean_en_sol]
type = FunctionAux
variable = mean_en_sol
function = mean_en_fun
[]
[em_sol]
type = FunctionAux
variable = em_sol
function = em_fun
[]
[ion_sol]
type = FunctionAux
variable = ion_sol
function = ion_fun
[]
[Ex_sol]
type = FunctionAux
variable = Ex_sol
function = Ex_fun
[]
[Ey_sol]
type = FunctionAux
variable = Ey_sol
function = Ey_fun
[]
[potential_sol]
type = FunctionAux
variable = potential_sol
function = potential_fun
[]
[]
[Functions]
#Material Variables
[massem]
type = ConstantFunction
value = 2.0
[]
#Electron diffusion coeff.
[diffem]
type = ConstantFunction
value = 0.05
[]
[muem]
type = ConstantFunction
value = 0.01
[]
#Electron energy mobility coeff.
[diffmean_en]
type = ConstantFunction
value = 0.05
[]
#Ion diffusion coeff.
[diffion]
type = ParsedFunction
vars = diffem
vals = diffem
value = diffem
[]
[muion]
type = ParsedFunction
vars = muem
vals = muem
value = muem
[]
[N_A]
type = ConstantFunction
value = 1.0
[]
[ee]
type = ConstantFunction
value = 1.0
[]
[diffpotential]
type = ConstantFunction
value = 0.05
[]
#Manufactured Solutions
#The manufactured electron density solution
[em_fun]
type = ParsedFunction
vars = 'N_A'
vals = 'N_A'
value = 'log((sin(pi*y) + 0.2*sin(2*pi*t)*cos(pi*y) + 2.0 + sin(pi*x)) / N_A)'
[]
#The manufactured ion density solution
[ion_fun]
type = ParsedFunction
vars = 'N_A'
vals = 'N_A'
value = 'log((sin(pi*y) + 0.2*sin(2*pi*t)*cos(pi*y) + 2.0 + sin(pi*x)) / N_A)'
[]
#The manufactured electron energy solution
[mean_en_fun]
type = ParsedFunction
vars = 'ee N_A diffpotential diffem muem massem diffmean_en diffion muion'
vals = 'ee N_A diffpotential diffem muem massem diffmean_en diffion muion'
value = 'log(((3*massem*pi*((diffpotential*pi*cos(pi*t) - cos(pi*t)*(sin(pi*x) + sin(pi*y)) + 4)/ee + 8*muion*pi*(sin(pi*t) + 1)*(sin(pi*x) + sin(pi*y) + (cos(pi*y)*sin(2*pi*t))/5 + 2))^2)/(16*ee*(sin(pi*x) + sin(pi*y) + (cos(pi*y)*sin(2*pi*t))/5 + 2))) / N_A)'
[]
#The manufactured eff. Efield solution
[Ex_fun]
type = ParsedFunction
vars = 'ee N_A diffpotential diffem muem massem diffmean_en diffion muion'
vals = 'ee N_A diffpotential diffem muem massem diffmean_en diffion muion'
value = '-pi*cos(pi*x)*(sin(pi*t) + 1)'
[]
[Ey_fun]
type = ParsedFunction
vars = 'ee N_A diffpotential diffem muem massem diffmean_en diffion muion'
vals = 'ee N_A diffpotential diffem muem massem diffmean_en diffion muion'
value = '-pi*cos(pi*y)*(sin(pi*t) + 1)'
[]
#The manufactured potential solution
[potential_fun]
type = ParsedFunction
vars = 'ee N_A diffpotential diffem muem massem diffmean_en diffion muion'
vals = 'ee N_A diffpotential diffem muem massem diffmean_en diffion muion'
value = '0.25*(sin(pi*t)/pi + 1.0)*(sin(pi*y) + sin(pi*x)) - t'
[]
#Source Terms in moles
#The electron source term.
[em_source]
type = ParsedFunction
vars = 'ee N_A diffpotential diffem muem massem diffmean_en diffion muion'
vals = 'ee N_A diffpotential diffem muem massem diffmean_en diffion muion'
value = '(diffem*pi^2*sin(pi*x) + (diffem*pi^2*(5*sin(pi*y) + cos(pi*y)*sin(2*pi*t)))/5 + (2*pi*cos(2*pi*t)*cos(pi*y))/5 - (muem*pi*(pi + sin(pi*t))*(10*sin(pi*x) + 10*sin(pi*y) + 10*sin(pi*x)*sin(pi*y) - 10*cos(pi*x)^2 - 10*cos(pi*y)^2 + cos(pi*y)*sin(2*pi*t)*sin(pi*x) + 2*cos(pi*y)*sin(2*pi*t)*sin(pi*y) + 10))/20) / N_A'
[]
#The ion source term.
[ion_source]
type = ParsedFunction
vars = 'ee N_A diffpotential diffem muem massem diffmean_en diffion muion'
vals = 'ee N_A diffpotential diffem muem massem diffmean_en diffion muion'
value = '(diffion*pi^2*sin(pi*x) + (diffion*pi^2*(5*sin(pi*y) + cos(pi*y)*sin(2*pi*t)))/5 + (2*pi*cos(2*pi*t)*cos(pi*y))/5 + (muion*pi^2*(sin(pi*t) + 1)*(10*sin(pi*x) + 10*sin(pi*y) + 10*sin(pi*x)*sin(pi*y) - 10*cos(pi*x)^2 - 10*cos(pi*y)^2 + cos(pi*y)*sin(2*pi*t)*sin(pi*x) + 2*cos(pi*y)*sin(2*pi*t)*sin(pi*y) + 10))/5) / N_A'
[]
[energy_source]
type = ParsedFunction
vars = 'ee N_A diffpotential diffem muem massem diffmean_en diffion muion'
vals = 'ee N_A diffpotential diffem muem massem diffmean_en diffion muion'
value = '((3*massem*pi*((diffpotential*pi*cos(pi*t) - cos(pi*t)*(sin(pi*x) + sin(pi*y)) + 4)/ee + 8*muion*pi*(sin(pi*t) + 1)*(sin(pi*x) + sin(pi*y) + (cos(pi*y)*sin(2*pi*t))/5 + 2))*(8*muion*pi^2*cos(pi*t)*(sin(pi*x) + sin(pi*y) + (cos(pi*y)*sin(2*pi*t))/5 + 2) - (diffpotential*pi^2*sin(pi*t) - pi*sin(pi*t)*(sin(pi*x) + sin(pi*y)))/ee + (16*muion*pi^2*cos(2*pi*t)*cos(pi*y)*(sin(pi*t) + 1))/5))/(8*ee*(sin(pi*x) + sin(pi*y) + (cos(pi*y)*sin(2*pi*t))/5 + 2)) - diffmean_en*((3*massem*pi*((pi*cos(pi*t)*cos(pi*y))/ee - 8*muion*pi*(pi*cos(pi*y) - (pi*sin(2*pi*t)*sin(pi*y))/5)*(sin(pi*t) + 1))^2)/(8*ee*(sin(pi*x) + sin(pi*y) + (cos(pi*y)*sin(2*pi*t))/5 + 2)) + (3*massem*pi*((diffpotential*pi*cos(pi*t) - cos(pi*t)*(sin(pi*x) + sin(pi*y)) + 4)/ee + 8*muion*pi*(sin(pi*t) + 1)*(sin(pi*x) + sin(pi*y) + (cos(pi*y)*sin(2*pi*t))/5 + 2))^2*(pi^2*sin(pi*y) + (pi^2*cos(pi*y)*sin(2*pi*t))/5))/(16*ee*(sin(x*pi) + sin(y*pi) + (cos(y*pi)*sin(2*t*pi))/5 + 2)^2) - (3*massem*pi*((diffpotential*pi*cos(pi*t) - cos(pi*t)*(sin(pi*x) + sin(pi*y)) + 4)/ee + 8*muion*pi*(sin(pi*t) + 1)*(sin(pi*x) + sin(pi*y) + (cos(pi*y)*sin(2*pi*t))/5 + 2))*(8*muion*pi*(pi^2*sin(pi*y) + (pi^2*cos(pi*y)*sin(2*pi*t))/5)*(sin(pi*t) + 1) - (pi^2*cos(pi*t)*sin(pi*y))/ee))/(8*ee*(sin(pi*x) + sin(pi*y) + (cos(pi*y)*sin(2*pi*t))/5 + 2)) + (3*massem*pi*((diffpotential*pi*cos(pi*t) - cos(pi*t)*(sin(pi*x) + sin(pi*y)) + 4)/ee + 8*muion*pi*(sin(pi*t) + 1)*(sin(pi*x) + sin(pi*y) + (cos(pi*y)*sin(2*pi*t))/5 + 2))^2*(pi*cos(pi*y) - (pi*sin(2*pi*t)*sin(pi*y))/5)^2)/(8*ee*(sin(x*pi) + sin(y*pi) + (cos(y*pi)*sin(2*t*pi))/5 + 2)^3) + (3*massem*pi*((diffpotential*pi*cos(pi*t) - cos(pi*t)*(sin(pi*x) + sin(pi*y)) + 4)/ee + 8*muion*pi*(sin(pi*t) + 1)*(sin(pi*x) + sin(pi*y) + (cos(pi*y)*sin(2*pi*t))/5 + 2))*((pi*cos(pi*t)*cos(pi*y))/ee - 8*muion*pi*(pi*cos(pi*y) - (pi*sin(2*pi*t)*sin(pi*y))/5)*(sin(pi*t) + 1))*(pi*cos(pi*y) - (pi*sin(2*pi*t)*sin(pi*y))/5))/(4*ee*(sin(x*pi) + sin(y*pi) + (cos(y*pi)*sin(2*t*pi))/5 + 2)^2)) - diffmean_en*((3*massem*pi*((pi*cos(pi*t)*cos(pi*x))/ee - 8*muion*pi^2*cos(pi*x)*(sin(pi*t) + 1))^2)/(8*ee*(sin(pi*x) + sin(pi*y) + (cos(pi*y)*sin(2*pi*t))/5 + 2)) + (3*massem*pi^3*cos(pi*x)^2*((diffpotential*pi*cos(pi*t) - cos(pi*t)*(sin(pi*x) + sin(pi*y)) + 4)/ee + 8*muion*pi*(sin(pi*t) + 1)*(sin(pi*x) + sin(pi*y) + (cos(pi*y)*sin(2*pi*t))/5 + 2))^2)/(8*ee*(sin(x*pi) + sin(y*pi) + (cos(y*pi)*sin(2*t*pi))/5 + 2)^3) + (3*massem*pi^3*sin(pi*x)*((diffpotential*pi*cos(pi*t) - cos(pi*t)*(sin(pi*x) + sin(pi*y)) + 4)/ee + 8*muion*pi*(sin(pi*t) + 1)*(sin(pi*x) + sin(pi*y) + (cos(pi*y)*sin(2*pi*t))/5 + 2))^2)/(16*ee*(sin(x*pi) + sin(y*pi) + (cos(y*pi)*sin(2*t*pi))/5 + 2)^2) - (3*massem*pi*((diffpotential*pi*cos(pi*t) - cos(pi*t)*(sin(pi*x) + sin(pi*y)) + 4)/ee + 8*muion*pi*(sin(pi*t) + 1)*(sin(pi*x) + sin(pi*y) + (cos(pi*y)*sin(2*pi*t))/5 + 2))*(8*muion*pi^3*sin(pi*x)*(sin(pi*t) + 1) - (pi^2*cos(pi*t)*sin(pi*x))/ee))/(8*ee*(sin(pi*x) + sin(pi*y) + (cos(pi*y)*sin(2*pi*t))/5 + 2)) + (3*massem*pi^2*cos(pi*x)*((diffpotential*pi*cos(pi*t) - cos(pi*t)*(sin(pi*x) + sin(pi*y)) + 4)/ee + 8*muion*pi*(sin(pi*t) + 1)*(sin(pi*x) + sin(pi*y) + (cos(pi*y)*sin(2*pi*t))/5 + 2))*((pi*cos(pi*t)*cos(pi*x))/ee - 8*muion*pi^2*cos(pi*x)*(sin(pi*t) + 1)))/(4*ee*(sin(x*pi) + sin(y*pi) + (cos(y*pi)*sin(2*t*pi))/5 + 2)^2)) - (3*massem*pi^2*cos(2*pi*t)*cos(pi*y)*((diffpotential*pi*cos(pi*t) - cos(pi*t)*(sin(pi*x) + sin(pi*y)) + 4)/ee + 8*muion*pi*(sin(pi*t) + 1)*(sin(pi*x) + sin(pi*y) + (cos(pi*y)*sin(2*pi*t))/5 + 2))^2)/(40*ee*(sin(x*pi) + sin(y*pi) + (cos(y*pi)*sin(2*t*pi))/5 + 2)^2)) / N_A'
[]
#The Ex source term.
[Ex_source]
type = ParsedFunction
vars = 'ee N_A diffpotential diffem muem massem diffmean_en diffion muion'
vals = 'ee N_A diffpotential diffem muem massem diffmean_en diffion muion'
value = '-pi^2*cos(pi*t)*cos(pi*x) - diffpotential*pi^3*cos(pi*x)*(sin(pi*t) + 1)'
[]
[Ey_source]
type = ParsedFunction
vars = 'ee N_A diffpotential diffem muem massem diffmean_en diffion muion'
vals = 'ee N_A diffpotential diffem muem massem diffmean_en diffion muion'
value = '-pi^2*cos(pi*t)*cos(pi*y) - diffpotential*pi^3*cos(pi*y)*(sin(pi*t) + 1)'
[]
[potential_source]
type = ParsedFunction
vars = 'ee N_A diffpotential diffem muem massem diffmean_en diffion muion'
vals = 'ee N_A diffpotential diffem muem massem diffmean_en diffion muion'
value = '(cos(pi*t)*(sin(pi*x) + sin(pi*y)))/4 + diffpotential*pi^2*sin(pi*x)*(sin(pi*t)/(4*pi) + 1/4) + diffpotential*pi^2*sin(pi*y)*(sin(pi*t)/(4*pi) + 1/4) - 1'
[]
[em_ICs]
type = ParsedFunction
vars = 'N_A'
vals = 'N_A'
value = 'log((3.0 + sin(pi/2*x)) / N_A)'
[]
[ion_ICs]
type = ParsedFunction
vars = 'N_A'
vals = 'N_A'
value = 'log((3.0 + sin(pi/2*x)) / N_A)'
[]
[mean_en_ICs]
type = ParsedFunction
vars = 'em_ICs'
vals = 'em_ICs'
value = 'log(1.0)'
[]
[V_func_left_BC]
type = ParsedFunction
vars = 'ee N_A diffpotential diffem muem massem diffmean_en diffion muion'
vals = 'ee N_A diffpotential diffem muem massem diffmean_en diffion muion'
value = '-diffpotential*pi*cos(pi*x)*(sin(pi*t)/(4*pi) + 1/4)'
[]
[V_func_down_BC]
type = ParsedFunction
vars = 'ee N_A diffpotential diffem muem massem diffmean_en diffion muion'
vals = 'ee N_A diffpotential diffem muem massem diffmean_en diffion muion'
value = '-diffpotential*pi*cos(pi*y)*(sin(pi*t)/(4*pi) + 1/4)'
[]
[]
[BCs]
[em_BC]
type = FunctionDirichletBC
variable = em
function = 'em_fun'
boundary = '0 1 2 3'
preset = true
[]
[ion_BC]
type = FunctionDirichletBC
variable = ion
function = 'ion_fun'
boundary = '0 1 2 3'
preset = true
[]
[energy_BC]
type = FunctionDirichletBC
variable = mean_en
function = 'mean_en_fun'
boundary = '0 1 2 3'
preset = true
[]
[Ex_BC]
type = FunctionDirichletBC
variable = Ex
function = 'Ex_fun'
boundary = '0 1 2 3'
preset = true
[]
[Ey_BC]
type = FunctionDirichletBC
variable = Ey
function = 'Ey_fun'
boundary = '0 1 2 3'
preset = true
[]
[potential_left_BC]
type = DielectricBCWithEffEfield
variable = potential
electrons = em
electron_energy = mean_en
ions = 'ion'
Ex = Ex
Ey = Ey
dielectric_constant = 1.0
thickness = 1.0
emission_coeffs = 'users_gamma'
potential_units = V
position_units = 1.0
boundary = 3
[]
[potential_Dirichlet_BC]
type = FunctionDirichletBC
variable = potential
function = 'potential_fun'
boundary = '0 1 2'
preset = true
[]
[]
[Materials]
[field_solver]
type = FieldSolverMaterial
potential = potential
[]
[Material_Coeff]
type = GenericFunctionMaterial
prop_names = 'e N_A massem NonAD_muion NonAD_diffpotential diffEx diffEy'
prop_values = 'ee N_A massem muion diffpotential diffpotential diffpotential '
[]
[ADMaterial_Coeff_Set1]
type = ADGenericFunctionMaterial
prop_names = 'diffion muion diffem muem diffmean_en diffpotential'
prop_values = 'diffion muion diffem muem diffmean_en diffpotential'
[]
[Charge_Signs]
type = GenericConstantMaterial
prop_names = 'sgnem sgnion sgnmean_en'
prop_values = '-1.0 1.0 -1.0'
[]
[emission_coeffs]
type = ADGenericConstantMaterial
prop_names = 'users_gamma'
prop_values = '1.0'
[]
[]
[Postprocessors]
[em_l2Error]
type = ElementL2Error
variable = em
function = em_fun
[]
[ion_l2Error]
type = ElementL2Error
variable = ion
function = ion_fun
[]
[mean_en_l2Error]
type = ElementL2Error
variable = mean_en
function = mean_en_fun
[]
[Ex_l2Error]
type = ElementL2Error
variable = Ex
function = Ex_fun
[]
[Ey_l2Error]
type = ElementL2Error
variable = Ey
function = Ey_fun
[]
[potential_l2Error]
type = ElementL2Error
variable = potential
function = potential_fun
[]
[h]
type = AverageElementSize
[]
[]
[Preconditioning]
active = 'smp'
[smp]
type = SMP
full = true
[]
[fdp]
type = FDP
full = true
[]
[]
[Executioner]
type = Transient
# end_time = 50
start_time = 50
end_time = 51
# dt = 0.008
dt = 0.02
automatic_scaling = true
compute_scaling_once = false
petsc_options = '-snes_converged_reason -snes_linesearch_monitor'
solve_type = NEWTON
line_search = none
petsc_options_iname = '-pc_type -pc_factor_shift_type -pc_factor_shift_amount'
petsc_options_value = 'lu NONZERO 1.e-10'
scheme = bdf2
nl_abs_tol = 1e-13
[]
[Outputs]
[out]
type = Exodus
interval = 10
[]
[]
(test/tests/mms/bcs/2D_ElectronBC.i)
[Mesh]
[geo]
type = FileMeshGenerator
file = '2D_ElectronBC_IC_out.e'
use_for_exodus_restart = true
[]
[]
[Problem]
type = FEProblem
[]
[Variables]
[em]
initial_from_file_var = em
[]
[ion]
initial_from_file_var = ion
[]
[mean_en]
initial_from_file_var = mean_en
[]
[Ex]
initial_from_file_var = Ex
[]
[Ey]
initial_from_file_var = Ey
[]
[potential]
initial_from_file_var = potential
[]
[]
[Kernels]
#Electron Equations
[em_time_derivative]
type = TimeDerivativeLog
variable = em
[]
[em_diffusion]
type = CoeffDiffusion
variable = em
position_units = 1.0
[]
[em_advection]
type = EFieldAdvection
variable = em
position_units = 1.0
[]
[em_source]
type = BodyForce
variable = em
function = 'em_source'
[]
#Ion Equations
[ion_time_derivative]
type = TimeDerivativeLog
variable = ion
[]
[ion_diffusion]
type = CoeffDiffusion
variable = ion
position_units = 1.0
[]
[ion_advection]
type = EffectiveEFieldAdvection
variable = ion
u = Ex
v = Ey
position_units = 1.0
[]
[ion_source]
type = BodyForce
variable = ion
function = 'ion_source'
[]
#Eff. Efield
[EffEfield_X_time_deriv]
type = TimeDerivative
variable = Ex
[]
[EffEfield_X_diffusion]
type = MatDiffusion
diffusivity = diffEx
variable = Ex
[]
[EffEfield_X_source]
type = BodyForce
variable = Ex
function = 'Ex_source'
[]
[EffEfield_Y_time_deriv]
type = TimeDerivative
variable = Ey
[]
[EffEfield_Y_diffusion]
type = MatDiffusion
diffusivity = diffEy
variable = Ey
[]
[EffEfield_Y_source]
type = BodyForce
variable = Ey
function = 'Ey_source'
[]
#Potential
[Potential_time_deriv]
type = TimeDerivative
variable = potential
[]
[Potential_diffusion]
type = MatDiffusion
diffusivity = diffpotential
variable = potential
[]
[Potential_source]
type = BodyForce
variable = potential
function = 'potential_source'
[]
#Electron Energy Equations
[mean_en_time_deriv]
type = TimeDerivativeLog
variable = mean_en
[]
[mean_en_diffusion]
type = CoeffDiffusion
variable = mean_en
position_units = 1.0
[]
[mean_en_source]
type = BodyForce
variable = mean_en
function = 'energy_source'
[]
[]
[AuxVariables]
[mean_en_sol]
[]
[em_sol]
[]
[ion_sol]
[]
[Ex_sol]
[]
[Ey_sol]
[]
[potential_sol]
[]
[]
[AuxKernels]
[mean_en_sol]
type = FunctionAux
variable = mean_en_sol
function = mean_en_fun
[]
[em_sol]
type = FunctionAux
variable = em_sol
function = em_fun
[]
[ion_sol]
type = FunctionAux
variable = ion_sol
function = ion_fun
[]
[Ex_sol]
type = FunctionAux
variable = Ex_sol
function = Ex_fun
[]
[Ey_sol]
type = FunctionAux
variable = Ey_sol
function = Ey_fun
[]
[potential_sol]
type = FunctionAux
variable = potential_sol
function = potential_fun
[]
[]
[Functions]
#Material Variables
[massem]
type = ConstantFunction
value = 1.0
[]
#Electron diffusion coeff.
[diffem]
type = ConstantFunction
value = 0.05
[]
[muem]
type = ConstantFunction
value = 0.01
[]
#Electron energy mobility coeff.
[diffmean_en]
type = ConstantFunction
value = 0.05
[]
#Ion diffusion coeff.
[diffion]
type = ParsedFunction
vars = diffem
vals = diffem
value = diffem
[]
[muion]
type = ParsedFunction
vars = muem
vals = muem
value = muem
[]
[N_A]
type = ConstantFunction
value = 1.0
[]
[ee]
type = ConstantFunction
value = 1.0
[]
[diffpotential]
type = ConstantFunction
value = 0.25
[]
#Manufactured Solutions
#The manufactured electron density solution
[em_fun]
type = ParsedFunction
vars = 'N_A'
vals = 'N_A'
value = 'log((sin(pi*y) + 0.2*sin(2*pi*t)*cos(pi*y) + 1.0 + sin(pi*x)) / N_A)'
[]
#The manufactured ion density solution
[ion_fun]
type = ParsedFunction
vars = 'N_A'
vals = 'N_A'
value = 'log((sin(pi*y) + 0.2*sin(2*pi*t)*cos(pi*y) + 1.0 + sin(pi*x)) / N_A)'
[]
#The manufactured electron energy solution
[mean_en_fun]
type = ParsedFunction
vars = 'ee N_A diffpotential diffem muem massem diffmean_en diffion muion'
vals = 'ee N_A diffpotential diffem muem massem diffmean_en diffion muion'
value = 'log(((3*massem*pi*(4*pi*diffem + 8*muem*pi*(sin(pi*t) + 1)*(sin(pi*x) + sin(pi*y) +
(cos(pi*y)*sin(2*pi*t))/5 + 1))^2)/(16*ee*(sin(pi*x) + sin(pi*y) +
(cos(pi*y)*sin(2*pi*t))/5 + 1))) / N_A)'
[]
#The manufactured eff. Efield solution
[Ex_fun]
type = ParsedFunction
vars = 'ee N_A diffpotential diffem muem massem diffmean_en diffion muion'
vals = 'ee N_A diffpotential diffem muem massem diffmean_en diffion muion'
value = '-pi*cos(pi*x)*(sin(pi*t) + 1)'
[]
[Ey_fun]
type = ParsedFunction
vars = 'ee N_A diffpotential diffem muem massem diffmean_en diffion muion'
vals = 'ee N_A diffpotential diffem muem massem diffmean_en diffion muion'
value = '-pi*cos(pi*y)*(sin(pi*t) + 1)'
[]
#The manufactured potential solution
[potential_fun]
type = ParsedFunction
vars = 'ee N_A diffpotential diffem muem massem diffmean_en diffion muion'
vals = 'ee N_A diffpotential diffem muem massem diffmean_en diffion muion'
value = '-(sin(pi*t) + 1.0)*(sin(pi*y) + sin(pi*x))'
[]
#Source Terms in moles
#The electron source term.
[em_source]
type = ParsedFunction
vars = 'ee N_A diffpotential diffem muem massem diffmean_en diffion muion'
vals = 'ee N_A diffpotential diffem muem massem diffmean_en diffion muion'
value = '(diffem*pi^2*sin(pi*x) + (diffem*pi^2*(5*sin(pi*y) +
cos(pi*y)*sin(2*pi*t)))/5 + (2*pi*cos(2*pi*t)*cos(pi*y))/5 +
(muem*pi^2*(sin(pi*t) + 1)*(5*sin(pi*x) + 5*sin(pi*y) + 10*sin(pi*x)*sin(pi*y) -
10*cos(pi*x)^2 - 10*cos(pi*y)^2 + cos(pi*y)*sin(2*pi*t)*sin(pi*x) +
2*cos(pi*y)*sin(2*pi*t)*sin(pi*y) + 10))/5) / N_A'
[]
#The ion source term.
[ion_source]
type = ParsedFunction
vars = 'ee N_A diffpotential diffem muem massem diffmean_en diffion muion'
vals = 'ee N_A diffpotential diffem muem massem diffmean_en diffion muion'
value = '(diffion*pi^2*sin(pi*x) + (diffion*pi^2*(5*sin(pi*y) + cos(pi*y)*sin(2*pi*t)))/5 +
(2*pi*cos(2*pi*t)*cos(pi*y))/5 + (muion*pi^2*(sin(pi*t) + 1)*(5*sin(pi*x) + 5*sin(pi*y) +
10*sin(pi*x)*sin(pi*y) - 10*cos(pi*x)^2 - 10*cos(pi*y)^2 + cos(pi*y)*sin(2*pi*t)*sin(pi*x) +
2*cos(pi*y)*sin(2*pi*t)*sin(pi*y) + 10))/5) / N_A'
[]
[energy_source]
type = ParsedFunction
vars = 'ee N_A diffpotential diffem muem massem diffmean_en diffion muion'
vals = 'ee N_A diffpotential diffem muem massem diffmean_en diffion muion'
value = '((3*massem*pi*(8*muem*pi^2*cos(pi*t)*(sin(pi*x) + sin(pi*y) + (cos(pi*y)*sin(2*pi*t))/5 + 1) +
(16*muem*pi^2*cos(2*pi*t)*cos(pi*y)*(sin(pi*t) + 1))/5)*(4*pi*diffem + 8*muem*pi*(sin(pi*t) + 1)*(sin(pi*x) +
sin(pi*y) + (cos(pi*y)*sin(2*pi*t))/5 + 1)))/(8*ee*(sin(pi*x) + sin(pi*y) + (cos(pi*y)*sin(2*pi*t))/5 + 1)) -
diffmean_en*((3*massem*pi^3*sin(pi*x)*(4*pi*diffem + 8*muem*pi*(sin(pi*t) + 1)*(sin(pi*x) + sin(pi*y) +
(cos(pi*y)*sin(2*pi*t))/5 + 1))^2)/(16*ee*(sin(x*pi) + sin(y*pi) + (cos(y*pi)*sin(2*t*pi))/5 + 1)^2) +
(3*massem*pi^3*cos(pi*x)^2*(4*pi*diffem + 8*muem*pi*(sin(pi*t) + 1)*(sin(pi*x) + sin(pi*y) +
(cos(pi*y)*sin(2*pi*t))/5 + 1))^2)/(8*ee*(sin(x*pi) + sin(y*pi) + (cos(y*pi)*sin(2*t*pi))/5 + 1)^3) +
(24*massem*muem^2*pi^5*cos(pi*x)^2*(sin(pi*t) + 1)^2)/(ee*(sin(pi*x) + sin(pi*y) + (cos(pi*y)*sin(2*pi*t))/5 + 1)) -
(3*massem*muem*pi^4*sin(pi*x)*(4*pi*diffem + 8*muem*pi*(sin(pi*t) + 1)*(sin(pi*x) + sin(pi*y) +
(cos(pi*y)*sin(2*pi*t))/5 + 1))*(sin(pi*t) + 1))/(ee*(sin(pi*x) + sin(pi*y) + (cos(pi*y)*sin(2*pi*t))/5 + 1)) -
(6*massem*muem*pi^4*cos(pi*x)^2*(4*pi*diffem + 8*muem*pi*(sin(pi*t) + 1)*(sin(pi*x) + sin(pi*y) +
(cos(pi*y)*sin(2*pi*t))/5 + 1))*(sin(pi*t) + 1))/(ee*(sin(x*pi) + sin(y*pi) + (cos(y*pi)*sin(2*t*pi))/5 + 1)^2)) -
diffmean_en*((3*massem*pi*(pi*cos(pi*y) - (pi*sin(2*pi*t)*sin(pi*y))/5)^2*(4*pi*diffem +
8*muem*pi*(sin(pi*t) + 1)*(sin(pi*x) + sin(pi*y) + (cos(pi*y)*sin(2*pi*t))/5 + 1))^2)/(8*ee*(sin(x*pi) + sin(y*pi) +
(cos(y*pi)*sin(2*t*pi))/5 + 1)^3) + (3*massem*pi*(pi^2*sin(pi*y) + (pi^2*cos(pi*y)*sin(2*pi*t))/5)*(4*pi*diffem +
8*muem*pi*(sin(pi*t) + 1)*(sin(pi*x) + sin(pi*y) + (cos(pi*y)*sin(2*pi*t))/5 + 1))^2)/(16*ee*(sin(x*pi) +
sin(y*pi) + (cos(y*pi)*sin(2*t*pi))/5 + 1)^2) + (24*massem*muem^2*pi^3*(pi*cos(pi*y) -
(pi*sin(2*pi*t)*sin(pi*y))/5)^2*(sin(pi*t) + 1)^2)/(ee*(sin(pi*x) + sin(pi*y) + (cos(pi*y)*sin(2*pi*t))/5 + 1)) -
(6*massem*muem*pi^2*(pi*cos(pi*y) - (pi*sin(2*pi*t)*sin(pi*y))/5)^2*(4*pi*diffem + 8*muem*pi*(sin(pi*t) + 1)*(sin(pi*x) +
sin(pi*y) + (cos(pi*y)*sin(2*pi*t))/5 + 1))*(sin(pi*t) + 1))/(ee*(sin(x*pi) + sin(y*pi) + (cos(y*pi)*sin(2*t*pi))/5 + 1)^2) -
(3*massem*muem*pi^2*(pi^2*sin(pi*y) + (pi^2*cos(pi*y)*sin(2*pi*t))/5)*(4*pi*diffem +
8*muem*pi*(sin(pi*t) + 1)*(sin(pi*x) + sin(pi*y) + (cos(pi*y)*sin(2*pi*t))/5 + 1))*(sin(pi*t) + 1))/(ee*(sin(pi*x) + sin(pi*y) +
(cos(pi*y)*sin(2*pi*t))/5 + 1))) - (3*massem*pi^2*cos(2*pi*t)*cos(pi*y)*(4*pi*diffem + 8*muem*pi*(sin(pi*t) + 1)*(sin(pi*x) +
sin(pi*y) + (cos(pi*y)*sin(2*pi*t))/5 + 1))^2)/(40*ee*(sin(x*pi) + sin(y*pi) + (cos(y*pi)*sin(2*t*pi))/5 + 1)^2)) / N_A'
[]
#The Ex source term.
[Ex_source]
type = ParsedFunction
vars = 'ee N_A diffpotential diffem muem massem diffmean_en diffion muion'
vals = 'ee N_A diffpotential diffem muem massem diffmean_en diffion muion'
value = '-pi^2*cos(pi*t)*cos(pi*x) - diffpotential*pi^3*cos(pi*x)*(sin(pi*t) + 1)'
[]
[Ey_source]
type = ParsedFunction
vars = 'ee N_A diffpotential diffem muem massem diffmean_en diffion muion'
vals = 'ee N_A diffpotential diffem muem massem diffmean_en diffion muion'
value = '-pi^2*cos(pi*t)*cos(pi*y) - diffpotential*pi^3*cos(pi*y)*(sin(pi*t) + 1)'
[]
[potential_source]
type = ParsedFunction
vars = 'ee N_A diffpotential diffem muem massem diffmean_en diffion muion'
vals = 'ee N_A diffpotential diffem muem massem diffmean_en diffion muion'
value = '-pi*cos(pi*t)*(sin(pi*x) + sin(pi*y)) -
diffpotential*pi^2*sin(pi*x)*(sin(pi*t) + 1) -
diffpotential*pi^2*sin(pi*y)*(sin(pi*t) + 1)'
[]
[em_ICs]
type = ParsedFunction
vars = 'N_A'
vals = 'N_A'
value = 'log((3.0 + sin(pi/2*x)) / N_A)'
[]
[ion_ICs]
type = ParsedFunction
vars = 'N_A'
vals = 'N_A'
value = 'log((3.0 + sin(pi/2*x)) / N_A)'
[]
[mean_en_ICs]
type = ParsedFunction
vars = 'em_ICs'
vals = 'em_ICs'
value = 'log(3./2.) + em_ICs'
[]
[em_left_Flux_BC]
type = ParsedFunction
vars = 'ee N_A diffpotential diffem muem massem diffmean_en diffion muion'
vals = 'ee N_A diffpotential diffem muem massem diffmean_en diffion muion'
value = '(-diffem*pi*cos(pi*x) - muem*pi*cos(pi*x)*(sin(pi*t) + 1)*(sin(pi*x) +
sin(pi*y) + (cos(pi*y)*sin(2*pi*t))/5 + 1)) / N_A'
[]
[em_down_Flux_BC]
type = ParsedFunction
vars = 'ee N_A diffpotential diffem muem massem diffmean_en diffion muion'
vals = 'ee N_A diffpotential diffem muem massem diffmean_en diffion muion'
value = '(-(diffem*pi*(5*cos(pi*y) - sin(2*pi*t)*sin(pi*y)))/5 -
muem*pi*cos(pi*y)*(sin(pi*t) + 1)*(sin(pi*x) + sin(pi*y) +
(cos(pi*y)*sin(2*pi*t))/5 + 1)) / N_A'
[]
[]
[BCs]
#[em_left_BC]
# type = FunctionDirichletBC
# variable = em
# function = 'em_fun'
# boundary = 3
# preset = true
#[]
#[em_left_BC]
# type = FunctionNeumannBC
# variable = em
# function = 'em_left_Flux_BC'
# boundary = 3
# preset = true
#[]
[em_physical_diffusion_left]
type = SakiyamaElectronDiffusionBC
variable = em
electron_energy = mean_en
boundary = 3
position_units = 1.0
[]
[em_Ar+_second_emissions_left]
type = SakiyamaSecondaryElectronWithEffEfieldBC
variable = em
Ex = Ex
Ey = Ey
ions = ion
emission_coeffs = 'users_gamma'
boundary = 3
position_units = 1.0
[]
[em_right_BC]
type = FunctionDirichletBC
variable = em
function = 'em_fun'
boundary = 1
preset = true
[]
#[em_down_BC]
# type = FunctionDirichletBC
# variable = em
# function = 'em_fun'
# boundary = 0
# preset = true
#[]
#[em_down_BC]
# type = FunctionNeumannBC
# variable = em
# function = 'em_down_Flux_BC'
# boundary = 0
# preset = true
#[]
[em_physical_diffusion_down]
type = SakiyamaElectronDiffusionBC
variable = em
electron_energy = mean_en
boundary = 0
position_units = 1.0
[]
[em_Ar+_second_emissions_down]
type = SakiyamaSecondaryElectronWithEffEfieldBC
variable = em
Ex = Ex
Ey = Ey
ions = ion
emission_coeffs = 'users_gamma'
boundary = 0
position_units = 1.0
[]
[em_up_BC]
type = FunctionDirichletBC
variable = em
function = 'em_fun'
boundary = 2
preset = true
[]
[ion_BC]
type = FunctionDirichletBC
variable = ion
function = 'ion_fun'
boundary = '0 1 2 3'
preset = true
[]
[energy_BC]
type = FunctionDirichletBC
variable = mean_en
function = 'mean_en_fun'
boundary = '0 1 2 3'
preset = true
[]
[Ex_BC]
type = FunctionDirichletBC
variable = Ex
function = 'Ex_fun'
boundary = '0 1 2 3'
preset = true
[]
[Ey_BC]
type = FunctionDirichletBC
variable = Ey
function = 'Ey_fun'
boundary = '0 1 2 3'
preset = true
[]
[potential_BC]
type = FunctionDirichletBC
variable = potential
function = 'potential_fun'
boundary = '0 1 2 3'
preset = true
[]
[]
[Materials]
[field_solver]
type = FieldSolverMaterial
potential = potential
[]
[Material_Coeff]
type = GenericFunctionMaterial
prop_names = 'e N_A massem diffpotential diffEx diffEy'
prop_values = 'ee N_A massem diffpotential diffpotential diffpotential '
[]
[ADMaterial_Coeff_Set1]
type = ADGenericFunctionMaterial
prop_names = 'diffion muion diffem muem diffmean_en'
prop_values = 'diffion muion diffem muem diffmean_en'
[]
[Charge_Signs]
type = GenericConstantMaterial
prop_names = 'sgnem sgnion sgnmean_en'
prop_values = '-1.0 1.0 -1.0'
[]
[emission_coeffs]
type = ADGenericConstantMaterial
prop_names = 'users_gamma'
prop_values = '1.0'
[]
[]
[Postprocessors]
[em_l2Error]
type = ElementL2Error
variable = em
function = em_fun
[]
[ion_l2Error]
type = ElementL2Error
variable = ion
function = ion_fun
[]
[mean_en_l2Error]
type = ElementL2Error
variable = mean_en
function = mean_en_fun
[]
[Ex_l2Error]
type = ElementL2Error
variable = Ex
function = Ex_fun
[]
[Ey_l2Error]
type = ElementL2Error
variable = Ey
function = Ey_fun
[]
[potential_l2Error]
type = ElementL2Error
variable = potential
function = potential_fun
[]
[h]
type = AverageElementSize
[]
[]
[Preconditioning]
active = 'smp'
[smp]
type = SMP
full = true
[]
[fdp]
type = FDP
full = true
[]
[]
[Executioner]
type = Transient
start_time = 50
end_time = 51
# dt = 0.008
dt = 0.02
automatic_scaling = true
compute_scaling_once = false
petsc_options = '-snes_converged_reason -snes_linesearch_monitor'
solve_type = NEWTON
line_search = none
petsc_options_iname = '-pc_type -pc_factor_shift_type -pc_factor_shift_amount'
petsc_options_value = 'lu NONZERO 1.e-10'
scheme = bdf2
nl_abs_tol = 1e-13
[]
[Outputs]
perf_graph = true
[out]
type = Exodus
interval = 10
[]
[]
(test/tests/mms/bcs/2D_EnergyBC_NegivateOutWardFacingEfield.i)
[Mesh]
[geo]
type = FileMeshGenerator
file = '2D_EnergyBC_NegivateOutWardFacingEfield_IC_out.e'
use_for_exodus_restart = true
[]
[]
[Problem]
type = FEProblem
[]
[Variables]
[em]
initial_from_file_var = em
[]
[ion]
initial_from_file_var = ion
[]
[mean_en]
initial_from_file_var = mean_en
[]
[Ex]
initial_from_file_var = Ex
[]
[Ey]
initial_from_file_var = Ey
[]
[potential]
initial_from_file_var = potential
[]
[]
[Kernels]
#Electron Equations
[em_time_derivative]
type = TimeDerivativeLog
variable = em
[]
[em_diffusion]
type = CoeffDiffusion
variable = em
position_units = 1.0
[]
[em_source]
type = BodyForce
variable = em
function = 'em_source'
[]
#Ion Equations
[ion_time_derivative]
type = TimeDerivativeLog
variable = ion
[]
[ion_diffusion]
type = CoeffDiffusion
variable = ion
position_units = 1.0
[]
[ion_advection]
type = EffectiveEFieldAdvection
variable = ion
u = Ex
v = Ey
position_units = 1.0
[]
[ion_source]
type = BodyForce
variable = ion
function = 'ion_source'
[]
#Eff. Efield
[EffEfield_X_time_deriv]
type = TimeDerivative
variable = Ex
[]
[EffEfield_X_diffusion]
type = MatDiffusion
diffusivity = diffEx
variable = Ex
[]
[EffEfield_X_source]
type = BodyForce
variable = Ex
function = 'Ex_source'
[]
[EffEfield_Y_time_deriv]
type = TimeDerivative
variable = Ey
[]
[EffEfield_Y_diffusion]
type = MatDiffusion
diffusivity = diffEy
variable = Ey
[]
[EffEfield_Y_source]
type = BodyForce
variable = Ey
function = 'Ey_source'
[]
#Potential
[Potential_time_deriv]
type = TimeDerivative
variable = potential
[]
[Potential_diffusion]
type = MatDiffusion
diffusivity = diffpotential
variable = potential
[]
[Potential_source]
type = BodyForce
variable = potential
function = 'potential_source'
[]
#Electron Energy Equations
[mean_en_time_deriv]
type = TimeDerivativeLog
variable = mean_en
[]
[mean_en_diffusion]
type = CoeffDiffusion
variable = mean_en
position_units = 1.0
[]
[mean_en_advection]
type = EFieldAdvection
variable = mean_en
position_units = 1.0
[]
[mean_en_source]
type = BodyForce
variable = mean_en
function = 'energy_source'
[]
[]
[AuxVariables]
[mean_en_sol]
[]
[em_sol]
[]
[ion_sol]
[]
[Ex_sol]
[]
[Ey_sol]
[]
[potential_sol]
[]
[]
[AuxKernels]
[mean_en_sol]
type = FunctionAux
variable = mean_en_sol
function = mean_en_fun
[]
[em_sol]
type = FunctionAux
variable = em_sol
function = em_fun
[]
[ion_sol]
type = FunctionAux
variable = ion_sol
function = ion_fun
[]
[Ex_sol]
type = FunctionAux
variable = Ex_sol
function = Ex_fun
[]
[Ey_sol]
type = FunctionAux
variable = Ey_sol
function = Ey_fun
[]
[potential_sol]
type = FunctionAux
variable = potential_sol
function = potential_fun
[]
[]
[Functions]
#Material Variables
[massem]
type = ConstantFunction
value = 1.0
[]
#Electron diffusion coeff.
[diffem]
type = ConstantFunction
value = 0.05
[]
[muem]
type = ConstantFunction
value = 0.01
[]
#Electron energy mobility coeff.
[diffmean_en]
type = ConstantFunction
value = 0.05
[]
[mumean_en]
type = ConstantFunction
value = 0.01
[]
#Ion diffusion coeff.
[diffion]
type = ParsedFunction
vars = diffmean_en
vals = diffmean_en
value = diffmean_en
[]
[muion]
type = ParsedFunction
vars = mumean_en
vals = mumean_en
value = mumean_en
[]
[N_A]
type = ConstantFunction
value = 1.0
[]
[ee]
type = ConstantFunction
value = 1.0
[]
[diffpotential]
type = ConstantFunction
value = 0.25
[]
#Manufactured Solutions
#The manufactured electron density solution
[em_fun]
type = ParsedFunction
vars = 'ee N_A diffpotential diffem muem massem diffmean_en mumean_en diffion muion'
vals = 'ee N_A diffpotential diffem muem massem diffmean_en mumean_en diffion muion'
value = 'log(((16*ee*(sin(pi*x) + sin(pi*y) + (cos(pi*y)*sin(2*pi*t))/5 + 1)^3)/(3*massem*pi*((12*diffmean_en*pi)/5 +
(12*mumean_en*pi*(sin(t*pi) + 1)*(sin(x*pi) + sin(y*pi) + (cos(y*pi)*sin(2*t*pi))/5 + 1))/5)^2)) / N_A)'
[]
#The manufactured ion density solution
[ion_fun]
type = ParsedFunction
vars = 'N_A'
vals = 'N_A'
value = 'log((sin(pi*y) + 0.2*sin(2*pi*t)*cos(pi*y) + 1.0 + sin(pi*x)) / N_A)'
[]
#The manufactured electron energy solution
[mean_en_fun]
type = ParsedFunction
vars = 'ee N_A diffpotential diffem muem massem diffmean_en mumean_en diffion muion'
vals = 'ee N_A diffpotential diffem muem massem diffmean_en mumean_en diffion muion'
value = 'log((sin(pi*y) + 0.2*sin(2*pi*t)*cos(pi*y) + 1.0 + sin(pi*x)) / N_A)'
[]
#The manufactured eff. Efield solution
[Ex_fun]
type = ParsedFunction
vars = 'ee N_A diffpotential diffem muem massem diffmean_en mumean_en diffion muion'
vals = 'ee N_A diffpotential diffem muem massem diffmean_en mumean_en diffion muion'
value = 'pi*cos(pi*x)*(sin(pi*t) + 1)'
[]
[Ey_fun]
type = ParsedFunction
vars = 'ee N_A diffpotential diffem muem massem diffmean_en mumean_en diffion muion'
vals = 'ee N_A diffpotential diffem muem massem diffmean_en mumean_en diffion muion'
value = 'pi*cos(pi*y)*(sin(pi*t) + 1)'
[]
#The manufactured potential solution
[potential_fun]
type = ParsedFunction
vars = 'ee N_A diffpotential diffem muem massem diffmean_en mumean_en diffion muion'
vals = 'ee N_A diffpotential diffem muem massem diffmean_en mumean_en diffion muion'
value = '-(sin(pi*t) + 1.0)*(sin(pi*y) + sin(pi*x))'
[]
#Source Terms in moles
#The electron source term.
[em_source]
type = ParsedFunction
vars = 'ee N_A diffpotential diffem muem massem diffmean_en mumean_en diffion muion'
vals = 'ee N_A diffpotential diffem muem massem diffmean_en mumean_en diffion muion'
value = '((32*ee*cos(2*pi*t)*cos(pi*y)*(sin(pi*x) + sin(pi*y) + (cos(pi*y)*sin(2*pi*t))/5 +
1)^2)/(5*massem*((12*diffmean_en*pi)/5 + (12*mumean_en*pi*(sin(t*pi) + 1)*(sin(x*pi) +
sin(y*pi) + (cos(y*pi)*sin(2*t*pi))/5 + 1))/5)^2) - diffem*((32*ee*(pi*cos(pi*y) -
(pi*sin(2*pi*t)*sin(pi*y))/5)^2*(sin(pi*x) + sin(pi*y) + (cos(pi*y)*sin(2*pi*t))/5 +
1))/(massem*pi*((12*diffmean_en*pi)/5 + (12*mumean_en*pi*(sin(t*pi) + 1)*(sin(x*pi) +
sin(y*pi) + (cos(y*pi)*sin(2*t*pi))/5 + 1))/5)^2) - (16*ee*(pi^2*sin(pi*y) +
(pi^2*cos(pi*y)*sin(2*pi*t))/5)*(sin(pi*x) + sin(pi*y) + (cos(pi*y)*sin(2*pi*t))/5 +
1)^2)/(massem*pi*((12*diffmean_en*pi)/5 + (12*mumean_en*pi*(sin(t*pi) + 1)*(sin(x*pi) +
sin(y*pi) + (cos(y*pi)*sin(2*t*pi))/5 + 1))/5)^2) - (768*ee*mumean_en*(pi*cos(pi*y) -
(pi*sin(2*pi*t)*sin(pi*y))/5)^2*(sin(pi*t) + 1)*(sin(pi*x) + sin(pi*y) +
(cos(pi*y)*sin(2*pi*t))/5 + 1)^2)/(5*massem*((12*diffmean_en*pi)/5 + (12*mumean_en*pi*(sin(t*pi) +
1)*(sin(x*pi) + sin(y*pi) + (cos(y*pi)*sin(2*t*pi))/5 + 1))/5)^3) + (128*ee*mumean_en*(pi^2*sin(pi*y) +
(pi^2*cos(pi*y)*sin(2*pi*t))/5)*(sin(pi*t) + 1)*(sin(pi*x) + sin(pi*y) + (cos(pi*y)*sin(2*pi*t))/5 +
1)^3)/(5*massem*((12*diffmean_en*pi)/5 + (12*mumean_en*pi*(sin(t*pi) + 1)*(sin(x*pi) + sin(y*pi) +
(cos(y*pi)*sin(2*t*pi))/5 + 1))/5)^3) + (4608*ee*mumean_en^2*pi*(pi*cos(pi*y) -
(pi*sin(2*pi*t)*sin(pi*y))/5)^2*(sin(pi*t) + 1)^2*(sin(pi*x) + sin(pi*y) + (cos(pi*y)*sin(2*pi*t))/5 +
1)^3)/(25*massem*((12*diffmean_en*pi)/5 + (12*mumean_en*pi*(sin(t*pi) + 1)*(sin(x*pi) + sin(y*pi) +
(cos(y*pi)*sin(2*t*pi))/5 + 1))/5)^4)) - diffem*((32*ee*pi*cos(pi*x)^2*(sin(pi*x) + sin(pi*y) +
(cos(pi*y)*sin(2*pi*t))/5 + 1))/(massem*((12*diffmean_en*pi)/5 + (12*mumean_en*pi*(sin(t*pi) +
1)*(sin(x*pi) + sin(y*pi) + (cos(y*pi)*sin(2*t*pi))/5 + 1))/5)^2) - (16*ee*pi*sin(pi*x)*(sin(pi*x) +
sin(pi*y) + (cos(pi*y)*sin(2*pi*t))/5 + 1)^2)/(massem*((12*diffmean_en*pi)/5 + (12*mumean_en*pi*(sin(t*pi) +
1)*(sin(x*pi) + sin(y*pi) + (cos(y*pi)*sin(2*t*pi))/5 + 1))/5)^2) - (768*ee*mumean_en*pi^2*cos(pi*x)^2*(sin(pi*t) +
1)*(sin(pi*x) + sin(pi*y) + (cos(pi*y)*sin(2*pi*t))/5 + 1)^2)/(5*massem*((12*diffmean_en*pi)/5 +
(12*mumean_en*pi*(sin(t*pi) + 1)*(sin(x*pi) + sin(y*pi) + (cos(y*pi)*sin(2*t*pi))/5 + 1))/5)^3) +
(128*ee*mumean_en*pi^2*sin(pi*x)*(sin(pi*t) + 1)*(sin(pi*x) + sin(pi*y) + (cos(pi*y)*sin(2*pi*t))/5 +
1)^3)/(5*massem*((12*diffmean_en*pi)/5 + (12*mumean_en*pi*(sin(t*pi) + 1)*(sin(x*pi) + sin(y*pi) +
(cos(y*pi)*sin(2*t*pi))/5 + 1))/5)^3) + (4608*ee*mumean_en^2*pi^3*cos(pi*x)^2*(sin(pi*t) + 1)^2*(sin(pi*x) +
sin(pi*y) + (cos(pi*y)*sin(2*pi*t))/5 + 1)^3)/(25*massem*((12*diffmean_en*pi)/5 +
(12*mumean_en*pi*(sin(t*pi) + 1)*(sin(x*pi) + sin(y*pi) + (cos(y*pi)*sin(2*t*pi))/5 + 1))/5)^4)) -
(32*ee*((12*mumean_en*pi^2*cos(pi*t)*(sin(pi*x) + sin(pi*y) + (cos(pi*y)*sin(2*pi*t))/5 + 1))/5 +
(24*mumean_en*pi^2*cos(2*pi*t)*cos(pi*y)*(sin(pi*t) + 1))/25)*(sin(pi*x) + sin(pi*y) +
(cos(pi*y)*sin(2*pi*t))/5 + 1)^3)/(3*massem*pi*((12*diffmean_en*pi)/5 + (12*mumean_en*pi*(sin(t*pi) +
1)*(sin(x*pi) + sin(y*pi) + (cos(y*pi)*sin(2*t*pi))/5 + 1))/5)^3)) / N_A'
[]
#The ion source term.
[ion_source]
type = ParsedFunction
vars = 'ee N_A diffpotential diffem muem massem diffmean_en mumean_en diffion muion'
vals = 'ee N_A diffpotential diffem muem massem diffmean_en mumean_en diffion muion'
value = '(diffion*pi^2*sin(pi*x) + (diffion*pi^2*(5*sin(pi*y) + cos(pi*y)*sin(2*pi*t)))/5 +
(2*pi*cos(2*pi*t)*cos(pi*y))/5 - (muion*pi^2*(sin(pi*t) + 1)*(5*sin(pi*x) + 5*sin(pi*y) +
10*sin(pi*x)*sin(pi*y) - 10*cos(pi*x)^2 - 10*cos(pi*y)^2 + cos(pi*y)*sin(2*pi*t)*sin(pi*x) +
2*cos(pi*y)*sin(2*pi*t)*sin(pi*y) + 10))/5) / N_A'
[]
[energy_source]
type = ParsedFunction
vars = 'ee N_A diffpotential diffem muem massem diffmean_en mumean_en diffion muion'
vals = 'ee N_A diffpotential diffem muem massem diffmean_en mumean_en diffion muion'
value = '(diffmean_en*pi^2*sin(pi*x) + (diffmean_en*pi^2*(5*sin(pi*y) + cos(pi*y)*sin(2*pi*t)))/5 +
(2*pi*cos(2*pi*t)*cos(pi*y))/5 + (mumean_en*pi^2*(sin(pi*t) + 1)*(5*sin(pi*x) + 5*sin(pi*y) +
10*sin(pi*x)*sin(pi*y) - 10*cos(pi*x)^2 - 10*cos(pi*y)^2 + cos(pi*y)*sin(2*pi*t)*sin(pi*x) +
2*cos(pi*y)*sin(2*pi*t)*sin(pi*y) + 10))/5) / N_A'
[]
#The Ex source term.
[Ex_source]
type = ParsedFunction
vars = 'ee N_A diffpotential diffem muem massem diffmean_en mumean_en diffion muion'
vals = 'ee N_A diffpotential diffem muem massem diffmean_en mumean_en diffion muion'
value = 'pi^2*cos(pi*t)*cos(pi*x) + diffpotential*pi^3*cos(pi*x)*(sin(pi*t) + 1)'
[]
[Ey_source]
type = ParsedFunction
vars = 'ee N_A diffpotential diffem muem massem diffmean_en mumean_en diffion muion'
vals = 'ee N_A diffpotential diffem muem massem diffmean_en mumean_en diffion muion'
value = 'pi^2*cos(pi*t)*cos(pi*y) + diffpotential*pi^3*cos(pi*y)*(sin(pi*t) + 1)'
[]
[potential_source]
type = ParsedFunction
vars = 'ee N_A diffpotential diffem muem massem diffmean_en mumean_en diffion muion'
vals = 'ee N_A diffpotential diffem muem massem diffmean_en mumean_en diffion muion'
value = '-pi*cos(pi*t)*(sin(pi*x) + sin(pi*y)) - diffpotential*pi^2*sin(pi*x)*(sin(pi*t) + 1) -
diffpotential*pi^2*sin(pi*y)*(sin(pi*t) + 1)'
[]
[em_ICs]
type = ParsedFunction
vars = 'N_A'
vals = 'N_A'
value = '4.0'
[]
[ion_ICs]
type = ParsedFunction
vars = 'N_A'
vals = 'N_A'
value = 'log((3.0 + sin(pi/2*x)) / N_A)'
[]
[mean_en_ICs]
type = ParsedFunction
vars = 'em_ICs'
vals = 'em_ICs'
value = '1.0'
[]
[em_left_Flux_BC]
type = ParsedFunction
vars = 'ee N_A diffpotential diffem muem massem diffmean_en mumean_en diffion muion'
vals = 'ee N_A diffpotential diffem muem massem diffmean_en mumean_en diffion muion'
value = '(-diffmean_en*pi*cos(pi*x) - mumean_en*pi*cos(pi*x)*(sin(pi*t) + 1)*(sin(pi*x) +
sin(pi*y) + (cos(pi*y)*sin(2*pi*t))/5 + 1)) / N_A'
[]
[em_down_Flux_BC]
type = ParsedFunction
vars = 'ee N_A diffpotential diffem muem massem diffmean_en mumean_en diffion muion'
vals = 'ee N_A diffpotential diffem muem massem diffmean_en mumean_en diffion muion'
value = '(-(diffmean_en*pi*(5*cos(pi*y) - sin(2*pi*t)*sin(pi*y)))/5 -
mumean_en*pi*cos(pi*y)*(sin(pi*t) + 1)*(sin(pi*x) + sin(pi*y) + (cos(pi*y)*sin(2*pi*t))/5 + 1)) / N_A'
[]
[]
[BCs]
[em_BC]
type = FunctionDirichletBC
variable = em
function = 'em_fun'
boundary = '0 1 2 3'
preset = true
[]
[ion_BC]
type = FunctionDirichletBC
variable = ion
function = 'ion_fun'
boundary = '0 1 2 3'
preset = true
[]
#[energy_left_BC]
# type = FunctionDirichletBC
# variable = mean_en
# function = 'mean_en_fun'
# boundary = 3
# preset = true
#[]
[energy_left_physical_diffusion]
type = SakiyamaEnergyDiffusionBC
variable = mean_en
electrons = em
boundary = 3
position_units = 1.0
[]
[energy_left_second_emissions]
type = SakiyamaEnergySecondaryElectronWithEffEfieldBC
variable = mean_en
em = em
ions = ion
Ex = Ex
Ey = Ey
Tse_equal_Te = false
user_se_energy = 1.0
emission_coeffs = 'users_gamma'
boundary = 3
position_units = 1.0
[]
[energy_right_BC]
type = FunctionDirichletBC
variable = mean_en
function = 'mean_en_fun'
boundary = 1
preset = true
[]
#[energy_down_BC]
# type = FunctionDirichletBC
# variable = mean_en
# function = 'mean_en_fun'
# boundary = 0
# preset = true
#[]
[energy_down_physical_diffusion]
type = SakiyamaEnergyDiffusionBC
variable = mean_en
electrons = em
boundary = 0
position_units = 1.0
[]
[energy_down_second_emissions]
type = SakiyamaEnergySecondaryElectronWithEffEfieldBC
variable = mean_en
em = em
ions = ion
Ex = Ex
Ey = Ey
Tse_equal_Te = false
user_se_energy = 1.0
emission_coeffs = 'users_gamma'
boundary = 0
position_units = 1.0
[]
[energy_up_BC]
type = FunctionDirichletBC
variable = mean_en
function = 'mean_en_fun'
boundary = 2
preset = true
[]
[Ex_BC]
type = FunctionDirichletBC
variable = Ex
function = 'Ex_fun'
boundary = '0 1 2 3'
preset = true
[]
[Ey_BC]
type = FunctionDirichletBC
variable = Ey
function = 'Ey_fun'
boundary = '0 1 2 3'
preset = true
[]
[potential_BC]
type = FunctionDirichletBC
variable = potential
function = 'potential_fun'
boundary = '0 1 2 3'
preset = true
[]
[]
[Materials]
[field_solver]
type = FieldSolverMaterial
potential = potential
[]
[Material_Coeff]
type = GenericFunctionMaterial
prop_names = 'e N_A massem diffpotential diffEx diffEy'
prop_values = 'ee N_A massem diffpotential diffpotential diffpotential '
[]
[ADMaterial_Coeff_Set1]
type = ADGenericFunctionMaterial
prop_names = 'diffion muion diffem muem diffmean_en mumean_en'
prop_values = 'diffion muion diffem muem diffmean_en mumean_en'
[]
[Charge_Signs]
type = GenericConstantMaterial
prop_names = 'sgnem sgnion sgnmean_en'
prop_values = '-1.0 1.0 -1.0'
[]
[emission_coeffs]
type = ADGenericConstantMaterial
prop_names = 'users_gamma'
prop_values = '1.0'
[]
[]
[Postprocessors]
[em_l2Error]
type = ElementL2Error
variable = em
function = em_fun
[]
[ion_l2Error]
type = ElementL2Error
variable = ion
function = ion_fun
[]
[mean_en_l2Error]
type = ElementL2Error
variable = mean_en
function = mean_en_fun
[]
[Ex_l2Error]
type = ElementL2Error
variable = Ex
function = Ex_fun
[]
[Ey_l2Error]
type = ElementL2Error
variable = Ey
function = Ey_fun
[]
[potential_l2Error]
type = ElementL2Error
variable = potential
function = potential_fun
[]
[h]
type = AverageElementSize
[]
[]
[Preconditioning]
active = 'smp'
[smp]
type = SMP
full = true
[]
[fdp]
type = FDP
full = true
[]
[]
[Executioner]
type = Transient
start_time = 50
end_time = 51
# dt = 0.008
dt = 0.02
automatic_scaling = true
compute_scaling_once = false
petsc_options = '-snes_converged_reason -snes_linesearch_monitor'
solve_type = NEWTON
line_search = none
petsc_options_iname = '-pc_type -pc_factor_shift_type -pc_factor_shift_amount'
petsc_options_value = 'lu NONZERO 1.e-10'
scheme = bdf2
nl_abs_tol = 1e-13
[]
[Outputs]
perf_graph = true
[out]
type = Exodus
interval = 10
[]
[]
(test/tests/mms/bcs/2D_IonBC.i)
[Mesh]
[geo]
type = FileMeshGenerator
file = '2D_IonBC_IC_out.e'
use_for_exodus_restart = true
[]
[]
[Problem]
type = FEProblem
[]
[Variables]
[ion]
initial_from_file_var = ion
[]
[Ex]
initial_from_file_var = Ex
[]
[Ey]
initial_from_file_var = Ey
[]
[]
[Kernels]
#Ion Equations
[ion_time_derivative]
type = TimeDerivativeLog
variable = ion
[]
[ion_diffusion]
type = CoeffDiffusion
variable = ion
position_units = 1.0
[]
[ion_advection]
type = EffectiveEFieldAdvection
variable = ion
u = Ex
v = Ey
position_units = 1.0
[]
[ion_source]
type = BodyForce
variable = ion
function = 'ion_source'
[]
#Eff. Efield
[EffEfield_X_time_deriv]
type = TimeDerivative
variable = Ex
[]
[EffEfield_X_diffusion]
type = MatDiffusion
diffusivity = diffEx
variable = Ex
[]
[EffEfield_X_source]
type = BodyForce
variable = Ex
function = 'Ex_source'
[]
[EffEfield_Y_time_deriv]
type = TimeDerivative
variable = Ey
[]
[EffEfield_Y_diffusion]
type = MatDiffusion
diffusivity = diffEy
variable = Ey
[]
[EffEfield_Y_source]
type = BodyForce
variable = Ey
function = 'Ey_source'
[]
[]
[AuxVariables]
[ion_sol]
[]
[Ex_sol]
[]
[Ey_sol]
[]
[]
[AuxKernels]
[ion_sol]
type = FunctionAux
variable = ion_sol
function = ion_fun
[]
[Ex_sol]
type = FunctionAux
variable = Ex_sol
function = Ex_fun
[]
[Ey_sol]
type = FunctionAux
variable = Ey_sol
function = Ey_fun
[]
[]
[Functions]
#Material Variables
#Ion diffusion coeff.
[diffion]
type = ConstantFunction
value = 0.05
[]
[muion]
type = ConstantFunction
value = 0.01
[]
[N_A]
type = ConstantFunction
value = 1.0
[]
[ee]
type = ConstantFunction
value = 1.0
[]
[diffpotential]
type = ConstantFunction
value = 0.25
[]
#Manufactured Solutions
#The manufactured ion density solution
[ion_fun]
type = ParsedFunction
vars = 'N_A'
vals = 'N_A'
value = 'log((cos(pi/2*y) + 0.2*sin(2*pi*t)*cos(pi*y) + 1.0 + cos(pi/2*x)) / N_A)'
[]
#The manufactured eff. Efield solution
[Ex_fun]
type = ParsedFunction
vars = 'ee N_A diffpotential diffion muion'
vals = 'ee N_A diffpotential diffion muion'
value = '-pi*cos(pi*x)*(sin(pi*t) + 1)'
[]
[Ey_fun]
type = ParsedFunction
vars = 'ee N_A diffpotential diffion muion'
vals = 'ee N_A diffpotential diffion muion'
value = '-pi*cos(pi*y)*(sin(pi*t) + 1)'
[]
#Source Terms in moles
#The ion source term.
[ion_source]
type = ParsedFunction
vars = 'ee N_A diffpotential diffion muion'
vals = 'ee N_A diffpotential diffion muion'
value = '(diffion*((pi^2*cos((pi*y)/2))/4 + (pi^2*sin(2*pi*t)*(2*cos((pi*y)/2)^2 - 1))/5) +
(2*pi*cos(2*pi*t)*cos(pi*y))/5 + (diffion*pi^2*cos((pi*x)/2))/4 + muion*pi^2*sin(pi*x)*(sin(pi*t) + 1)*(cos((pi*x)/2) +
cos((pi*y)/2) + (cos(pi*y)*sin(2*pi*t))/5 + 1) + muion*pi^2*sin(pi*y)*(sin(pi*t) + 1)*(cos((pi*x)/2) + cos((pi*y)/2) +
(cos(pi*y)*sin(2*pi*t))/5 + 1) + muion*pi*cos(pi*y)*((pi*sin((pi*y)/2))/2 + (pi*sin(2*pi*t)*sin(pi*y))/5)*(sin(pi*t) + 1) +
(muion*pi^2*cos(pi*x)*sin((pi*x)/2)*(sin(pi*t) + 1))/2) / N_A'
[]
#The Ex source term.
[Ex_source]
type = ParsedFunction
vars = 'ee N_A diffpotential diffion muion'
vals = 'ee N_A diffpotential diffion muion'
value = '-pi^2*cos(pi*t)*cos(pi*x) - diffpotential*pi^3*cos(pi*x)*(sin(pi*t) + 1)'
[]
[Ey_source]
type = ParsedFunction
vars = 'ee N_A diffpotential diffion muion'
vals = 'ee N_A diffpotential diffion muion'
value = '-pi^2*cos(pi*t)*cos(pi*y) - diffpotential*pi^3*cos(pi*y)*(sin(pi*t) + 1)'
[]
[ion_ICs]
type = ParsedFunction
vars = 'N_A'
vals = 'N_A'
value = 'log((3.0 + sin(pi/2*x)) / N_A)'
[]
[ion_left_Flux_BC]
type = ParsedFunction
vars = 'ee N_A diffpotential diffion muion'
vals = 'ee N_A diffpotential diffion muion'
value = '((diffion*pi*sin((pi*x)/2))/2 - muion*pi*(2*cos((pi*x)/2)^2 - 1)*(sin(pi*t) + 1)*(cos((pi*x)/2) +
cos((pi*y)/2) + (2*cos(pi*t)*sin(pi*t)*(2*cos((pi*y)/2)^2 - 1))/5 + 1)) / N_A'
[]
[ion_down_Flux_BC]
type = ParsedFunction
vars = 'ee N_A diffpotential diffion muion'
vals = 'ee N_A diffpotential diffion muion'
value = '(diffion*((pi*sin((pi*y)/2))/2 + (pi*sin(2*pi*t)*sin(pi*y))/5) -
muion*pi*cos(pi*y)*(sin(pi*t) + 1)*(cos((pi*x)/2) + cos((pi*y)/2) + (cos(pi*y)*sin(2*pi*t))/5 + 1)) / N_A'
[]
[]
[BCs]
#[ion_left_BC]
# type = FunctionDirichletBC
# variable = ion
# function = 'ion_left_BC'
# boundary = 3
# preset = true
#[]
[ion_left_physical_advection]
type = SakiyamaIonAdvectionWithEffEfieldBC
variable = ion
Ex = Ex
Ey = Ey
boundary = 3
position_units = 1.0
[]
[ion_right_BC]
type = FunctionDirichletBC
variable = ion
function = 'ion_fun'
boundary = 1
preset = true
[]
#[ion_down_BC]
# type = FunctionDirichletBC
# variable = ion
# function = 'ion_down_BC'
# boundary = 0
# preset = true
#[]
[ion_down_physical_advection]
type = SakiyamaIonAdvectionWithEffEfieldBC
variable = ion
Ex = Ex
Ey = Ey
boundary = 0
position_units = 1.0
[]
[ion_up_BC]
type = FunctionDirichletBC
variable = ion
function = 'ion_fun'
boundary = 2
preset = true
[]
[Ex_BC]
type = FunctionDirichletBC
variable = Ex
function = 'Ex_fun'
boundary = '0 1 2 3'
preset = true
[]
[Ey_BC]
type = FunctionDirichletBC
variable = Ey
function = 'Ey_fun'
boundary = '0 1 2 3'
preset = true
[]
[]
[Materials]
[Material_Coeff]
type = GenericFunctionMaterial
prop_names = 'e N_A diffEx diffEy'
prop_values = 'ee N_A diffpotential diffpotential '
[]
[ADMaterial_Coeff_Set1]
type = ADGenericFunctionMaterial
prop_names = 'diffion muion'
prop_values = 'diffion muion'
[]
[Charge_Signs]
type = GenericConstantMaterial
prop_names = 'sgnion'
prop_values = '1.0'
[]
[]
[Postprocessors]
[ion_l2Error]
type = ElementL2Error
variable = ion
function = ion_fun
[]
[Ex_l2Error]
type = ElementL2Error
variable = Ex
function = Ex_fun
[]
[Ey_l2Error]
type = ElementL2Error
variable = Ey
function = Ey_fun
[]
[h]
type = AverageElementSize
[]
[]
[Preconditioning]
active = 'smp'
[smp]
type = SMP
full = true
[]
[fdp]
type = FDP
full = true
[]
[]
[Executioner]
type = Transient
start_time = 50
end_time = 51
# dt = 0.008
dt = 0.02
automatic_scaling = true
compute_scaling_once = false
petsc_options = '-snes_converged_reason -snes_linesearch_monitor'
solve_type = NEWTON
line_search = none
petsc_options_iname = '-pc_type -pc_factor_shift_type -pc_factor_shift_amount'
petsc_options_value = 'lu NONZERO 1.e-10'
scheme = bdf2
nl_abs_tol = 1e-13
[]
[Outputs]
perf_graph = true
[out]
type = Exodus
interval = 10
[]
[]
(test/tests/mms/bcs/2D_IonBC_NegivateOutWardFacingEfield.i)
[Mesh]
[geo]
type = FileMeshGenerator
file = '2D_IonBC_NegivateOutWardFacingEfield_IC_out.e'
use_for_exodus_restart = true
[]
[]
[Problem]
type = FEProblem
[]
[Variables]
[ion]
initial_from_file_var = ion
[]
[Ex]
initial_from_file_var = Ex
[]
[Ey]
initial_from_file_var = Ey
[]
[]
[Kernels]
#Ion Equations
[ion_time_derivative]
type = TimeDerivativeLog
variable = ion
[]
[ion_diffusion]
type = CoeffDiffusion
variable = ion
position_units = 1.0
[]
[ion_advection]
type = EffectiveEFieldAdvection
variable = ion
u = Ex
v = Ey
position_units = 1.0
[]
[ion_source]
type = BodyForce
variable = ion
function = 'ion_source'
[]
#Eff. Efield
[EffEfield_X_time_deriv]
type = TimeDerivative
variable = Ex
[]
[EffEfield_X_diffusion]
type = MatDiffusion
diffusivity = diffEx
variable = Ex
[]
[EffEfield_X_source]
type = BodyForce
variable = Ex
function = 'Ex_source'
[]
[EffEfield_Y_time_deriv]
type = TimeDerivative
variable = Ey
[]
[EffEfield_Y_diffusion]
type = MatDiffusion
diffusivity = diffEy
variable = Ey
[]
[EffEfield_Y_source]
type = BodyForce
variable = Ey
function = 'Ey_source'
[]
[]
[AuxVariables]
[ion_sol]
[]
[Ex_sol]
[]
[Ey_sol]
[]
[]
[AuxKernels]
[ion_sol]
type = FunctionAux
variable = ion_sol
function = ion_fun
[]
[Ex_sol]
type = FunctionAux
variable = Ex_sol
function = Ex_fun
[]
[Ey_sol]
type = FunctionAux
variable = Ey_sol
function = Ey_fun
[]
[]
[Functions]
#Material Variables
#Ion diffusion coeff.
[diffion]
type = ConstantFunction
value = 0.05
[]
[muion]
type = ConstantFunction
value = 0.01
[]
[N_A]
type = ConstantFunction
value = 1.0
[]
[ee]
type = ConstantFunction
value = 1.0
[]
[diffpotential]
type = ConstantFunction
value = 0.25
[]
#Manufactured Solutions
#The manufactured ion density solution
[ion_fun]
type = ParsedFunction
vars = 'N_A'
vals = 'N_A'
value = 'log((sin(pi*y) + 0.2*sin(2*pi*t)*cos(pi*y) + 1.0 + sin(pi*x)) / N_A)'
[]
#The manufactured eff. Efield solution
[Ex_fun]
type = ParsedFunction
vars = 'ee N_A diffpotential diffion muion'
vals = 'ee N_A diffpotential diffion muion'
value = '(diffion*pi*cos(pi*x))/(muion*(sin(pi*x) + sin(pi*y) + (cos(pi*y)*sin(2*pi*t))/5 + 1))'
[]
[Ey_fun]
type = ParsedFunction
vars = 'ee N_A diffpotential diffion muion'
vals = 'ee N_A diffpotential diffion muion'
value = '(diffion*(pi*cos(pi*y) - (pi*sin(2*pi*t)*sin(pi*y))/5))/(muion*(sin(pi*x) + sin(pi*y) + (cos(pi*y)*sin(2*pi*t))/5 + 1))'
[]
#Source Terms in moles
#The ion source term.
[ion_source]
type = ParsedFunction
vars = 'ee N_A diffpotential diffion muion'
vals = 'ee N_A diffpotential diffion muion'
value = '((2*pi*cos(2*pi*t)*cos(pi*y))/5) / N_A'
[]
#The Ex source term.
[Ex_source]
type = ParsedFunction
vars = 'ee N_A diffpotential diffion muion'
vals = 'ee N_A diffpotential diffion muion'
value = '-diffpotential*((2*diffion*pi^3*cos(pi*x)^3)/(muion*(sin(x*pi) + sin(y*pi) + (cos(y*pi)*sin(2*t*pi))/5 + 1)^3) - (diffion*pi^3*cos(pi*x))/(muion*(sin(pi*x) + sin(pi*y) + (cos(pi*y)*sin(2*pi*t))/5 + 1)) + (3*diffion*pi^3*cos(pi*x)*sin(pi*x))/(muion*(sin(x*pi) + sin(y*pi) + (cos(y*pi)*sin(2*t*pi))/5 + 1)^2)) - (2*diffion*diffpotential*pi*cos(pi*x)*(pi*cos(pi*y) - (pi*sin(2*pi*t)*sin(pi*y))/5)^2)/(muion*(sin(x*pi) + sin(y*pi) + (cos(y*pi)*sin(2*t*pi))/5 + 1)^3) - (2*diffion*pi^2*cos(2*pi*t)*cos(pi*x)*cos(pi*y))/(5*muion*(sin(x*pi) + sin(y*pi) + (cos(y*pi)*sin(2*t*pi))/5 + 1)^2) - (diffion*diffpotential*pi*cos(pi*x)*(pi^2*sin(pi*y) + (pi^2*cos(pi*y)*sin(2*pi*t))/5))/(muion*(sin(x*pi) + sin(y*pi) + (cos(y*pi)*sin(2*t*pi))/5 + 1)^2)'
[]
[Ey_source]
type = ParsedFunction
vars = 'ee N_A diffpotential diffion muion'
vals = 'ee N_A diffpotential diffion muion'
value = '-diffpotential*((2*diffion*(pi*cos(pi*y) - (pi*sin(2*pi*t)*sin(pi*y))/5)^3)/(muion*(sin(x*pi) + sin(y*pi) + (cos(y*pi)*sin(2*t*pi))/5 + 1)^3) - (diffion*(pi^3*cos(pi*y) - (pi^3*sin(2*pi*t)*sin(pi*y))/5))/(muion*(sin(pi*x) + sin(pi*y) + (cos(pi*y)*sin(2*pi*t))/5 + 1)) + (3*diffion*(pi^2*sin(pi*y) + (pi^2*cos(pi*y)*sin(2*pi*t))/5)*(pi*cos(pi*y) - (pi*sin(2*pi*t)*sin(pi*y))/5))/(muion*(sin(x*pi) + sin(y*pi) + (cos(y*pi)*sin(2*t*pi))/5 + 1)^2)) - (2*diffion*pi^2*cos(2*pi*t)*sin(pi*y))/(5*muion*(sin(pi*x) + sin(pi*y) + (cos(pi*y)*sin(2*pi*t))/5 + 1)) - (diffion*diffpotential*pi^2*sin(pi*x)*(pi*cos(pi*y) - (pi*sin(2*pi*t)*sin(pi*y))/5))/(muion*(sin(x*pi) + sin(y*pi) + (cos(y*pi)*sin(2*t*pi))/5 + 1)^2) - (2*diffion*diffpotential*pi^2*cos(pi*x)^2*(pi*cos(pi*y) - (pi*sin(2*pi*t)*sin(pi*y))/5))/(muion*(sin(x*pi) + sin(y*pi) + (cos(y*pi)*sin(2*t*pi))/5 + 1)^3) - (2*diffion*pi*cos(2*pi*t)*cos(pi*y)*(pi*cos(pi*y) - (pi*sin(2*pi*t)*sin(pi*y))/5))/(5*muion*(sin(x*pi) + sin(y*pi) + (cos(y*pi)*sin(2*t*pi))/5 + 1)^2)'
[]
[ion_ICs]
type = ParsedFunction
vars = 'N_A'
vals = 'N_A'
value = 'log((3.0 + sin(pi/2*x)) / N_A)'
[]
[ion_left_Flux_BC]
type = ParsedFunction
vars = 'ee N_A diffpotential diffion muion'
vals = 'ee N_A diffpotential diffion muion'
value = '(0) / N_A'
[]
[ion_down_Flux_BC]
type = ParsedFunction
vars = 'ee N_A diffpotential diffion muion'
vals = 'ee N_A diffpotential diffion muion'
value = '(0) / N_A'
[]
[]
[BCs]
#[ion_left_BC]
# type = FunctionDirichletBC
# variable = ion
# function = 'ion_fun'
# boundary = 3
# preset = true
#[]
[ion_left_physical_advection]
type = SakiyamaIonAdvectionWithEffEfieldBC
variable = ion
Ex = Ex
Ey = Ey
boundary = 3
position_units = 1.0
[]
[ion_right_BC]
type = FunctionDirichletBC
variable = ion
function = 'ion_fun'
boundary = 1
preset = true
[]
#[ion_down_BC]
# type = FunctionDirichletBC
# variable = ion
# function = 'ion_down_BC'
# boundary = 0
# preset = true
#[]
[ion_down_physical_advection]
type = SakiyamaIonAdvectionWithEffEfieldBC
variable = ion
Ex = Ex
Ey = Ey
boundary = 0
position_units = 1.0
[]
[ion_up_BC]
type = FunctionDirichletBC
variable = ion
function = 'ion_fun'
boundary = 2
preset = true
[]
[Ex_BC]
type = FunctionDirichletBC
variable = Ex
function = 'Ex_fun'
boundary = '0 1 2 3'
preset = true
[]
[Ey_BC]
type = FunctionDirichletBC
variable = Ey
function = 'Ey_fun'
boundary = '0 1 2 3'
preset = true
[]
[]
[Materials]
[Material_Coeff]
type = GenericFunctionMaterial
prop_names = 'e N_A diffEx diffEy'
prop_values = 'ee N_A diffpotential diffpotential '
[]
[ADMaterial_Coeff_Set1]
type = ADGenericFunctionMaterial
prop_names = 'diffion muion'
prop_values = 'diffion muion'
[]
[Charge_Signs]
type = GenericConstantMaterial
prop_names = 'sgnion'
prop_values = '1.0'
[]
[]
[Postprocessors]
[ion_l2Error]
type = ElementL2Error
variable = ion
function = ion_fun
[]
[Ex_l2Error]
type = ElementL2Error
variable = Ex
function = Ex_fun
[]
[Ey_l2Error]
type = ElementL2Error
variable = Ey
function = Ey_fun
[]
[h]
type = AverageElementSize
[]
[]
[Preconditioning]
active = 'smp'
[smp]
type = SMP
full = true
[]
[fdp]
type = FDP
full = true
[]
[]
[Executioner]
type = Transient
start_time = 50
end_time = 51
# dt = 0.008
dt = 0.02
automatic_scaling = true
compute_scaling_once = false
petsc_options = '-snes_converged_reason -snes_linesearch_monitor'
solve_type = NEWTON
line_search = none
petsc_options_iname = '-pc_type -pc_factor_shift_type -pc_factor_shift_amount'
petsc_options_value = 'lu NONZERO 1.e-10'
scheme = bdf2
nl_abs_tol = 1e-13
[]
[Outputs]
perf_graph = true
[out]
type = Exodus
interval = 10
[]
[]