Introduction

Air pollution with solid materials such as car exhaust and smoke or toxic gaseous materials such as combustion gases (CO, SO2, NO2) resulting from industrial development are important matters as they negatively affect both the environment and human health (Chen et al. 2021; Shi et al. 2021; Dai et al. 2021; Xu et al. 2022). The release of a large amount of nitrogen dioxide and sulfur into the air causes smog and acid rain, which have adverse effects on fresh water and soil. Toxic ammonia gas with a pungent odor is used in many industries such as water purification, a refrigerant gas, fertilizer, and in the removal of sulfur oxides and nitrogen oxides from smokestacks (Timmer et al. 2005; Soleimanpour et al. 2013; Srivastava et al. 2015). To reduce the number of toxic gases in the air, there is a promising challenge to search for materials that are used as sensitive materials for these gases.

Researchers conducted their study using three-dimensional (3D) such as MnO2 (Ye et al. 2020), two-dimensional (2D) such as graphene (Ali and Tit 2019; Ardehjani and Farmanzadeh 2019; Kumar et al. 2017; Chen et al. 2018; Zhou et al. 2017), GeS monolayer (Ma et al. 2018), MoS2 monolayer (Zhang et al. 2019; Abbasi and Sardroodi 2019; Wei et al. 2018), and g-C3N4 (Zhang et al. 2018), one-dimensional (1D) such as polypyrrole (Hernandez et al. 2007) and zero-dimensional materials (0D) such as fullerenes and fullerenes-like structure (Salimifard et al. 2017; Li et al. 2020) for the sensitivity of harmful gases. Fullerenes-like structure and fullerenes as novel materials based on physical and chemical properties. Several nanoclusters (XY)12 (X: B, Al, Ga,…)(Y: N, P, …, etc.) were investigated that have inherent special stability. Noei (2017) studied the sensitivity of B12N12 and Al12N12 nanoclusters for SO2 gas. He reported that Al12N12 nanocage displays a higher sensitivity toward SO2 molecule and adsorbs on the tetragonal ring of the Al12N12. Rad and Ayub (2017) investigated B12N12 nanocage functionalized by nickel for sensing SO2 and O3 molecules and the study reveals high adsorption for both SO2 and O3 molecules.

Silicon carbide (SiC) compound that is composed of silicon and carbon belongs to the same group (IV) of the periodic table. After diamond and boron nitride, SiC is the third hardest material, which provides it exceptional features including high-temperature stability, chemical resistance, and biological compatibility (Locke et al. 2012). Silicon carbide nanomaterials are one of the most promising semiconductors due to their superior properties. They are used in electronic industrial (Cho et al. 2000; Bhatnagar and Baliga 1993) and biophysics fields (Zhou et al. 2006; Zhang et al. 2003). Hence, silicon carbide nanostructures have attracted wide and great interest. Mpourmpakis et al. (2006) reported the potential of the SiC nanotubes for hydrogen storage. They found that SiC nanotubes show 20% in comparison with carbon nanotubes for the binding energy of the H2 molecules. Silicon carbide Si12C12 nanocage consists of hexagons and tetragons. Wang et al. (2005) have studied the structure of (SiC)n cages (n = 6–36) showing that (SiC)12 nanocage is the most stable cage in this family. Solimannejad et al. (2017) investigated the Si12C12 nanocage by Cu decoration toward cyanogen gas using DFT calculations and the result reveals that the interaction of cyanogen gas with nanocage is chemisorption which is a good sensor for detecting NCCN molecules. To our knowledge, no research article studied the interaction of NO2, SO2, and NH3 toxic gases with the Si12C12 nanocage. It is known that atom doping improves the electronic properties of semiconductor materials. Therefore, we also studied the n- and p-type doped for the sensitivity of NO2, SO2, and NH3 toxic gases.

Computational details

In this work, we have carried out a computational study based on the density functional theory by performing full optimization of both the pristine and the doped nanocages in the absence and presence of gas molecules. All DFT calculations were implemented in the Gaussian 09 code (Frisch et al. 2009) using B3LYP functional and 6–31 g(d,p) basis set for NH3 system and 6–31 g(d) for SO2 and NO2 systems. The density functional B3LYP has been widely employed in nanostructures research (Arab and Habibzadeh 2016; Tabtimsai et al. 2013; Ghorbaninezhad and Ghorbaninezhad 2013; Beheshtian et al. 2013). The adsorption energy (Eads) of gas molecules on nanocage can be calculated using the following equations:

$$E_{{{\text{ads}}}} = E_{{{\text{G}}@{\text{nanocage}}}} - E_{{\text{G}}} - E_{{{\text{nanocage}}}}$$
(1)
$$E_{{{\text{ads}}}} = E_{{{\text{G}}@{\text{doped}}\,{\text{nanocage}}}} - E_{{\text{G}}} - E_{{{\text{doped}}\,{\text{nanocage}}}}$$
(2)

