Molecular diffusion in a nanoporous solid, e.g., zeolite, porous carbon, metal-organic framework (MOF) and covalent organic framework (COF)1,2,3,4,5, is an important process with regard to chemical separation6,7 and catalysis8,9. For separating chemicals, state-of-the art nanoporous membranes6 require faster diffusion or permeation of the separated chemicals across the membrane layer, so that the production efficacy increases and cost is reduced. In heterogeneous catalysis using the nanoporous solids, reactant diffusion to the active site is the rate-determining step8,10,11,12. Hence, for both of the applications, efficacy of the process is controlled by the diffusivity (D). In the case of perfect molecular sieving (i.e., size-based exclusion)13,14, exclusively selective molecular diffusion occurs while in the case of competitive diffusion of the molecules in the pores, selectivity is decreased. However, the selectivity can be improved by specific pore environment design at different length-scales; few Ångstrom to nanometer-sized pores can be geometrically and chemically tuned or the nanoporous channels can be oriented in a specific direction at micron scale to accelerate diffusion15,16,17,18,19,20,21. To formulate these strategies that can accelerate diffusion and consequently the selectivity, insight into the rate-determining step is necessary.

In the nanoporous materials, following physical processes take place during the permeation of the chemicals along the concentration gradient: (A) adsorbate-pore surface interaction, (B) surface to pore diffusion and (C) interpore diffusion. The surface barrier phenomenon22,23,24,25 (i.e., transport resistance due to structural defects and pore blocking) is related to the steps A and B. In certain cases, in particular for MOF thin films, surface barriers influence the diffusion rate. Surface barriers are omnipresent; however it can be substantially minimized by changing the synthetic conditions22,26. In case of vanishing surface barrier effect, step C is the rate limiting factor6,27. As the permeation is directly proportional to the D and adsorbate solubility, managing the interpore diffusion (step C) is the key in case of nanoporous solids. Earlier studies revealed that the diffusion in the nanoporous solids, e.g., MOFs, can be modeled and estimated using the Fick’s law28,29,30. However, in the case of nonlinearity in diffusion (i.e., diffusivity as a function of mass loading in step C), an appropriate model is difficult to formulate29,30. This nonlinearity increases with increasing mass loading, as adsorbate-adsorbate interaction also comes into play31. Further, in the case of the nonhomogeneous pores (i.e., more than one types of pore window sizes and functionalities)29,32, which is commonly the case for nanoporous MOFs and COFs, estimation of D also remains tricky. In this communication we postulate that in the absence of substantial surface resistance, the interpore diffusion can be controlled using a chemically derived path at the nonlinear regime of mass loading.

The exact estimation of the molecular diffusion path (and tortuosity)33 in a nanoporous solid may not be straight forward in the presence of structural defects and disordered crystalline domains30. Molecular simulations can be useful to understand the complex, pore topology-dependent diffusion characteristics34,35,36,37. By experimental route, it is rather more useful to assess the factors that control the interpore diffusion and find out a convenient way to tune those factors. One way to do so is to make a model porous structure and carefully analyze the mass uptake rate (Mrate). As a proof of concept, we have chosen a nanoporous system in which the pores are highly ordered; one type of the pore windows is aligned along the concentration gradient and another type is orthogonal to the gradient (Fig. 1). The oriented windows are created by metal-organic ligand coordination in a layer-by-layer (lbl) liquid-phase epitaxy (LPE) method, i.e., surface-anchored MOF thin films38 and solvent vapors are used to probe the Mrate. Presence of the two chemically and geometrically distinct windows that are perfectly aligned orthogonal to each other helps to realize the interpore diffusion directionalities. It is revealed that D is not controlled by surface barriers and the interpore diffusion in the selected structure is actually controlled by the orthogonally positioned (to the concentration gradient) pore windows, but not those which are aligned along the concentration gradient. These findings assist to tune the molecular diffusion process using a chemically derived route. We have adopted an isoreticular MOF design strategy39 to introduce different chemical functionalities in two isostructural MOFs, and in the following discussion we demonstrate its impact on the molecular diffusivities with supporting mass uptake rate experiments and simulations.

Fig. 1: Molecular diffusion in MOF.
figure 1

An illustration of the molecular diffusion along the concentration gradient in a crystalline, porous structure, in which mass uptake is controlled by the pore windows orthogonal to the concentration gradient; (molecules are methanol, presented in space fill model, O = red, C = gray); concentration gradient is along c-axis. Color code: blue Cu-paddle-wheel, gray BDC linker, yellow pillar linker.


