Introduction

Porous solids, ranging from classic inorganic zeolites to molecular organic and hybrid frameworks1,2,3, have fascinating properties for various heterogeneous reactions, such as electrochemical energy storage4,5,6, heterogeneous catalysis7,8,9,10, and sensing11,12,13,14. Regarding heterogeneous reactions involving porous solid films, mass transfer at solid/liquid or solid/gas interfaces plays an important role in reaction kinetics, and the overall rate of reaction is usually limited by the interfacial mass transfer15,16,17. However, subject to the no-slip boundary condition in pressure-driven flows18,19, mass transfer near the surface of the solid film is largely limited to the relatively slow process of molecular diffusion since the convective movement of fluids approaches zero (Fig. 1a). The critical bottleneck to promote convective movement at the boundary layer results from high hydraulic resistance, i.e., the low permeability of solid film samples20,21. Such a low permeability induced stagnant boundary layer poses a grand challenge for further promotion of interfacial mass transfer, necessitating the design of innovative porous nanointerfaces to boost interfacial mass transfer.

Fig. 1: Schematic of interfacial mass transport on a solid porous film.
figure 1

a Flow velocity vectors and slow mass transfer (concentration gradient-induced molecular diffusion) on the surface of a solid porous film (left) and the corresponding concentration field on the surface of the solid porous film (right). b Flow velocity vectors and fast mass transfer (molecular diffusion plus convection) on the surface of a hierarchical porous film (left) and the corresponding concentration field on the surface of the hierarchical porous film (right). The black arrow indicates the flow direction, and the length of the arrow indicates the magnitude of the velocity. The red spots represent the molecules that reach the surface of the film.

Conductive metal–organic frameworks (c-MOFs), which are electroactive crystalline porous coordination polymers22,23,24, are emerging as promising electronic materials and have exhibited potential for broad applications such as electronic devices25, electrocatalysis26,27 and energy storage28,29. Due to their high porosity, intrinsic electrical conductivity and abundant functional sites, c-MOF films have been widely utilized as active layers for chemiresistive gas sensing30,31,32. In a c-MOF-based chemiresistive gas sensing system, the sensing relies heavily on the adsorption of target gas molecules on the surface of c-MOF films, and the kinetics of this kind of heterogeneous reaction are mainly influenced by interfacial mass transfer33,34. Therefore, the c-MOF-based chemiresistive gas sensing can be considered a model for establishing the permeability-interfacial mass transfer correlation, providing guidelines to address the challenge of accelerating the interfacial mass transfer for porous solid systems.

