PoreAna 0.2
  • API
  • Sample
  • Density
  • Diffusion (Bin)
  • Diffusion (MC)
  • Further Properties
  • Site
    • Page
        • bins
          • bins()
    • bins
      • bins()
    Source

    bins¶

    poreana.density.bins(link_data, area=[[10, 90], [10, 90]], target_dens=0, is_print=True)¶

    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

    \[V_i^\text{radial}=\pi z_\text{pore}(r_i^2-r_{i-1}^2).\]

    with pore length \(z_\text{pore}\) and radius \(r_i\) of sub volume \(i\). This yields

    \[\rho_{n,i}^\text{radial}=\frac{N_i}{V_i^\text{radial}}=\frac{N_i}{\pi z_\text{pore}}\frac{1}{r_i^2-r_{i-1}^2}.\]

    Outside the pore, the sub volumes are given by

    \[V_j^\text{ex}=(x_\text{pore}\cdot y_\text{pore}-\pi r^2)z_j\]

    with pore width \(x_\text{pore}\), height \(y_\text{pore}\), pore radius \(r\) and slice width \(z_j\). Thus

    \[\rho_{n,j}^\text{ex}=\frac{N_j}{V_j^\text{ex}}=\frac{N_j}{x_\text{pore}\cdot y_\text{pore}-\pi r^2}\frac{1}{z_j}.\]

    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

    \[\rho=\frac M{N_A}\rho_n\]

    with Avogadro constant \(N_A\). The units are then transformed to \(\frac{\text{kg}}{\text m^3}\) by

    \[[\rho]=\frac{[M]\frac{\text{g}}{\text{mol}}}{[N_A]10^{23}\frac{\#}{\text{mol}}}[\rho_n]\frac{\#}{\text{nm}^3} =\frac{[M]}{[N_A]}[\rho_n]\cdot10\frac{\text{kg}}{\text m^3}\]

    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.

    Parameters:
    link_datastring

    Link to hdf5, obj or yml data file generated by the sample routine poreana.sample.Sample.init_density()

    arealist, optional

    Bin areas to calculate the mean number density from (pore, exout)

    target_densfloat, optional

    Target density in \(\frac{\text{kg}}{\text{m}^3}\)

    is_printbool, optional

    True to print output

    Returns:
    densitydictionary

    dictonary with inputs and the calculated density profiles and mean density

    Back to top

    © Copyright 2021, Hamzeh Kraus.
    Created using Sphinx 7.4.6.