5 #ifndef _INJECTIONDISCRETIZATION_H_
6 #define _INJECTIONDISCRETIZATION_H_
39 template <
class X,
class Diag,
class OffDiag>
55 const Field& varField,
56 const Field& electricField,
57 const Field& conductionbandField,
81 TArray& transmission = *ts;
95 XArray& rCell =
dynamic_cast<XArray&
>(rField[cVarIndex]);
108 const int subID = _constants[
"substrate_id"];
110 const int nLevel = _constants[
"nLevel"];
111 const int normal = _constants[
"normal_direction"];
112 const int nTrap = _constants[
"nTrap"];
114 T_Scalar fluxCoeff(0), fermilevel(0);
122 for(
int c=0; c<cells.
getCount(); c++){
123 transmission[c] = 0.0;
126 fermilevel = fermilevelsubstrate;
128 for (
T_Scalar en = fermilevel-4.0; en <= fermilevel+4.0; en += energystep){
142 const int nFaces = faces.
getCount();
144 for(
int f=0; f<nFaces; f++){
148 int indices[nLevel+1];
150 int c0 = faceCells(f,0);
151 int c1 = faceCells(f,1);
159 for(
int l=0; l < nLevel; l++){
161 throw CException(
"index out of boundary in elec_model injection calculation");
163 const int nbc = cellCells.
getCount(me);
166 for(
int nc = 0; nc < nbc; nc++){
167 const int neighbor = cellCells(me, nc);
168 const T_Scalar dr = cellCentroid[me][normal] - cellCentroid[neighbor][normal];
171 neighborUp = neighbor;
180 transmission[indices[0]]=1.0;
181 for(
int l=0; l < nLevel; l++){
182 int low = indices[l];
183 int me = indices[l+1];
185 T_Scalar dX = cellCentroid[me][normal] - cellCentroid[low][normal];
189 T_Scalar avg = (valueMe + valueLow) / 2.0;
194 transmission[me] = transmission[low] * exp(exponent);
197 for(
int l=0; l < nLevel; l++){
199 int me = indices[l+1];
201 if ((en-conduction_band[me]) > 0) {
203 const T_Scalar dX = dielectric_thickness/nLevel;
204 fluxCoeff = alpha * transmission[me] * supplyfunction * fermifunction * energystep *
QE * cellVolume[me] /
fabs(dX) ;
205 rCell[me][nTrap] += fluxCoeff;
220 for(
int c=0; c < cells.
getCount(); c++){
221 transmission[c] = 0.0;
224 fermilevel = fermilevelmembrane;
225 for (
T_Scalar en = fermilevel-4.0; en <= fermilevel+4.0; en += energystep){
239 const int nFaces = faces.
getCount();
241 for(
int f=0; f<nFaces; f++){
245 int indices[nLevel+1];
247 int c0 = faceCells(f,0);
248 int c1 = faceCells(f,1);
256 for(
int l=0; l < nLevel; l++){
258 throw CException(
"index out of boundary in elec_model injection calculation");
260 const int nbc = cellCells.
getCount(me);
263 for(
int nc = 0; nc < nbc; nc++){
264 const int neighbor = cellCells(me, nc);
265 const T_Scalar dr = cellCentroid[me][normal] - cellCentroid[neighbor][normal];
268 neighborUp = neighbor;
277 transmission[indices[0]]=1.0;
278 for(
int l=0; l < nLevel; l++){
279 int low = indices[l];
280 int me = indices[l+1];
282 T_Scalar dX = cellCentroid[me][normal] - cellCentroid[low][normal];
286 T_Scalar avg = (valueMe + valueLow) / 2.0;
291 transmission[me] = transmission[low] * exp(exponent);
294 for(
int l=0; l < nLevel; l++){
295 int low = indices[l];
296 int me = indices[l+1];
298 if ((en-conduction_band[me]) > 0) {
300 const T_Scalar dX = energystep / electric_field[me][normal];
302 fluxCoeff = alpha * transmission[me] * supplyfunction * fermifunction * energystep *
QE * cellVolume[me] /
fabs(dX) ;
304 rCell[me][nTrap] += fluxCoeff;
const FaceGroupList & getBoundaryFaceGroups() const
int getCount(const int i) const
shared_ptr< FaceGroup > FaceGroupPtr
const Field & _conductionbandField
const T FermiFunction(const T &energy, const T &fermilevel, const T &temperature)
const GeomFields & _geomFields
void discretize(const Mesh &mesh, MultiFieldMatrix &mfmatrix, MultiField &xField, MultiField &rField)
NumTypeTraits< X >::T_Scalar T_Scalar
const Field & _electricField
const ElectricModelConstants< T_Scalar > & _constants
Tangent sqrt(const Tangent &a)
CCMatrix::OffDiagArray OffDiagArray
pair< const Field *, const StorageSite * > ArrayIndex
Array< Vector< T_Scalar, 3 > > VectorT3Array
const CRConnectivity & getCellCells() const
CCMatrix::DiagArray DiagArray
const StorageSite & getCells() const
CRMatrix< Diag, OffDiag, X > CCMatrix
const T PositiveValueOf(T input)
const CRConnectivity & getFaceCells(const StorageSite &site) const
Tangent fabs(const Tangent &a)
InjectionDiscretization(const MeshList &meshes, const GeomFields &geomFields, const Field &varField, const Field &electricField, const Field &conductionbandField, const ElectricModelConstants< T_Scalar > &constants)
const T ElectronSupplyFunction(const T &energy, const T &fermilevel, const T &temperature)
vector< Mesh * > MeshList