The counterpoise method (Beheshtian et al. 2013) was used to compute the adsorption energy (Eads) of gas molecules on nanocage, which was corrected with basis set superposition error (BSSE).

$$E_{{{\text{ads}}}}^{{{\text{corr}}}} = E_{{{\text{ads}}}} - E_{{{\text{BSSE}}}}$$
(3)

where EG@nanocage, EG@doped nanocage, Enanocage, Edoped nanocage, EG are the total energies of gas molecules on pristine nanocage(Si12C12), gas molecules on doped nanocage (PSi11C12 and Si12BC11), nanocage, doped nanocages, and gas molecules, respectively.

We have calculated thermodynamic parameters at T = 298 K and P = 1 atm as follow:

$$\Delta H = H_{{{\text{G}}@{\text{nanocage}}}} {-}H_{{\text{G}}} - H_{{{\text{nanocage}}}}$$
(4)
$$\Delta H = H_{{{\text{G}}@{\text{doped}}\,{\text{nanocage}}}} {-}H_{{\text{G}}} - H_{{\text{doped nanocage}}}$$
(5)

where HG@nanocage, HG@doped nanocage, Hnanocage, Hdoped nanocage, HG are sum of electronic and thermal enthalpies of gas molecules on pristine nanocage(Si12C12), gas molecules on doped nanocage (PSi11C12 and Si12BC11), nanocage, doped nanocages, and gas molecules, respectively. The Gibbs free energy and entropy were calculated by a similar method. The figures were plotted with the Gauss View software. The partial density of state (PDOS) for the selected systems was carried out by the GaussSum program (O'Boyle et al. 2008) (Fig. 1).

Fig. 1
figure 1

Structural model of a pristine Si12C12; b SiP–Si11C12; (C) CB–Si12C11

Results and discussion

The adsorptions configurations and energetic of SO2 on Si12C12, SiP–Si11C12, and CB–Si12C11 nanocages

To investigate the reactivity of silicon carbide nanocage that doping with phosphorus (n-type) and boron atoms (p-type) toward various toxic gases, the adsorption of these gases at the pure Si12C12 was initially calculated as a reference. Next, the adsorption configuration and corresponding adsorption energies were examined to clarify how the n-type and p-type of doped silicon carbide nanocage affect the SO2, NO2, and NH3 adsorption using DFT with the B3LYP methods. Three non-equivalent adsorption orientations including monodentate and cycloaddition orientations, named a, b and c, were considered for the adsorption of SO2 on the pristine Si12C12, SiP–Si11C12 (n-type), and CB–Si12C11 (p-type) surfaces, Figs. 2, 3 and 4. To form a monodentate configuration (structure a), the oxygen atom of SO2 is bonded with a silicon atom of Si12C12, Fig. 2. The two O atoms of gas bind to two adjacent surface Si atoms to form structure b, whereas the S atom of SO2 binds to a surface C atom, and the two O atoms of gas bind to two adjacent surface Si atoms to form structure c. The comparative adsorption energy of SO2 on various sites is summarized in Tables 1, 2 and 3. As demonstrated in Tables 1, 2 and 3, the negative values of binding energy correspond to the exothermic reaction consequently the adsorption of SO2, NO2, and NH3 on the surface of Si12C12, SiP–Si11C12, and CB–Si12C11 are energetically favorable. The results elucidated that SO2 molecules are chemically adsorbed on structures 1b (− 2.36 eV), all SiP–Si11C12 (− 1.315 to − 1.530 eV), and CB–Si12C11 (− 2.20 and − 2.63 eV) whereas physically adsorbed on (structures 1a and 1c). The sequence of adsorption energy for the SO2 gas is CB–Si12C11 > Si12C12 > SiP–Si11C12, suggesting that, the CB–Si12C11 (p-type) is energetically more appropriate than SiP–Si11C12 (n-type).

Fig. 2
figure 2

The optimized structure of a SO2; b NO2; c NH3 at the pristine Si12C12

Fig. 3
figure 3

The optimized structure of a SO2; b NO2; c NH3 at SiP–Si11C12

Fig. 4
figure 4

The optimized structure of a SO2; b NO2; c NH3 at CB–Si12C11

Table 1 Geometrical parameters (Å), binding energy (Eads), charges (q) of SO2, NO2 and NH3 on Si12C12 nanocage
Table 2 Geometrical parameters (Å), binding energy (Eads), charges (q) of SO2, NO2 and NH3 on SiP-i11C12 nanocage
Table 3 Geometrical parameters (Å), binding energy (Eads), charges (q) of SO2, NO2 and NH3 on CB-Si12C11 nanocage in gas phase and two different solvent phases

The variation in the bond lengths of the SO2 molecule at the Si12C12, SiP–Si11C12, and CB–Si12C11 showed that the calculated bond lengths Si–C, P–C, and Si–B increased from 1.834 Å to 1.977 Å, 1.844 Å to 1.860 Å and 1.974 Å to 2.080 Å, respectively, demonstrating that adsorbed gases weakened the interaction between Si–C, P–C, and Si–B of Si12C12, SiP–Si11C12, and CB–Si12C11. Meanwhile, the nearest distances between the SO2 molecules with the carbon atom of Si12C12 (1b), and SiP–Si11C12 (2b) were 1.765, 1.808 Å, respectively, implying the possible strong interaction between the C atom of nanocage and the S atom of SO2. Moreover, the oxygen atoms of SO2 interact with Si atoms of Si12C12, SiP–Si11C12, and CB–Si12C11 at distances of 1.837, 1.833, and 1.812 Å, respectively. The calculated averages bond lengths of the S–O bonds in SO2@Si12C12 (1b), SO2@ SiP–i11C12 (2b), and SO2@ CB–Si12C11 (3a) is significantly enlarged from 1.462 Å in free SO2 molecule with a close agreement with Chen et al. (2016) to 1.636, 1.655 and 1.669 Å in the most stable configuration of adsorbed gas molecules on Si12C12, SiP–Si11C12, and CB–Si12C11 (structure 1b, 2b and 3a) that are depicted in Tables 1, 2 and 3. According to the provided results, the change in the SO2 bond lengths upon adsorption at CB–Si12C11 is greater than those of SiP–i11C12 and Si12C12.

To examine the effect of solvent on the interaction of the most stable configuration of SO2 molecule at the CB–Si12C11 (3a), full geometry optimizations were performed for gas molecule on CB–Si12C11 in aqueous solution and acetonitrile as polar solvents, using the conductor-like polarizable continuum model (CPCM) and the self-consistency reaction field (SCRF) approach (Barone and Cossi 1998). According to the provided results in Table 3, all the adsorption energies of SO2 molecule at the CB–Si12C11 (3a) are lower in polar solvents than in the gas phase, indicating that the molecular polarities of SO2 molecule at the CB–Si12C11 (3a) in the solvent phases are lower than in the gas phase. Although the calculated averages bond lengths of the most stable configuration of adsorbed SO2 molecule at the CB–Si12C11 1 (3a) in the two solvents show a similar trend, the length elongation of S–O in the solvent phase is greater than corresponding bond lengths in the gas phase. According to NBO analysis, a significant charge transfer of − 0.617e and − 0.611 e from CB–Si12C11 to the sensitive SO2 is greater than that of gas phase (− 0.595 e), while the corresponding energy gaps exhibit a negligible change (~ 0.003 eV).

The effect of diffuse basis set (6–31 g + (d)) on the interaction of the most stable configuration of SO2 molecule at the CB–Si12C11 (3a) is examined Table 3. Although the results indicate a significant decrease in adsorption energy when compared to the 6–31 g(d) basis set, the bond lengths and charge transfers of the SO2/CB–Si12C11 (3a) system are almost the same in both basis sets.

The adsorptions configurations and energetic of NO2 on Si12C12, SiP–Si11C12, and CB–Si12C11 nanocage

The geometrical, electronic properties, and the binding energies of NO2 on the various adsorption sites of the Si12C12, SiP–Si11C12, and CB–Si12C11 nanocages were examined and compared. To find the most stable complexes due to the adsorption of NO2 on the Si12C12, SiP–Si11C12, and CB–Si12C11, several configurations of NO2 molecules are explored. Then, molecular configurations were systematically estimated to examine the most active and stable surface that was energetically more favorable, Figs. 2, 3 and 4. Our results showed that NO2 molecules are chemically adsorbed on all Si12C12, SiP–Si11C12, and CB–Si12C11 surfaces. From Tables 1, 2 and 3, the adsorption energies of the most stable configurations of NO2 (structure 4a, 5a, and 6a) at Si12C12, SiP–Si11C12, and CB–Si12C11 are − 1.80, − 2.15, and − 3.58 eV, respectively, indicating the adsorption capability of CB–Si12C11 is greater than that of SiP–Si11C12 and Si12C12.

The greater adsorption energies values corresponded to Si–O, P–O, and B–O bond lengths are 1.723, 1.669, and 1.490 Å for Si12C12, SiP–Si11C12, and CB–Si12C11, respectively; suggesting the strongest adsorption at CB–Si12C11 with the lowest bond length. On the other hand, the shorter length of the O–Si bond at 1.76 Å compared with 1.79 Å for O–Si (Pekka and Michiko 2009; Lina et al. 2020) elucidates the nature of exothermic chemisorptions confirming the large interaction energy and charge transfer, Tables 1, 2 and 3. The length elongation of N–O (1.508 Å) at SiP–Si11C12 is greater than corresponding bond lengths at the Si12C12 (1.41 Å) nanocage. The elongated N–O bond is due to the strong adsorption of NO2 with SiP–Si11C12 (structure 5a). According to the provided results in Table 3, the length elongation of N–O bond lengths upon adsorption on the CB–Si12C11 is greater than that for SiP–Si11C12 and Si12C12 nanocages. From the comparison of NO2 and SO2 binding energies, it is also worth noting that NO2 in the most stable configurations binds significantly more strongly than SO2 at the same sites, in accordance with (Artuc et al. 2014).

The adsorptions configurations and energetic of NH3 on Si12C12, SiP–Si11C12, and CB–Si12C11 nanocages

The variation in interaction energies of the most stable orientations of supplementary materials, NH3 on Si12C12, SiP–Si11C12, and CB–Si12C11 nanocages is represented in Figs. 2, 3 and 4. The corresponding adsorption energies, charge transfers, the nearest distance between the NH3 molecule and the nanocage are listed in Tables 1, 2 and 3. The NH3 molecule has the highest interaction at Si12C12 and CB–Si12C11 with the binding energy of − 1.53 eV (structure 7a) and − 1.34 eV (structure 9b), which is categorized in the region of chemisorptions. The Eads of NH3 at SiP–Si11C12 structures (8a–8c) are − 0.24, 0.09, and − 0.11, which revealed that the adsorption of NH3 is weak physical adsorption or weak van der Waals forces of attraction even if the reaction is spontaneous. The overall increase in the binding energies for NH3 on the CB–Si12C11 with respect to the Si12C12 and SiP–Si11C12 clearly suggests that the CB–Si12C11 (P-type) surface mediated mechanism is active. Interestingly, the C–N bond length with 4.172, 3.957 Å shows that there is only a faint interaction between NH3 and both Si12C12 and SiP–Si11C12 (structures 7c and 8c). Meanwhile, as shown in Tables 1, 2, the physisorption N–H bond length demonstrated a negligible change.

The BSSE calculations were examined using the counterpoise approach as described by Boys and Bernardi (1970) for the most stable adsorption system configurations. The BSSE corrected stabilization energy values are significantly lower than the uncorrected values (Table 1). The stabilization energies of SO2, NO2, and NH3 on CB–Si12C11 nanocage were determined to be 0.014, 0.008 and 0.008 eV, suggesting that BSSE does not play an important role in the studied systems.

Natural bond orbital (NBO) analysis

Natural bond orbital (NBO) analysis of adsorbed SO2, NO2, and NH3 molecules was investigated as shown in Tables 1, 2 and 3. It should be noted that the strong SO2 and NO2 adsorption induces a significant electronic redistribution at the surface of nanocages. The negative values of SO2 and NO2 refer to electron transfer from nanocages to gas molecules (acceptor character), whereas the positive value of the NH3 (donor character) represents charge transfer from NH3 molecule to the Si12C12, SiP–Si11C12, and CB–Si12C11. The P and B atoms in the SiP–Si11C12 and CB–Si12C11 molecules supply the majority of the charges to the molecule to stabilize the binding between adsorbed gas and the surface. This means that the charge of doped P atoms can easily transfer to their nearby C atom of the silicon carbide to stabilize the entire system. Consequently, a better charge transfer takes place from the phosphorus-doped silicon carbide nanocages to the neighboring carbon atom of SiP–Si11C12 accepted by SO2 and NO2. Therefore, the presence of carbon adjacent to P at the SiP–Si11C12 increases the charge depletion at the P atoms to 0.620 e and 0.715 e, due to the greater electronegativity of O and S compared to that of the P atom. These results can be explained by the electronegativity variation among S, O, and N atoms, where the most electronegative O atom withdraws more electrons at SiP–Si11C12, resulting in more d-states available for greater binding energies of NO2 and SO2 gases. Meanwhile, phosphorus-doped silicon carbide acts as a bridge for interacting with adsorbed gases (SO2, NO2), and the carbon atoms of SiP–Si11C12 subsequently, it plays an important role as a great potential application as NO2 and SO2 gas sensor. According to NBO analysis, a significant charge transfer of − 0.477 and − 0.323 e from SiP–Si11C12 to the sensitive SO2 and NO2 was mainly accumulated over the oxygen atom of SO2 and NO2. The charge transfer from SiP–Si11C12 to the NO2 and SO2 gases results in a reduction in SiP–Si11C12 carrier density. Therefore, the resistance of n-type SiP–Si11C12 enhances, while the corresponding energy gaps exhibit a negligible change, Table 2. As a result, the phosphorus-doped silicon carbide with a positive charge and negatively charged at SO2, NO2 creates an electrical field on the surface that enhances the dipole moment. Even though the B atom of CB–Si12C11has a negative charge that increases from − 1.146 to − 1.588 in the SO2@ CB–Si12C11 (3a), it decreases to − 0.931 in NO2@ CB–Si12C11 (6a) complex. As a result, the resistance of the p-type of NO2@ CB–Si12C11 (6a) structure reduces and the corresponding energy gaps exhibit a negligible change, Table 3.

According to the provided results (Tables 1, 2 and 3), the more negative Eads suggests a higher charge transfer and a significant molecular orbital overlap matrix between Si12C12 and CB–Si12C11 and the NH3 adsorbed gases. In contrast, the low Eads, low transfer charge, and larger bond length have demonstrated that SiP–Si11C12 has weak adsorption of NH3 molecule. Moreover, the slightly positive charge accumulated on the most stable configurations of NH3 (structure 7a and 9b) where the adsorbed gas donates 0.231 and 0.394 e toward the Si12C12 and CB–Si12C11, respectively. Overall, when the NH3 molecule is adsorbed at C position on the Si12C12 nanocage, there is a minimum charge transfer (0.032e) compared to others, whereas the NH3@ CB–Si12C11 (9b) complex has the maximum charge transfer (0.480e). Consequently, the reducing (NH3) gas molecules adsorbed on CB–Si12C11 act as charge donors, transferring electrons to the CB-Si12C11 monolayer, reducing the charge carrier density of the p-type CB–Si12C11 surface and enhancing its resistance.

Frontier molecular orbital analysis

The kinetic stability and chemical reactivity of phosphorus and boron silicon carbide nanocages as molecular gas sensors is fundamentally attributed to the FMOs, HOMO, LUMO, and energy gap of the most stable adsorption configurations of SO2, NO2, and NH3 at Si12C12, SiP–Si11C12, and CB–Si12C11 nanostructure were investigated in Tables 1, 2 and 3 and Figs. 5, 6, 7 and 8. It was shown that the energy gap of isolated pristine Si12C12 is essentially reduced from 3.23 to 2.858 eV and 2.933 eV by doping P and B atoms at the SiP–Si11C12 and CB–Si12C11 surfaces, respectively, causing improvement of the conduction properties of the doping nanocage. It can be displayed in Fig. 5 that the HOMO and LUMO mainly distribute on Si12C12, SiP–Si11C12, and CB–Si12C11 fragments. The adsorption of the NO2 at SiP–Si11C12 and CB–Si12C11 systems reduced the energy gap notably up to 0.024 and 0.838 eV especially at CB–Si12C11 surface is noteworthy with the smallest band gap, suggesting an enhancement in the reactivity of the complexes.

Fig. 5
figure 5

HOMO and LUMO states of a pristine Si12C12; b SiP–Si11C12; c CB–Si12C11

Fig. 6
figure 6

HOMO and LUMO states of SO2 at a pristine Si12C12; b SiP–Si11C12; c CB–Si12C11

Fig. 7
figure 7

HOMO and LUMO states of NO2 at a pristine Si12C12; b SiP–Si11C12; c CB–Si12C11

Fig. 8
figure 8

HOMO and LUMO states of NH3 at a pristine Si12C12; b SiP–Si11C12; c CB–Si12C11

Although the strong localization of HOMO occurs essentially on the SiP–Si11C12 and CB–Si12C11 nanocages, strong delocalization of the LUMOs occurs on the SO2 and NO2 and the P- and B-doped sites (Figs. 6 and 7). These results show a significant flow of electron cloud toward the interface between the adsorbed gas (SO2 and NO2) and the SiP–Si11C12, CB–Si12C11, suggesting the enhanced chemisorption adsorption of SO2 and NO2. The oxygen atom in SO2 and NO2 have more electrons than sulfur and nitrogen atoms, they prefer to bond with the Si atom in Si12C12, SiP–Si11C12, and CB–Si12C11. The contribution to the HOMO of NO2@ CB–Si12C11 (6a) is fundamentally centered on the C-2p while N-2p, O-2p, B-2p, and their close vicinity Si-3p orbitals mostly contribute to the LUMO, however, the contributions of the other atoms are insignificant. Furthermore, the band gaps of NH3@Si12C12 (7a) and NH3@ CB–Si12C11 (9b) complexes are 3.23 and 2.938 eV remains almost the same as Si12C12 and CB–Si12C11, respectively.

Because the oxygen atoms in SO2 and NO2 have more electrons than sulfur and nitrogen atoms, they prefer to bond with the Si atom in Si12C12, SiP–Si11C12, and CB–Si12C11.

Molecular electrostatic potential (MEP) analysis

To investigate the charge transfer mechanism during physisorption and chemisorptions of the SO2, NO2, and NH3 on Si12C12, SiP–Si11C12, and CB–Si12C11, molecular electrostatic potential maps (MEP) of the most stable configuration of adsorbed gases are plotted in Figs. 9, 10 and 11. The red color denotes that electron-rich “negative” regions will react with electrophilic molecules. The blue color, on the other hand, denotes a “positive” personality that favors chemical reactions with nucleophilic molecules.

Fig. 9
figure 9

Molecular electrostatic potential of a Si12C12, b SO2; c NO2; d NH3 at the pristine Si12C12

Fig. 10
figure 10

Molecular electrostatic potential of a SiP–Si11C12, b SO2; c NO2; d NH3 at the SiP–Si11C12

Fig. 11
figure 11

Molecular electrostatic potential of a CB–Si12C11, b SO2; c NO2; d NH3 at the CB–Si12C11

The pictures of electrostatic potential for SiP–Si11C12 and CB–Si12C11 show nonuniformity when contrast with that of the pure Si12C12 (Fig. 9). The phosphorus- and boron-doped silicon carbide changes the local electron density and surface polarity, as shown in the electrostatic potential analysis above. For SiP–Si11C12, as shown in Fig. 9b, the electrons transfer from the P atom to the C atom takes place. Due to the color between the P atom and the C atom in SiP–Si11C12 being darker than the color between the P atom and the Si atom, the electron transfer between the P and C atoms is greater than the electron transfer between the P and Si atoms in SiP–Si11C12. These modifications have a significant effect in the interaction between hazardous gases (SO2, NO2, and NH3) with the SiP–Si11C12 and CB–Si12C11 nanocages.

It can be displayed in Figs. 9, 10 and 11 that the electrostatic potential of oxygen atoms in SO2 and NO2 indicates electron accumulation. However, in the areas of P and Si, which are marked as positive zones, phosphorus-doped silicon carbide has a higher positive electrostatic potential, whereas C is marked as negative zones. Furthermore, the plotted MEP visualizes that the red color represents negative zones, which are mainly at the C and B atoms of the CB–Si12C11 site, while the blue color represents electron-deficient sites at the Si atom. However, no significant color variation in MEP maps is observed during NH3 adsorption, confirming the lower Eads and charge transfer.

Thermodynamic parameters and nature of the binding forces

To investigate the influence of doping silicon carbide with phosphorus and boron atoms on the thermodynamic stability of the complex formation process, the Gibbs free energy change (ΔG), enthalpy change (ΔH) and entropy change (ΔS) for the studied systems in the gas phase have been calculated at standard pressure and temperature (STP,1 atm. and 298.15 K), using B3LYP level, Tables 4, 5 and 6. It can be seen that mostly all the Si12C12, SiP–Si11C12, and CB–Si12C11 surfaces show spontaneous adsorption behavior for SO2 and NO2 at ambient temperature (i.e., negative ΔG values). The high negative free energy change (ΔG) values of the most stable SO2@Si12C12 (1b), NO2@Si12C12 (4a), and NH3@Si12C12 (7a) complexes are − 53.24, − 41.12, and − 32.71 kcal mol−1, respectively), indicating spontaneous adsorption on the surface with strong interaction.