While considering a model porous structure, we have set the following criteria: (i) preconceivable nanometer pore size and geometry, (ii) periodically arranged pores with specific orientation, (iii) chemical tunability, and (iv) ease of assembly as a thin film at micrometer length scale (so that it can be related to a membrane-type structure). Among the contemporary porous materials, MOFs qualify with these criteria. MOFs consist of inorganic metal or metaloxo nodes and functionalized organic linkers40,41, which are linked by reversible and directional coordination bonds. The choices for metal and linkers are virtually infinite, and the possible structural topologies are also numerous. To name a few benchmark examples where molecular diffusion and gas adsorption selectivities have been studied in details and possible applications for membrane-based gas separation have also been performed, are ZIFs (Zeolitic imidazolate frameworks), UiOs (University of Oslo), MILs (Material Institute Lavoisier)38,42,43,44,45,46. In our present approach, we have considered a rather simple PCU topology that can afford two different pore windows. One advantage of this type of topology, otherwise also known as pillared-layer MOFs47,48,49, is that these structures can be grown as a thin film in an oriented fashion50,51,52 and two different types of pore windows can be arranged in a preconceived orientation.

The selected model structure is Cu(BDC)(pillar) MOF, where the pillars are Py-X = X-Py (Py = pyridyl, X = CH and N) (Fig. 2a). The Cu(BDC) 2D square grids are formed by linking Cu-paddle-wheels with benzenedicarboxylic acid (BDC) linker along the ab plane and these 2D sheets are pillared by Py-X = X-Py along the c-axis (along [001]) forming an extended pillared-layer structure (Fig. 2a). This 3D structure features two types of pore windows, one of them has a size of ~7.3 × 4.3 Å along the c-axis while the other one is ~9.7 × 6.9 Å along the ab plane. These window sizes are estimated by adding van der Waals radii of the atoms in the simulated structures (see computational details). Herein, we have two types of pillared-layer (PL) structures, denoted as PLC=C and PLN=N. The only difference between the two structures is their pillar linker functionality, one having -C = C- while the other one with -N = N-. Note that the smaller pore windows are chemically equivalent but different chemical functionalities are present at the larger pore windows (~3-times larger, Fig. 2a).

Fig. 2: Design of the pillar-layered MOF structure.
figure 2

Structural insight of the model nanoporous MOF structure: a a pillared-layer surface-anchored MOF, with two distinct pore windows WV and WH; inset figures illustrate the chemical constituents of the MOF and scanning electron microscopy image of the PLC=C MOF (scale bar = 100 nm), b comparison of the simulated and out-of-plane XRD patterns of the PL thin films. Color code: Cu = green, O = red, C = gray.

To synthesize the model structures and perform the molecular diffusion studies, we have grown oriented thin films of both PLC=C and PLN=N using well-known LPE method in an lbl fashion (see experimental section). By repeating the number of deposition cycles we could obtain homogenous and pinhole free ~200 nm thick films (Fig. 2a, see Supplementary Fig. 1). These synthesized films were characterized using powder X-ray diffraction (PXRD) and Raman spectroscopy (Supplementary Figs. 2 and 3, respectively). Figure 2b shows the out-of-plane (OP) PXRD along with the simulated PXRD patterns. In the OP PXRD, the diffraction peaks appear at ~5.4, 10.8, and 16.3°. Comparison of these peaks with simulated PXRD suggests that these peaks are related to (00l) planes of the PLC=C. In the in-plane PXRD, we have observed the diffraction peaks corresponding to the orthogonal planes ((100), (010) and (110), see Supplementary Fig. 2). This observation confirms that the PLC=C structure is oriented along the (001) or c-direction where the smaller pore windows are vertically aligned, (hereafter called as WV) and the larger windows are parallel to the substrate plane (along the ab plane, hereafter called as WH). PLN=N thin film also exhibits similar growth orientation, as can be confirmed from the PXRD patterns (Fig. 2b and Supplementary Fig. 2).

Because of the crystal growth preference along the c-axis, the surfaces of both thin films are populated with the WV windows as shown in Fig. 2a. Hence, during the molecular diffusion into the thin film steps A and B (vide supra) should be similar for both PLC=C and PLN=N. Diffusivity will differ, only if the different chemical functionalities come into play or the larger pore windows WH control the diffusivity. To study this, we have measured mass uptake rates of the PL thin films grown on quartz crystal microbalance (QCM)28 sensors with –OH functionalized Au-surface. Methanol (kinetic diameter ~3.6 Å)53 is used as a probe molecule because it is compatible with the pore window sizes and has high vapor pressure at ambient temperature. The QCM sensors coated with the PL thin films were mounted in a fluidic cell in a temperature-controlled environment. The saturated methanol vapor (~16.8 kPa)54 uptake profiles were recorded at 298 K by monitoring the fundamental frequency change (Δf) over time (t). The mass change (Δm) per area is calculated using the Sauerbrey equation:

$$\Delta m=\,-c\frac{\Delta f}{n}$$

where n denotes the overtone order and c is the mass sensitivity constant28.

In Fig. 3a, the fractional mass uptake is plotted against the uptake time in linear and logarithmic scale. At lower fractional uptake (<20%; molecules entering from the vapor phase into the pore, i.e., steps A and B) both PLC=C and PLN=N shows linear uptake behavior and almost no difference in the uptake rate (D = 5.7 × 10−16 ± 1.2 for PLC=C and 2.4 × 10−16 ± 0.8 m2/s for PLN=N at lower % uptake). But beyond this regime, when the interpore diffusion step C, dominates the mass uptake rate, the uptake rate slowed down for PLN=N as compared to that of PLC=C for similar thickness of the films (~ 530 ± 45 nm, saturation mass uptake time is ~3× slower for PLN=N compared to that of PLC=C) (see Supplementary Fig. 4). These observations indicate that at lower mass loading, i.e., when methanol molecules are mostly near the surface, diffusivity rates are controlled by the pore windows which are similar in PLC=C and PLN=N, i.e., WV. While the above statement is true for an ideal MOF structure, surface barrier effect cannot be neglected. To evaluate this, we have carried out thin film thickness dependent methanol mass uptake measurements for both of the PL structures. The coinciding plots of fractional mass uptake versus normalized time indicate that surface barrier effect is not the controlling factor (Fig. 3b, c)22. This is because the uptake time follows a quadratic relation with the thickness of the film as shown in Eq. (2). We attribute this feature of the MOF thin film to the synthetic conditions used in this work (see synthesis methods). Hence, it is safe to assume that at lower mass loading vertically aligned WV is the key parameter.

$$m\left(t\right) = {m}_{{eq}}\left(1-{{{{{\rm{exp }}}}}}\left(-\frac{t}{\tau }\right)\right)$$
$$\tau=\frac{{l}^{2}}{3D}+\frac{l}{\alpha }$$

Where m(t) denotes the mass uptake defined by an exponential decay function where \(l\) denotes the thickness of the film, D is the diffusivity, α is surface permeability, meq is the equilibrium loading and t is the time.

Fig. 3: Methanol vapor uptake rates.
figure 3

Mass uptake rate studies: a fractional methanol vapor mass uptake rate profiles at 298 K for PLC=C and PLN=N, b, c fractional methanol vapor uptake rate profiles with different film thickness for PLC=C and PLN=N, respectively. Error bars calculated using thickness of the films.

Note that at lower mass uptake regime, concentration gradient is maximum, and it is anticipated that methanol molecules will diffuse along the gradient through WV. The surprising large difference in the uptake saturation time indicates that the larger windows WH do play an important role even though diffusion through these windows is orthogonal to the concentration gradient. Moreover, the WH sizes are similar for PLC=C and PLN=N, hence it must be the different chemical functionalities that are controlling the diffusion rate. In the following discussion, we reveal that diffusion through WH is indeed rate limiting for the interpore diffusion and can be tuned by chemical design.

