Skip to content

Dev/moments #8

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

Merged
merged 16 commits into from
Feb 14, 2023
Merged

Dev/moments #8

merged 16 commits into from
Feb 14, 2023

Conversation

haykh
Copy link
Collaborator

@haykh haykh commented Feb 1, 2023

  1. Evaluating moments from particle distribution for the output (* details below)
  2. Abstraction for the output fields
  3. Minor reformatting

(*) Users can now provide [output] fields = [..., ...] parameter in the input with the desired fields to be written at runtime.

Regular field components are addressed as Ex, Bz, Jy etc. To output all 3 components of the given field add Ei (where the code will automatically assume i=1,2,3 for E-field).

Rho and N stand for the mass and the number densities. T stands for the energy-stress tensor, which should be followed by two component identifiers. For instance, T01 or T0x or Ttx stands for the momentum flux in the x-direction. T0i will be automatically unraveled into 3 components with i=1,2,3. Tij will be unraveled into 6 independent components of the spatial part of the energy-momentum tensor i=1,2,3; i<j<=3. Tii will be interpreted as only the diagonal components, i.e., T11, T22, T33. One may also provide only the particular components, e.g., T23, T11, etc.

All the particle-based moments (densities, and the energy-stress tensor) will be computed by default using the distributions of all massive particles. If needed, one can specify the particular species for which to compute Rho, N and/or T separately. Simply pad the definition by the species indices, separated by the underscore _. For example, T03_2_4 computes the z-direction momentum flux for species 2 and 4, Tij_1 computes the stress-energy tensor components for the species 1.

Usage example

Assume the simulation has 4 species (electrons/positrons + ions + photons) and we want to output all the B-field components, the Ez, the pair density, the photon density, the total pressure-tensor of the plasma, and the photon momentum flux in all directions. Our input file might look something like this.

[particles]
n_species = 4

[species_1]
label    = "e-"
mass     = 1.0
charge   = -1.0

[species_2]
label    = "e+"
mass     = 1.0
charge   = 1.0

[species_3]
label    = "i"
mass     = 1800.0
charge   = 1.0

[species_4]
label    = "ph"
mass     = 0.0
charge   = 0.0

[output] 
fields = [ "Bi", "Ez", "Rho_1_2",  "Rho_4", "Tij_1_2_3", "T0i_4" ]

@haykh haykh added the enhancement New feature or request label Feb 14, 2023
@haykh haykh merged commit eb69b0a into dev/main Feb 14, 2023
@haykh haykh deleted the dev/moments branch February 14, 2023 04:52
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant