Skip to content
Snippets Groups Projects
Commit a35ec5e7 authored by Guillaume Demesy's avatar Guillaume Demesy
Browse files

finish postplot solar cells

parent b1355730
No related branches found
No related tags found
No related merge requests found
Pipeline #5176 passed
...@@ -335,7 +335,8 @@ PostProcessing { ...@@ -335,7 +335,8 @@ PostProcessing {
{ Name epsr_xx; Value { Local { [ CompXX[epsr[]] ]; In Omega; Jacobian JVol; } } } { Name epsr_xx; Value { Local { [ CompXX[epsr[]] ]; In Omega; Jacobian JVol; } } }
{ Name Damp_pml_top; Value { Local { [Damp_pml_top[] ]; In Omega; Jacobian JVol; } } } { Name Damp_pml_top; Value { Local { [Damp_pml_top[] ]; In Omega; Jacobian JVol; } } }
{ Name Poy_tot; Value { Local { [ 0.5*Re[Cross[{u}+E1[] , Conj[ H1[]-I[]/(mur[]*mu0*om0)*{Curl u}]]] ]; In Omega; Jacobian JVol; } } } { Name Poy_tot; Value { Local { [ 0.5*Re[Cross[{u}+E1[] , Conj[ H1[]-I[]/(mur[]*mu0*om0)*{Curl u}]]] ]; In Omega; Jacobian JVol; } } }
{ Name lambda_step ; Value { Local { [ lambda0/nm ]; In Omega ; Jacobian JVol; } } }
For k In {2:6} For k In {2:6}
{ Name Abs_L~{k} ; Value { Integral { [ ep0*om0 * 0.5*Im[CompXX[epsr[]]]*(SquNorm[{u}+E1[]]) / (Pinc*period_x*period_y) ] ; In L~{k} ; Integration I1 ; Jacobian JVol ; } } } { Name Abs_L~{k} ; Value { Integral { [ ep0*om0 * 0.5*Im[CompXX[epsr[]]]*(SquNorm[{u}+E1[]]) / (Pinc*period_x*period_y) ] ; In L~{k} ; Integration I1 ; Jacobian JVol ; } } }
EndFor EndFor
...@@ -439,6 +440,7 @@ PostOperation { ...@@ -439,6 +440,7 @@ PostOperation {
Print[ numbering_ij~{i}~{j}[SurfIntBot], OnRegion SurfIntBot, File > StrCat[myDir,"numbering_ij.txt"], Format Table ]; Print[ numbering_ij~{i}~{j}[SurfIntBot], OnRegion SurfIntBot, File > StrCat[myDir,"numbering_ij.txt"], Format Table ];
EndFor EndFor
EndFor EndFor
Print[ lambda_step, OnPoint{0,0,0}, Format Table, File > StrCat[myDir, "temp_lambda_step.txt"], SendToServer "GetDP/Lambda_step" ] ;
} }
} }
} }
......
import numpy as np import numpy as np
import matplotlib.pyplot as pl
import sys import sys
myDir = sys.argv[1] myDir = sys.argv[1]
# myDir = res3D # myDir = res3D
Rnm = np.loadtxt(myDir+'eff_r.txt')[:,1] Rnm = np.loadtxt(myDir+'/eff_r.txt',ndmin=2)[:,1] + 1j*np.loadtxt(myDir+'/eff_r.txt',ndmin=2)[:,2]
Tnm = np.loadtxt(myDir+'eff_t.txt')[:,1] Tnm = np.loadtxt(myDir+'/eff_t.txt',ndmin=2)[:,1] + 1j*np.loadtxt(myDir+'/eff_t.txt',ndmin=2)[:,2]
Q = [np.loadtxt(myDir+'temp-Q_L_%g.txt'%k)[1] for k in range(2,7)] Q = [np.loadtxt(myDir+'/temp-Q_L_%g.txt'%k,ndmin=2)[:,1] for k in range(2,7)]
Q.append(np.loadtxt(myDir+'temp-Q_scat.txt')[1]) Q.append(np.loadtxt(myDir+'/temp-Q_scat.txt',ndmin=2)[:,1])
Q=np.array(Q) Q=np.array(Q)
TOT = Rnm.sum()+Tnm.sum()+Q.sum() TOT = Rnm.real.sum()+Tnm.real.sum()+Q.sum()
print('Rtot',Rnm.sum()) print('Rtot',Rnm.real.sum())
print('Ttot',Tnm.sum()) print('Ttot',Tnm.real.sum())
print('Atot',Q.sum()) print('Atot',Q.sum())
print('TOT ',TOT) print('TOT ',TOT)
\ No newline at end of file
if myDir[6:]=='solarcell':
Nmax=2
tab_lambdas=np.loadtxt(myDir+'/temp_lambda_step.txt',ndmin=2)[:,8]
nb_lambdas=len(tab_lambdas)
Rnm = Rnm.reshape((nb_lambdas,2*Nmax+1,2*Nmax+1))
Tnm = Tnm.reshape((nb_lambdas,2*Nmax+1,2*Nmax+1))
Rtot = [Rnm[i].real.sum() for i in range(nb_lambdas)]
Ttot = [Tnm[i].real.sum() for i in range(nb_lambdas)]
Abs_rods = Q[-1]
Abs_ITO = Q[0]
Abs_subs = Q[2]+Q[3]+Q[4]+Ttot
pl.figure()
pl.plot(tab_lambdas,Abs_ITO,label='absorption ITO electrode')
pl.plot(tab_lambdas,Abs_rods,label='absorption in Si rods')
pl.plot(tab_lambdas,Abs_subs,label='absorption in Si subs')
pl.plot(tab_lambdas,Rtot,label='reflection')
pl.legend()
pl.xlabel('$\lambda$ [nm]')
pl.ylabel('fraction of incident energy')
pl.savefig('solar_balance.pdf')
pl.show()
\ No newline at end of file
GMSHDIR="/home/demesy/programs/gmsh-4.4.1-Linux64/bin" GMSHDIR="/home/demesy/programs/gmsh-4.4.1-Linux64/bin"
for t in bisin checker halfellipsoid hole pyramid torus 2Dlamellar for t in bisin checker halfellipsoid hole pyramid torus 2Dlamellar solarcell
do do
$GMSHDIR/gmsh grating3D.pro -setstring test_case $t - $GMSHDIR/gmsh grating3D.pro -setstring test_case $t -
mv res3D res3D_$t mv res3D res3D_$t
done done
for t in bisin checker halfellipsoid hole pyramid torus 2Dlamellar for t in bisin checker halfellipsoid hole pyramid torus 2Dlamellar solarcell
do do
$GMSHDIR/gmsh grating3D.geo -setstring test_case $t res3D_$t/*.pos & $GMSHDIR/gmsh grating3D.geo -setstring test_case $t res3D_$t/*.pos &
echo "\n"$t echo "\n"$t
python grating3D_postplot.py res3D_$t/ python grating3D_postplot.py res3D_$t
done done
\ No newline at end of file
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment