Beispiel #1
0
def single_computation(*args):
    (ph, th) = args
    main_direction = otsun.polar_to_cartesian(ph, th) * -1.0  # Sun direction vector
    current_scene = otsun.Scene(sel)
    tracking = otsun.MultiTracking(main_direction, current_scene)
    tracking.make_movements()
    emitting_region = otsun.SunWindow(current_scene, main_direction)
    l_s = otsun.LightSource(current_scene, emitting_region, light_spectrum, 1.0, direction_distribution)
    exp = otsun.Experiment(current_scene, l_s, number_of_rays, None)
    exp.run()
    tracking.undo_movements()
    print(f"Computed ph={ph}, th={th}")
    efficiency_from_source_Th = (exp.captured_energy_Th / aperture_collector_Th) / (
        exp.number_of_rays / exp.light_source.emitting_region.aperture)
    return ph, th, efficiency_from_source_Th
Beispiel #2
0
# Magnitudes used for outputs in Spectral Analysis
# ---
captured_energy_PV = 0.0
captured_energy_Th = 0.0
source_wavelength = []
Th_energy = []
Th_wavelength = []
Th_points_absorber = []
PV_energy = []
PV_wavelength = []
PV_values = []
# --------- end

# objects for scene
sel = doc.Objects
current_scene = otsun.Scene(sel)

for w in np.arange(wavelength_ini, wavelength_end, wavelength_step):
    light_spectrum = w
    main_direction = otsun.polar_to_cartesian(
        phi, theta) * -1.0  # Sun direction vector
    emitting_region = otsun.SunWindow(current_scene, main_direction)
    l_s = otsun.LightSource(current_scene, emitting_region, light_spectrum,
                            1.0, direction_distribution, polarization_vector)
    exp = otsun.Experiment(current_scene, l_s, number_of_rays, show_in_doc)
    exp.run(show_in_doc)
    print("%s" % (w) + '\n')
    Th_energy.append(exp.Th_energy)
    Th_wavelength.append(exp.Th_wavelength)
    PV_energy.append(exp.PV_energy)
    PV_wavelength.append(exp.PV_wavelength)