Table 4 Thermodynamic parameters of SO2, NO2, and NH3 on Si12C12 nanocage
Table 5 thermodynamic parameters of SO2, NO2, and NH3 on SiP-i11C12 nanocage
Table 6 Thermodynamic parameters of SO2, NO2 and NH3 on CB-Si12C11 nanocage

The enthalpy change values ΔH of the most stable adsorption configurations of SO2, NO2, and NH3 with CB–Si12C11 nanocage are − 50.06, − 80.78 and − 28.44, Kcal mol−1, and the corresponding ΔG of the same configurations are − 35.99, − 66.72, and − 18.23 kcal mol−1, respectively, demonstrate the process's viability and the interaction between the donors and the acceptors is an exothermic and enthalpy stabilized, consequently electrostatic interactions are present. In contrast, the interaction of NH3 at CB–Si12C11 nanocage is less thermally stable than that of SO2 and NO2 at the same conditions. The free energies of the interaction of NH3 for orientation (7b,7c) at Si12C12 are 36.26 (5.01) Kcal mol−1, respectively. Therefore, during the complexation of NH3 at Si12C12 (orientation b and c) and SiP–Si11C1 (all orientations), the ΔG values reveal that the interaction of NH3 on these nanocages is an unviable process (positive free energy), Tables 4, 5 and 6. Subsequently, the ΔG of NH3 complexation reflects the less exergonic process, confirming the lowest adsorption energy and weakly bound adsorption for NH3 at this system.