To ascertain that the dominating diffusion path for steps A and B involves WV only, we have carried out two sets of experiments: In experiment set 1, we have compared the methanol diffusivities of 4 isoreticular PL MOFs (PLDABCO, PLC=C, PLN=N, and PLS-S, see experimental section for details and), having identical crystalline orientation, i.e., WV windows are vertically oriented. In these 4 PLs, WV dimensions and chemical functionalities are identical; however the WH windows are different. We have estimated similar diffusivity values for all the PLs at 298 K (Fig. 4a, see Supplementary Figs. 6 and 10). Hence no effect of the WH can be observed. In experiment set 2, we have compared the activation energy (EA) and enthalpy of adsorption (ΔH) for the PLC=C and PLN=N for methanol (see Supplementary Figs. S11, S12) by measuring mass uptake at different temperatures. We found that the differences are very small (ΔH = ~5.8 (±0.5) and 6.5 (±0.76) kcal/mol and ΔEA = 6.4 (±0.57) and 7.36 (±0.64) kcal/mol for PLN=N and PLC=C), Fig. 4b, c). The EA is estimated by the diffusivities at lower uptake regime, hence similar EA values confirm the hypothesis that steps A and B involve mostly WV. Similar ΔH values indicate that the adsorbate-adsorbent interaction differences are small enough, to be identified by the present experimental setup. Density functional theory calculations indicate similar binding energies of methanol with PLC=C (13.87 kcal/mol) and PLN=N (13.35 kcal/mol), in accordance with the experimental observations.

Fig. 4: Methanol diffusivity.
figure 4

a Comparison of the diffusivities at 298 K for PL MOFs with oriented pores; the specific van der waals surface added pore is shown in the inset; for all the PLs with different pillars the accessible pores at the surface are similar; chemical structure of the different pillars are shown in the inset, b Arrhenius plot of diffusivity and c equilibrium constant. Error bars calculated using fitting parameters.

After ruling out the surface barrier effect and confirming the role of WV at the lower mass loading, we focus on the differences observed at the higher mass loading. The distinct time differences in the saturation uptake can be attributed to the following structural features: (i) structural defect densities, (ii) cooperative effect between adsorbed molecules, (iii) lateral diffusion through WH pores with different functionalities. We rule out the defect densities, because in that case mass uptake rate will be affected also at the lower mass loading (steps A and B). To test the impact of cooperative effect, we have compared the percentage change in the rate of mass uptake (slope %) vs. fractional mass loading at two different temperatures (298 and 315 K, Fig. 5a). We observed that with increasing mass uptake, rate increases. It indicates that the methanol-methanol cooperative interaction at higher loading accelerates mass uptake. Furthermore, at lower temperature the change in the slope percentage is higher for both the PLs. This is probably due to the stronger methanol-methanol interaction at the lower temperature, indicating presence of similar cooperativity in both the PLs. Hence, methanol cooperative interaction is not the rate limiting step at higher mass loading.

Fig. 5: Methanol uptake at variable temperature and concentration gradient.
figure 5

a % changes in the mass uptake rates at different temperatures for the PLC=C and PLN=N, b ratio of 20% loading time for PLN=N vs. PLC=C at different concentration gradient controlled by varying nitrogen flow. (See source data for details).

In light of the dependence of interpore diffusivities on the WH windows, which are stationed orthogonal to the concentration gradient, we postulate that the effective diffusion is governed not only by the concentration gradient but also by the pore window size. At the lower uptake regime, during steps A and B, concentration gradient is highest and hence, it dominates the mass uptake rate. At higher mass loading (when the interpore diffusion dominates) concentration gradient continuously decreases, and the pore window size becomes the rate limiting factor. In the present case 3× larger size of WH, as compared to WV, dictates the diffusion path during interpore diffusion at lower concentration gradient. This is verified by concentration gradient dependent methanol mass uptake measurements (see Supplementary Fig. 13). As the concentration gradient reduces, differences in the uptake rates become more prominent even at the lower mass loading (<20%) (Fig. 5b). This phenomena can be generalized to any 3D porous structure, in which more than one type of pore window exists. Note that the net diffusion still follows the Ficks law, only the microscopic interpore diffusion path varies. Evidently, as the chemical functionalities of the WH are changed, uptake rates change sharply. Comparing the mass uptake time of methanol and 1-butanol, for the different PLs with different pillar functionalities indicate that (size-based) selectivities are higher at saturation, compared to the lower mass loading region (Supplementary Table 1). Using this approach, the permeation and selectivity of the chemical mixtures can be regulated rationally, in a preconceived manner.

To get an insight into the energy barriers along the WV and WH pores for methanol, we performed force field based molecular dynamics simulations (see computational section). The comparative free energy profiles are illustrated in Fig. 6. It is evident from these simulations that during the diffusion along the WV pores (from A to A’), the free energy changes are similar for PLC=C and PLN=N. On the contrary, it is energetically uphill to traverse along the WH pores (from B to B’) for PLN=N but energetically downhill for PLC=C. This horizontal movement allows a higher mass uptake rate in PLC=C, that is observed in experiments. A preferential interaction between methanol and the pillar functionalities is clearly visible at the two energy minimum (see Figs. S14S16) at 0.0 nm (at the window) and 0.3 nm (on the edges of the PL-cage). The potential energy difference calculated between the two positions (PLC=C (0.3–0.0 nm) = 0.5 kcal/mol, PLN=N (0.3–0.0 nm) = −0.24 kcal/mol) also shows preferential movement of methanol molecules across the PLC=C MOFs, ascertaining the hypothesis of chemically controlled interpore diffusion.