Herein, we demonstrate a hierarchical-structure-accelerated interfacial dynamic (HSAID) strategy for the promotion of interfacial mass transfer to boost heterogeneous reactions. Hierarchical c-MOF films (denoted Zn-HHTP-H, PcCu-Zn-H and Co-HHTP-H) were constructed by an in-situ transformation of three-dimensional (3D) ZIF-8 (Zn(MeIM)2, where MeIM = 2-methylimidazole) or ZIF-67(Co(MeIM)2) film precursors using π-conjugated ligands (2,3,6,7,10,11-hexahydroxytriphenylene (HHTP) or 2,3,9,10,16,17,23,24-octahydroxyphthalocyaninato copper (PcCu-(OH)8) on a solid surface. The resultant crystalline c-MOF films possess hierarchical structures with a nanoporous shell (~1.2 nm) and hollow interior voids (~500 nm). Systematic gas permeability tests and computational fluid dynamics (CFD) simulations revealed that the permeability of hierarchical hollow Zn-HHTP-H films was 8.4-fold greater than that of a bulk-type Zn-HHTP film, greatly increasing the interfacial mass transfer rate (Fig. 1b). The prepared c-MOF films were further integrated as chemiresistors for ammonia sensing to elucidate the influence of their hollow nature on interfacial mass transfer. Compared to the bulk-type films (MOF films without hierarchical porous structures synthesized by the hydrothermal method), the hierarchical c-MOF film-based sensors displayed a 10-fold improvement in the response speed of ammonia. In particular, the Zn-HHTP-H-based chemiresistive ammonia sensor exhibited the fastest response speed (response time of 9.1 s) at room temperature, superior to those of previously reported chemiresistive ammonia sensors (with response time ≥35 s)32,33,35. Our work provides a general synthetic strategy for constructing hierarchical porous structures, thus improving the interfacial mass transfer to accelerate heterogeneous reactions, which can be further employed to achieve high-performance devices.

Results

Synthesis and characterization of hierarchical c-MOF films

Hierarchical c-MOF films were constructed on a silicon substrate based on an accessible insulating MOF-to-c-MOF transformation approach (Fig. 2a). In the first step, a typical ~500 nm thick ZIF-8 film was synthesized on silicon substrate36, which was utilized as the sacrificial precursor (Supplementary Fig. 1). Second, upon immersion into an HHTP solution (ethanol:water = 7:1, v/v) at room temperature, the as-prepared ZIF-8 film was in-situ transformed into a hierarchical c-MOF (Zn-HHTP-H) film (Fig. 2b, e). Through this sacrificial-template synthetic method, the white ZIF-8 films were gradually decomposed while dark purple Zn-HHTP-H films were formed after 24 h (Supplementary Figs. 2, 3). DFT calculations revealed that the transformation reaction from ZIF-8 crystals to Zn-HHTP crystals is thermodynamically spontaneous (Supplementary Table 1). This should be attributed to the greater stability of the square planar linkages of ZnO4 in Zn-HHTP than the Zn-N coordination bonds in ZIF-8 (Supplementary Fig. 4)37. Following the same sacrificial template synthetic method, the PcCu-Zn and Co-HHTP films with hierarchical hollow nanostructures were synthesized (named PcCu-Zn-H and Co-HHTP-H, respectively, Fig. 2c–g, Supplementary Figs. 58). All these hierarchical c-MOF films exhibited intrinsic electrical conductivity, while the inside was hollow (Fig. 2f, g, Supplementary Table 2).

Fig. 2: Synthetic strategy and structural characterization.
figure 2

a Schematic overview of the transformation of insulating 3D MOF film precursors to hierarchical c-MOF films. bd Schematic structures of Zn-HHTP, PcCu-Zn, and Co-HHTP, respectively. eg The corresponding cross-sectional scanning electron microscope (SEM) images of the Zn-HHTP-H, PcCu-Zn-H, and Co-HHTP-H films, respectively. The scale bars represent 500 nm for (e), 1 μm for (f), and 500 nm for (g).

As shown in the transmission electron microscope (TEM) image (Fig. 3a and Supplementary Fig. 9), the thickness of the Zn-HHTP-H hollow shell was approximately 20 nm, suggesting that the Zn-HHTP-H film possessed a very thin upper surface. The selected-area electron diffraction (SAED) pattern verified the polycrystalline feature of the hollow Zn-HHTP film (Fig. 3b). The lattice fringes at interplanar spacings of 1.8 nm and 0.31 nm corresponded to the (100) and (022) planes of Zn-HHTP crystals, respectively (Fig. 3c)38. The honeycomb pattern observed by high-resolution transmission electron microscopy (HRTEM) illustrated the highly ordered hexagonal MOF frameworks along c-axis (Fig. 3d). Elemental mappings by electron energy loss spectroscopy (EELS) confirmed the homogeneous distribution of C, O, and Zn throughout Zn-HHTP-H (Supplementary Fig. 9).

Fig. 3: Characterization and gas permeability properties.
figure 3

a TEM image of the Zn-HHTP-H scraped off from the film. b SAED pattern (white circle in (a)). c, d High-resolution TEM image of the red square shown in (a). e Nitrogen adsorption and desorption isotherms measured at 77 K for different Zn-HHTP films. f Comparison of the N2 flux values of different Zn-HHTP films at the same operating pressure. gi Contour plots of velocity through the film in the plane of symmetry. The insets show the models for three different Zn-HHTP films. The scale bars represent 500 nm for (a) and 10 nm for (c, d).

Morphology control of c-MOF films

We suggest that the transformation followed a “dissolution-recrystallization” mechanism39,40, and the following possible reaction pathway was proposed (Supplementary Figs. 1013a):

$$2{{{{{\rm{HHTP}}}}}}\rightleftharpoons 2{({{{{{{\rm{HHTP}}}}}}}^{\ast })}^{3-}+6{{{{{{\rm{H}}}}}}}^{+}$$
(1)
$$3{{{{{\rm{Zn}}}}}}{({{{{{\rm{MeIM}}}}}})}_{2}+6{{{{{{\rm{H}}}}}}}^{+}\rightleftharpoons 6{{{{{\rm{HMeIM}}}}}}+3{{{{{{\rm{Zn}}}}}}}^{2+}$$
(2)
$$3{{{{{{\rm{Zn}}}}}}}^{2+}+2{({{{{{{\rm{HHTP}}}}}}}^{\ast })}^{3-}\rightleftharpoons {{{{{{\rm{Zn}}}}}}}_{3}{({{{{{{\rm{HHTP}}}}}}}^{\ast })}_{2}$$
(3)

The total reaction is represented as follows:

$$3{{{{{\rm{Zn}}}}}}{({{{{{\rm{MeIM}}}}}})}_{2}+2{{{{{\rm{HHTP}}}}}}={{{{{{\rm{Zn}}}}}}}_{3}{({{{{{{\rm{HHTP}}}}}}}^{\ast })}_{2}+6{{{{{\rm{HMeIM}}}}}}$$
(4)

A proper balance between the etching and coordination rates was found to be pivotal for achieving a well-defined hollow nanostructure (Supplementary Figs. 13b19). Herein, the ethanol was introduced to reduce the water-dependent etch rate. The Zn-HHTP-H film with ~500 nm cavities was obtained only at low water fractions (25%) and low temperatures (40 °C) (Supplementary Figs. 13b, S13d and S15). When the water fraction and temperature were increased (e.g., 37.5% and 40 °C, respectively), a Zn-HHTP film was formed with small cavities of ~175 nm (denoted as Zn-HHTP-HS film, Supplementary Figs. 13b, S13e and S16, 17). For comparison, a bulk-type Zn-HHTP film (denoted Zn-HHTP-B) with a thickness of ~500 nm was also synthesized directly on a silicon wafer via a procedure similar to that described previously (Supplementary Figs. 2021)41. The Zn-HHTP-HS and Zn-HHTP-B films share identical crystalline structures with Zn-HHTP-H (Supplementary Fig. 22). Fourier transform infrared (FT-IR) spectroscopy, X-ray photoelectron spectroscopy (XPS) and thermogravimetric analyses (TGA) further confirmed the identical compositions of these Zn-HHTP films (Supplementary Figs. 2325). The Brunauer−Emmett−Teller (BET) measurements revealed that the surface areas of the Zn-HHTP-H (614.0 m2 g−1) and Zn-HHTP-HS (479.4 m2 g−1) films were much higher than that of the Zn-HHTP-B film (165.3 m2 g−1), although they all possessed 1.1 nm micropores (Fig. 3e and Supplementary Fig. 26).

To determine the difference in the gas permeability, the abovementioned Zn-HHTP films were further synthesized on a porous nylon 66 membrane via the MOF-to-c-MOF transformation approach (Supplementary Fig. 27). As shown in the permeability test, although the three Zn-HHTP film samples presented a similar film thickness of ~500 nm, much different gas permeabilities were observed (Supplementary Fig. 28). The N2 fluxes of the Zn-HHTP-H film (70.65 L m−2s−1) and the Zn-HHTP-HS film (19.21 L m−2s−1) were 8.4 and 2.3 times higher than that of the bulk-type Zn-HHTP film (8.45 L m−2s−1), respectively (Fig. 3f). Apparently, the hollow interior of the Zn-HHTP films prevented the pressure loss along the path through the c-MOF films, leading to high permeability of the c-MOF films42. Next, the theoretical pressure-driven flow was analyzed to understand the film permeability via commercial CFD software Ansys Fluent (Fig. 3g–i, Supplementary Figs. 29, 30). The simulated N2 fluxes of the Zn-HHTP-H and Zn-HHTP-HS films were 10.2 and 2.2 times higher than that of the Zn-HHTP-B film, respectively, consistent with the experimental permeability results (Fig. 3g–i).

Numerical simulations of the film structure–gaseous fluid interaction

The flow in the vicinity of the solid surface was facilitated by introducing hollow cavities into the bulk-type Zn-HHTP films (Fig. 4, Supplementary Figs. 31, 32 and Supplementary Table 3). Mass transfer mainly depended on the slow molecular diffusion onto the surface of bulk-type film, while extra nonzero convection velocities were generated on the hollow film (Fig. 4a). The surface convection induced by the nonzero velocity enhanced the mass transport, thus largely reducing the time required to achieve equilibrium concentration fields for the hollow films (Fig. 4b, Supplementary Videos 13). The simulation results suggested that the mass transfer efficiency followed the order Zn-HHTP-B film <Zn-HHTP-HS film <Zn-HHTP-H film.

Fig. 4: Numerical simulations of the flow velocity and mass transfer.
figure 4

a Vectors and magnitudes of velocities in the plane of symmetry. The inset images show the models for three different Zn-HHTP films. b Time evolutions of NH3 concentration distributions (from 0 to 0.3 s). c The average surface velocities U in different planes above the surface of the Zn-HHTP films. U0 and z0 represent the average inlet velocity and the thickness of the films, respectively. d The theoretical permeability KHollow for the Zn-HHTP films with varying hollow volume ratios β.

The average surface velocity was positively related to the hollow volume Vhollow (Fig. 4c). The MOF film models were built with three different hollow volume ratios β = Vhollow/Vbulk (β = 0 for the Zn-HHTP-B film, β = 0.43 for the Zn-HHTP-HS film, and β = 0.76 for the Zn-HHTP-H film; V is the volume of the film). To quantify the influence of convection velocity on the mass transfer efficiency, Us was obtained from the top surface area (A) and the local velocity (u) on the surface of MOF films by applying the equation \({U}_{s}=1/A\int {udS}\) (dS is the unit area in integral). The values of Us were then calculated to be 4.87 × 10−6 m/s, 1.43 × 10−5 m/s, and 3.94 × 10−5 m/s for the Zn-HHTP-B, Zn-HHTP-HS, and Zn-HHTP-H films, respectively, indicating that the Zn-HHTP-H film allowed higher mass transfer via convection (Fig. 4b). Such high mass transport of the Zn-HHTP-H film was attributed to the high permeability within the hollow film (Fig. 3f). Along with the high permeability, the surface convection was increased. The increased convection on the hollow film surface in turn enlarged the concentration gradient and enhanced the transport from the environment to the film surface.

Furthermore, we proposed a model to express the relationship between the surface fluid behavior and the hollow nature of the Zn-HHTP porous media (see the “Methods”). By applying the formula derived by Beavers and Joseph43, we implemented a nonzero velocity over the classical bulk-type porous films as the slip boundary condition to solve the governing equation of Stokes flow (see the “Methods”). The velocity U in the fluid region above the film was described as follows:

$${{{{{\rm{U}}}}}}=-\frac{1}{2\mu }\left[\frac{{H}^{2}\,+\,2{K}_{{bulk}}\alpha H}{1+\,\alpha H}-\left(\frac{2{K}_{{bulk}}\alpha -\,\alpha {H}^{2}}{1+\,\alpha H}\right)z-\,{z}^{2}\right]\frac{{dp}}{{dx}}$$
(5)

where Kbulk is the permeability, μ is the dynamic viscosity, α is the slip coefficient, H represents the height of the fluid region, z is the distance between the position and the film surface, and −dp/dx is the pressure gradient.

The flow in the Zn-HHTP-H and Zn-HHTP-HS channels was supposed to still follow Eq. (5), and the morphological hollow was regarded as a porosity factor of the porous medium44,45. Herein, we applied the generalized Kozeny‒Carman (KC) model to derive the hollow-related permeability KHollow (see the “Methods”)46,47.

$${{{{{\rm{U}}}}}}=-\frac{1}{2\mu }\left[\frac{{H}^{2}\,+\,2{K}_{{hollow}}\alpha H}{1+\,\alpha H}-\left(\frac{2{K}_{{hollow}}\alpha -\,\alpha {H}^{2}}{1+\,\alpha H}\right)z-\,{z}^{2}\right]\frac{{dp}}{{dx}}$$
(6)
$${K}_{Hollow}=\left[1+\frac{{\beta }^{3}}{{(1-\beta )}^{2}}\right]$$
(7)

The contribution of internal structural voids to the enhancement of mass transport near the films at varying hollow volume ratios was determined by Eqs. (6) and (7). By fitting the simulated velocity based on the function form of Eq. (6), the values of KHollow for the Zn-HHTP-H and Zn-HHTP-HS models were obtained (Fig. 3c and Supplementary Table 4). The corresponding results from the modified permeability model, i.e., Eq. (7), indicated that the present simulation was in good agreement with the gas permeability experimental results for the Zn-HHTP film (Figs. 3f, 4d and Supplementary Table 4). The proposed model was found to be reliable for evaluating the surface fluid behavior of porous films with internal hollow structures, which offered guidance to further control and optimize the overall mass transfer performance.

Chemiresistive gas-sensing performance

The fresh Zn-HHTP films on silicon substrates were integrated into a chemiresistive device by depositing silver electrodes onto the surface of Zn-HHTP films (Fig. 5a, b and Supplementary Fig. 33). Ammonia (NH3), a typical biomarker for diseases and a highly toxic and explosive gas in the manufacturing and chemical industries, was used as a molecular probe to elucidate the film structure-dependent mass transport behavior in gas sensing48,49. The gas sensing on c-MOF chemiresistive sensors was attributed to the transfer of electrons caused by surface adsorption (Fig. 5a). The n-type dopant of NH3 can donate electrons to the electron-dominated Zn-HHTP semiconductor50 (Seebeck coefficient = −4.4 ± 0.07 μV K−1, thermoelectric measurement shown in Supplementary Fig. 34), causing a change in the resistance of the Zn-HHTP sensors (Supplementary Fig. 35). Significantly different response times were observed for different Zn-HHTP film samples, although all the Zn-HHTP samples possessed similar film thicknesses of ~500 nm (Fig. 5c and Supplementary Fig. 36). Upon exposure to 50 ppm ammonia, the Zn-HHTP-H film-based sensor displayed a very fast response of 9.1 s. The corresponding response times of the Zn-HHTP-HS (41.9 s) and Zn-HHTP-B (99.3 s) films were significantly longer than that of the Zn-HHTP-H film. Note that the fast response speed of the Zn-HHTP-H film sensor was superior to that of reported chemiresistive ammonia sensors at room temperature (Fig. 5d and Supplementary Table 5). This excellent response speed indicated that the increased interfacial mass transfer is a dominant factor that greatly promotes the gas-sensing performance.

Fig. 5: Gas sensing performance.
figure 5

a Schematic overview of the sensing mechanism of Zn-HHTP film-based sensor towards ammonia. b Optical photograph and microscopy image of the fabricated Zn-HHTP-H thin-film-based sensor device. The black area represents the silicon wafer covered by the Zn-HHTP film, and the striped pattern represents the silver electrode. c Response and recovery times for three Zn-HHTP films (Zn-HHTP-B, Zn-HHTP-HS, and Zn-HHTP-H films, respectively) based sensors towards 50 ppm ammonia. d Comparison of the room-temperature ammonia sensing performance of various chemiresistive materials, such as c-MOFs, polymers, and metal oxides (see Supplementary Table 5 for details). The scale bar represents 500 μm for (b).

The Zn-HHTP-H sensor exhibited a response intensity of 43.8% towards 50 ppm ammonia, while the responses of the Zn-HHTP-HS and Zn-HHTP-B films were only 24.8% and 10.8%, respectively (Supplementary Fig. 36). The theoretical limit of detection (LOD) of the Zn-HHTP-H sensor was calculated to be 39.9 ppb (Supplementary Fig. 37 and Table 5), which was also much lower than those of the other two Zn-HHTP sensors (108.2 ppb for Zn-HHTP-HS and 328.8 ppb for the Zn-HHTP-B film). The anti-interference performance of the Zn-HHTP-H film sensor towards 20 ppm of 12 typical interfering gases is shown in Supplementary Fig. 38a. The results demonstrate that the Zn-HHTP film sensing platform was free from the interference of common gases in practical applications and showed high selectivity towards ammonia. In addition, the Zn-HHTP film exhibited good repeatability with a low coefficient of variation (1.96%) for repeated detection over 20 cycles (Supplementary Fig. 38b).

Generality of the HSAID strategy

We also synthesized contrast hollow porous c-MOF films with different metal sites (Zn2+ and Co2+) and ligands (PcCu-(OH)8 and HHTP) (PcCu-Zn-H and Co-HHTP-H, Fig. 6a–c). The lattice fringes at interplanar spacings of 1.7 nm and 1.8 nm both corresponded to the (100) planes of PcCu-Zn and Co-HHTP crystals (Supplementary Fig. 39)23,27. Although these materials shared the same crystal structures and compositions, the BET measurements indicated that the hierarchical PcCu-Zn-H (677.4 m2 g−1) and Co-HHTP-H (637.9 m2 g−1) films exhibited much higher surface areas than the corresponding bulk-type films (187.0 and 234.2 m2 g−1 for PcCu-Zn-B and Co-HHTP-B, respectively) (Supplementary Figs. 4047). The gas permeability values of hierarchical c-MOF films on nylon 66 membranes (103.94 and 37.35 L m−2 s−1 for PcCu-Zn-H and Co-HHTP-H, respectively) were obviously superior to those of the contrast bulk-type films (21.81 and 4.85 L m−2 s−1 for PcCu-Zn-B and Co-HHTP-B, respectively. Figure 6b–d and Supplementary Figs. 48, 49).

Fig. 6: Extended hierarchical MOF films and gas sensing performance.
figure 6

a TEM image of PcCu-Zn-H scraped off from the film. b Comparison of the N2 flux values of the PcCu-Zn-H and PcCu-Zn-B films. c TEM image of Co-HHTP-H scraped off from the film. d Comparison of the N2 flux values of the Co-HHTP-H and Co-HHTP-B films. e Response and recovery times for PcCu-Zn-H and PcCu-Zn-B film-based sensors towards 100 ppm ammonia. f Response and recovery times for Co-HHTP-H and Co-HHTP-B film-based sensors towards 20 ppm ammonia. The scale bars represent 500 nm for (a) and (c).

Upon exposure to 100 ppm ammonia, the PcCu-Zn-H film-based sensor displayed a very fast response time of 9.8 s, while the corresponding response time of PcCu-Zn-B (over 53.1 s) was significantly longer (Fig. 6e and Supplementary Fig. 50). Similarly, upon exposure to 20 ppm ammonia, the response speed of the Co-HHTP-H film-based sensor (19.2 s) was much higher than that of the Co-HHTP-B film (over 75.1 s) (Fig. 6f and Supplementary Fig. 51). Such a fast sensing response in hierarchical c-MOF film-based sensors was attributed to the hollow nature that promoted interfacial mass transfer between the gas environment and the solid c-MOF films.

Discussion

In summary, taking hierarchical porous c-MOF films as models, we demonstrate a general HSAID strategy to efficiently enhance interfacial mass transfer to boost surface reactions (e.g., gas sensing). Hierarchical c-MOF films were constructed via a facile transformation from insulating 3D MOFs and possessed well-defined hollow nanostructures. The CFD simulations and permeability test revealed that the hollow nature significantly enhanced the permeability of the hierarchical c-MOF film, leading to an increase in the motion velocity of molecules. In particular, the Zn-HHTP-H film displayed a more than 7-fold improvement in local mass transport at the film-gaseous environment interface compared with the Zn-HHTP-B film. As a proof-of-concept model, the Zn-HHTP-H film-based chemiresistive sensor exhibited a 10 times faster response speed toward ammonia than the bulk film, was also superior to the other reported sensors at room temperature. Our work addressed the limit of interfacial mass transport based on an emerging class of conductive and porous MOF films and shed light on the microscopic material–environment interplay and interfacial dynamic mechanisms. Furthermore, this work is also applicable to an enormous range of heterogeneous interactions from simple adsorption to complex catalytic reactions, thus revolutionizing the material design for heterogeneous reactions with highly enhanced efficiency and minimum energy and time consumption.

Methods

Preparation of the ZIF-8 film on silicon wafers

A ZIF-8 film with a thickness of ~500 nm was synthesized on a silicon substrate as described previously with some modifications36. Typically, the Si/SiO2 wafers were hydroxylated by immersing in a piranha solution (98% H2SO4 and 30% H2O2 (v/v = 3:1)) at 110 °C for 2 h. After rinsing and ultrasonically cleaning three times with pure methanol, a Si/SiO2 wafer (4 × 1.5 cm) was first immersed into 30 mL of 50 mM Zn(NO3)2 ∙ 6H2O methanolic solution under mild stirring for 30 min. Then, 30 mL of 100 mM 2-methylimidazole (Hmim) methanolic solution was added, and the mixture was allowed to react at room temperature for 5 h. The above steps were repeated twice to realize full coverage of the substrate. Finally, the thin films were dried at 80 °C for further use.

Transformation of ZIF-8 film into Zn-HHTP films

To prepare Zn-HHTP films with different morphologies, a Si/SiO2 wafer (4 × 1.5 cm) with a ZIF-8 film was reacted with 30 mL of an HHTP ethanol/water solution for 24 h. The Zn-HHTP-H films were synthesized by reacting the ZIF-8 film with a 1 mg mL−1 solution of HHTP in ethanol/water solution (7:1, v/v) at room temperature. The Zn-HHTP-HS films were synthesized by reacting a ZIF-8 film with a 2 mg mL−1 solution of HHTP in ethanol/water solution (5:3, v/v) at 40 °C. The Zn-HHTP NWs were synthesized by reacting a ZIF-8 film with a 2 mg mL−1 solution of HHTP in ethanol/water solution (2:6, v/v) at 40 °C. The obtained films were washed with methanol and dried at 80 °C for further use.

Transformation of a ZIF-8 film into PcCu-Zn-H films

PcCu-(OH)8 was synthesized as described previously27. To prepare PcCu-Zn-H films with hollow nanostructures, 28 mL of a 1 mg ml−1 PcCu-(OH)8 solution and 120 mg of sodium acetate in DMF/water solution (7:1, v/v) were prepared first. Next, a Si/SiO2 wafer (4 × 1.5 cm) with a ZIF-8 film was immersed into the solution and reacted at room temperature for 24 h. The obtained PcCu-Zn-H films were washed with methanol and dried at 80 °C for further use.

Preparation of the ZIF-67 film on silicon wafers

A ZIF-67 film with a thickness of ~500 nm was synthesized on a silicon substrate via a procedure similar to that used for the preparation of the ZIF-8 film. Typically, the hydroxylated Si/SiO2 wafers (4 × 1.5 cm) were first immersed into 15 mL of 25 mM Co(NO3)2 ∙ 6H2O methanolic solution under mild stirring for 10 s. Then, 25 mL of 80 mM 2-Hmim methanolic solution was added, and the mixture was allowed to react at room temperature for 3 h. The above steps were repeated twice to realize full coverage of the substrate. Finally, the thin films were dried at 80 °C for further use.

Transformation of ZIF-67 film into Co-HHTP-H films

To prepare Co-HHTP films with hollow nanostructures, a Si/SiO2 wafer (4 × 1.5 cm) with ZIF-67 film was reacted with 32 mL of a 1 mg ml−1 HHTP ethanol/water (6:2, v/v) solution at room temperature for 24 h. The obtained films were washed with methanol and dried at 80 °C for further use.

Construction of Zn-HHTP-B films

Zn-HHTP-B films on hydroxylated Si/SiO2 wafers were synthesized as previously reported with minor modification41. Typically, zinc acetate (2.9 mmol, 45 mg) was first dissolved in 10 mL of deionized water to prepare solution A in a 20 mL vial. Then, a hydroxylated Si/SiO2 wafer was immersed into solution A under mild stirring for 15 min. The HHTP ligand (1.5 mmol, 48.6 mg) was dispersed in 10 mL of isopropanol to prepare solution B. Solution B was added to solution A, and the mixture was allowed to react at 85 °C for 12 h. The above steps were repeated twice and the obtained films were washed with methanol and dried at 80 °C for further use.

Construction of PcCu-Zn-B films

PcCu-Zn-B films on hydroxylated Si/SiO2 wafers were synthesized as previously reported with minor modification41. Typically, PcCu-(OH)8 (15 mg) was first dissolved in 8 mL of DMF to prepare solution A in a 20 mL vial. Then, ammonia solution (25% v/v, 1 mL) in deionized water (8 mL) and 12 mg Zn(acac)2 were added successively. After sonication for 5 min, a hydroxylated Si/SiO2 wafer was immersed into solution, and the mixture was allowed to react at 65 °C for 12 h. The above steps were repeated twice and the obtained films were washed with methanol and dried at 80 °C for further use.

Construction of Co-HHTP-B films

Co-HHTP-B films on hydroxylated Si/SiO2 wafers were synthesized with a procedure similar to that used for the preparation of Zn-HHTP films. Typically, cobalt acetate (50 mg) was first dissolved in 10 mL of deionized water to prepare solution A in a 20 mL vial. Then, a hydroxylated Si/SiO2 wafer was immersed into solution A under mild stirring for 15 min. The HHTP ligand (35 mg) was dispersed in 10 mL of isopropanol to prepare solution B. Solution B was added to solution A, and the mixture was allowed to react at 85 °C for 12 h. The above steps were repeated twice and the obtained films were washed with methanol and dried at 80 °C for further use.

Computational fluid dynamics for gas adsorption in porous media

Three-dimensional numerical simulations of N2/NH3 mixture gas are conducted using ANSYS Fluent 19.0 with a laminar flow model. NH3 gas convection/diffusion and adsorption in Zn-HHTP were modeled with a species transport model combined with a porous media model and user-defined functions (UDFs) to consider the adsorption of NH3 on porous surfaces. Detailed parameters and methods for the simulation are presented in the Supplementary Methods.

We considered the Stokes flow of a viscous fluid through a parallel channel formed by an impermeable upper boundary (z = H) and a permeable lower boundary (z = 0). The nonslip boundary was applied at the upper boundary, i.e., u = 0 at z = H, where H represents the height of the fluid region above the film. The film surface velocity Us was proportional to the shear rate at the permeable boundary, i.e., \(\frac{{du}}{{dz}}=a\left({{{{{{\rm{U}}}}}}}_{s}-{{{{{{\rm{U}}}}}}}_{D}\right)\) at z = 0. Here, α is the slip coefficient, and Darcy’s velocity is given by \({{{{{{\rm{U}}}}}}}_{D}=-\frac{K}{\mu }\frac{{dp}}{{{{{{\rm{d}}}}}}x}\), where dp/dx is the pressure gradient.

For the Stokes flow, \(\nabla p=\mu {\nabla }^{2}{{{{{\boldsymbol{u}}}}}}{{{{{\boldsymbol{\Rightarrow }}}}}}\frac{{dp}}{{{{{{\rm{d}}}}}}x}=\mu \frac{{\partial }^{2}u}{\partial {z}^{2}}\). According to the boundary conditions given above, the solution in the fluid channel is\(\,{{{{{\rm{U}}}}}}=-\frac{1}{2\mu }\left[\frac{{H}^{2}\,+\,2{K}_{{bulk}}\alpha H}{1+\,\alpha H}-\left(\frac{2{K}_{{bulk}}\alpha -\,\alpha {H}^{2}}{1+\,\alpha H}\right)z-\,{z}^{2}\right]\frac{{dp}}{{dx}}\).

Thus, the film surface velocity at z = 0 can be written as \({{{{{{\rm{U}}}}}}}_{s}\,=-\frac{1}{2\mu }\left(\frac{{H}^{2}\,+\,2{K}_{{bulk}}\alpha H}{1+\,\alpha H}\right)\frac{{dp}}{{dx}}\).

The derivation process of the permeability-porosity relationship is presented below. We considered a film consisting of circular pores with a cross-sectional area of Ai and radius of ri. The total cross-sectional area A of the film was \(\,\int {A}_{i}{dN}\left({r}_{i}\right)\), where \({dN}\left({r}_{i}\right)\) denotes the number of pores with a radius of ri.

For laminar flow, \({{{{{{\rm{U}}}}}}}_{i}\left({r}_{i}\right)=-\frac{{r}_{i}^{2}}{8}\frac{1}{\mu }\frac{{dp}}{{dx}}\), where \({{{{{{\rm{U}}}}}}}_{i}\left({r}_{i}\right)\) is the average velocity in individual pores. The average velocity through the cross-sectional area A was approximated as\(\,{{{{{{\rm{U}}}}}}}_{f}=\frac{1}{A}\int {{{{{{\rm{U}}}}}}}_{i}\left({r}_{i}\right){A}_{i}{dN}\left({r}_{i}\right)\approx \frac{\sum {{{{{{\rm{U}}}}}}}_{i}\left({r}_{i}\right){A}_{i}{dN}\left({r}_{i}\right)}{\sum {A}_{i}{dN}\left({r}_{i}\right)}\propto \varepsilon {U}_{i}\left({r}_{h}\right)\), where the hydraulic radius \({r}_{h}\propto \frac{\varepsilon }{\left(1-\varepsilon \right)}\) was introduced to replace ri. Thus, \({{{{{{\rm{U}}}}}}}_{f}\propto -\varepsilon \frac{{r}_{h}^{2}}{8}\frac{1}{\mu }\frac{{dp}}{{{{{{\rm{d}}}}}}x}=-\frac{{\varepsilon }^{3}}{{\left(1-\varepsilon \right)}^{2}}\frac{1}{\mu }\frac{{dp}}{{{{{{\rm{d}}}}}}x}\). A comparison of Uf with Darcy’s velocity yielded the permeability-porosity relationship \({K}_{{bulk}}={C}_{{kc}}\frac{{\varepsilon }^{3}}{{\left(1-\varepsilon \right)}^{2}}\).

We believe the permeability-porosity relationship derived above is still valid for hollow interior films. It is reasonable to assume that the contribution of hollows by volume ratio is directly analogous to the effect of porosity on permeability, and the difference in permeability caused by hollows is proportional to the term\(\,\frac{{\varepsilon }^{3}}{{\left(1-\varepsilon \right)}^{2}}\). Therefore, we substituted the hollow volume ratio β for the porosity ε and directly added an increment \({\triangle K}_{{Hollow}}=\frac{{\beta }^{3}}{{\left(1-\beta \right)}^{2}}{K}_{{bulk}}\) to the original Kbulk. Finally, we obtained the permeability of the hollow interior film from the following equation: \({K}_{{Hollow}}\,=\left[1+\frac{{\beta }^{3}}{{\left(1-\beta \right)}^{2}}\right]{K}_{{bulk}}\).

The values of KHollow for the Zn-HHTP-H and Zn-HHTP-HS models were calculated using the data in Fig. 4c (for details, see Supplementary Table 3). Here, H is 1 μm, and Kbulk was set to \(2\times {10}^{-15}\,{{{{{{\rm{m}}}}}}}^{2}\). For example, according to Eq. (5) for the Zn-HHTP-HS film, \(\frac{{H}^{2}\,+\,2{K}_{{Hollow}}\alpha H}{1+\,\alpha H}=1.36\times {10}^{-14}\,{{{{{{\rm{m}}}}}}}^{2},\,\frac{2{K}_{{Hollow}}\alpha -\,\alpha {H}^{2}}{1+\,\alpha H}=-1.28\times {10}^{-6}\,{{{{{{\rm{m}}}}}}}^{2}\), KHollow was calculated to be \(6.01\times {10}^{-15}\,{{{{{{\rm{m}}}}}}}^{2}\). For the Zn-HHTP-H film, \(\frac{{H}^{2}\,+\,2{K}_{{Hollow}}\alpha H}{1+\,\alpha H}=7.06\times {10}^{-14}\,{{{{{{\rm{m}}}}}}}^{2},\,\frac{2{K}_{{Hollow}}\alpha -\,\alpha {H}^{2}}{1+\,\alpha H}=-1.69\times {10}^{-6}\,{{{{{{\rm{m}}}}}}}^{2}\,\), and KHollow was calculated to be \(2.88\times {10}^{-14}\,{{{{{{\rm{m}}}}}}}^{2}\,\). KHollow/Kbulk were thus calculated to be 3.01 and 14.45 for the Zn-HHTP-HS and Zn-HHTP-H films in our simulations, respectively. Additionally, according to Eq. (7) with β = 0.43 and 0.76, KHollow/Kbulk was calculated to be 1.25 and 8.81 for the Zn-HHTP-H and Zn-HHTP-HS films, respectively.

Permeability test

The permeance test was conducted by means of a pressure filtration device (HP4750, Sterlitech). The 2D c-MOF films coated on a nylon 66 membrane with a diameter of 22 mm were used for testing. The operating temperature was 25 °C, and the operating pressure was 0.5 bar. A soap bubble flowmeter was used to measure the gas flux.

Gas sensing experiments

The ~500 nm thick 2D c-MOF film samples on Si/SiO2 wafers were integrated into a chemiresistive device by depositing silver electrodes with a channel length of 80 μm. The fabricated sensors were aged at room temperature in air for 6 h. The fabricated sensors were aged at room temperature in air for 6 h. The sensing tests were carried out on a CGS-4TPs (Beijing Elite Tech Co., Ltd., China) intelligent sensing analysis system. The relative humidity (RH) was 25 ± 10%. Ammonia gases with different concentrations are generated by dropping certain amounts of ammonia water (25–28 wt%) with a microsyringe onto an evaporator in the test chamber (total volume of 20 L). Other kinds of gases, including ethanol, acetone, toluene, formaldehyde, and water, that are similar to ammonia were used. Detailed methods and experimental setup for the gas concentration regulation and gas-sensing test are presented in the Supplementary Methods.

Reporting summary

Further information on research design is available in the Nature Portfolio Reporting Summary linked to this article.