5. Visualization & Output

In general, simulation results are either available as particle data, spatially resolved variables based on the mesh (classic CFD results) and/or as integral values (e.g. for reservoir/heat bath simulations). The piclas2vtk tool converts the HDF5 files generated by PICLas to the binary VTK format, readable by many visualization tools like ParaView and VisIt. The tool is executed by

piclas2vtk [posti.ini] output.h5

Multiple HDF5 files can be passed to the piclas2vtk tool at once. The (optional) runtime parameters to be set in posti.ini are given below:

Option

Default

Description

NVisu

1

Number of points at which solution is sampled for visualization

VisuParticles

OFF

Converts the particle data (positions, velocity, species, internal energies)

NodeTypeVisu

VISU

Node type of the visualization basis: VISU,GAUSS,GAUSS-LOBATTO,CHEBYSHEV-GAUSS-LOBATTO

In the following, the parameters enabling the different output variables are described. It should be noted that these parameters are part of the parameter.ini required by PICLas.

5.1. Particle Data

At each Analyze_dt as well as at the start and end of the simulation, the state file (*_State_*.h5) is written out, which contains the complete particle information such as their positions, velocity vector, species and internal energy values.

To sample the particles impinging on a certain surface between Analyze_dt outputs, the following option can be enabled per boundary condition

Part-Boundary1-BoundaryParticleOutput = T

The particle data will then be written to *_PartStateBoundary_*.h5 and includes besides the position, velocity vector and kinetic energy (in eV), additionally the impact obliqueness angle between particle trajectory and surface normal vector, e.g. an impact vector perpendicular to the surface corresponds to an impact angle of \(0^{\circ}\). This allows you to create a histogram of the particle impacts in the post-processing.

The output of lost particles in a separate *_PartStateLost*.h5 file can be enabled by

CountNbrOfLostParts = T

It includes particles lost during the tracking (TrackingMethod = triatracking, tracing) as well as during the restart procedure. For the latter, the output includes particles that went missing but were found on other processors.

5.2. Field Solver and PIC

The following table summarizes the available fields in connection with Poisson’s or Maxwell’s equations (some require a particle solver to be active) that can be stored to the state file (*_State_*.h5) file at every Analyze_dt as well as at the start and end of the simulation

Option

Default

Description

Poisson

Maxwell

PIC-OutputSource

F

charge \(\rho\) and current density \(j\)

yes

yes

CalcElectricTimeDerivative

F

time derivative \(\frac{\partial D}{\partial t}=\varepsilon_{r}\varepsilon_{0}\frac{\partial E}{\partial t}\)

yes

no

CalcPotentialEnergy

F

potential field energy of the EM field

yes

yes

Charge and current density: When running a PIC simulation, the particle-grid deposited properties, such as charge and current densities (in each direction x, y,and z) can be output by enabling

PIC-OutputSource = T

that stores the data in the same format as the solution polynomial of degree \(N\), i.e., \((N+1)^{3}\) data points for each cell.

Displacement current: The temporal change of the electric displacement field \(\frac{\partial D}{\partial t}=\varepsilon_{r}\varepsilon_{0}\frac{\partial E}{\partial t}\) can be stored for Poisson’s equation (PICLAS_EQNSYSNAME=poisson) by setting

CalcElectricTimeDerivative = T

Again, the data in the same format as the solution polynomial of degree \(N\), i.e., \((N+1)^{3}\) data points for each cell in the container DG_TimeDerivative in the *_State_*.h5 file and can be converted to .vtk format with piclas2vtk. Furthermore, the integrated displacement current that traverses each field boundary (except periodic BCs) can be analyzed over time and is written to FieldAnalyze.csv, for details see Section Field Variables.

Potential field energy: The global energy that is stored within the electric and the magnetic field can be analyzed over time by setting

CalcPotentialEnergy = T

and is written to FieldAnalyze.csv, for details see Section Field Variables.

5.2.1. Element-polynomial field properties

In general, the data is the same format as the solution polynomial of degree \(N\), i.e., \((N+1)^{3}\) data points for each cell in the respective container in the .h5 files and can be converted to .vtk format with piclas2vtk. The resolution of the converted data can be adjusted by setting NVisu to any integer value, which is the used for the interpolation of the original data.

