-
-
July 3, 2024 at 5:03 pmhallwSubscriberI have a student who is working on obtaining EM field intensity data for gold nanospheres. Our goal is to obtain the exponential decay profile of the EM field as it extends away from the nanoparticle surface. The student has tried visualizing the data from the field profile and field power monitors, as well as using the getelectric, getmagnetic, getdata, and getresults script commands.The field intensities they obtained using getelectric and getmagnetic do not follow the expected exponential decay profile. They have tried adjusting the sizes of the monitors, source, and simulation box but have been unsuccessful in trying to fix this.Another issue that they ran into is when using the getelectric and getmagnetic script commands the results are in terms of "index 1", "index 2", etc., and they are unclear about what units those are referring to.In addition, when using the getdata and getresult commands they are unable to visualize any of the data at all and are wondering which of the script commands is best to use, and how to get the data after running the commands.
-
July 4, 2024 at 7:16 amAmrita PatiAnsys Employee
Hi Paige,
I believe this could be because of multiple reasons. It is hard to predict the exact cause without having a look at the file. It could be because of the mesh resolution, the boundary conditions, source injection error etc. Would you be able to share a screenshot of the overall simulation geometry? We have an example on Mie scattering that you might find useful with regard to the setup, please find the link: Mie scattering - FDTD. We always recommend users to perform convergence testing to confirm the accuracy of the simulation.
Another issue that they ran into is when using the getelectric and getmagnetic script commands the results are in terms of "index 1", "index 2", etc., and they are unclear about what units those are referring to.
You are correct, if you obtain the intensity using these commands and then visualize it (using the visualize script command) directly then you would see the indices as the attributes as opposed to the actual spatial data. What I will instead recommend is to try something like this (you can also find this information on the corresponding article for getelectric):
E2=getelectric("x_normal_profile"); #x_normal_profile is the monitor name, the monitor is in the y-z plane
y=getdata("x_normal_profile","y");
z=getdata("x_normal_profile","z");
image(y,z,E2(:,:,:,1)); #Here 1 refers to the first frequency point, can be changed to the desired value to look at the field intensity at different wavelengthsIf you are running a multi-frequency simulation, E2 will be of the size (No. of points in x x No. of points in y x No.of points in z x No. of frequency points). So, if you collect the intensity and the y and z values (in my example, monitor is 2D x-normal so there is only one point in x), you should be able to use the image script command to plot the spatial intensity for different frequency points by changing the index of the last dimension, as I have plotted for the first frequency point.
For the getresult, getdata script commands you would find example scripts from the corresponding webpages. I understand that it can be a bit confusing at the beginning, but it becomes much simpler with a little bit of use. Once you get the data using any of the commands, you can look at the number of points in space and number of frequency/wavelength points in the monitor setting. This will give you an idea of which dimension of the intensity/field data corresponds to which parameter. Please feel free to let me know if you have any further questions on this.
I can provide more specific information on the first question if you could share a screenshot. Thank you!
Regards,
Amrita -
July 8, 2024 at 4:37 pmhallwSubscriber
Hi Amrita,
Thank you for your responce. The sphere radius is 0.0175 um, centered at 0, 0, 0 um. The simulation span is 1 um for x,y and z, and is also centered at 0. The boundary conditions are all PML. The source injection axis is z-axis, and the span is 0.148 um for x, y and z. The mesh override region has dx=dy=dz=0.001 um, and geometry x span = y span = z span = 0.152 um. The source injection axis is z-axis, and geometry x=y=z span=0.148 um. The DFT monitors are 0.152 um span in each direction. The absorbance group geometry is 0.144 um spans, and the scattering is 0.152 um spans. Here is a screenshot of the overall geometry.
-
July 8, 2024 at 5:25 pmhallwSubscriber
When using the getelectric command, how do I get the data as the field decays all the way to zero? The graph seems to stop once it has reached about 5e-05. Also, I am still confused about what "index_3" is referring to and what units that it is in. I see that it peaks at about 75 on the x-axis, but the field should be decaying away from the particle surface, not increasing and then decreasing.
-
- You must be logged in to reply to this topic.
-
416
-
192
-
178
-
161
-
140
© 2024 Copyright ANSYS, Inc. All rights reserved.