Finally, a comparison between the ΔG° of SO2, NO2, and NH3 at SiP–Si11C12 and CB–Si12C11 nanocage results shows that over the entire temperature and pressure range studied, the CB–Si12C11 (p-type) nanocage is thermodynamically more favorable than both Si12C12, SiP–Si11C12 (n-type) nanocage. Thermodynamic analysis revealed that the boron atom doped silicon carbide nanocage is energetically stable, increasing the surface capacity of adsorbing NO2, SO2, and NH3.

The projected density of states (PDOS) analysis

To further study the interaction and electronic properties between SO2, NO2, NH3 and Si12C12, SiP–Si11C12, CB–Si12C11 nanocages, the most thermodynamically favorable phosphorus and boron functionalities on the electronic properties of pristine Si12C12 nanocages toward SO2, NO2, and NH3 were analyzed by calculating the projected density of states (PDOS). After fully optimization, the most stable configuration of SO2@Si12C12 (1b), SO2@SiP–i11C12 (2b), SO2@CB–Si12C11 (3a), NO2@Si12C12 (4a), NO2@SiP–i11C12 (5a), NO2@ CB–Si12C11 (6a), NH3@Si12C12 (7a) and NH3@ CB–Si12C11 (9b) complexes were selected for further study of projected density of states. The calculated PDOS of C-2p, B-2p, N-2p, O-2p, P-3p, P-3d, S-3p, S-3d Si-3p, and Si-3d states were shown to detect the contribution of outermost atomic orbital to PDOS, Figs. 12, 13, 14 and 15.

