@@ -187,10 +187,9 @@ def esdiffusion(
187
187
)
188
188
# Cs edge seal/Ce encapsulant
189
189
r1 = so * np .exp (- eas / (met_data [row ][0 ] + dtemp * mid_point ))
190
- r2 = (
191
- dod * np .exp (- ead / (met_data [row ][0 ] + dtemp * mid_point ))
192
- * r1 * encapsulant_width / edge_seal_width
193
- ) # Ds/De*Cs/Ce*We/Ws
190
+ r2 = dod * np .exp (- ead / (met_data [row ][0 ] + dtemp * mid_point )
191
+ )* r1 * encapsulant_width / edge_seal_width
192
+ # Ds/De*Cs/Ce*We/Ws
194
193
# Calculates the edge seal nodes. Adjusted to not calculate ends and to have the first node be temperature.
195
194
for node in range (2 , seal_nodes ):
196
195
perm [row + 1 + rp_row ][node ] = perm_mid [node ] + fos * (
@@ -201,34 +200,41 @@ def esdiffusion(
201
200
perm [row + 1 + rp_row ][node ] = perm_mid [node ] + foe * (
202
201
perm_mid [node - 1 ] + perm_mid [node + 1 ] - 2 * perm_mid [node ]
203
202
)
204
- # Calculates the center encapsulant node. Accounts for temperature and two interfade nodes.
203
+ # Calculates the center encapsulant node. Accounts for temperature and two interface nodes.
205
204
perm [row + 1 + rp_row ][encapsulant_nodes + seal_nodes + 2 ] = perm_mid [
206
- encapsulant_nodes + seal_nodes + 2
207
- ] + 2 * foe * (perm_mid [encapsulant_nodes + seal_nodes + 1 ] - perm_mid [encapsulant_nodes + seal_nodes + 2 ])
205
+ encapsulant_nodes + seal_nodes + 2 ] + 2 * foe * (
206
+ perm_mid [encapsulant_nodes + seal_nodes + 1 ] -
207
+ perm_mid [encapsulant_nodes + seal_nodes + 2 ])
208
+
208
209
# Calculated edge seal node adjacent to the first encapsulant node. Node numbers shifted.
209
210
perm [row + 1 + rp_row ][seal_nodes ] = perm_mid [seal_nodes ] + fos * (
210
211
perm_mid [seal_nodes - 1 ]
211
212
+ perm_mid [seal_nodes + 3 ] * r1 * 2 / (1 + r2 )
212
- - perm_mid [seal_nodes ] * (1 + 2 / (1 + r2 ))
213
- )
213
+ - perm_mid [seal_nodes ] * (1 + 2 / (1 + r2 )))
214
+
214
215
# Calculated encapsulant node adjacent to the last edge seal node. Node numbers shifted.
215
216
perm [row + 1 + rp_row ][seal_nodes + 3 ] = perm_mid [seal_nodes + 3 ] + foe * (
216
217
perm_mid [seal_nodes ] / r1 * 2 / (1 + 1 / r2 )
217
218
+ perm_mid [seal_nodes + 4 ]
218
- - perm_mid [seal_nodes + 3 ] * (1 + 2 / (1 + 1 / r2 ))
219
- )
219
+ - perm_mid [seal_nodes + 3 ] * (1 + 2 / (1 + 1 / r2 )))
220
+
220
221
# sets the concentration at the edge seal to air interface.
221
222
perm [row + 1 + rp_row ][1 ] = Sos * np .exp (
222
223
- Eass / (met_data [row + 1 ][0 ] + dtemp * mid_point )
223
224
)
224
225
perm_mid = perm [row + 1 + rp_row ]
225
226
226
- # calculate edge seal at interface to encapsulant.
227
- perm [row + 1 + rp_row ][seal_nodes + 1 ] = (
228
- perm_mid [seal_nodes + 3 ] / r2 * r1 + perm_mid [seal_nodes ]
229
- ) / (1 / r2 + 1 )
230
- # calculate encapsulant at interface to the edge seal.
231
- perm [row + 1 + rp_row ][seal_nodes + 2 ] = perm [row + 1 + rp_row ][seal_nodes + 1 ] / r1
227
+ # Calculate edge seal at interface to encapsulant.
228
+ # Blocked out code did weird things and was based on equal flxes. Actually using a simple averaging. This looks better and is not used in the diffusion calculations.
229
+ #perm[row + 1 + rp_row][seal_nodes + 1] = (perm_mid[seal_nodes + 3]*r1
230
+ # + perm_mid[seal_nodes]*r2) / (1+r2)
231
+ perm [row + 1 + rp_row ][seal_nodes + 1 ] = perm_mid [seal_nodes ]+ (perm_mid [seal_nodes ]- perm_mid [seal_nodes - 1 ])/ 2
232
+
233
+ # Calculate encapsulant at interface to the edge seal.
234
+ #perm[row + 1 + rp_row][seal_nodes + 2] = perm[row + 1 + rp_row][seal_nodes + 1] / r1
235
+ perm [row + 1 + rp_row ][seal_nodes + 2 ] = perm_mid [seal_nodes + 3 ]- (perm_mid [seal_nodes + 4 ]- perm_mid [seal_nodes + 3 ])/ 2
236
+
237
+ # Puts in the time for the first column.
232
238
perm [row + 1 + rp_row ][0 ] = rp_time + met_data [row + 1 ][1 ]
233
239
234
240
# Because it is cycling around, it needs to start with the last temperature.
0 commit comments