1.4 Time trace output to CSV file

After BlasterSim completes, a CSV spreadsheet with detailed data the simulation is written. This spreadsheet can be opened in a spreadsheet program like Excel or any other program that supports CSV spreadsheets. The name of the spreadsheet is determined by file name of the input file. The file extension of the input file is removed and the file extension csv is used instead in the CSV output. For example, in § 1.8.2 the file name is springer-example.nml, so the spreadsheet is written to springer-example.csv. By default, every 10th time step is written to the CSV file rather than every time step. Every time step would be too detailed and lead to large CSV files. How often the CSV file is written to can be changed with the csv_frequency variable in the inputs. Additionally, all time steps with events that require special treatment from BlasterSim like the plunger hitting the end of the plunger tube in a springer will be written to the CSV file, and the type of event can be determined from the rc column.

The CSV file contains the following columns:

  • t (t): Simulation time. Floating-point number. Units of ms.

  • m_total (mtotal): Total mass in the simulation. Floating-point number. Units of mg. This should remain approximately constant and is present for debugging purposes.

  • e_total (etotal): Total energy in the simulation. Floating-point number. Units of J. This should remain approximately constant and is present for debugging purposes.

  • For each control volume i (for a springer this would be the plunger tube, barrel, atmosphere for the plunger tube, and atmosphere for the barrel):

    • x (xixref,i): Location of the projectile/plunger. More specifically, the distance between the projectile/plunger and a reference location. For plunger tubes, the reference location is picked so that the initial value of x=l_draw and the end of the plunger tube is x=0. For barrels, the reference location is picked to that the initial value of x=0 and the end of the barrel is x=l_travel. Otherwise, xref,i=0. The reference value is necessary to convert between BlasterSim’s internal representation, which can be confusing as it factors in dead volume by adding extra xi, and a more easily understood representation. Floating-point number. Units of m. Not present for constant pressure control volumes like atmospheres.

    • x_dot (x˙i): Velocity of the projectile/plunger. Floating-point number. Units of m/s. Not present for constant pressure control volumes like atmospheres.

    • m_k (mi,k): Mass of gas k. Floating-point number. Units of mg. For constant pressure control volumes (atmospheres), this starts out at zero. This can be used to track leaks to the atmosphere.

    • e_g (ei): Energy of gas. Floating-point number. Units of J. For constant pressure control volumes (atmospheres), this starts out at zero. BlasterSim does not distinguish between work done on a control volume and leaks at the moment, so this being non-zero does not necessarily indicate anything about leaks.

    • p (pi): Pressure of gas. Floating-point number. Units of kPa.

    • temp (Ti): Temperature of gas. Floating-point number. Units of K.

    • rho (ρi): Mass density of gas. Floating-point number. Units of kg/m3. Not present for constant pressure control volumes like atmospheres.

    • e_f (Ef,i): Energy lost due to friction on the projectile/plunger. Floating-point number. Units of J. Not present for one side of a projectile/plunger control volume to avoid double counting.

    • e_s (Es,i): Spring potential energy. Floating-point number. Units of J. Not present for one side of a projectile/plunger control volume to avoid double counting.

    • e_k (Ek,i): Projectile/plunger kinetic energy. Floating-point number. Units of J. Not present for one side of a projectile/plunger control volume to avoid double counting. For control volumes with springs (mspring0 kg), the added mass from the spring is factored in as well. See equation 2.24 for how the spring mass factors in.

    • e_m (Em,i): Energy lost to plunger impact. Floating-point number. Units of J. See § 2.1.9 for details of how this is calculated.

  • rc: Return code of run subroutine. Integer. See § 1.5 for details on the precise meaning of each code.