The following table summarizes the available fields in connection with Poisson’s or Maxwell’s equations

Option

Default

Description

Poisson

Maxwell

CalcEMFieldOutput

F

external electric \(\textbf{E}\) and magnetic \(\textbf{B}\) field

yes

yes

External electromagnetic field vector When using external electromagnetic fields, either via a constant vector

PIC-externalField = (/ 0.0, 0.0, 0.0, 0.0, 0.0, 0.0 /)

or a cell-local polynomial distribution calculated via superB by

PIC-BGFileName = BGField.h5

the resulting electromagnetic field, that is used by the PIC solver in addition to the calculated fields (superposition), can be visualized via

CalcEMFieldOutput = T

and the resulting data (vector fields for E and B) is stored in PROJECT_PIC-EMField.h5.

5.2.2. Element-constant field/particle properties

The determined properties are given by a single value within each cell and are NOT sampled over time as opposed to the output described in Section Particle Flow and Surface Sampling. These parameters are only available for PIC simulations, are part of the regular state file (as a separate container within the HDF5 file) and automatically included in the conversion to the VTK format. They are written to PROJECT_Solution_000.000*.h5 and after conversion are found in PROJECT_ElemData_000.000*.vtu.

The following table summarizes the available fields in connection with Poisson’s or Maxwell’s equations

Option

Default

Description

Poisson

Maxwell

CalcCoupledPower

F

absorbed power by charged particles due to electro(-magnetic) fields

yes

yes

CalcPlasmaFreqeuncy

F

(cold) plasma frequency depending on the electron particle number density

yes

yes

CalcPICTimeStep

F

PIC time step resolution depending on the (cold) plasma frequency

yes

yes

CalcDebyeLength

F

Debye length depending on the electron temperature and particle number density

yes

yes

CalcPointsPerDebyeLength

F

PIC spatial resolution depending on the element size and the Debye length

yes

yes

CalcPICCFLCondition

F

single parameter combining plasma frequency and Debye length criterion

yes

yes

CalcMaxPartDisplacement

F

largest displacement of a particle within one time step related to the cell size

yes

yes

CalcPICTimeStepCyclotron

F

PIC time step resolution depending on the cyclotron frequency (magnetic field)

yes

yes

CalcCyclotronFrequency

F

cyclotron frequency of charged particles in magnetic fields

yes

yes

Power Coupled to Particles The energy transferred to particles during the push (acceleration due to electromagnetic fields) is determined by using

CalcCoupledPower = T

which calculates the time-averaged power (moving average) coupled to the particles in each cell (average power per cubic metre) and stores it in PCouplDensityAvgElem for each species separately. Additionally, the properties PCoupl (instantaneous) and a time-averaged (moving average) value PCoupledMoAv are stored in the ParticleAnalyze.csv output file.

Plasma Frequency The (cold) plasma frequency can be calculated via

\[\omega_{p}=\omega_{e}=\sqrt{\frac{e^{2}n_{e}}{\varepsilon_{0}m_{e}}}\]

which is the frequency with which the charge density of the electrons oscillates, where \(\varepsilon_{0}\) is the permittivity of vacuum, \(e\) is the elementary charge, \(n_{e}\) and \(m_{e}\) are the electron density and mass, respectively. The calculation is activated by

CalcPlasmaFreqeuncy = T

and the output container for the data is labelled PlasmaFrequencyCell. Note that this output is only performed for elements that are considered valid, which is also stored as a separate container PICValidPlasmaCell (1: True, 0: False). The criterion that an element is valid is that a quasi-neutral plasma should be present in the element for plasma and parameters to be meaningful. Therefore, the quasi-neutrality parameter must be above 0.5 and at least 20 particles present in the considered element, independent of their charge value.

PIC Particle Time Step The maximum allowed time step within the PIC schemes can be estimated by

\[\Delta_{t,\mathrm{PIC}}<\frac{0.2}{\omega_{p}}\]

where \(\omega_{p}\) is the (cold) plasma frequency (only calculated for valid elements, see above). The calculation is activated by

CalcPICTimeStep = T

