Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Pyramidal Structure #99

Open
michelgaglioni opened this issue Nov 24, 2021 · 6 comments
Open

Pyramidal Structure #99

michelgaglioni opened this issue Nov 24, 2021 · 6 comments

Comments

@michelgaglioni
Copy link

michelgaglioni commented Nov 24, 2021

Hello guys,

I'd like to know if is there any way to draw a pyramid-like structure in S4. Since in the function SetLayerPatternPolygon I can declare only the x and y coordinates of the polygon, I'm not being able to realize a way to do so.
Would it be the case of adding multiple layers and tapering them?
Does anyone have any suggestion?

Thanks in advance,

Michel

@kwrobert
Copy link

Yes, you would need to add multiple layers and staircase approximate your pyramid. This can actually have substantial affects on your results if you don’t add enough layers, but simulation time scales linearly with the number of layers. The trade off between accuracy and speed is a decision you must make.

@michelgaglioni
Copy link
Author

Alright then. One more question, if it's not to bother: is there a way to use a for loop to create various tappered layers, or would I have to add each layer manually by the function S:AddLayer? If possible, could you give me an example of that?

Thanks again!

@kwrobert
Copy link

I haven't used this library in years. Sounds like you are using the Lua API, in which case just call S:AddLayer inside your for loop. However, I would highly recommend the Python API.

Also, this version of the library has a few nasty bugs. For example, the Z components of the returned electric fields are computed incorrectly in this base version. I highly recommend looking into some of the forks of this library that are out there.

@michelgaglioni
Copy link
Author

I haven't used this library in years. Sounds like you are using the Lua API, in which case just call S:AddLayer inside your for loop. However, I would highly recommend the Python API.

Also, this version of the library has a few nasty bugs. For example, the Z components of the returned electric fields are computed incorrectly in this base version. I highly recommend looking into some of the forks of this library that are out there.

Yes, I'm using the LUA version since I have zero experience in Python language. So far the only function I've been using is S:GetPowerFlux, since I work with absorption in solar cells. I haven't plotted any fields yet, but it's good to know about this problem. Gonna be using COMSOL instead to work with the fields, just to make sure, then.

Thanks a lot, Robert!

@phoebe-p
Copy link

Hi @michelgaglioni, this response is a bit late and I don't know how much progress you've made yourself by now but you might be interested in checking out my fork of S4 which implements @kwrobert 's fixes as well as some other changes, and which makes S4 compatible with Python3. Since you said you are working on solar cells, I also developed a Python package called RayFlare which (among other things) provides a 'wrapper' for S4 to calculate things like absorption per layer and absorption profiles (it was developed specifically to study the optics of solar cells).

@michelgaglioni
Copy link
Author

Hi @michelgaglioni, this response is a bit late and I don't know how much progress you've made yourself by now but you might be interested in checking out my fork of S4 which implements @kwrobert 's fixes as well as some other changes, and which makes S4 compatible with Python3. Since you said you are working on solar cells, I also developed a Python package called RayFlare which (among other things) provides a 'wrapper' for S4 to calculate things like absorption per layer and absorption profiles (it was developed specifically to study the optics of solar cells).

Hello Phoebe,

Thanks for the suggestions! Your Rayflare package seems to be very useful for what I intend to reseach. Right know I'm a little busy, but I'm gonna dig deeper into it as soon as I manage to. I'll be implementing your corrections in the fork that you mentioned, too. Thanks for now!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants