A device and method for detecting the gas content of a two-phase flow of oil and gas using a
halogen lamp
light source are disclosed. The method includes the following steps: Step 1: Turn on the
halogen lamp
light source and inject the prepared two-phase flow of oil and gas to be tested into the pipeline through a three-way valve according to the pre-calibrated gas content. Step 2: Turn on the
peristaltic pump to uniformly fill the pipeline with the two-phase flow of oil and gas to be tested, then turn off the
peristaltic pump. A first collimating lens is connected to the
halogen lamp
light source via a first
optical fiber to receive the incident light emitted by the
halogen lamp light source. A
spectrometer is connected to the second collimating lens via a second
optical fiber to receive the outgoing light of the two-phase flow of oil and
gas passing through the
flow cell. The
spectrometer records the spectral information in a computer. Step 3: Repeat steps 1 and 2 until the spectral information of all calibrated gas contents is obtained. Step 4: Establish a prediction model using the spectral information. Specifically, a
principal component regression (PCR) model for detecting the gas content of the two-phase flow of oil and gas is established to predict the gas content of the two-phase flow.