and the output container for the data is labelled PICTimeStepCell. An additional output to PartAnalyze.csv is the percentage of elements that do not meet the PIC time step criterion via the column -PercentResolvedPICTimeStep.

Debye length The Debye length can be calculated via

\[\lambda_{D}=\sqrt{\frac{\varepsilon_{0}k_{B}T_{e}}{e^{2}n_{e}}}\]

where \(\varepsilon_{0}\) is the permittivity of vacuum, \(k_{B}\) is the Boltzmann constant, \(e\) is the elementary charge and \(T_{e}\) and \(n_{e}\) are the electron temperature and density, respectively. The Debye length measures the distance after which the magnitude of the electrostatic potential of a single charge drops by \(1/\text{e}\). The calculation is activated by

CalcDebyeLength = T

and the output container for the data is labelled DebyeLengthCell. Again, this output is only created for valid elements, see above for details.

Points per Debye Length The spatial resolution in terms of grid points per Debye length can be estimated via

\[\mathrm{PPD}=\frac{\lambda_{D}}{\Delta x}=\frac{(p+1)\lambda_{D}}{L}\sim 1\]

where \(\Delta x\) is the grid spacing (average spacing between grid points), \(p\) is the polynomial degree of the solution, \(\lambda_{D}\) is the Debye length and \(L=V^{1/3}\) is the characteristic cell length, which is determined from the volume \(V\) of the grid cell. Furthermore, the calculation in each direction \(x\), \(y\) and \(z\) is performed by setting \(L=\left\{ L_{x}, L_{y}, L_{z} \right\}\), which are the average distances of the bounding box of each cell. These values are especially useful when dealing with Cartesian grids. The calculation is activated by

CalcPointsPerDebyeLength = T

and the output container for the 3D data is labelled PPDCell3D. Furthermore, a container for each spatial coordinate is created, which are labelled PPDCellDirX, PPDCellDirY and PPDCellDirZ, respectively. As for the PIC time step, an additional output to PartAnalyze.csv is the percentage of elements that do not meet the PPD criterion in 3D and for each spatial direction. There are four columns in the PartAnalyze.csv file for the Debye criterion, -PercentResolvedPPD3, -PercentResolvedPPDX, -PercentResolvedPPDY and -PercentResolvedPPDZ, respectively.

PIC CFL Condition The plasma frequency time step restriction and the spatial Debye length restriction can be merged into a single parameter

\[\frac{\Delta t}{0.4 \Delta x}\sqrt{\frac{k_{b}T_{e}}{m_{e}}}= \frac{(p+1)\Delta t}{0.4 L}\sqrt{\frac{k_{b}T_{e}}{m_{e}}} \lesssim 1\]

where \(\Delta t\) is the time step, \(\Delta x\) is the grid spacing (average spacing between grid points), \(p\) is the polynomial degree of the solution, \(k_{B}\) is the Boltzmann constant, \(T_{e}\) and \(m_{e}\) are the electron temperature and mass, respectively. Furthermore, the calculation in each direction \(x\), \(y\) and \(z\) is performed by setting \(L=\left\{ L_{x}, L_{y}, L_{z} \right\}\), which are the average distances of the bounding box of each cell. These values are especially useful when dealing with Cartesian grids. The calculation is activated by

CalcPICCFLCondition = T

and the output container for the 3D data is labelled PICCFL3D. Furthermore, a container for each spatial coordinate is created, which are labelled PICCFLDirX, PICCFLDirY and PICCFLDirZ, respectively.

Maximum Particle Displacement The largest displacement of a particle within one time step \(\Delta t\) is estimated for each cell via

\[\frac{\mathrm{max}(v_{\mathrm{iPart}})\Delta t}{\Delta x}=\frac{(p+1)\mathrm{max}(v_{\mathrm{iPart}})\Delta t}{L} < 1\]

which means that the fastest particle is not allowed to travel over the length of two grid points separated by \(\Delta x\). Furthermore, the calculation in each direction \(x\), \(y\) and \(z\) is performed by setting \(L=\left\{ L_{x}, L_{y}, L_{z} \right\}\), which are the average distances of the bounding box of each cell. These values are especially useful when dealing with Cartesian grids. The calculation is activated by

CalcMaxPartDisplacement = T

