Giter Site home page Giter Site logo

akohta / emf_mie_mmls Goto Github PK

View Code? Open in Web Editor NEW
1.0 1.0 0.0 37.66 MB

This is the electromagnetic field analysis program for multi-layered spherical particles. The radiation force acting on the sphere can be analyzed. This is based on Mie scattering theory, the own developed method is used.

License: MIT License

Makefile 1.33% C 96.39% Gnuplot 1.79% Shell 0.49%
electromagnetic-simulation electromagnetic-wave mie-theory multiple-scattering radiation-force multilayered-sphere

emf_mie_mmls's Introduction

emf_mie_mmls

This is the electromagnetic field analysis program for multi-layered spherical particles. This is based on Mie scattering theory, the own developed method is used. This program can analyze multiple scattering between spheres by using iterative solution. The electromagnetic field analysis program "multi_fbeam" is used to analyze incident field. GNU Scientific Library and libpng are required.

analysis model

Usage of example code

  1. type 'make' command to compile.
    The executable mie_mmls_solver, example1.out, example2.out, example3.out, example4.out are created.
    The mie_mmls_solver is the solver of Mie coefficients. The example1.out is the executable of source code example1.c, it shows a simplest example using "emf_mie_mmls". The example2.out is the executable of source code example2.c, it shows a example of electromagnetic field intensity analysis. The example3.out is the executable of source code example3.c, it shows a example of outputting the instantaneous value of the electromagnetic field as an image. The example4.out is the executable of source code example4.c, it shows a example of far-field intensity analysis.

  2. type './mie_mmls_solver' with an argument of output datafile name.
    For example, './mie_mmls_solver ex.dat'. The beam datafile "ipw.txt" (plane wave is defined) and the sphere datafile "mlsphr.txt" (radius 2.5, three-layered spherical particle is defined) are used. This executable calcluates Mie coefficients, outputs them to binary file with the specified name. This program searches for a sphere datafile in current directory using the default datafile name "mlsphr.txt". As a simple representation of the analysis model, the nodes used for the surface integral are output as point cloud data. In this case, the file "ex.particles" is output, and the visualization result is "ex_particle.png". The image was created using gnuplot script "gscript_particles.plt" and converted eps to png by using ImageMagick.

  3. type './example1.out' with an argument of datafile name.
    For example, './example1.out ex.dat'. This executable calculates electromagnetic field, radiation force and torque. This is the simplest example using this code.

  4. type './example2.out' with an argument of datafile name.
    For example, './example2.out ex.dat'. This executable calculates electromagnetic field intensity distributions, outputs them to text files. The I_example2.png is the visualization result of electromagnetic field intensity distributions, created by Gnuplot script gscript_example2.plt (converted eps to png by using ImageMagick).

  5. type './example3.out' with an argument of datafile name.
    For example, './example3.out ex.dat'. This executable calculates instantaneous value of the electromagnetic fields, outputs them to png image files. The image files are output to the folder which has a name adding "images" to the datafile name specified in the argument (file-extension is excluded). Each image file has a name that indicates the cross section, field component, and number of time steps (ex. xz_Ex_014.png). The color bar is output as color_bar.png in the same folder. The range of color bar in each cross section is output to the info.txt file (ex. xy_info.txt for z=0 plane). The xz_Ex.gif, yz_Ex.gif and xy_Ex.gif are animated gifs that concatenate the png files created by using the shell script gif_animation.sh.

  6. type './example4.out' with an argument of datafile name.
    For example, './example4.out ex.dat'. This executable calculates far-field intensity distributions and outputs them to text files. The I_example4.png is the visualization result of electric field intensity distributions, created by gnuplot script gscript_example4.plt.

Please see ex2mie_src/emf_mie_mmls.h for detail of functions, mfb_src/multi_fbeam.h for detail of incident fields. The mie_mmls_solver, example2.out and example3.out are parallelized using OpenMP. The number of threads is controlled by the environment variable OMP_NUM_THREADS. The file named make_icx is the makefile for Intel compiler. For this code, Intel compiler is about 1.5 times faster than gcc (using gcc version 9.3.0, icx version 2021.4.0). The additional analysis example of single sphere is in the folder analysis_sample1.

point cloud data 0
intensity distributions 0
xz_Ex.gifyz_Ex.png
xy_Ex.gif
far-field 0

Analysis sample of mutiple multi-layered spheres (in the folder analysis_sample2)

The analysis sample of multiple multi-layered spheres is in the folder analysis_sample2. The multiple scattering between spheres can be analyzed by the executable mie_mmls_solver. The usage is the same as example code. For exampe, '../mie_mmls_solver ex2.dat', '../example2.out ex2.dat' (run in analysis_sample2 folder). The I_example2.png in this folder is the visualization result of electromagnetic field intensity distributions.

point cloud data 2 intensity distributions 2 xz_Ex.gif 2yz_Ex.png 2   xy_Ex.gif 2   far-field 2  

Analysis sample of radiation force

The code in the folder analysis_sample3 is the radiation force analysis program for optical trapping. The usage is 'make' and './radiation_force.out'. The radiation_force.png is the visualization result of radiation forces, created by Gnuplot script gscript_radiation_force.plt.

radiation force

System of units

This program use the own defined system of units (OSU), optimized for optics. The system of units is defined as ( speed of light in vacuum ), ( permeability of vacuum ). For the conversion from OSU to MKSA system of units, the unit of length in OSU is defined as [m] in MKSA, the unit of power in OSU is defined as [W] in MKSA. The conversions of base unit are follows.
,
,
,
,
,
.
Please see com_src/osu_mksa.h and com_src/osu_mksa.c for detail of conversions.

References

  1. Barton, J. P., D. R. Alexander, and S. A. Schaub. "Internal and near‐surface electromagnetic fields for a spherical particle irradiated by a focused laser beam." Journal of Applied Physics 64.4 (1988): 1632-1639.
  2. Barton, J. P., D. R. Alexander, and S. A. Schaub. "Theoretical determination of net radiation force and torque for a spherical particle illuminated by a focused laser beam." Journal of Applied Physics 66.10 (1989): 4594-4602.
  3. Barton, John P., et al. "Electromagnetic field for a beam incident on two adjacent spherical particles." Applied optics 30.33 (1991): 4706-4715.
  4. Abramowitz, Milton, and Irene A. Stegun, eds. Handbook of mathematical functions with formulas, graphs, and mathematical tables. Vol. 55. US Government printing office, 1948.
  5. GNU Scientific Library GSL
  6. the command-line driven graphing utility gnuplot
  7. The utilities for manipulating images ImageMagick
  8. The official PNG reference library libpng
  9. The electromagnetic field analysis program multi_fbeam

The formula (12) in the Reference 2 ( z-component of radiation torque ) is misprinted. The following formula is correct.
.
The first letter in the term of sum is missed.

emf_mie_mmls's People

Contributors

akohta avatar

Stargazers

 avatar

Watchers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.