Skip to content
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

General moving-window transformations in boosted-frame simulations #5226

Merged
merged 6 commits into from
Sep 28, 2024

Conversation

bnara
Copy link
Contributor

@bnara bnara commented Sep 8, 2024

During initialization in boosted-frame simulations, the moving window, of length $L$ given in lab-frame coordinates, is resized along the direction of the boost. Currently, the code assumes that the moving window is traveling along the direction of the boost at the speed-of-light.

This PR generalizes the transformation of the moving window from the lab-frame to the boosted-frame, taking into account the direction and speed of the moving window (c.f., Eq. 1 in Ref. [1]). As an example, let's say the boosted-frame moves with speed $\beta = 0.6$ (gamma_boost = 1.25). If the moving window also travels at speed $\beta$, then its length in the boosted frame is $L \gamma = 1.25 L$ rather than $2 L$, as is currently calculated.

Special cases for negative values of moving_window_v and moving windows not traveling along the boost direction were both checked. In order to have access to the moving window parameters, there needed to be some rearrangement of initialization order.

[1] J.-L. Vay, Phys. Rev. Lett. 98, 130405 (2007)

@bnara bnara marked this pull request as draft September 8, 2024 17:09
@bnara bnara marked this pull request as ready for review September 9, 2024 16:28
@bnara
Copy link
Contributor Author

bnara commented Sep 10, 2024

The diagnostic field output window, specified via diag_lo and diag_hi, could be transformed in the same way:

if (WarpX::boost_direction[ dim_map[WarpX::moving_window_dir] ] == 1) {

@ax3l ax3l added the component: boosted frame boosted frame components & logic label Sep 16, 2024
@ax3l ax3l requested a review from RemiLehe September 16, 2024 23:14
@RemiLehe RemiLehe closed this Sep 27, 2024
@RemiLehe RemiLehe reopened this Sep 27, 2024
@RemiLehe RemiLehe enabled auto-merge (squash) September 27, 2024 13:59
auto-merge was automatically disabled September 27, 2024 14:32

Head branch was pushed to by a user without write access

@@ -194,8 +231,11 @@ void ConvertLabParamsToBoost()
{
if (boost_direction[dim_map[idim]]) {
amrex::Real convert_factor;
// Assume that the window travels with speed +c
convert_factor = 1._rt/( gamma_boost * ( 1 - beta_boost ) );
amrex::Real beta_window = beta_boost;
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Shouldn't this be

amrex::Real beta_window = 0;

i.e. if do_moving_window is false, the velocity of the moving window is effectively 0?

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Apologies, I got confused. After more thought, I agree that this should be amrex::Real beta_window = beta_boost; in the absence of an explicit moving window.

@RemiLehe
Copy link
Member

RemiLehe commented Sep 27, 2024

Thanks for this PR!
Some of the tests were failing because they produce different results. (Since the box size is now different.)
I udpated the input script so that, with the new code, it produces the same results as the old input script with the old code.

I also had a question (see inline comment), but have not modified the code according to what I was suggesting in this question.

@RemiLehe RemiLehe enabled auto-merge (squash) September 27, 2024 21:23
@RemiLehe RemiLehe merged commit eef12e9 into ECP-WarpX:development Sep 28, 2024
37 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
component: boosted frame boosted frame components & logic
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants