Skip to content

Commit

Permalink
Add docstrings to PDD short cirtuit solver
Browse files Browse the repository at this point in the history
  • Loading branch information
dalonsoa committed Nov 5, 2022
1 parent 41bdc2c commit de18f91
Show file tree
Hide file tree
Showing 3 changed files with 30 additions and 15 deletions.
28 changes: 21 additions & 7 deletions solcore/poisson_drift_diffusion/DriftDiffusionUtilities.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@
from .. import asUnit, constants
from ..registries import register_short_circuit_solver
from ..state import State
from ..structure import Junction
from ..light_source import LightSource
from .DeviceStructure import (
CreateDeviceStructure,
Expand Down Expand Up @@ -145,20 +146,33 @@ def equilibrium_pdd(junction, **options):

@register_short_circuit_solver("PDD", reason_to_exclude=reason_to_exclude)
def short_circuit_pdd(
junction,
junction: Junction,
wavelength: NDArray,
light_source: LightSource,
output_sc: int = 1,
**options
):
"""Solves the devices electronic properties at short circuit. Internally, it calls Equilibrium.
:param junction: A junction object
:param options: Options to be passed to the solver
:return: None
"""Solves the electronic properties of the junction at short circuit.
Internally, it calls Equilibrium to get the initial bandstructure and then increases
progrssively the intensity of the light - done in the Fortran code - until the
desired spectrum.
The junction object is expected to have a `absorbed` method taking as input the
an array of mesh points in the junction and returning a 2D array showing the
fraction of light absorbed at each wavelenght and depth position. If that were not
the case, absorption is set to zero... which defeats the purpose of doing this
calculation to start with.
Args:
junction: A junction object with layers.
wavelength (NDArray): Array of the wavelenghts to solve the problem for.
light_source (LightSource): Light source object defining the illumination
specturm.
output_sc (int, optional): If the ouput of the shortcirctuit calculation process
should be shown. Defaults to 1.
"""

# We run equilibrium
equilibrium_pdd(
junction,
wavelength=wavelength,
Expand Down
5 changes: 2 additions & 3 deletions solcore/registries.py
Original file line number Diff line number Diff line change
Expand Up @@ -162,7 +162,6 @@ def register_optics(
)



SHORT_CIRCUIT_SOLVER_SIGNATURE = Callable[[Junction, Any], None]
SHORT_CIRCUIT_SOLVER_REGISTRY: Dict[str, SHORT_CIRCUIT_SOLVER_SIGNATURE] = {}

Expand All @@ -177,8 +176,8 @@ def register_short_circuit_solver(
a generic **kwargs.
After running the function, the input Junction object will be updated with the
bandstructure and the recombination properties, such as VB and CB band edges,
population of electrons and holes, etc.
bandstructure and recombination profile at short circuit will be available in a new
`short_circuit_data` attribute of the junction object as a State object.
Args:
name (str): Name of the solver.
Expand Down
12 changes: 7 additions & 5 deletions solcore/solar_cell_solver.py
Original file line number Diff line number Diff line change
Expand Up @@ -257,12 +257,14 @@ def solve_equilibrium(solar_cell, options):


@register_action("short_circuit")
def solve_short_circuit(solar_cell, options):
"""Uses the PDD solver to calculate the properties of all the all the junctions under short circuit
def solve_short_circuit(solar_cell: SolarCell, options: State):
"""Solves the electronic properfies of the cell at short circuit conditons.
:param solar_cell: A solar_cell object
:param options: Options for the solvers
:return: None
The junction objects are updated with the bandstructure and recombination profiles.
Args:
solar_cell: The solar cell to solve.
options: Options required by the solver.
"""

solve_optics(solar_cell, options)
Expand Down

0 comments on commit de18f91

Please sign in to comment.