How to add optical generation (photovoltaics)

Hello Juan and the forum,

I am new to DevSim. I plan to use it in my research on thermophotovoltaics. First, I thank Juan and all others who contributed to this.

Now, I basically need to have the J-V curve of a 1-D diode just as in the examples. The only thing is I should have optical generation too. I do have a code that could calculate the optical generation at each node but I do not know how I could implement this in DevSim. Could you please help?

Thank you very much
Yigithan

Hi @yigithanmkose,

Welcome to the forum!

Please see if this post by @simbilod is useful to you:
Ssac and transient in generation term. In it, @GLuek suggests an interesting method of switching the generation term on and off.

1 Like

Hi @yigithanmkose ,

I have had success with @GLuek 's method of modifying the recombination term by adding an β€œOptGen” field.

The following function is what I use to set values of a field (e.g. for name=OptGen) given it existing in unstructured format with a list of x-positions, y-positions, and associated values (you can adjust to 1D):

import devsim as ds
import numpy as np
from scipy.interpolate import griddata

def add_unstructured_data_to_mesh(
device: str,
region: str,
name: str,
x_array: np.array,
y_array: np.array,
val_array: np.array,
) β†’ None:
β€œβ€"
Interpolate data stored on an unstructured grid onto a DEVSIM model.

Arguments:
    device: name of the devsim device
    region: name of the devsim region
    name: associated with the model of the data being added
    x_array: [N:1] array of x-coordinates
    y_array: [N:1] array of y-coordinates
    val_array: [N:1] array of model values
"""

xpos = np.array(ds.get_node_model_values(device=device, region=region, name="x"))
ypos = np.array(ds.get_node_model_values(device=device, region=region, name="y"))

data_on_mesh = griddata(
    (x_array, y_array), val_array, xi=np.column_stack((xpos, ypos)),fill_value=0, method="linear"
)

if name not in ds.get_node_model_list(device=device, region=region):
    ds.node_solution(device=device, region=region, name=name)

ds.set_node_values(device=device, region=region, name=name, values=data_on_mesh)
1 Like

Hello @Juan and @simbilod
Thank you very much for the help
I am working on it. I will update

1 Like