Memosa-FVM  0.2
ElectricBC.h
Go to the documentation of this file.
1 // This file os part of FVM
2 // Copyright (c) 2012 FVM Authors
3 // See LICENSE file for terms.
4 
5 #ifndef _ELECTRICBC_H_
6 #define _ELECTRICBC_H_
7 
8 
9 #include "FloatVarDict.h"
10 #include "AMG.h"
11 
12 template<class T>
13 struct ElectricBC : public FloatVarDict<T>
14 {
16  {
17  this->defineVar("specifiedPotential",T(300.0));
18  this->defineVar("specifiedPotentialFlux",T(0.0));
19  this->defineVar("specifiedXElecField",T(0.0));
20  this->defineVar("specifiedYElecField",T(0.0));
21  this->defineVar("specifiedZElecField",T(0.0));
22  this->defineVar("specifiedCharge",T(0.0));
23  this->defineVar("specifiedChargeFlux",T(0.0));
24  this->defineVar("timeStep",T(1.0));
25 
26  }
27  string bcType;
28 };
29 
30 template<class T>
31 struct ElectricVC : public FloatVarDict<T>
32 {
34  {
35  this->defineVar("dielectric_constant",T(7.9));
36  }
37  string vcType;
38 };
39 
40 template<class T>
42 {
44  {
45  this->defineVar("dielectric_ionization", T(3.0)); //in EV
46  this->defineVar("dielectric_bandgap", T (5.0)); // in EV
47  this->defineVar("optical_dielectric_constant", T(4.0));
48  this->defineVar("dielectric_thickness", T(2.5e-7)); //in meter
49  this->defineVar("dielectric_constant", T(7.9));
50  this->defineVar("electron_capture_cross", T(1e-17)); //in m^-2
51 
52  this->defineVar("membrane_workfunction", T (5.0)); //in EV
53 
54  this->defineVar("substrate_workfunction", T (5.0)); //in EV
55 
56  this->defineVar("membrane_voltage", T (0.0));
57 
58  this->defineVar("substrate_voltage", T(0.0));
59 
60  this->defineVar("OP_temperature", T(300.0)); //in K
61  this->defineVar("electron_effmass", T(0.5));
62  this->defineVar("poole_frenkel_emission_frequency", T(1.0e+12)); //in s^-1
63  this->defineVar("electron_mobility", T(50e4)); // m^2 / Vs
64  this->defineVar("electron_saturation_velocity", T(1e9)); // m/s
65  this->defineVar("voltage", T(100)); // V
66 
67  this->defineVar("substrate_id", int(5)); //mesh id of substrate
68  this->defineVar("membrane_id", int(4)); //mesh id of membrane
69  this->defineVar("nLevel", int(0)); //number of grid in normal direction
70  this->defineVar("normal_direction", int(2)); //normal direction index; values: 0 1 2
71  this->defineVar("nTrap", int(1));
72 
73  }
74 
75 
77  vector<T> electron_trapdepth;
78 
79 };
80 
81 template<class T>
83 {
85  {
86  this->defineVar("initialCharge",T(0));
87  this->defineVar("initialPotential",T(0.0));
88  this->defineVar("initialTotalCharge", T(0.0));
89  this->defineVar("initialTunnelingCharge", T(1.0));
90  this->defineVar("timeStep",T(0.1));
91  this->defineVar("Interface_A_coeff",T(1.0));
92  this->defineVar("Interface_B_coeff",T(0.0));
93  this->defineVar("ButlerVolmerRRConstant",T(5.0e-7));
94  this->defineVar("ButlerVolmerAnodeShellMeshID", int(-1));
95  this->defineVar("ButlerVolmerCathodeShellMeshID", int(-1));
96  this->defineVar("BatteryElectrolyteMeshID", int(-1));
97  this->ButlerVolmer = false;
98  this->electrostaticsTolerance=1e-8;
99  this->chargetransportTolerance=1e-8;
100  this->electrostaticsLinearSolver = 0;
101  this->chargetransportLinearSolver = 0;
102  this->timeDiscretizationOrder = 1;
103  this->transient_enable = true;
104  this->ibm_enable = false;
105  this->electrostatics_enable = true;
106  this->chargetransport_enable = true;
107  this->tunneling_enable = false;
108  this->emission_enable = false;
109  this->capture_enable = false;
110  this->injection_enable = false;
111  this->drift_enable = false;
112  this->diffusion_enable = false;
113  this->trapbandtunneling_enable = false;
114  this->printNormalizedResiduals = true;
115  }
117 
121 
134 
138 
139 #ifndef SWIG
141  {
142  if (this->electrostaticsLinearSolver == 0)
143  {
144  LinearSolver* ls(new AMG());
145  ls->relativeTolerance = 1e-3;
146  ls->nMaxIterations = 20;
147  ls->verbosity=0;
148  this->electrostaticsLinearSolver = ls;
149  }
150  return *this->electrostaticsLinearSolver ;
151  }
152 
154  {
155  if (this->chargetransportLinearSolver == 0)
156  {
157  LinearSolver* ls(new AMG());
158  ls->relativeTolerance = 1e-3;
159  ls->nMaxIterations = 20;
160  ls->verbosity=0;
161  this->chargetransportLinearSolver = ls;
162  }
163  return *this->chargetransportLinearSolver ;
164  }
165 #endif
166 };
167 
168 
169 
170 
171 #endif
172 
double chargetransportTolerance
Definition: ElectricBC.h:119
LinearSolver * chargetransportLinearSolver
Definition: ElectricBC.h:137
Definition: AMG.h:27
void defineVar(const string varName, const T defaultValue)
Definition: FloatVarDict.h:94
LinearSolver * electrostaticsLinearSolver
Definition: ElectricBC.h:136
double tunnelingtransportTolerance
Definition: ElectricBC.h:120
string vcType
Definition: ElectricBC.h:37
int nMaxIterations
Definition: LinearSolver.h:31
vector< T > electron_trapdensity
Definition: ElectricBC.h:76
double electrostaticsTolerance
Definition: ElectricBC.h:118
double relativeTolerance
Definition: LinearSolver.h:33
LinearSolver & getElectroStaticsLinearSolver()
Definition: ElectricBC.h:140
string bcType
Definition: ElectricBC.h:27
vector< T > electron_trapdepth
Definition: ElectricBC.h:77
LinearSolver & getChargeTransportLinearSolver()
Definition: ElectricBC.h:153