The existing step-by-step diffusion and reaction models are refined to explicitly account for Coulomb interactions:
- Diffusion model: The interaction potential is incorporated into the stochastic equations of motion;
- Reaction model: A Coulomb-corrected missed-reaction probability is derived, and unreactive partially diffusion-controlled encounters are resolved within the local force field.
| Contact | |
|---|---|
| info@pathmc.org | |
| URL | pathmc.org |
For Linux systems, the provided
mkdir build
cd build
make -f ../MakefileAfter the executable has been built, the required simulation input data and directory structure must be copied into the build directory. This includes simulation parameter files, such as species and reaction tables, as well as the directory structure expected by
make -f ../Makefile copy_dirsAfter this step, the build directory contains the
For Windows systems, the build procedure is analogous. However,
To verify that the build was successful, run the supplied example simulation from the build directory:
pathmc -m IN_MAC/example_in.macpathmc -arg1 <opt1> -arg2 <opt2> -arg3 --arg4long ...The most relevant command-line arguments are:
| Short argument | Long argument | Description |
|---|---|---|
Some example calls are:
pathmc --version
pathmc -m IN/in.mac
pathmc -m IN/in.mac --pot 1
pathmc -m IN/in.mac --pc PRECHEM/prechem/_1/_MeV.txt
For typical simulations, only the input file needs to be specified on the command line, since all additional parameters are defined in that file:
pathmc -m <input_file>.mac
Before a simulation with
MOL_NAME ; x / nm ; y / nm ; z / nm
e_aq^-1; 28.9887; -94.2703; 3333.73
e_aq^-1; 7.5753; -73.0198; 3370.02
...
MOL_NAME field must match the corresponding definitions in the species and reaction tables provided by the CHEM_TABLES directory. Example prechemical configuration files are available in the PRECHEM subfolder.
Before defining the reactions, the chemical species must first be specified. In particular, the charge used for Coulomb interactions must be provided, together with information on whether spin-controlled reactions should be modeled explicitly. If <SPIN> is not defined, spin effects are not treated explicitly and are instead included implicitly through the specified bulk reaction rate. An example is shown below:
<?xml version ="1.0"?>
<SPECIES_DATA>
<SPECIES>
<NAME>e_aq^-1</NAME>
<D>4.9E-9</D>
<Q>-1</Q>
<R>0.5E-9</R>
<SPIN>1</SPIN>
</SPECIES>
...
</SPECIES_DATA>
Scavengers are defined by a concentration
<SPECIES>
<NAME>O2</NAME>
<D>0</D>
<C>5.2E-4</C>
</SPECIES>
If no scavengers are defined, the background model is not initialized; the
log file reports on all background particles. The species table must be saved as an
The reactions to be considered and their observed reaction rates <TYPE> must also be specified explicitly if partially diffusion-controlled reactions are to be resolved in the force field. If no type is given, the reaction is assumed to be of type 1, i.e. totally diffusion-controlled.
The reactions are defined as follows:
<?xml version ="1.0"?>
<REACTION_DATA>
<REACTION>
<REACTANT>H^0</REACTANT>
<REACTANT>e_aq^-1</REACTANT>
<PRODUCT>H_2^0</PRODUCT>
<PRODUCT>OH^-1</PRODUCT>
<K>2.5</K>
<TYPE>1</TYPE>
</REACTION>
<REACTION>
<REACTANT>e_aq^-1</REACTANT>
<REACTANT>H3O^1</REACTANT>
<PRODUCT>H^0</PRODUCT>
<K>2.11</K>
<TYPE>4</TYPE>
</REACTION>
...
</REACTION_DATA>
The species names specified in the reaction table must already be defined in the species table; Type 6 reactions are identified automatically if one of the reactants has been defined as a scavenger. For clarity, the reaction tables should be stored in the CHEM_TABLES/... subdirectory, although this is not required.
Before execution, the simulation parameters must be defined in an input file with the following simple structure:
# Example PATHMC input file
# This is a comment...
PRECHEMF PRECHEM/<folder_of_configurations> # "PRECHEM" FOR FILE, "PRECHEMF" FOR FOLDER
REACTION_TABLE CHEM_TABLES/rt_g4.xml # PATH TO REACTION TABLE
SPECIES_TABLE CHEM_TABLES/st_g4_spin.xml # PATH TO SPECIES TABLE
DT_MIN 1E-12 # MINIMUM TIME STEP
T_FINAL 1.1E-8 # END SIMULATION TIME
TIMESTEP_MODE 1 # 0 = STATIC (DT_MIN), 1 = DYNAMIC
POTENTIAL_MODE 1 # 0 = FORCE_FREE, 1 = PAIR_POTENTIAL
VERBOSE 0 # DETAIL OF OUTPUT AND LOGGING
BINS 20 # TEMPORAL BINS FOR SCORING
SEED 3141592 # RANDOM SEED
END # END OF INPUT FILE
Particular attention should be paid to the terminating END statement.
The input file has a simple structure: each command, for example PRECHEMF, is followed by its corresponding value. In this case, the value specifies the path to the prechemical configuration directory. Similarly, SPECIES_TABLE and REACTION_TABLE define the file paths to the species and reaction tables, respectively.
The parameters DT_MIN and T_FINAL set the lower time-step limit and the termination time, respectively. The option TIMESTEP_MODE controls dynamic time-step scaling. This scaling consists of a drift-controlled and a reaction-controlled contribution, allowing propagation in the force field while preventing reactions from being missed with a certain confidence.
POTENTIAL_MODE enables or disables the interaction potentials in the diffusion model.
If PRECHEM is used, PRECHEMF command is used instead, the specified value is interpreted as a directory containing multiple prechemical configuration files. These files are processed sequentially in multi-file mode. At the end of this procedure, a summary file containing the mean *.gval_sum.
If the name of a prechemical configuration file contains the deposited energy in
At this point, all requirements for running a simulation are met. Once the input file with extension IN_MAC directory, the simulation can be started.
During execution, the simulation reports its progress and the
---------- BEGIN : G - VAL SAVE POINT =>
t e_aq OH- OH* H2 H3O+ H* H2O2 ...
2.51189e-07 36 4 34 5 40 6 9 ...
---------- END : G - VAL SAVE POIN
This output contains the current simulation time and the species-resolved counts used to calculate the
All output files, including RUN_ID in multi-file mode.
After completion of the simulation, an LOG_<INPUT_FILE>_<RUNID>.HTML log file is automatically generated in the LOG directory, which reports on the success of the run, possible errors, the species and reaction table, and all simulation parameters and outputs: an example log file can be found here.
Unless otherwise noted, the original code authored for LICENSE.
This repository includes third-party components under their respective licenses;
see LICENSE_THIRD_PARTY.md for details.