Fig. 12
figure 12

The projected density of states (PDOS) of a pristine Si12C12; b SiP–Si11C12; c CB–Si12C11. The Fermi level is set to be 0 eV

Fig. 13
figure 13

The projected density of states (PDOS) of SO2 at a pristine Si12C12; b SiP–Si11C12; c CB–Si12C11. The Fermi level is set to be 0 eV

Fig. 14
figure 14

The projected density of states (PDOS) of NO2 at a pristine Si12C12; b SiP–Si11C12; c CB–Si12C11. The Fermi level is set to be 0 eV

Fig. 15
figure 15

The projected density of states (PDOS) of NH3 at a pristine Si12C12; b SiP–Si11C12; c CB–Si12C11. The Fermi level is set to be 0 eV

For SO2@Si12C12 (1b) and NO2@Si12C12 (4a) complexes, it can also be clarified that the orbital of O-2p and Si-3p overlaps from − 15.3 to − 6.1 eV below the Fermi level, which indicates the possible bonding between Si and O. The O-2p and S-2p orbitals also overlap from − 15.3 to − 6.1 and from − 4.2 to 4.5 above the Fermi level, showing strong hybridization between S and O. In addition, for SO2 and NO2 at SiP–Si11C12, obvious strong hybridizations are between P-3p, P-3d orbitals and O-2p orbitals from − 16.7 eV to − 10.3 eV. It can be observed that the intensity of phosphorus states reduces when compared with phosphorus states before adsorption of SO2 and NO2, indicating charge transfer from P to O atom of the adsorbed gas (Figs. 12, 13, 14 and 15).