Fig. 6: Free energy profiles for interpore diffusion.
figure 6

Free energy profiles of a methanol molecule during transition from one pore to the other through (a) WV and (b) WH; red = PLN=N and black = PLC=C. (Right) the net transition paths are shown in dotted lines for the PLC=C structure; molecular geometries corresponding to the energy minimum (A or A’ and B or B’ positions) are shown in Supplementary Figs 1415.


Complexity in microscopic mechanism for interpore diffusion, which is the rate determining step during the permeation through a porous membrane or during a catalysis process, is challenging to resolve. This lack in clarity is due to the fact that the simplistic model of concentration gradient-dependent diffusion does not strictly apply. By careful analyses of the mass uptake rates in the oriented nanochannels of the pillared-layer MOFs, we could reveal the diffusion path and rate limiting parameters. We have demonstrated that surface barrier effect is absent in this MOF thin films, as the preparation method is carefully optimized. Different types of pillared-layer MOFs were grown in a layer-by-layer fashion as oriented thin films, and this allowed correlating the mass uptake rates with chemical functionalities and pore window orientation. The experimental observations indicated that in spite of the presence of concentration gradient, diffusivity is controlled by the large pores aligned along the direction orthogonal to the gradient. The diffusion directionality is dependent on both, the chemical gradient and the pore window size, and these factors dominate at different loading %. The changes in chemical functionality in these pore windows, realized by changing the pillar functionalities of the MOFs, drastically modulate the uptake time, resulting in a chemical control of the overall molecular diffusion. In the present case, we have found that ethylene (-C = C-) functionality, in comparison to -N = N- and -S–S-, helps to accelerate the mass uptake rate. The applicability of this diffusion mechanism can be extended to other adsorbate molecules and porous solids, in which the pores are 3D and surface barrier is negligible. However, nature of adsorbate-adsorbent interactions can vary in a nonlinear fashion and hence diffusivity rates will change accordingly31. Note that flexibility (local and global) of the MOF structures can also influence diffusivity, and this aspect is not addressed in the current hypothesis. The insight of the diffusion path and the chemical route to modulate diffusion can be applied further to designing of nanoporous membranes for chemical separation, e.g., aliphatic and aromatic hydrocarbons, pollutant gases and volatile organic compounds55. Also the chemical reactions carried out in the confined spaces of porous catalysts can be tuned using the findings presented here.


Synthesis of 4,4’-azopyridine

4,4’-Azopyridine was synthesized following a reported method56.

Synthesis of pillared-layer MOF thin films on QCM substrate

5 MHz (gold coated) QCM-sensors were dipped in an ethanolic solution (20 mM) of 11-mercapto-1-undecanol (MUD) for 24 h to obtain –OH functionalized surface. These substrates were then thoroughly washed with absolute ethanol (99.99%), dried and used for thin films synthesis. SiO2/Si substrates were cleaned by isopropanol and then by UV-ozone cleaner, to remove organic impurities and to create free –OH groups on the surface. The MOF thin films were prepared on those functionalized substrate via a well-known layer-by-layer (lbl) liquid-phase epitaxial (LPE) method48. The method consists of four steps to complete a cycle at 60 °C as: (i) dipped in 1 mM copper acetate ethanol solution for 10 min, (ii) drained the metal solution and washed with fresh ethanol, (iii) dipped in 0.2 mM linker solution (mixture of two linkers) in ethanol for 20 min and (iv) drained the linker solution and washed with fresh ethanol. MOF thin films with varying thickness were prepared by varying the number of cycles. 1,4-Benzene dicarboxylic acid is the primary linker used with different pillar linkers (4,4’-azopyridine, 1,2-di(4-pyridyl)ethylene, 4,4’-dithiodipyridine and 1,4-diazabicyclo[2.2.2]octane) for MOF films.


