This function calculates the density inside and outside of the pore. This is done by calculating the number density \(\rho_n\) and using the molar mass \(M\) of the molecule to determine the mass density \(\rho\).
The basic idea is counting the number of molecules \(N_i\) in volume slices \(V_i\), thus getting the number density \(\rho_{n,i}\) in these sub volumes. Inside the pore this is done by creating a radial slicing like the radial distribution function. These sub volumes are calculated by
with pore length \(z_\text{pore}\) and radius \(r_i\) of sub volume \(i\). This yields
Outside the pore, the sub volumes are given by
with pore width \(x_\text{pore}\), height \(y_\text{pore}\), pore radius \(r\) and slice width \(z_j\). Thus
Note that the outside refers to the reservoirs of the pore simulation. Therefore the slices add up to the reservoir length \(z_{res}\). Since there is a reservoir on each side, they are brought together by translating the atom coordinates to one of the reservoirs. Since the outside density refers to the density of the outside surface, it does not contain the cylindrical extension of the pore inside the reservoirs.
Finally, the mass density is calculated by
with Avogadro constant \(N_A\). The units are then transformed to \(\frac{\text{kg}}{\text m^3}\) by
where the square brackets mean, that only the variables value is taken. Since finding full molecules in a sub volume is difficult, the atoms of the specified molecule are counted in the sub volumes and the result is then divided by the number of atoms the molecule consists of.
Link to hdf5, obj or yml data file generated by the sample routine poreana.sample.Sample.init_density()
Bin areas to calculate the mean number density from (pore, exout)
Target density in \(\frac{\text{kg}}{\text{m}^3}\)
True to print output
dictonary with inputs and the calculated density profiles and mean density