Furthermore, it can be deduced that S-3p, O-2p orbitals (HOMO) are mainly contributed by B-2p and Si-3p states that vicinity the CB site excessively from ~ − 9.4 eV to − 6.5 eV below the Fermi level. However, the LUMO is dominated by B-2p orbitals of B atoms neighboring the Si contributed over a wide range from ~ − 0.5 eV to 6.5 eV above Fermi level, Fig. 9. The intensity of sulfur states reduces when compared with sulfur states of SO2@Si12C12 (1b) complex, suggesting charge transfer from S to O atom (Figs. 12 and 14). The slightly higher energy shifts of Si-3p and B-2p orbitals are due to charge transfer from the Si, and S atoms toward the B-2p and O-2p states, increasing Eg of SO2@ CB–Si12C11 (3a) (3.006 eV) compared with CB–Si12C11 before adsorption of SO2 (2.933 eV), therefore SO2 adsorption on CB–Si12C11 is more stable than that of SiP–Si11C12 (Figs. 13 and 14).

The intensity of B-2p and O-2p states increased at − 6.9 and 10.8 eV when compared with B-2p and O-2p states before adsorption of NO2 due to the electron transfer from Si and N, Table 3. Furthermore, there are obvious overlapping peaks at − 8.9 eV and − 5.8 eV between the B-2p and O-2p orbital, indicating that there is strong hybridization and combination between the orbital, which may be due to the formation of strengthening the bond between B and O. These differences suggested that the interaction of NO2 with SiP–Si11C12 and CB–Si12C11 is stronger than that between SO2 and the same surfaces. Furthermore, the B-2p, Si-3p, and Si-3d orbitals were upshifted toward the Fermi level, from − 4.5 eV to − 2.4 eV, indicating the band gap after the adsorption of NO2 on CB–Si12C11 decreased from 2.933 to 2.095 eV. The intensity of B-2p and Si-3p orbitals decreased at − 6.9 and 10.8 eV when compared with B-2p and Si-3p orbitals before adsorption of NO2, indicating the charge transfer from B to O atom of NO2 molecule, Table 3.