Powder X-ray diffractometer (XRD) patterns of thin films were recorded on a Rigaku XDS 2000 diffractometer using nickel-filtered Cu Kα radiation (λ = 1.5418 Å) ranging from 5 to 20° at room temperature (voltage 40 kV, current 200 mA). Out-of plane PXRD was recorded in 2θ/θ (step size 0.01, scan rate 0.2°/s), in-plane in 2θ/φ geometry with grazing incident angle (ω) at 0.3° and step size of 0.01 with scan rate 0.1°/s.

Surface morphology of samples were characterized using field emission scanning electron microscopy (FESEM), JEOL JSM-7200F instrument with a cold emission gun operating at 30 kV. Energy-Dispersive X-ray spectroscopy (EDS) elemental analysis and mapping were also done on the FESEM.

The vibrational Raman spectra were recorded by using a Renishaw inVia Raman microscope (532 nm excitation).

The adsorption profiles were measured using a quartz crystal microbalance (QCM) from open QCM, Italy. Thickness for all the thin films was calculated using J.A. Wollam ellipsometer (alpha-SE). The data was fitted using a B-Spline model including surface roughness.

QCM experiments

The MOF samples were activated preceding the measurements by heating the QCM sensors at 65 °C for 12 h under vacuum (10−4 bar). Mass uptake experiments were carried out using a constant flow rate (50 sccm) of dry N2, passing through saturated solvent vapors (methanol, 1-butanol).

Analyses of uptake kinetics

Mass-frequency relationship for the QCM measurements is given by Sauerbrey equation;28

$$\Delta m=\,-c\frac{\Delta f}{n}$$

Where n denotes the overtone order (n = 3, 5, and 7) and c is the mass sensitivity constant. For a 5 MHz crystal, c has value of 17.7 ng/cm2.

Diffusivity, D, can be obtained by fitting the mass uptake vs. the square root of adsorption time using this equation:28

$$\frac{{{{{{{\rm{M}}}}}}}_{{{{{{\rm{t}}}}}}}\left({{{{{\rm{t}}}}}}\right)}{{{{{{{\rm{M}}}}}}}_{{{\infty }}}}\,\approx \,\frac{8}{\surd {{{{{\rm{\pi }}}}}}} \frac{\surd {{{{{\rm{Dt}}}}}}}{{{{{{{\rm{L}}}}}}}^{2}}$$

Computational details

All the periodic DFT calculations were performed using PBE functional along with empirical D3 correction as implemented in CP2K software package that employs Gaussian plane waves. Double zeta quality basis sets were employed for all the atoms (DZVP-GTH-qn for all non-metallic atoms and DZVP-MOLOPT-SR-GTH for the Cu centers) along with GTH-PBE pseudopotentials. For the PLC=C and PLN=N structures geometry and cell parameters were optimized simultaneously. In order to run force field-based molecular dynamics simulations RESP fitted partial charges were computed with REPEAT method using Bloechl charges as initial guess. Coordinates of the structures are provided in the Supplementary Information. The binding energy of methanol with the PL MOFs (Ebinding) is computed as follows:

Ebinding = <Esystem> - EMeOH – EMOF, where for the average system energy single point DFT calculations are performed on multiple MD snapshots. Atomic coordinates used for the binding energy calculation is provided as an additional file.

Molecular dynamics

The MOF structures were constructed by multiplying the ab-initio optimized 1 × 1 × 1 unit cell, to create 3 × 3 × 3 cages that are periodic along ab and terminated along c with a vacuum. UFF LJ57 parameters and ab-initio computed charges (Supplementary Table 2) are used to simulate the non-bonding interactions of the MOF system, while the MOF is considered frozen. For the methanol molecule, CHARMM parameters are calculated using CHARMM-GUI58. All simulations are performed in the open source program GROMACS59.

100 methanol molecules are added to the MOF system and the system is equilibrated. NVT ensemble simulations are performed, with a temperature of 300 K maintained using the V-rescale method60. In case of 100 methanol molecules, a longer (1 μs) simulation is performed to generate the density distribution shown in Supplementary Fig. 17. For the free energy profiles, umbrella sampling simulations61 are performed that bias the perpendicular distance (along a or c axis) between the pore (WH or WV) and the methanol molecule. The WV and WH profiles contain 11 (0.0–1.0 nm) and 7 (0.0–0.6 nm) sampling windows each (of 100 ns each) that are 0.1 nm apart, and apply a bias of 100–300 kJ/mol. A smaller bias (50 kJ/mol) is also added to the parallel direction to restrict greater movement of the methanol molecule.