and the output container for the 3D data is labelled MaxPartDisplacement3D. Furthermore, a container for each spatial coordinate is created, which are labelled MaxPartDisplacementDirX, MaxPartDisplacementDirY and MaxPartDisplacementDirZ, respectively.

Electron Cyclotron Motion The gyrokinetic or cyclotron motion of electrons can be analyzed by calculating the cyclotron frequency for the non-relativistic case

\[\omega_c = \frac{eB}{m_{e}}\]

Symbol

Parameter

\(\omega_c\)

cyclotron frequency (non-relativistic)

\(e\)

elementary charge (of an electron, absolute value)

\(B\)

magnitude of the magnetic flux density at the electron’s position

\(m_e\)

electron rest mass

or if the electron velocity is considered to be relativistic (automatic switch), the following formula is used

\[\omega_c = \frac{eB}{\gamma m_e} = \frac{eB}{m_e\sqrt{1-v_e^2/c^2}}\]

Symbol

Parameter

\(\omega_c\)

cyclotron frequency (relativistic)

\(e\)

elementary charge (of an electron, absolute value)

\(B\)

magnitude of the magnetic flux density at the electron’s position

\(\gamma\)

Lorentz factor

\(m_e\)

electron rest mass

\(v_e\)

magnitude of velocity

\(c\)

speed of light

and, hence, the required time step (Boris push)

\[\Delta t = \frac{0.02}{\omega_c}\]

to resolve the gyro motion adequately by setting the following two parameters

CalcPICTimeStepCyclotron = T
CalcCyclotronFrequency   = T

The first activates the calculation of the smallest time step in each cell (only regarding the cyclotron motion, not other restrictions) and the second activates the calculation of the min/max value of the cyclotron frequency (and also radius) for each cell. The containers that are written to .h5 (and converted to .vtu) are

PICTimeStepCyclotronCell

for the time step restriction and

CyclotronFrequencyMaxCell
CyclotronFrequencyMinCell
GyroradiusMinCell
GyroradiusMaxCell

for the cyclotron frequency and radius (min/max values).

5.2.3. Time-averaged Fields

At each Analyze_dt and at the end of the simulation, additional time-averaged field properties can be written to *_TimeAvg_*.h5 by enabling

CalcTimeAverage = T

where the averaging will take place over the time spanned between two Analyze_dt outputs. The time-averaged values and fluctuations are selected via VarNameAvg and VarNameFluc, depending on the equation system that is solved (Poisson or Maxwell). These properties are stored in the same format as the solution polynomial of degree \(N\), i.e., \((N+1)^{3}\) data points for each cell. For Maxwell’s equations, the following properties are available

VarName{Avg,Fluc} = ElectricFieldX
VarName{Avg,Fluc} = ElectricFieldY
VarName{Avg,Fluc} = ElectricFieldZ
VarName{Avg,Fluc} = MagneticFieldX
VarName{Avg,Fluc} = MagneticFieldY
VarName{Avg,Fluc} = MagneticFieldZ
VarName{Avg,Fluc} = Phi
VarName{Avg,Fluc} = Psi
VarName{Avg,Fluc} = ElectricFieldMagnitude
VarName{Avg,Fluc} = MagneticFieldMagnitude
VarName{Avg,Fluc} = PoyntingVectorX
VarName{Avg,Fluc} = PoyntingVectorY
VarName{Avg,Fluc} = PoyntingVectorZ
VarName{Avg,Fluc} = PoyntingVectorMagnitude

and for Poisson’s equation

VarName{Avg,Fluc} = Phi
VarName{Avg,Fluc} = ElectricFieldX
VarName{Avg,Fluc} = ElectricFieldY
VarName{Avg,Fluc} = ElectricFieldZ
VarName{Avg,Fluc} = ElectricFieldMagnitude

In case of a PIC simulation, the particle-grid deposited properties (via the user-selected deposition method) are also available via VarNameAvg and VarNameFluc