As shown in these figures, the partially filled N-2p, O-2p, orbitals of NO2 adsorbed on SiP–i11C12 and CB–Si12C11 elucidated a stronger hybridization than on pure Si12C12, due to the wide distribution of P-3p and B-2p states below the Fermi level, ranging from − 16.8 to − 6.5 eV, instead of the more localized behavior observed on pristine Si12C12. In contrast, the orbital hybridization between NH3 and SiP–Si11C12 is not obvious (Fig. 15), indicating that SiP–Si11C12 was not sensitive to NH3 molecule, but only weak physical adsorption (− 0.24 eV). However, hybridization is not as strong for NH3 and does not occur near the Fermi level, increasing the energy band gap in those systems, which is consistent with the lower binding energies listed in Tables 1, 2 and 3. The great orbital hybridization further indicates that the powerful capability of CB–Si12C11 (P-type) has excellent adsorption performance to sense the poisonous NO2, SO2 and NH3 gases.

Nonlinear optical properties

Polarizabilities and first hyperpolarizabilities characterize the response of a system in an applied electric field. Therefore, theoretical calculations based on quantum mechanics are used to determine the magnitude of polarizability and first hyperpolarizability of the material that is responsible for more active nonlinear optical (NLO) performance (Yaqoob et al. 2022). The significance of the polarizability and the first hyperpolarizability are responsible for the efficiency of electronic communication between SO2, NO2, NH3 and Si12C12, SiP–Si11C12, CB–Si12C11 surfaces (substrates) as well as intramolecular charge transfer (Prasad et al. 2010; Cinar et al. 2011).

