Optical ray tracing for luminescent materials and spectral converter photovoltaic devices.
Project description
Optical ray tracing for luminescent materials and spectral converter photovoltaic devices
Introduction
pvtrace is a statistical photon path tracer written in Python. It follows photons through a 3D scene and records their interactions with objects to build up statistical information about energy flow. This approach is particularly useful in photovoltaics and non-imaging optics where the goal is to design systems which efficiently transport light to target locations.
Documentation
Interactive Jupyter notebooks examples and tutorial can be found in the docs directory.
Static versions are included in the project documentation, https://pvtrace.readthedocs.io
Capabilities
pvtrace was originally written to characterise the performance of Luminescent Solar Concentrators (LSC) and takes a Monte-Carlo approach to ray-tracing. Each ray is independent and can interact with objects in the scene via reflection and refraction. Objects can have different optical properties: refractive index, absorption coefficient, emission spectrum and quantum yield.
One of the key features of pvtrace is the ability to simulate re-absorption of photons in luminescent materials. This requires following thousands of rays to build intensity profiles and spectra of incoming and outgoing photons because these process cannot be approximated in a continuous way.
pvtrace may also be useful to researches or designers interested in ray-optics simulations but will be slower at running these simulations compared to other software packages because it follows each ray individually.
A minimal working example that traces a glass sphere
# Add nodes to the scene graph
world = Node(
name="world (air)",
geometry=Sphere(
radius=10.0,
material=Dielectric.air()
)
)
sphere = Node(
name="sphere (glass)",
geometry=Sphere(
radius=1.0,
material=Dielectric.glass()
),
parent=world
)
sphere.translate((0,0,2))
# Add source of photons
light = Node(
name="Light (555nm)",
light=Light(
divergence_delegate=functools.partial(
Light.cone_divergence, np.radians(20)
)
)
)
# Trace the scene
scene = Scene(world)
tracer = PhotonTracer(scene)
for ray in light.emit(100):
path = tracer.follow(ray)
Install
Using pip
pip install pvtrace
or conda
conda install pvtrace
Dependancies
- python >= 3.7.2
- trimesh (for mesh shapes)
- meshcat (for visualisation)
- numpy
- anytree
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
File details
Details for the file pvtrace-2.0.1.tar.gz
.
File metadata
- Download URL: pvtrace-2.0.1.tar.gz
- Upload date:
- Size: 49.8 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/1.13.0 pkginfo/1.5.0.1 requests/2.21.0 setuptools/40.6.2 requests-toolbelt/0.9.1 tqdm/4.31.1 CPython/3.7.2
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | d3b51cacf5daebca24b5aa1c56473f20351ee8489486f4448e01cbfddc412501 |
|
MD5 | b8a2210b9c3637023507fedea43b0708 |
|
BLAKE2b-256 | f3eab20e26feda259bd58b7c8ea4f46b5816d58f5fbfaee0d731c9cd4a1a4a17 |