-
Notifications
You must be signed in to change notification settings - Fork 217
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
SingleParticle Test: Little Gyro Spin
Modifies the single particle test to make a little spin in 2 periods during 100 steps with relativistic momentum. At the same time, the particle is accelerated non-relativistically by about 0.005 beta in orthogonal direction with an E-Field. Can be used to validate pushers, current, charge, radiation or photon creation. Does only need a single GPU and creates just around ~1GB output which is compressed about 37 MB. Currently no tools added alongside, since I am waiting for a small bug in yt to be fixed (and also for our new CI node). So long, [here](https://gist.github.com/ax3l/9b49780a1bbedbe054f7d98654644e71/128a383a55ee62e342028b0744d72b3e40b60c8e) is an example script that does not look nice yet: ```python import opmd_viewer import numpy as np %matplotlib notebook import matplotlib.pyplot as plt ts3 = opmd_viewer.OpenPMDTimeSeries("singleParticle-004/simOutput/h5/") pos_x = [] pos_y = [] pos_z = [] mom_z = [] t = [] for t_it in ts3.iterations: tmp = ts3.get_particle(["x", "y", "z", "uz"], "e", iteration=t_it) pos_x.append(tmp[0][0]) pos_y.append(tmp[1][0]) pos_z.append(tmp[2][0]) mom_z.append(tmp[3][0]) t.append(ts3.current_t) plt.figure() plt.plot(pos_x, pos_y, "x", label="pos_xy") plt.legend() plt.show() plt.figure() plt.plot(pos_z, label="z") plt.legend() plt.show() plt.figure() plt.plot(mom_z, label="mom_z") plt.show() plt.figure() plt.plot(t, label="t") plt.show() ``` There are other tests that I like more when we add a RT test analysis, e.g. a drift in an inhomogenous B field.
- Loading branch information
Showing
8 changed files
with
161 additions
and
60 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
94 changes: 94 additions & 0 deletions
94
examples/SingleParticleTest/include/simulation_defines/param/gridConfig.param
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,94 @@ | ||
/** | ||
* Copyright 2013-2017 Axel Huebl, Rene Widera, Benjamin Worpitz | ||
* | ||
* This file is part of PIConGPU. | ||
* | ||
* PIConGPU is free software: you can redistribute it and/or modify | ||
* it under the terms of the GNU General Public License as published by | ||
* the Free Software Foundation, either version 3 of the License, or | ||
* (at your option) any later version. | ||
* | ||
* PIConGPU is distributed in the hope that it will be useful, | ||
* but WITHOUT ANY WARRANTY; without even the implied warranty of | ||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | ||
* GNU General Public License for more details. | ||
* | ||
* You should have received a copy of the GNU General Public License | ||
* along with PIConGPU. | ||
* If not, see <http://www.gnu.org/licenses/>. | ||
*/ | ||
|
||
|
||
|
||
#pragma once | ||
|
||
namespace picongpu | ||
{ | ||
|
||
namespace SI | ||
{ | ||
/** Period of a gyro-motion in s for an electron with beta=0.5 in B=50T | ||
* unit: seconds */ | ||
constexpr float_64 T_GYRO_SI = 0.825e-12; | ||
|
||
/** Duration of one timestep | ||
* unit: seconds */ | ||
constexpr float_64 DELTA_T_SI = T_GYRO_SI / 50.; | ||
|
||
/** equals X | ||
* unit: meter */ | ||
constexpr float_64 CELL_WIDTH_SI = 8.6e-6; | ||
/** equals Y | ||
* unit: meter */ | ||
constexpr float_64 CELL_HEIGHT_SI = CELL_WIDTH_SI; | ||
/** equals Z | ||
* unit: meter */ | ||
constexpr float_64 CELL_DEPTH_SI = CELL_WIDTH_SI; | ||
|
||
/** Note on units in reduced dimensions | ||
* | ||
* In 2D3V simulations, the CELL_DEPTH_SI (Z) cell length | ||
* is still used for normalization of densities, etc. | ||
* | ||
* A 2D3V simulation in a cartesian PIC simulation such as | ||
* ours only changes the degrees of freedom in motion for | ||
* (macro) particles and all (field) information in z | ||
* travels instantaneous, making the 2D3V simulation | ||
* behave like the interaction of infinite "wire particles" | ||
* in fields with perfect symmetry in Z. | ||
*/ | ||
|
||
} //namespace SI | ||
|
||
//! Defines the size of the absorbing zone (in cells) | ||
const uint32_t ABSORBER_CELLS[3][2] = { | ||
{32, 32}, /*x direction [negative,positive]*/ | ||
{32, 32}, /*y direction [negative,positive]*/ | ||
{32, 32} /*z direction [negative,positive]*/ | ||
}; //unit: number of cells | ||
|
||
//! Define the strength of the absorber for any direction | ||
const float_X ABSORBER_STRENGTH[3][2] = { | ||
{1.0e-3, 1.0e-3}, /*x direction [negative,positive]*/ | ||
{1.0e-3, 1.0e-3}, /*y direction [negative,positive]*/ | ||
{1.0e-3, 1.0e-3} /*z direction [negative,positive]*/ | ||
}; //unit: none | ||
|
||
constexpr uint32_t ABSORBER_FADE_IN_STEPS = 16; | ||
|
||
/** When to move the co-moving window. | ||
* An initial pseudo particle, flying with the speed of light, | ||
* is fired at the begin of the simulation. | ||
* When it reaches slide_point % of the absolute(*) simulation area, | ||
* the co-moving window starts to move with the speed of light. | ||
* | ||
* (*) Note: beware, that there is one "hidden" row of gpus at the y-front, | ||
* when you use the co-moving window | ||
* 0.75 means only 75% of simulation area is used for real simulation | ||
*/ | ||
constexpr float_64 slide_point = 0.90; | ||
|
||
} | ||
|
||
|
||
|
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