In this regard, polarizability (αo) and first hyperpolarizability (βo) are calculated by using Eq. (2) and (3) and are given in Tables 7 and 8. As given in Table 7, the polarizability of SiP–Si11C12 and CB–Si12C11 increase to 172.7364 a.u and 584.4089 a.u with respect to 0.0954 a.u that of isolated Si12C12. The first hyperpolarizability of the isolated Si12C12, SiP–Si11C12, and CB–Si12C11 is only 2.217, 280.83, and 1166.027 a.u, confirming the doping of P and B atoms significantly enhances the polarizability and first hyperpolarizability for the Si12C12 nanocage. The largest values of αo and β0 are reported for CB–Si12C11 (P-type) which is much larger than for Si12C12 and SiP–Si11C12 due to the distortion of symmetry of the nanocage. Because the predominant charge transfer interaction of the studied systems takes place along the longitudinal x-axis, the longitudinal x-components of polarizability (αxx) and first hyperpolarizability (βxxx) have been used as longitudinal components. Thus, the polarizabilities of the structure SO2@Si12C12 (1b), NO2@Si12C12 (4a), and NH3@Si12C12 (7a) complexes increase to 86,426.9, 6154.45, and 3988.13, respectively, with respect to 0.0954 that of isolated Si12C12. The sequence of the polarizabilities for the three various toxic gases is SO2 > NO2 > NH3 at the same substrate. It is clear that the first hyperpolarizabilities for the three complexes depend very strongly on the distance and charge transfer between the Si12C12, SiP–Si11C12, CB–Si12C11, and the respective gas.

Table 7 Polarizabilities (α) of the Si12C12, SiP-i11C12, CB-Si12C11 and their complexes with the most stable configuration of SO2, NO2, NH3 molecules calculated at the B3LYP level of theory
Table 8 First hyperpolarizabilitie(βo) of the of the Si12C12, SiP-i11C12, CB-Si12C11 and their complexes with the most stable configuration of SO2, NO2, NH3 molecules calculated at the B3LYP level of theory

The highest value of polarisability αo and first hyperpolarizability βo are assigned to SO2@ CB–Si12C11 structure 3a (11,700.77 a.u), whereas NH3@Si12C12 (7a) has the lowest hyperpolarizability (52.162 a.u.). Such a decreasing trend for βo can be attributed to the geometric distance and the lowest charge transfer between NH3 and the surface of nanocage. The greater electron transfer and binding energy between the SO2 at CB–Si12C11 surfaces are corresponding to the large hyperpolarizability. Finally, the SO2@ CB–Si12C11 (3a) complex is the most candidate for photonic and optical limiting applications because of the enhanced optical nonlinearities, clearly, the new strategy is extremely effective in improving the NLO response.

Conclusions

DFT calculations have been performed to explore the adsorption geometry, adsorption energy, charge transfer, FMOs, PDOS, the polarizabilities, and first hyperpolarizabilities of SO2, NO2, and NH3 with silicon carbide nanocage that doping with phosphorus (n-type) and boron atoms (p-type). Based on the geometric structure and interaction energies, the CB–Si12C11 nanocage is energetically more effective for the SO2, NO2, and NH3 adsorption, stable and preferred than SiP–Si11C12. The adsorption of the NO2 at SiP–Si11C12 and CB–Si12C11 systems reduces the band gap significantly up to 0.838 eV, especially at CB–Si12C11 surface is noteworthy with the smallest band gap, confirming an enhancement in the conductivity and reactivity of the complexes. The NO2 interaction energies are, significantly larger than those for the corresponding geometries of SO2 at the same sites as well as the SiP–Si11C12 are not suitable for the detection of NH3. CB–Si12C11 (p-type) has excellent adsorption performance to sense the poisonous NO2, SO2, and NH3 gases. Therefore, from a thermodynamic point of view, a comparison between the ΔG° of SO2, NO2, and NH3 at SiP–Si11C12 and CB–Si12C11 nanocage results show that over the entire temperature and pressure range studied, the CB–Si12C11 (p-type) nanocage is thermodynamically more favorable than both Si12C12, SiP–Si11C12 (n-type) nanocage. The SO2@CB–Si12C11 (3a) complex is the most candidate for photonic and optical limiting applications to enhance the NLO response. In summary, CB–Si12C11 has superior sensing performance to SO2, NO2, and NH3 compared with Si12C12, SiP–Si11C12.