-
Notifications
You must be signed in to change notification settings - Fork 18
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
Initial propagation angle of laser enabled #1057
Conversation
suggestion
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks for this PR! See comments below. Could you add some documentation for the user? A NEW entry at the end of this section
hipace/docs/source/run/parameters.rst
Line 758 in c41482d
Laser parameters |
src/laser/Laser.H
Outdated
@@ -22,6 +22,7 @@ public: | |||
std::string m_name {""}; | |||
amrex::Real m_a0 {0.}; /**< Laser peak normalized amplitude */ | |||
amrex::Real m_w0 {0.}; /**< Laser waist */ | |||
amrex::Real m_init_angle_yz {0.}; /**< initial angle of laser pulse fron tilt on yoz */ |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The name could be more explicit, and the description is not too accurate. Here is a suggestion. Note that renaming the variable here would require other changes below.
amrex::Real m_init_angle_yz {0.}; /**< initial angle of laser pulse fron tilt on yoz */ | |
amrex::Real m_propagation_angle_yz {0.}; /**< Propagation angle of the pulse in the yz plane (0 is the along the z axis) */ |
src/laser/MultiLaser.cpp
Outdated
amrex::Real z = plo[2] + (islice+0.5_rt)*dx_arr[2] - z0; | ||
amrex::Real x = (i+0.5_rt)*dx_arr[0]+plo[0]-x0; | ||
amrex::Real y = (j+0.5_rt)*dx_arr[1]+plo[1]-y0; | ||
const amrex::Real yp=std::cos(init_angle_yz)*y+std::sin(init_angle_yz)*z; | ||
const amrex::Real zp=-std::sin(init_angle_yz)*y+std::cos(init_angle_yz)*z; | ||
z=zp; | ||
y=yp; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
amrex::Real z = plo[2] + (islice+0.5_rt)*dx_arr[2] - z0; | |
amrex::Real x = (i+0.5_rt)*dx_arr[0]+plo[0]-x0; | |
amrex::Real y = (j+0.5_rt)*dx_arr[1]+plo[1]-y0; | |
const amrex::Real yp=std::cos(init_angle_yz)*y+std::sin(init_angle_yz)*z; | |
const amrex::Real zp=-std::sin(init_angle_yz)*y+std::cos(init_angle_yz)*z; | |
z=zp; | |
y=yp; | |
amrex::Real x = (i+0.5_rt)*dx_arr[0]+plo[0]-x0; | |
# y and z location of the grid points | |
amrex::Real yg = (j+0.5_rt)*dx_arr[1]+plo[1]-y0; | |
amrex::Real zg = plo[2] + (islice+0.5_rt)*dx_arr[2] - z0; | |
# Rotation in the yz plane to set the laser's propagation direction | |
const amrex::Real y=std::cos(init_angle_yz)*yg+std::sin(init_angle_yz)*zg; | |
const amrex::Real z=-std::sin(init_angle_yz)*yg+std::cos(init_angle_yz)*zg; |
src/laser/MultiLaser.cpp
Outdated
// Compute envelope for time step 0 | ||
Complex diffract_factor = 1._rt + I * z * 2._rt/( k0 * w0 * w0 ); | ||
Complex diffract_factor = 1._rt + I * (z-zfoc*std::cos(init_angle_yz)) * 2._rt/( k0 * w0 * w0 ); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Could you check if this correction is needed? e.g. by running with zero and non-zero (but small) angle, and checking where the laser is focused?
z0 re-added
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks good. Thanks for this PR!
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks for this PR! See inlined comments. Also, could you remove file .DS_Store
from the PR?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks! See minor comments below.
Co-authored-by: Maxence Thévenet <maxence.thevenet@desy.de>
The laser is now allowed to be initialized with a transverse angle on yoz plane by setting
laser.init_angle_yz
.The testing input script is
And the result is tested by means of python script
The output of theta_num shows that the laser is perfectly initialized with a transverse angle. And the error is small enough to be neglected. And then we let the pulse propagate for 2mm and trace the pulse orbit by the following script:
Under this resolution, the slope of the orbit is -0.017036.