VarName{Avg,Fluc} = PowerDensityX-Spec0x
VarName{Avg,Fluc} = PowerDensityY-Spec0x
VarName{Avg,Fluc} = PowerDensityZ-Spec0x
VarName{Avg,Fluc} = PowerDensity-Spec0x
VarName{Avg,Fluc} = ChargeDensity-Spec0x
VarName{Avg,Fluc} = ChargeDensityX-Spec0x
VarName{Avg,Fluc} = ChargeDensityY-Spec0x
VarName{Avg,Fluc} = ChargeDensityZ-Spec0x
VarName{Avg,Fluc} = ChargeDensity-Spec0x

which must be supplied for each particle species x separately.

5.3. Particle Flow and Surface Sampling

Flow field and surface outputs are available when the DSMC, BGK and FP methods are utilized (standalone or coupled with PIC) and stored in *_DSMCState_*.h5. A sampling over a certain number of iterations is performed to calculate the average macroscopic values such as number density, bulk velocity and temperature from the microscopic particle information. Two variants are available in PICLas, allowing to sample a certain amount of the simulation duration or to sample continuously during the simulation and output the result after the given number of iterations.

The first variant is usually utilized to sample at the end of a simulation, when the steady state condition is reached. The first parameter Part-TimeFracForSampling defines the percentage that shall be sampled relative to the simulation end time \(T_\mathrm{end}\) (Parameter: TEnd)

Part-TimeFracForSampling = 0.1
Particles-NumberForDSMCOutputs = 2

Particles-NumberForDSMCOutputs defines the number of outputs during the sampling time. Example: The simulation end time is \(T_\mathrm{end}=1\), thus sampling will begin at \(T=0.9\) and the first output will be written at \(T=0.95\). At this point the sample will NOT be resetted but continued. Therefore, the second and last output at \(T=T_\mathrm{end}=1.0\) is not independent of the previous result but contains the sample of the complete sampling duration. It should be noted that if a simulation is continued at e.g. \(T=0.95\), sampling with the given parameters will begin immediately.

The second variant can be used to produce outputs for unsteady simulations, while still to be able to sample for a number of iterations (Parameter: Part-IterationForMacroVal). The first two flags allow to enable the output of flow field/volume and surface values, respectively.

Part-WriteMacroVolumeValues = T
Part-WriteMacroSurfaceValues = T
Part-IterationForMacroVal = 100

Example: The simulation end time is \(T_\mathrm{end}=1\) with a time step of \(\Delta t = 0.001\). With the parameters given above, we would sample for 100 iterations up to \(T = 0.1\) and get the first output. Afterwards, the sample is deleted and the sampling begins anew for the following output at \(T=0.2\). This procedure is repeated until the simulation end, resulting in 10 outputs with independent samples.

Parameters indicating the quality of the simulation (e.g. the maximal collision probability in case of DSMC) can be enabled by

Particles-DSMC-CalcQualityFactors = T

Output and sampling on surfaces can be enabled by

Particles-DSMC-CalcSurfaceVal = T

By default this will include the species-specific impact counter per iteration of simulation particles, the force per area in \(x\), \(y\), and \(z\) and the heat flux. The output of the surface-sampled data is written to *_DSMCSurfState_*.h5. Additional surface values can be sampled by using

CalcSurfaceImpact = T

which calculates the species-dependent averaged impact energy (trans, rot, vib, elec), impact vector, impact obliqueness angle (between particle trajectory and surface normal vector, e.g. an impact vector perpendicular to the surface corresponds to an impact angle of \(0^{\circ}\)), number of real particle impacts over the sampling duration and number of real particle impacts per area per second.

5.3.1. Electronic excitation

To sample the cell-local excitation of electronic energy levels, an additional flag has to be set

Part-SampleElectronicExcitation = T

This option adds an additional container to the DSMCState output, which after a successful conversion with piclas2vtk will produce an additional file *_visuExcitationData_*.vtu. Here the excitation rate is given per second [1/s] for each electronic level. This option is currently only supported with the cross-section based electronic excitation (see Section Cross-section based electronic relaxation probability).

5.4. Integral Variables

This analysis measures integral values from the field- and/or particle-solver data over time and writes different .csv files. Mainly field-related data is stored in FieldAnalyze.csv, whereas particle-related analysis is divided into mostly global data in PartAnalyze.csv and surface data in SurfaceAnalyze.csv. Some information might be scattered across different files if multiple things such as fields and particles/surfaces are involved.

5.4.1. Field Variables

