Files
katrin-plasma/docs/paper/the-karl-code/referee_report_2.md
T

154 lines
22 KiB
Markdown

<style>
r { color: Red }
o { color: Orange }
gr { color: Green }
cs { color: Red; background-color: White }
fs { color: Yellow; background-color: Black}
csfs {color: Orange; background-color: #5f6a6a }
done {color: green; font-style: italic}
reply {color: blue; font-weight: bold}
note {color: red; background-color: Black; font-style: italic; font-weight: bold}
</style>
## Reviewer #2
Here I provide the requested review of **"KARL - A Monte Carlo model for atomic and molecular processes in the tritium atmosphere of the KATRIN experiment"**.
Clearly this is a very useful piece of software that has implemented a lot of important functionality for tritium experiments such as KATRIN. I commend the authors on their decision to publish and release their code.
The paper itself has a number of weaknesses, however, and I believe it needs a major revision before I can recommend it for publication. I give point-by-point comments referenced to line number below, but summarize the most important points here.
The paper omits much of the information that is the most interesting about this work - for example, detailed plots of what cross sections are implemented, a quantitative comparison of different stepping approaches, performance metrics, and so on. This material should be included to make this paper a comprehensive and useful reference for the code.
1. <done>The text needs a deep edit for concision and clarity. In several places the same idea is repeated in several subsequent sentences, and often a lot of words are spent on basic concepts that will be clear to most authors (e.g., what is a vector field?), while when complex ideas that are more specific to this code are just skipped over or referenced out (e.g., what does the Boris algorithm do and in what sense is it more or less optimal than the other option?). The text should be refocussed towards the aspects that make this codebase particularly interesting and/or nontrivial, and the language improved and condensed throughout.
</done><br>
<reply>Following the two referee reports we have made a large number of changes. While doing so we have tried to clarify the logic, avoided repetitions and focussed on the new developments. As far as we know the KARL code is the only freely available code for the simulation of tritium experiments - this is the point that makes it most interesting.<br>We have reduced the explaination of basic concepts to a minimum, but we believe that a minimal explaination is required for context. </reply>
1. <done>Almost all the "results" are referred out to Ref [7], which makes the reader wonder why it is necessary to have two papers rather than one. I would like to encourage the authors to bring the results forward into this text. I also encourage them to include the scripts that generate these as documented examples in the code repository, since these are the actual code use cases that an external user may want to recreate.
</done><br><reply>We have extended the "results" section and included the necessary scripts to re-run those and possibly extend them. The intention of this paper has been primarily to make the code publicly available along with documentation. We understand that the documentation effort has not been sufficient in first place, but we hope that this problem has now been remedied. </reply>
3. <done>Barely any performance estimates are given. For the two stepper algorithms, for example, how different are the simulation results, and at what relative CPU cost? What degree of uncertainty is associated with granularity of the geometry? How many events need be simulated for a typical application in KATRIN and how long does this take? Which of the processes carry the most time cost, and can any of them be neglected for faster simulations without losing too much accuracy?
</done><br><reply> We have added a performance estimate for the two mover algorithms. These do not include any sort of estimate about the physical time for a simulation, however, a scaling graph is provided in the paper. All of the remaining issues depend very strongly on the specific setup of a simulation. E.g. the uncertainty of the geometry depends a lot on the gradients within the provided profile of the background gas and the most costly process depends on the magnitude of the background gas, since that determines the mean free path. </reply>
1. <done>I took a look at the source code. There are almost no comments anywhere, in either the headers or source, and this is especially problematic when many of the functions accept an argument that is simply named "object". It seems to me it would be good practice to add comments to at least add comments to explain what each function does, what it accepts as input and gives as output.
</done><br> <reply> We have written extensive comments for the source code. Our main objective was to make the functions readable, some of the inner workings are not that well documented. </reply>
5. <done>There are some example scripts given in the codebase, but they are not referenced in the paper, do not come with documentation, and it is not clear what they do in terms of expected input, processing and output. Somewhere it should be made clear how one should run these examples, what they do, and what the expected output is. Furthermore, the examples should contain at least some semi-realistic use cases of the code for addressing relevant physics questions for tritium experiments.
</done><br> <reply> We have added a section to the README in karl that explains a bit what the different given json files are. A semi-realistic use case is included with the katrin_parameter_example.json file in the simulation_config/ directory.</reply>
I now proceed to give some line-by-line comments -
Page 3:
Line 27: <done>Please define what is meant by "high" energy electrons. How dominant is elastic scattering over inelastic in this energy range?
</done><br> <reply>We have rephrased this completely. High-energy electrons usually refers to energies near the endpoint of beta decay. </reply>
Line 32: <done>I don't know what is meant by "ab initio" in this sentence.
</done><br><reply>We have omitted "ab initio" preserving the original meaning</reply>
Line 38: <done>The definition of a Markov chain is that the process depends only on current state but not on past history of the system. But as described later, there appear to nonlinear feedback terms where the path of the electron depends on other interactions in its history like the possible creation of ions that lead to further recombination. So it seems a Markov chain may not be an ideal description here?
</done><br><reply>We agree that the final implementation of the code - due to the use of the recombination technique - is no longer a Markov chain. The use of the term "Markov" in this paragraph is on the other hand superfluous.</reply>
Line 35: <done>clarify somehow that the spectrum referred to here is the one before any scattering interactions.
</done><br><reply>This should be much more concise now.</reply>
Line 40: <done>It is not clear what is meant by the "whole energy range"</done><br><reply>We have tried to clarify this part.</reply>
Line 41: <done>I find this description very confusing. It is not clear what the authors mean by a "branch", what constitutes a "new branch" or an "initial branch", and what is meant by the idea of the branches "feeding back". I have a feeling that the authors have a mental model of the process in mind but have not explained this model to the reader by this point.</done><br><reply>We have rephrased the whole branch thing and have tested the text with an independent researcher... We hope that the current version is now understandable.</reply>
Page 4:
Line 13: <done>"High resolution" -> resolution in what quantity? What does high mean in this context? I also don't understand what phase space evolution would necessarily be expected to have better or worse resolution than particle tracking MC.</done><br><reply>We have tried to explain this in more detail. In fact we are developing a very boiled down version of the phasespace solver, but a reasonable comparison of the two approaches is rather complex. We can however acknowledge that the phasespace code is only feasible for 1D simulations...</reply>
Line 24: <done>mention the mean free path used to sample a poisson process (as written it suggests a fixed distance step)</done><br> <reply> The equation for the mean free path is given right after this text. </reply>
Line 28: <done> "density is proportional to cumulated time" - presumably it depends not only on the time but also on the flux into the segment and also the volume of the segment? How large are the segments? Is there variability of density across those segments?</done> <br><reply> It is of course completely valid to calculate the time integral of the in- and outflux at the boundaries which would give the density inside the boundaries via the continuity equation. We use an equivalent formulation: With the known number of total particles one can calculate the fraction of time spent within one specific part of the simulation volume. The time fraction is then translated into a density fraction. This is explained later in the paper in more detail. The formulation of course only yields an average density. </reply>
Line 31: <done>"likeliness of recombination" → "rate of recombination"?</done> <br> <reply> We have reworded the sentence to make the original intent clearer </reply>
Page 5:
Line 21: <done>mean free path has been used earlier, introduce the acronym then.</done><br><reply>We have introduced the acronym earlier in the text.</reply>
Page 9:
<done>"Additionally, the particle class only accepts…" → the relevance of this comment is not clear to me. What would be the alternative?</done><br> <reply> We have removed that sentence since it was indeed superfluous. </reply>
Page 10: <done>"The density fields need a higher resolution than the density difference". Why? Can you be quantitative about the scale of error introduced with some different resolutions? Perhaps a plot showing the accuracy for a few choices?</done><br><reply>The mean free path can only be calculated on the base of local quantities. When particles move through large density differences this may cause a problem. Our solution to the problem is to stop motion at boundaries and rolling the mfp again. The practical effect on the other hand is minimal: For all simulations the maximum distance is significantly smaller anyway.</reply>
Page 11-12: <done> It reads oddly that the drift mover is treated in so much more analytical detail than the Boris one. I suggest to balance these better, ideally increasing the level of description of the Boris approach to match the drift one. I would also like to see some performance comparisons of these two options, in terms of simulation time and performance. Some general discussion is given as to why the user may choose one or other, but an evaluation of how well they work in some realistic test cases seems relevant here.</done><br><reply>Being very familiar with the Boris push we felt that the drift mover needed more attention. This decision was obviously too biased. It has been corrected now.</reply>
Page 13: <done>
I see that trapped particles are killed by the simulation. But doesnt this invalidate the density field calculation, since trapped particles should have a very long retention time and hence contribute a lot to the density? Do trapped particles also</done><br><reply>You are essentially correct: Dumping particles could invalidate the density fields. This is a somewhat delicate choice of the max interaction counter. We have added some plots showing which max interaction numbers yield correct density fields. </reply>
Line 36: <done>what does "macroscopic" mean in this sentence?</done> <br> <reply> We have removed the mention of the "macroscopic cross section" entirely and have specified that it is the cross section scaled by the density of the target specie. </reply>
Figure 1: <done>Don't the ions and electrons - especially trapped ones - contribute to the space charge in the volume, and hence affect the E and B fields? So shouldn't there be a line "into" the E and B fields box from somewhere? How are the effects of space charge handled in general?</done> <br> <reply> KARL itself currently has no capability to solve the poisson equation to obtain the electric field from the space charge. Both the electric and magnetic fields created by the charged particles have to be calculated from external plasma simulations (as mentioned at the end of section 1) and be used as an input for a following simulation with KARL.</reply>
General comment: <done>for each kind of interaction I recommend to include an equation so its clear to the reader what the process is, e.g. "elastic scattering e + X -> e+ X, where X=[T2, ….or whatever else]". I understand that the code is written to allow flexibility so these can be extended, but explaining what is implemented now will help the reader understand the role of each process.</done> <br> <reply> We have included an example for each interaction in the proposed way. However, we refrained from the usage of "X" since that would unnecessarily complicate the examples. </reply>
Page 14: <done>Elastic scattering: please include figures of the various cross sections, indicating the models that are combined, the data, and the version recommended for use in simulations in KARL.</done><br><reply>This has been updated.</reply>
Line 40: <done>"for tracked particles the drift velocity is assumed to be zero and the density field". Why is this a valid assumption? I can imagine a particle making gyro orbits has a typical velocity much larger than its mean drift velocity, for example.</done><br><reply>This sentence has been extremely misleading - we have removed it completely.</reply>
Line 44: <done>the description here is confusing. Presumably theta and phi are drawn in the COM frame and then mapped to lab frame, not vice versa, right? It reads here as if they are randomly drawn in the lab frame, if thats so please explain why and how.</done>
<br><reply> As before we have clarified the use of lab and COM frame, which should solve this problem.</reply>
Clustering: <done>please include a figure with the cross sections. It is actually not totally clear here what clustering interactions are considered (what exactly is the initial state and what is the final state), can you explain it more explicitly? Please also briefly explain the approaches taken in refs 15,16 to evaluate these cross sections.</done><br><reply>As for many other processes also here more plots and equations are given. With regard to Ref 19&20 (formerly Ref 15&16) we now point out that this has been determined experimentally. We do not feel qualified to explain the process better than the original authors.</reply>
Page 15: <done>Recombination: please include a figure giving the cross sections from data and recommended cross section for use in KARL. Briefly explain the approaches taken in 17,18,19 to measure or evaluate these cross sections. Also, can you comment on whether recombination strictly two body or if three body effects are improtant, for example?</done><br><reply>As above we have added plots a short mention about the method of cross section determination.</reply>
Charge exchange: <done>please give figures, equation for process, brief discussion on how its measured.</done><br><reply>Figures have been added.</reply>
Excitation: <done>same comment as above.</done><br><reply></reply>
Page 16: <done>Line 15: Shouldn't the ionization energy threshold be applied in the center of mass frame? Text suggests it is in the lab frame. Please also give plots of cross sections etc.</done><br><reply>You are completely right, this has been corrected. "A few" cross section plots have been added. </reply>
Page 17: <done> "the fastest axis refers to the axis for which the entry can be accessed the quickest". This note doesn't make sense to me; my understanding is that to access a 4D array you give 4 coordinates A[j,k,l,m]. Please clarify in what sense any axis is quicker than any other.</done><br> <reply> We have added a sentence about it being an effect of caching. "fastest axis" for multi-dimensional arrays typically refers to the axis which is stored in the neighboring memory cells. </reply>
<done>On this page the text is quite verbose with some things being repeated in multiple sentences. I recommend to edit and condense this section.
<br>Page 18:
First paragraph of this section seems verbose, can be trimmed down.
<br>Line 41: I don't understand why the sentence begins "However," -this seems to imply something in contradiction to the previous paragraph, but it is not. Instead consider "Alternatively,"</done><br>
<reply> We have rephrased this paragraph.</reply>
Line 53: <done>what is the meaning of either "reasonable" and "robust" in this context?</done><br><reply>We have changed this to physically correct and low-noise</reply>
Line 55: <done>This is the first mention of rotation. Where is the physics of molecular rotation included? Is it improbable? How much so? Please expand.</done><br><reply>After internal discussions we have reached the conclusion that mentioning molecular rotation at this stage is unnecessary. </reply>
Page 19:
Line 40: <done>I think "however" is an odd construction here. I would suggest to begin with "the injector class can be configured in a number of ways. The most commonly used is…". And later, "another approach to injection is…"</done><br> <reply> The "however" was removed </reply>
Figure 3: <done>Please explain "weak scaling" and "Ideal" in this figure.</done> <br> <reply> We have added a short explanation of the figure in the text. </reply>
Page 21:
Line 16: <done>less than 1Gb, but for how many events?</done> <br> <reply> As mentioned in the text of the paper, the output size does not (directly) depend on the number of events. It mainly depends on the resolution of the simulation domain, as that dictates the size of the arrays to be stored. Furthermore it also depends on the number of output steps the user wants to keep. </reply>
<done>Lines 20-21: I find it hard to understand what this sentence is trying to tell me.</done><br><reply>The mentioned generators are pieces of code responsible for creating specific objects. Since they are just an implementation detail, that is unimportant wrt to the the creation of an JSON parameter file, the mention of the generators has been removed.</reply>
Line 37: <done>Value has to be provided by its value and its unit; dual use of the word value, seems circular?</done> <br> <reply> We have rephrased this sentence to be more clear in the division of physical vs numerical value. </reply>
<done>Line 42: "Functions are an integral part of the code", is this not a statement about code in general, or perhaps even mathematics in general?</done><br><reply>We have removed this more philosophical statement.</reply>
Line 42: <csfs> More generally in this section it seems far too many words are spent explaining concepts that any user of this code will already know, and can be easily inferred from reading the source code, for example, explaining what a scalar or vector field is. It seems that lines P21 L42 - Page 22 L33 could be replaced with a single sentence, "the code implements utility classes for functions returning scalar fields, and three kinds of vector fields (constant vector, Z-pointing vector, and generic vector)", for example.</csfs> <br> <reply> We agree that the explanation of these concepts is unnecessary, so we have removed the corresponding parts. However, this section is intended to show the possible options the user can choose within a parameter file. And while the names of the options were chosen to imply their respective function, we think it is still beneficial to state it explicitly. </reply>
Page 24:
<done>
The particle queue is introduced, and then it is clarified that it is not a queue. The code design seems appropriate, but can't the authors then rename it to something other than a queue, since it is not one??</done><br><reply>The queue is now a list</reply>
Test cases section:
<done>
The test provided is one useful unit test. But it does not seem to me to be as generic a test as the authors claim, since recovery of the Maxwell Boltzmann distribution after thermalization is a very generic expectation and would happen in any energy and momentum-conversing system where the particle kinematics are randomized by interactions with background gas - this test would pass even if the various interactions, geometry, etc were implemented dramatically wrongly. Some more strenuous tests (compared to either data or calculated expectations) would seem to me to be appropriate to validate the code, here.</done> <br> <reply> We have extended the test cases section by a test for each of the implemented interactions. We agree that due to the H-theorem any collision dominated particle distribution will thermalize. The other tests are therefore more sophisticated. </reply>
Page 26:
<done> Ref [7] is referenced heavily here. I think it is not really appropriate to defer all discussions of tests and results to another paper - if it is not a self contained reference to the code, its not so clear what the purpose of the current paper is. I suggest:
Include results of tests here and
Ensure they are implemented as example scripts in the code base.</done><br><reply>
We have followed your suggestion and moved a number of results and many tests - the majority of those are not included in [7] - in the paper. We would like to point out that the primary purpose of this paper is the distribution of simulation tools which are required by the community. </reply>
Page 27:
Line 15-24 <done>a lot of claims are given here in a short space it is not obvious from the results presented that this is the interpretation. Can the authors provide more plots or quantitative arguments to demonstrate that the observed distributions are a result of the expected dynamics of clustering?</done><br><reply>We have now added the cross section graph for the clustering and also several plots showing the composition of the species. It seems evident for us that with growing distance from the center the tritium ions undergo clustering processes. </reply>