ChargeSimulatorSolcore
The ChargeSimulatorSolcore is a 1D poisson-drift-diffusion simulator based on the open-source software Solcore, made compatible with the openbandparams database.
Warning
There are currently issues with the solcore simulator, namely:
The voltages applied to the device that are returned to the user are not necessarily correct. Depending on the voltage values array you give it it may return the values in a different order. Please see https://github.com/qpv-research-group/solcore5/issues/294
Illustration of the 1D to 2D data interpolation performed with the ChargeSimmulatorSolcore.
- class imodulator.ChargeSimulator.ChargeSimulatorSolcore(device, simulation_line, temperature=300.0, bias_start_stop_step=[0, 1, 1])
- Each SemiconductorPolygon can have the following charge_transport_kwargs:
sol_obp_material: a openbandparams material object,
sol_Na: concentration of acceptors in cm^-3,
sol_Nd: concentration of donors in cm^-3,
sol_electron_minority_lifetime: electron minority lifetime in seconds,
sol_hole_minority_lifetime: hole minority lifetime in seconds,
Warning
This solver has a current issue with the ordering of the voltages when it outputs the results. Please visit https://github.com/qpv-research-group/solcore5/issues/294 for more details.
- __init__(device, simulation_line, temperature=300.0, bias_start_stop_step=[0, 1, 1])
Initialize the ChargeSimulatorNN.
- Parameters:
device (
PhotonicDevice) – PhotonicDevice instance containing the device geometry and materials.simulation_line (
LineString) – LineString defining the simulation line along which to perform 1D simulation.temperature (
float(default:300.0)) – Simulation temperature in Kelvin. Defaults to 300.0.bias_start_stop_step (
list(default:[0, 1, 1])) – Voltage sweep [start, stop, steps]. Defaults to [0,1,1].
- plot_mesh()
Plot the mesh points along the simulation line.
- Returns:
matplotlib figure and axis objects
- Return type:
fig, ax
- plot_results(V_idx=None, cmap='tab10', log_scale_carriers=True, plot_limits=True)
Plot simulation results in a 2x1 subplot layout.
- Parameters:
V_idx (list, optional) – Indices of voltages to plot. Defaults to first and last.
cmap (str, optional) – Colormap for voltage lines. Defaults to ‘tab10’.
log_scale_carriers (bool, optional) – Whether to use log scale for carrier concentrations. Defaults to True.
plot_limits (bool, optional) – Whether to plot vertical lines at segment boundaries. Defaults to True.
- Returns:
Figure and axes objects
- Return type:
tuple
- plot_with_simulation_line(color_polygon='black', color_line='green', color_junctions='blue', color_simulation_line='red', fill_polygons=False, linewidth_simulation=2, fig=None, ax=None)
Plot the device polygons with the simulation line overlay.
- Parameters:
color_polygon (default:
'black') – Color for device polygonscolor_line (default:
'green') – Color for current calculation linescolor_junctions (default:
'blue') – Color for junction regionscolor_simulation_line (default:
'red') – Color for the simulation linefill_polygons (default:
False) – Whether to fill the polygonslinewidth_simulation (default:
2) – Line width for simulation linefig (default:
None) – Existing figure object (optional)ax (default:
None) – Existing axis object (optional)
- Returns:
matplotlib figure and axis objects
- Return type:
fig, ax
- solve_PDD(verbose=False, tol=1e-06, max_iter=100, htp=1, smooth_output=False, savgol_window=15)
Solve the Poisson Drift Diffusion equations for the device.
Warning
The current implementation of the sesame pdd in solcore has a small bug that can cause the outputs to be switched around. Because the solver must first solve the 0V and then it goes to some voltage, the solver does some reordering of the voltages to make sure that the solver converges. However, when storing the voltages corresponding to the outputs in the junction object, it is not saving the correct voltages yet, and for that reason, the outputs can be switched around. For more details go to: https://github.com/qpv-research-group/solcore5/issues/294
- This function will update self object with the following attributes:
self.V: The potential distribution in the device.
self.Ec: The conduction band edge energy distribution in the device.
self.Ev: The valence band edge energy distribution in the device.
self.Efn: The Fermi level energy distribution in the device.
self.Efp: The Fermi level energy distribution in the device.
self.N: The electron concentration distribution in the device.
self.P: The hole concentration distribution in the device.
self.Efield: The electric field distribution in the device.
self.mun: The electron mobility distribution in the device.
self.mup: The hole mobility distribution in the device.
- Parameters:
verbose (bool) – Whether to print detailed output.
tol (float) – Tolerance for convergence.
max_iter (int) – Maximum number of iterations.
htp (int) – Number of homotopic Newton loops to perform
Note:: (..) – For more details on these arguments please consult solcore.sesame_drift_diffusion.solve_pdd
smooth_output (bool) – If True, it will apply a savitzky-golay filter to each of the attributes specified above. The reasoning behind this is to numerical artifacts with big spikes in the charge distributions and electrical fields. For more details please check https://github.com/qpv-research-group/solcore5/discussions/293
savgol_window (int) – The window size for the savitzky-golay filter. Default is 15. It should be an odd number.
- Returns:
None
- transfer_results_to_device(dx=0.05, xmin=-2, xmax=2)
Interpolate 1D simulation data onto a new 2D mesh.
Note
This method for the moment it only interpolates the 1D data onto the horizontal dimension.
- Parameters:
dx (float, optional) – Step size for new mesh in microns. Defaults to 0.05.
xmin (float) – Minimum x value for mesh (required).
xmax (float) – Maximum x value for mesh (required).
- Returns:
None. Stores interpolators in self.photonicdevice.charge.