The output of properties regarding Maxwell’s or Poisson’s field solver are written to FieldAnalyze.csv. If this analysis is not required in each time step, the parameter Field-AnalyzeStep (default is 1) can be set to an integer greater or equal 1.

Option

Default

Description

Poisson

Maxwell

CalcElectricTimeDerivative

F

time derivative \(\frac{\partial D}{\partial t}=\varepsilon_{r}\varepsilon_{0}\frac{\partial E}{\partial t}\)

yes

no

CalcPotentialEnergy

F

potential field energy of the EM field

yes

yes

CalcBoundaryFieldOutput

F

electric potential at user-specified boundaries

yes

no

Displacement current: The temporal change of the electric displacement field \(\frac{\partial D}{\partial t}=\varepsilon_{r}\varepsilon_{0}\frac{\partial E}{\partial t}\) can be stored for Poisson’s equation (PICLAS_EQNSYSNAME=poisson) by setting

CalcElectricTimeDerivative = T

The integrated displacement current that traverses each field boundary (except periodic BCs) can be analyzed over time and is written to FieldAnalyze.csv for each boundary separately, e.g. “007-ElecDisplCurrent-001-BC_left”. The electric displacement current is also considered when the total electric current on specific surfaces is calculated, for details see BoundaryParticleOutput (BPO) in Section Surface Variables.

Potential field energy: The global energy that is stored within the electric and the magnetic field can be analyzed over time by setting

CalcPotentialEnergy = T

and is written to FieldAnalyze.csv, e.g. “002-E-El” and “003-E-Mag” (magnetic energy is only calculated for Maxwell’s equations’). Additionally, but only when solving Maxwell’s equations, the energy stored in the divergence correction fields “004-E-phi” and “005-E-psi” as well as the total potential energy “006-E-pot”, respectively, can be analyzed.

Boundary Field Output The electric potential for specific boundaries can be analyzed over time by setting

CalcBoundaryFieldOutput = T
BFO-NFieldBoundaries    = 3         ! Nbr of boundaries
BFO-FieldBoundaries     = (/1,3,5/) ! Field-Boundary1, 3 and 5

where BFO-NFieldBoundaries defines the number of boundaries that are of interest and BFO-FieldBoundaries the boundary IDs of the field boundaries where the electric potential is to be recorded. Note that this output is only meaningful when a scalar potential is used on the corresponding boundary. Therefore, this output is only available for certain BCTypes, e.g., 2, 4, 5 and 6. The output is written to FieldAnalyze.csv for each boundary separately, e.g. “006-BFO-boundary001”.

5.4.2. Particle Variables

PIC resolution parameters: Information regrading the global percentage of elements that fulfill the PIC resolution criteria in time (max. PIC time step) and space (Debye length) can be written to PartAnalyze.csv. For further details and how this analysis are activated, see Section Element-constant field/particle properties.

5.4.3. Surface Variables

The output for different measurements involving particles and surfaces is written to SurfaceAnalyze.csv. If this analysis is not required in each time step, the parameter Surface-AnalyzeStep (default is 1) can be set to an integer greater or equal 1. Some values are sampled only during one time step and others are accumulated over the number of time steps defined by Surface-AnalyzeStep.

Parameter

Parameter

CalcElectronSEE

Secondary electron emission current for each Part-Boundary with SEE model

CalcBoundaryParticleOutput

Particle flux for each user-defined Part-Boundary and Part-Species

Secondary Electron Emission When CalcElectronSEE=T is activated, the secondary electron emission current (on all surfaces where such a model is used) is calculated and written to SurfaceAnalyze.csv. Note that all secondary electrons between two outputs are accumulated and divided by the time difference between these outputs. Hence, the averaging time can be adjusted using Surface-AnalyzeStep. The output in the .csv file will be similar to this example: 012-ElectricCurrentSEE-BC_WALL

BoundaryParticleOutput (BPO): The flux of particles crossing boundaries where they are removed can be calculated by setting CalcBoundaryParticleOutput = T. Additionally, the boundaries and species IDs must be supplied for which the output is to be created. This is done by setting

