Example #1
0
# add ch to logger
logger.addHandler(ch)

MyProject = 'test_PTC.FCStd'
FreeCAD.openDocument(MyProject)

# ---
# Materials
# ---
file_BK7 = 'BK7_Schott.txt'
otsun.WavelengthVolumeMaterial("Glass1", file_BK7)
otsun.OpaqueSimpleLayer("Opa1")
file_AR1 = 'AR-J.txt'
otsun.PolarizedCoatingTransparentLayer("file_AR1", file_AR1)
otsun.TwoLayerMaterial("AR1", "file_AR1", "file_AR1")
file_Coating_Ag = 'Air_Ag_Air.txt'
otsun.PolarizedCoatingReflectorLayer("Mir", file_Coating_Ag, 4.4, 20, 0.9)
otsun.TwoLayerMaterial("Mir1", "Mir", "Mir")
otsun.AbsorberTWModelLayer("Abs1", 0.9427, 0.017, 1.8)
# ---
# Inputs for Total Analysis
# ---

doc = FreeCAD.ActiveDocument
phi_ini = 0.0 + 1.E-9
phi_end = 0.0 + 1.E-4
phi_step = 5.0
theta_ini = 0.0 + 1.E-9
theta_end = 1.0 + 1.E-4
theta_step = 1.0
Example #2
0
from FreeCAD import Base
import Part
import numpy as np
np.random.seed(1)
import random
random.seed(1)

MyProject = 'Perovskite_Stack_200nm.FCStd'
FreeCAD.openDocument(MyProject)

# ---
# Materials
# ---
otsun.TransparentSimpleLayer("Trans", 1.0)
otsun.AbsorberSimpleLayer("Abs", 1.0)
otsun.TwoLayerMaterial("Trans_Abs", "Trans", "Abs")
file_thin_film = 'Fitxer_OTSun_Exp1a_theta0_90.txt'
file_Perovskite = 'Perovskite_Leguy.txt'
otsun.PolarizedThinFilm("ThinFilm", file_thin_film, "Vacuum", file_Perovskite)
otsun.PVMaterial("PV", file_Perovskite)
file_Spiro = 'Spiro_.txt'
otsun.WavelengthVolumeMaterial("Spiro", file_Spiro)
file_Ag = 'Ag_Yang.txt'
otsun.MetallicLambertianLayer("Ag", file_Ag)

# ---
# Constant inputs for Spectral Analysis
# ---
polarization_vector = None
show_in_doc = None
# --------- end
Example #3
0
ch.setFormatter(formatter)

# add ch to logger
logger.addHandler(ch)

MyProject = 'test_PTC.FCStd'
FreeCAD.openDocument(MyProject)

# ---
# Materials
# ---
otsun.SimpleVolumeMaterial("Glass1", 1.473, 0.015)
otsun.OpaqueSimpleLayer("Opa1")
otsun.TransparentSimpleLayer("AR1", 0.95)
otsun.ReflectorSpecularLayer("Mir", 0.885, 4.4, 20, 0.9)
otsun.TwoLayerMaterial("Mir1", "Mir", "Mir")
otsun.AbsorberLambertianLayer("Abs1", 0.92)

# ---
# Inputs for Total Analysis
# ---

doc = FreeCAD.ActiveDocument
phi_ini = 90.0 + 1.E-9
phi_end = 90.0 + 1.E-4
phi_step = 5.0
theta_ini = 0.0 + 1.E-9
theta_end = 45.0 + 1.E-4
theta_step = 45.0
number_of_rays = 100
aperture_collector_Th = 1845.0 * 10347.0