You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
- optically thin cooling based on tabulated cooling tables with either Townsend 2009 exact integration or operator-split subcycling
25
+
- tracer particles
25
26
- static and adaptive mesh refinement
26
27
- problem generators for
27
28
- linear waves
@@ -84,7 +85,7 @@ The following examples are a few standard cases.
84
85
85
86
Most simple configuration (only CPU, no MPI).
86
87
The `Kokkos_ARCH_...` parameter should be adjusted to match the target machine where AthenaPK will be executed.
87
-
A full list of architecture keywords is available on the [Kokkos wiki](https://kokkos.github.io/kokkos-core-wiki/keywords.html#architecture-keywords).
88
+
A full list of architecture keywords is available on the [Kokkos wiki](https://kokkos.org/kokkos-core-wiki/get-started/configuration-guide.html#keywords-arch).
88
89
89
90
# configure with enabling Intel Broadwell or similar architecture (AVX2) instructions
Copy file name to clipboardExpand all lines: docs/input.md
+85Lines changed: 85 additions & 0 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -323,3 +323,88 @@ d_log_temp_tol = 1e-8 # Tolerance in cooling table between subseque
323
323
Finally, a more comprehensive descriptions of various conventions used for cooling
324
324
functions (and the chosen implementation in AthenaPK) can be found in [Cooling Notes](cooling_notes.md)
325
325
and a notebook comparing various cooling tables (and their conversion) in [cooling/cooling.ipynb](cooling/cooling.ipynb).
326
+
327
+
### Particles
328
+
329
+
#### Tracers
330
+
331
+
Tracer particles can be enabled by setting `tracers/enabled=true` in the input file:
332
+
333
+
```
334
+
<tracers>
335
+
enabled = true
336
+
337
+
initial_seed_method = random_per_block # alternative: user
338
+
initial_num_tracers_per_cell = 0.125
339
+
### Optional arguments
340
+
#initial_rng_seed = INTEGER
341
+
```
342
+
343
+
Two seeding methods are currently supported:
344
+
345
+
-`initial_seed_method=random_per_block`
346
+
- seeds particles at random positions in each block
347
+
- NOTE: the random number generator seed uses the unique block id. Therefore, simulations with the mesh decomposition (mesh and meshblock sizes) are identical independent of the number of MPI ranks used, but if the meshblock size is changed for given mesh (and thus the total number of blocks) the initial state will be different.
348
+
-`initial_num_tracers_per_cell` determines the number of seeded particles per cell
349
+
-`initial_rng_seed` (optional) is used as seed in addition to the block id.
350
+
-`initial_seed_method=user`
351
+
- Calls a problem specific callback function (`ProblemSeedInitialTracers`), see [tracer callback documenation](https://github.com/parthenon-hpc-lab/athenapk/blob/main/docs/pgen.md#tracers).
352
+
353
+
By default, swarm fields are written only to restart files.
354
+
If they are required for "standard" output files (like single precision `hdf5`),
355
+
they need to be added manually to the output block, e.g., (bottom two lines)
356
+
```
357
+
<parthenon/output2>
358
+
file_type = hdf5 # Binary data dump
359
+
variables = prim # variables to be output
360
+
dt = 0.1 # time increment between outputs
361
+
id = prim
362
+
single_precision_output = true
363
+
364
+
swarms = tracers
365
+
tracers_variables = id, x, y, z, rho
366
+
#write_swarm_xdmf=true # uncomment to create an xdmf output (e.g., for Paraview or Visit)
367
+
```
368
+
369
+
Tracers can be read/processed by Paraview or Visit (via the xdmf file)
370
+
or by the `phdf` package shipped with the Parthenon submodule.
371
+
A sample plotting script for the latter might look like
print("Couldn't find module to read Parthenon hdf5 files.")
386
+
387
+
data = phdf.phdf("../run-turbulence/parthenon.prim.00010.phdf")
388
+
tracers = data.GetSwarm("tracers")
389
+
xs = tracers.x
390
+
ys = tracers.y
391
+
zs = tracers.z
392
+
ids = tracers.Get("id")
393
+
394
+
fig = plt.figure()
395
+
ax = fig.add_subplot(projection='3d')
396
+
397
+
ax.scatter(xs, ys, zs,s=1,c=ids)
398
+
```
399
+
resulting in the following image:
400
+
401
+

402
+
403
+
Following "restrictions" apply to the current tracer implementation:
404
+
- Only 3D simulations.
405
+
- Only one advection method (RK2/Heun's method).
406
+
- All primitive fields (`rho`, `pressure`, `vel_x`, `vel_y`, `vel_z`, `B_x`, `B_y`, and `B_x`) are traced by default (independent of whether they're needed or not) in addition to the position (`x`, `y`, `z`) and id (`id`) fields.
407
+
- Default tracer values (such as the primitive fields) are only updated right before writing an output file.
408
+
- Ids are only unique if tracers are seeded at the beginning at the simulations and no new tracer particles are added dynamically while the simulation is running.
409
+
410
+
Please get in touch, if you interested in running simulations that require lifting one (or more) of those restrictions.
It is executed once when a simulation is started the very first time (i.e., it
203
+
is not called on subsequent restarts).
204
+
See the standard tracer seeding implementation[`SeedInitialTracers`](https://github.com/parthenon-hpc-lab/athenapk/blob/main/src/tracers/tracers.cpp) for reference on how to deposit particles.
It is called at the end of the tracer package initialization and can be defined at the per-problem-generator level, see, e.g., the turbulence driver as an example.
212
+
213
+
Similarly, a callback is available to fill those new fields (or more) via
214
+
```c++
215
+
TaskStatus ProblemFillTracers(MeshData<Real> *md, parthenon::SimTime &tm, const Real dt);
216
+
```
217
+
It is called right after the default `FillTracers` task in the driver.
0 commit comments