Skip to content

farshad-jfz/solame

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

23 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

solame

Solame is a simple Python solar-cell simulator for planar devices aimed at teaching core photovoltaic physics.

Features

  • Optics: TMM-based multilayer absorption (fallback Beer-Lambert) to compute generation profile G(x)
  • Electrical: 1D drift-diffusion J-V solve (Poisson + continuity)
  • Numerics: finite-volume discretization with Scharfetter-Gummel fluxes
  • Outputs: J-V curve, Voc, Jsc, FF, efficiency
  • Plots: J-V and generation-versus-depth

Dependencies

  • Install TMM for optical solving: pip install tmm

Limitations

  • Optical constants are currently heuristic (n,k estimated from layer parameters).
  • Electrical model is 1D steady-state with simplified contact physics.
  • Parameters are approximate and may require calibration.

Contribution

Issues and PRs are welcome. Focus areas: stronger optical constants, contact models, parameter validation, tests, docs.

Usage Example

import matplotlib.pyplot as plt

from solame import Layer, Device, solve, plot_jv, plot_generation

# Define layers: ETL, absorber, HTL with typical parameters
etl = Layer(name="TiO2", thickness=50e-9, Nd=1e19, Eg=3.2, chi=4.0, epsr=9)
absorber = Layer(name="MAPbI3", thickness=500e-9, Na=1e15, Nd=1e15, Eg=1.55, chi=3.9, epsr=25)
htl = Layer(name="Spiro-OMeTAD", thickness=200e-9, Na=1e19, Eg=3.0, chi=2.2, epsr=3)

# Build device
device = Device([etl, absorber, htl], T=300)

# Run simulation
solve(device)

# Print key performance metrics
print(f"Short-circuit current density: {device.results['jsc']*1e3/1e4:.2f} mA/cm^2")
print(f"Open-circuit voltage: {device.results['voc']:.2f} V")
print(f"Fill factor: {device.results['ff']*100:.1f} %")
print(f"Efficiency: {device.results['efficiency']*100:.1f} %")

# Plot results
fig1, ax1 = plot_jv(device, units="mA/cm^2")
ax1.set_title("J-V Curve")
fig2, ax2 = plot_generation(device)
ax2.set_title("Generation Profile")
plt.show()

License

MIT

About

Solame is a simple Python solar-cell simulator for planar devices which targets teaching the physics of solar cells.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors

Languages