Skip to main content

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)
QuantityConstants
LengthMETER, METRE, ANGSTROM, MICRO, NANO, MILLI, CENTI, DECI, KILO, …
TimeSECOND, MINUTE, HOUR, DAY, WEEK, MONTH, YEAR
MassKILOGRAM, GRAM, TON
PressurePASCAL, BAR, TORR, ATM
TemperatureKELVIN
ElectricalAMPERE, COULOMB, VOLT, TESLA, HENRY, ELECTRON_VOLT
Energy and powerJOULE, 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​

ConstantValueUnit
ELEMENTARY_CHARGE1.6021766208e-19C
AMU1.660539040e-27kg
ELECTRON_MASS9.10938356e-31kg
BOLTZMANN_CONSTANT1.38064852e-23J/K
LIGHT_SPEED299792458.0m/s
PLANCK_CONSTANT6.626070040e-34J·s
GRAVITATIONAL_ACCELERATION9.81m/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​

ConstantBehaviour on impact
WALL_TYPE_SPECULARMirror reflection; the restitution is the border's elasticity
WALL_TYPE_DIFFUSERe-emitted in a random direction at unchanged speed
WALL_TYPE_MEMBRANENo 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​

ConstantParameters
DISTRIBUTION_CONSTANTsize_distribution_param_1 is the radius
DISTRIBUTION_UNIFORMparam_1 and param_2 are the lower and upper radius
DISTRIBUTION_LOG_NORMALparam_1 and param_2 describe the underlying normal distribution of the logarithm
DISTRIBUTION_WEIBULLparam_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​

ConstantMeaning
BB_SOLIDClosed by a wall
BB_PERIODICPeriodic; a particle that leaves enters on the opposite side
BB_OUT_MINOpen at the lower coordinate
BB_OUT_MAXOpen at the upper coordinate
BB_OUTOpen 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​

ConstantMeaning
FORMAT_GMSH_POSGmsh .pos view file, openable in ParaView and Gmsh
FORMAT_GMSH_MSHGmsh mesh file
FORMAT_TXTPlain text table, one row per particle and dump
FORMAT_EMDI_DMPBinary dump in PALADIN's own format
DUMP_ALL_IN_ONEOne file, one block per dump step
DUMP_SEPARATEOne 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​

ConstantQuantity
DUMP_SCALAR_IDParticle index
DUMP_SCALAR_TIMESimulation time
DUMP_SCALAR_RADIUSRadius
DUMP_SCALAR_MASSMass
DUMP_SCALAR_CHARGECharge in elementary charges
DUMP_SCALAR_CHARGE_MASS_RATIOCharge-to-mass ratio
DUMP_SCALAR_KINETIC_ENERGYKinetic energy
DUMP_SCALAR_VELOCITY_SQUARESquared velocity
DUMP_SCALAR_POTENTIALPotential at the particle position
DUMP_SCALAR_COLLISION_TYPEKind of the last collision (reflection, sticking, …)
DUMP_SCALAR_LAST_SURFACE_TAGPhysical group the particle last touched
DUMP_SCALAR_STARTING_ELEMENT_IDElement the particle started from, the backtrace quantity
DUMP_SCALAR_TIME_SINCE_STICKINGTime since the particle stuck
DUMP_SCALAR_MAX_STICKING_TIMELongest sticking time so far
DUMP_SCALAR_GENERAL_STICKING_TIMEAccumulated sticking time
DUMP_SCALAR_FLAG_CRITICAL_DENSITYSet when the particle is in a region with a plasma density of 2·10¹² m⁻³ or more
DUMP_SCALAR_ONEConstant 1, for a pure position dump

Detail scalars​

ConstantQuantity
DUMP_DETAIL_SCALAR_MAX_CURRENTLargest charging current the particle saw
DUMP_DETAIL_SCALAR_SHIELDING_LENGTHShielding length used in the charging
DUMP_DETAIL_SCALAR_SHIELD_STRENGTHStrength of the shielding
DUMP_DETAIL_SCALAR_TEMPERATUREParticle temperature
DUMP_DETAIL_SCALAR_DENSITYLocal gas density
DUMP_DETAIL_SCALAR_CHI, DUMP_DETAIL_SCALAR_XINormalised charge and drift parameter of the charging model
DUMP_DETAIL_SCALAR_COULOMB_LOGCoulomb logarithm used for the collision terms

Vectors​

ConstantQuantity
DUMP_VECTOR_POSITIONPosition
DUMP_VECTOR_VELOCITYVelocity
DUMP_VECTOR_ACCELERATIONAcceleration

Detail vectors, one per force term​

ConstantQuantity
DUMP_DETAIL_VECTOR_FORCE_GRAVITYWeight
DUMP_DETAIL_VECTOR_FORCE_ELECTRICCoulomb force
DUMP_DETAIL_VECTOR_FORCE_MAGNETICLorentz force
DUMP_DETAIL_VECTOR_FORCE_POLARIZATIONPolarisation force
DUMP_DETAIL_VECTOR_DEBYE_POLARIZATIONDebye polarisation force
DUMP_DETAIL_VECTOR_DRAG_COLLISIONALNeutral drag
DUMP_DETAIL_VECTOR_DRAG_ORBITALIon drag (Coulomb collisions)
DUMP_DETAIL_VECTOR_THERMO_COLLISIONALNeutral thermophoresis
DUMP_DETAIL_VECTOR_THERMO_ORBITALPlasma thermophoresis
DUMP_DETAIL_VECTOR_HEAT_FLUXLocal heat flux
DUMP_DETAIL_VECTOR_GRAD_TEMPERATURELocal 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.