-
Notifications
You must be signed in to change notification settings - Fork 200
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add reduced diagnostic: 2d differential luminosity (#5545)
Adds a luminosity diagnostic differentiated in the energies of two colliding species, called `DifferentialLuminosity2D`. It is defined as follows: ```math \begin{align*} \frac{d^2\mathcal{L}}{dE_1 dE_2}(E_1, E_2, t) = \int_0^t dt'\int d\boldsymbol{x}\, & \int d\boldsymbol{p}_1 \int d\boldsymbol{p}_2\; \sqrt{ |\boldsymbol{v}_1 - \boldsymbol{v}_2|^2 - |\boldsymbol{v}_1\times\boldsymbol{v}_2|^2/c^2} \\ & f_1(\boldsymbol{x}, \boldsymbol{p}_1, t')f_2(\boldsymbol{x}, \boldsymbol{p}_2, t') \delta(E_1 - E_1(\boldsymbol{p}_1) \delta( E_2 - E_2(\boldsymbol{p}_2)) \end{align*} ``` where: * $\boldsymbol{p}_i$ is the momentum of a particle of species $i$ * $E_i$ is the energy of a particle of species $i$, $E_i (\boldsymbol{p}_i) = \sqrt{m_1^2c^4 + c^2 |\boldsymbol{p}_i|^2}$ * $f_i$ is the distribution function of species $i$, normalized such that $\int \int f(\boldsymbol{x} \boldsymbol{p}, t )d\boldsymbol{x} d\boldsymbol{p} = N$, the number of particles in species $i$ at time $t$ The 2D differential luminosity is given in units of $\text{m}^{-2} \ \text{eV}^{-2}$. The user must specify the minimum, maximum, and number of bins to discretize the $E_1$ and $E_2$ axes. The computation of this diagnostic is similar to that of `ParticleHistogram2D`. The output is a folder containing a set of openPMD files. The values of the diagnostic are stored in a record labeled `d2L_dE1_dE2`, with axes `E1` and `E2`. --------- Co-authored-by: Remi Lehe <remi.lehe@normalesup.org>
- Loading branch information
Showing
9 changed files
with
583 additions
and
17 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
70 changes: 70 additions & 0 deletions
70
Source/Diagnostics/ReducedDiags/DifferentialLuminosity2D.H
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,70 @@ | ||
/* Copyright 2023 The WarpX Community | ||
* | ||
* This file is part of WarpX. | ||
* | ||
* Authors: Arianna Formenti, Remi Lehe | ||
* License: BSD-3-Clause-LBNL | ||
*/ | ||
|
||
#ifndef WARPX_DIAGNOSTICS_REDUCEDDIAGS_DIFFERENTIALLUMINOSITY2D_H_ | ||
#define WARPX_DIAGNOSTICS_REDUCEDDIAGS_DIFFERENTIALLUMINOSITY2D_H_ | ||
|
||
#include "ReducedDiags.H" | ||
#include <AMReX_GpuContainers.H> | ||
#include <AMReX_TableData.H> | ||
|
||
#include <map> | ||
#include <string> | ||
#include <vector> | ||
|
||
/** | ||
* This class contains the differential luminosity diagnostics. | ||
*/ | ||
class DifferentialLuminosity2D : public ReducedDiags | ||
{ | ||
public: | ||
|
||
/** | ||
* constructor | ||
* @param[in] rd_name reduced diags names | ||
*/ | ||
DifferentialLuminosity2D(const std::string& rd_name); | ||
|
||
/// File type | ||
std::string m_openpmd_backend {"default"}; | ||
|
||
/// minimum number of digits for file suffix (file-based only supported for now) */ | ||
int m_file_min_digits = 6; | ||
|
||
/// name of the two colliding species | ||
std::vector<std::string> m_beam_name; | ||
|
||
/// number of bins for the c.o.m. energy of the 2 species | ||
int m_bin_num_1; | ||
int m_bin_num_2; | ||
|
||
/// max and min bin values | ||
amrex::Real m_bin_max_1; | ||
amrex::Real m_bin_min_1; | ||
amrex::Real m_bin_max_2; | ||
amrex::Real m_bin_min_2; | ||
|
||
/// bin size | ||
amrex::Real m_bin_size_1; | ||
amrex::Real m_bin_size_2; | ||
|
||
/// output data | ||
amrex::TableData<amrex::Real,2> m_h_data_2D; | ||
|
||
void ComputeDiags(int step) final; | ||
|
||
void WriteToFile (int step) const final; | ||
|
||
private: | ||
|
||
/// output table in which to accumulate the luminosity across timesteps | ||
amrex::TableData<amrex::Real,2> m_d_data_2D; | ||
|
||
}; | ||
|
||
#endif // WARPX_DIAGNOSTICS_REDUCEDDIAGS_DIFFERENTIALLUMINOSITY2D_H_ |
Oops, something went wrong.