CalcBoundaryParticleOutput = T        ! Activate the analysis
BPO-NPartBoundaries        = 2        ! Nbr of particle boundaries where the flux and current are measured
BPO-PartBoundaries         = (/4,8/)  ! Only measure the flux and current on Part-Boundary4 and Part-Boundary8
BPO-NSpecies               = 2        ! Nbr of species that are considered for Part-Boundary4 and Part-Boundary8
BPO-Species                = (/2,3/)  ! Species IDs which should be included

where the number of boundaries and species as well as the corresponding IDs are defined. The other boundaries and species IDs will be ignored. Note that this feature is currently only implemented for boundaries of type Part-BoundaryX-Condition = open and Part-BoundaryX-Condition = reflective. The reflective BC must also use either species swap via Part-BoundaryX-NbrOfSpeciesSwaps or a secondary electron emission surface model via Part-BoundaryX-SurfaceModel. The output in the .csv file will be similar to this example: 004-Flux-Spec-002-BC_CATHODE Additionally, the total electric current will be calculated if any species that is selected via BPO-Species carries a charge unequal to zero. Note that only species defined via BPO-Species will be considered in the calculation of the total electric current. Furthermore, the secondary electron emission current is automatically added to the total electric current if CalcBoundaryParticleOutput = T. If the electric displacement current is calculated, it also will be added to the total current, if CalcElectricTimeDerivative = T. The output of the total electric current in the .csv file will be similar to this example: 008-TotalElectricCurrent-BC_ANODE

5.5. Dynamic Mode Decomposition

The dynamic mode decomposition is an algorithm that divides a temporal series into a set of modes which are associated with a frequency and grow/decay rate. The dynamic mode decomposition (DMD) is implemented according to Schmid et al. [69]. To use the DMD tool, it needs to be compiled first. In cmake, set the flag

POSTI_BUILD_DMD = ON (default is OFF)

which creates the executable ./bin/dmd. The input for the DMD tool is provided by a series of state files with a high temporal resolution between each output file in order to capture the relevant frequencies that are to be visualized. To analyze a specific frequency, multiple state files should be created within one period of the oscillation.

Run the DMD executable with the help command to see the available options

./dmd --help

To execute the DMD after a simulation, with e.g. the Maxwell solver, run the command

dmd dmd.ini coaxial_State_000.00*

with an exemplary dmd.ini file

N            = 4
SvdThreshold = 1e-8 ! Define relative lower bound of singular values

where N=4 is the polynomial degree of the solution and SvdThreshold = 1e-8 is used to filter singular values of the DMD.

Depending on the available memory one might have to decrease the number of input state files. After the execution two additional files coaxial_DMD.h5 and coaxial_DMD_Spec.dat will be created. The first file contains the field representation of the different modes and the second file contains the Ritz spectrum of the modes.

5.5.1. Ritz spectrum (coaxial_DMD_Spec.dat)

With the python script plot_RitzSpectrum.py the Ritz spectrum of the DMD can be plotted. The script is placed in the tools folder of piclas. To plot the spectrum execute:

python [PICLAS_DIRECTORY]/tools/plot_RitzSpectrum.py -d coaxial_DMD_Spec.dat

The result is a Ritz spectrum depicting all the calculated modes and their growth rate. On the x-axis the frequency of the modes and on the y-axis the growth/decay factor is plotted, whereat modes with \(\omega_r<0\) are damped. The modes placed directly on the x-axis are the global, the first, the second harmonic mode and so on. The color and size of the plotted modes represent the Euclidian norm of the mode which can be interpreted as an energy norm of the mode.

5.5.2. Mode visualization (coaxial_DMD.h5)

To visualize the field run the following command:

piclas2vtk [posti.ini] coaxial_DMD.h5

The new file coaxial_DMD_000.00000000000000000.vtu now contains multiple modes to visualize. Two additional input parameters are used to control the output of piclas2vtk by placing them in the posti.ini file

dmdSingleModeOutput  = 2  ! only extract mode 002
dmdMaximumModeOutput = 10 ! only extract modes 001-010

The parameter dmdSingleModeOutput is used to convert only a single specific mode to .vtu ignoring all other modes and dmdMaximumModeOutput can be used to dump all output modes up to this number. Note that each mode is written to a separate output file because a single might can become quite large very quickly and is then too large to visualize.