Warwick-Plasma / epoch

Particle-in-cell code for plasma physics simulations
https://epochpic.github.io
GNU General Public License v3.0
184 stars 58 forks source link

Doppler effect of the Moving Window #726

Closed hysjoe closed 3 weeks ago

hysjoe commented 1 month ago

I generate a plane wave moving in a 1d-box and use the moving window. When the moving window starts to move, the laser (plane wave) placed on the boundary (x_min) of the window will experience Doppler effect that the wavelength specified earlier will change. Also the boundary condition (bc_x_max = simple_outflow) seems to be changed either after the window starts to move. It appears that there is some reflection on bc_x_max instead of the simple_outflow. The simulation snapshots are shown in the bellow .pdf. Is there any method to avoid this?

s35Electric_Field_Ey.pdf

Status-Mirror commented 1 month ago

Hi @hysjoe,

I think the issue is caused when you try to inject things like lasers or particles through the moving window. The best solution would be to inject your full laser pulse before the window starts moving, and have the window move such that the pulse doesn't reach x_max. This would involve extending your domain.

The main use-case for the moving window is in wakefiled simulations, where the full pulse enters the domain, and the window moves at the pulse-speed. This prevents the pulse from interacting with the boundaries, so these Doppler issues aren't important.

Hope this helps, Stuart

hysjoe commented 1 month ago

Dear Stuart, I see. But, in addition to the Wakefield, I still need to simulate a plane wave existing through the domain with a fixed wavelength even if the window is moving. Is there any method such that the plane wave propagating into the window acts as it is at its original position which is outside the window? Thanks for your patience.

Best regards, Yang-Shuo Hsiung

On Oct 21, 2024, at 16:55, Stuart Morris @.***> wrote:

Hi @hysjoe https://github.com/hysjoe,

I think the issue is caused when you try to inject things like lasers or particles through the moving window. The best solution would be to inject your full laser pulse before the window starts moving, and have the window move such that the pulse doesn't reach x_max. This would involve extending your domain.

The main use-case for the moving window is in wakefiled simulations, where the full pulse enters the domain, and the window moves at the pulse-speed. This prevents the pulse from interacting with the boundaries, so these Doppler issues aren't important.

Hope this helps, Stuart

— Reply to this email directly, view it on GitHub https://github.com/Warwick-Plasma/epoch/issues/726#issuecomment-2426035645, or unsubscribe https://github.com/notifications/unsubscribe-auth/AROUSEMFPPTPBZNI64ZNDQDZ4S6QBAVCNFSM6AAAAABQIHTXNSVHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHMZDIMRWGAZTKNRUGU. You are receiving this because you were mentioned.

Status-Mirror commented 1 month ago

I don't think EPOCH has the capability you describe. You would just need to include a long simulation domain.

Why do you need the moving window, what are you trying to simulate? I might be able to suggest another workaround if I know the system you're interested in.

Cheers, Stuart

hysjoe commented 1 month ago

Dear Stuart, I want to simulate a laser plasma Wakefield and see its interaction with a plane wave, which exists around the mirror’s trajectory with a different constant wavelength. A larger simulation domain works in 1d, but I am worried about that if I simulate this in 2d or 3d, it will take much more time. Or is there a method that I can modify the source codes to subtract the Doppler effect after the window moves such that the wavelength of the plane wave is still same.

Best regards, Yang-Shuo Hsiung

On Oct 21, 2024, at 17:23, Stuart Morris @.***> wrote:

I don't think EPOCH has the capability you describe. You would just need to include a long simulation domain.

Why do you need the moving window, what are you trying to simulate? I might be able to suggest another workaround if I know the system you're interested in.

Cheers, Stuart

— Reply to this email directly, view it on GitHub https://github.com/Warwick-Plasma/epoch/issues/726#issuecomment-2426105056, or unsubscribe https://github.com/notifications/unsubscribe-auth/AROUSEITM4SGOB3AOWRSC7LZ4TBYBAVCNFSM6AAAAABQIHTXNSVHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHMZDIMRWGEYDKMBVGY. You are receiving this because you were mentioned.

Status-Mirror commented 1 month ago

I think there are changes you could make to the source-code which might help.

I don't think Doppler shift is the problem, I think it's because the laser-routines aren't aware the window is moving. Lasers are given as sinusoidal electric fields, which vary as $\sin(\omega t)$. Physically, this should be $\sin(\omega t - kx)$, but since it is assumed the boundary is stationary, the $kx$ term is neglected.

You can try including a spatial component to the lasers, by editing the update_laser_omegas function in laser.f90. Specifically, the line

        current%current_integral_phase = current%current_integral_phase &
            + current%omega * dt

advances the sine argument which determines the laser phase each step. If you play around with this part of the code, you might be able to make it produce the electric field components expected from a laser at a particular point in space and time.

My ability to advise further may be limited, as we don't generally support user-extensions to the code, but I hope this sets you on the right direction.

Cheers, Stuart

Status-Mirror commented 3 weeks ago

I'll mark this as closed for now, but feel free to reopen if you have any more questions.

hysjoe commented 3 weeks ago

Ok. Thanks.

On Nov 1, 2024, at 18:40, Stuart Morris @.***> wrote:

I'll mark this as closed for now, but feel free to reopen if you have any more questions.

— Reply to this email directly, view it on GitHub https://github.com/Warwick-Plasma/epoch/issues/726#issuecomment-2451671188, or unsubscribe https://github.com/notifications/unsubscribe-auth/AROUSEOFAE4USKTDSWW6LSDZ6NLCHAVCNFSM6AAAAABQIHTXNSVHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHMZDINJRGY3TCMJYHA. You are receiving this because you were mentioned.