ECP-WarpX / WarpX

WarpX is an advanced electromagnetic & electrostatic Particle-In-Cell code.
https://ecp-warpx.github.io
Other
306 stars 195 forks source link

implementing a nanoparticle #5392

Closed kirstynvalles02 closed 3 weeks ago

kirstynvalles02 commented 4 weeks ago

Greetings!

I am attempting to implement a nanoparticle in a specific spot of my simulation, however i am unsure of how to actually implement one into an imput file. any help would be greatly appreciated!

aeriforme commented 4 weeks ago

Hello!

If you want to initialize a nanometric sphere in your simulation, you can add a particle species with:

<species_name>.profile = parse_density_function
<species_name>.density_function(x,y,z) =  n0 * ( ((x-x0)*(x-x0) + (y-y0)*(y-y0) + (z-z0)*(z-z0)) < R**2)

This would add particles in your simulation according to density_function, meaning that n0 would be the number density of that species inside the sphere, x0,y0,z0 the center and R the radius of the sphere.

This example could be of help.

Otherwise, if what you want is to initialize a single macro particle in a given location, you can use <species_name>.injection_style = SingleParticle. In this case, you can check out this other example

You can find more details about particle initialization here.

Let me know if this answers your question! :)

kirstynvalles02 commented 3 weeks ago

youre honestly amazing! thank you so much!!

may i keep this chat open in case i have further questions??

kirstynvalles02 commented 3 weeks ago

hello!

quick question-- would i need a different parameter to declare it as a gold nanoparticle?