Constants and units
from pyPALADINServer import * brings in three things besides the classes: the unit constants,
the physical constants, and the value constants that are passed to a Border or a
DumperInstance. All of them are plain numbers, so they can be combined in the usual way.
Units
Every unit constant is 1.0, because PALADIN works in SI units throughout. The names exist to make a script readable and to make unit errors visible:
size = 1*MICRO*METER # 1e-6 m
density = 1000*KILOGRAM*PER(CUBIC(METER))
field = 1*VOLT*PER(METER)
| Quantity | Constants |
|---|---|
| Length | METER, METRE, ANGSTROM, MICRO, NANO, MILLI, CENTI, DECI, KILO, … |
| Time | SECOND, MINUTE, HOUR, DAY, WEEK, MONTH, YEAR |
| Mass | KILOGRAM, GRAM, TON |
| Pressure | PASCAL, BAR, TORR, ATM |
| Temperature | KELVIN |
| Electrical | AMPERE, COULOMB, VOLT, TESLA, HENRY, ELECTRON_VOLT |
| Energy and power | JOULE, WATT, NEWTON |
The SI prefixes run from YOCTO (1e-24) to YOTTA (1e24): DECA, HECTO, KILO, MEGA,
GIGA, TERA, PETA, EXA, ZETTA upward and DECI, CENTI, MILLI, MICRO, NANO,
PICO, FEMTO, ATTO, ZEPTO downward.
Three helpers exist for compound units: SQUARE(x), CUBIC(x) and PER(x), plus LOG_SCALE(x)
for a factor of x decades.
Warning: ATM is defined as 1.01325e3 Pa, which is 1013.25 Pa — a factor of 100 below a
standard atmosphere. Use PASCAL, BAR or TORR for a pressure, or write
1.01325e5*PASCAL explicitly.
Physical constants
| Constant | Value | Unit |
|---|---|---|
ELEMENTARY_CHARGE | 1.6021766208e-19 | C |
AMU | 1.660539040e-27 | kg |
ELECTRON_MASS | 9.10938356e-31 | kg |
BOLTZMANN_CONSTANT | 1.38064852e-23 | J/K |
LIGHT_SPEED | 299792458.0 | m/s |
PLANCK_CONSTANT | 6.626070040e-34 | J·s |
GRAVITATIONAL_ACCELERATION | 9.81 | m/s², always positive |
GRAVITATIONAL_ACCELERATION carries no direction: the sign comes from the vector in the
GRAVITY field, e.g. (0, 0, -GRAVITATIONAL_ACCELERATION) for a z-up geometry.
Wall types
| Constant | Behaviour on impact |
|---|---|
WALL_TYPE_SPECULAR | Mirror reflection; the restitution is the border's elasticity |
WALL_TYPE_DIFFUSE | Re-emitted in a random direction at unchanged speed |
WALL_TYPE_MEMBRANE | No change of velocity, the particle passes through |
Whether the particle adheres after the impact is decided by the adhesion model, not by the wall type.
Size distributions
| Constant | Parameters |
|---|---|
DISTRIBUTION_CONSTANT | size_distribution_param_1 is the radius |
DISTRIBUTION_UNIFORM | param_1 and param_2 are the lower and upper radius |
DISTRIBUTION_LOG_NORMAL | param_1 and param_2 describe the underlying normal distribution of the logarithm |
DISTRIBUTION_WEIBULL | param_1 and param_2 are scale and shape of the Weibull distribution |
Note: the meaning of param_1 and param_2 beyond the constant and the uniform case follows
the distribution formula and is not spelled out in the source. For a quantitative size
distribution, check the resulting radii in the initial dump before running a long case.
Bounding box options
| Constant | Meaning |
|---|---|
BB_SOLID | Closed by a wall |
BB_PERIODIC | Periodic; a particle that leaves enters on the opposite side |
BB_OUT_MIN | Open at the lower coordinate |
BB_OUT_MAX | Open at the upper coordinate |
BB_OUT | Open on both sides |
A particle that leaves through an open boundary is lost and can be written by a loss_dumper.
Dump formats and modes
| Constant | Meaning |
|---|---|
FORMAT_GMSH_POS | Gmsh .pos view file, openable in ParaView and Gmsh |
FORMAT_GMSH_MSH | Gmsh mesh file |
FORMAT_TXT | Plain text table, one row per particle and dump |
FORMAT_EMDI_DMP | Binary dump in PALADIN's own format |
DUMP_ALL_IN_ONE | One file, one block per dump step |
DUMP_SEPARATE | One file per dump step |
FORMAT_GMSH_POS is the right choice for anything that is looked at; FORMAT_TXT for anything
that is evaluated with a script, because it needs no reader.
Quantities a dumper can write
The values list of a dumper instance takes any combination of the constants below, and
value_units takes one entry per value.
Scalars
| Constant | Quantity |
|---|---|
DUMP_SCALAR_ID | Particle index |
DUMP_SCALAR_TIME | Simulation time |
DUMP_SCALAR_RADIUS | Radius |
DUMP_SCALAR_MASS | Mass |
DUMP_SCALAR_CHARGE | Charge in elementary charges |
DUMP_SCALAR_CHARGE_MASS_RATIO | Charge-to-mass ratio |
DUMP_SCALAR_KINETIC_ENERGY | Kinetic energy |
DUMP_SCALAR_VELOCITY_SQUARE | Squared velocity |
DUMP_SCALAR_POTENTIAL | Potential at the particle position |
DUMP_SCALAR_COLLISION_TYPE | Kind of the last collision (reflection, sticking, …) |
DUMP_SCALAR_LAST_SURFACE_TAG | Physical group the particle last touched |
DUMP_SCALAR_STARTING_ELEMENT_ID | Element the particle started from, the backtrace quantity |
DUMP_SCALAR_TIME_SINCE_STICKING | Time since the particle stuck |
DUMP_SCALAR_MAX_STICKING_TIME | Longest sticking time so far |
DUMP_SCALAR_GENERAL_STICKING_TIME | Accumulated sticking time |
DUMP_SCALAR_FLAG_CRITICAL_DENSITY | Set when the particle is in a region with a plasma density of 2·10¹² m⁻³ or more |
DUMP_SCALAR_ONE | Constant 1, for a pure position dump |
Detail scalars
| Constant | Quantity |
|---|---|
DUMP_DETAIL_SCALAR_MAX_CURRENT | Largest charging current the particle saw |
DUMP_DETAIL_SCALAR_SHIELDING_LENGTH | Shielding length used in the charging |
DUMP_DETAIL_SCALAR_SHIELD_STRENGTH | Strength of the shielding |
DUMP_DETAIL_SCALAR_TEMPERATURE | Particle temperature |
DUMP_DETAIL_SCALAR_DENSITY | Local gas density |
DUMP_DETAIL_SCALAR_CHI, DUMP_DETAIL_SCALAR_XI | Normalised charge and drift parameter of the charging model |
DUMP_DETAIL_SCALAR_COULOMB_LOG | Coulomb logarithm used for the collision terms |
Vectors
| Constant | Quantity |
|---|---|
DUMP_VECTOR_POSITION | Position |
DUMP_VECTOR_VELOCITY | Velocity |
DUMP_VECTOR_ACCELERATION | Acceleration |
Detail vectors, one per force term
| Constant | Quantity |
|---|---|
DUMP_DETAIL_VECTOR_FORCE_GRAVITY | Weight |
DUMP_DETAIL_VECTOR_FORCE_ELECTRIC | Coulomb force |
DUMP_DETAIL_VECTOR_FORCE_MAGNETIC | Lorentz force |
DUMP_DETAIL_VECTOR_FORCE_POLARIZATION | Polarisation force |
DUMP_DETAIL_VECTOR_DEBYE_POLARIZATION | Debye polarisation force |
DUMP_DETAIL_VECTOR_DRAG_COLLISIONAL | Neutral drag |
DUMP_DETAIL_VECTOR_DRAG_ORBITAL | Ion drag (Coulomb collisions) |
DUMP_DETAIL_VECTOR_THERMO_COLLISIONAL | Neutral thermophoresis |
DUMP_DETAIL_VECTOR_THERMO_ORBITAL | Plasma thermophoresis |
DUMP_DETAIL_VECTOR_HEAT_FLUX | Local heat flux |
DUMP_DETAIL_VECTOR_GRAD_TEMPERATURE | Local temperature gradient |
The force breakdown is the most useful diagnostic in the code: a trajectory that goes where it should not go can be explained by looking at which of these terms dominates where.
Full state
DUMP_SERIALIZED writes the complete state of a particle as one flat list of values — species,
index, inverse mass, charge, radius, temperature, initial radius, position, velocity, previous
acceleration, flags and the collision state. It is the format the particle serialisation uses,
and it is larger than any other dump.