The transport of unprocessed gas streams in production and gathering pipelines is becoming more attractive for new developments, particularly those in less friendly environments such as deep offshore locations. Transporting gas, oil, and water together from wells in satellite fields to existing processing facilities reduces the investments required for expanding production. However, engineers often face several problems when designing these systems. These problems include reduced flow capacity, corrosion, emulsion, asphaltene or wax deposition, and hydrate formation. Engineers need a tool to understand how the fluids travel together, quantify the flow reduction in the pipe, and determine where, how much, and the type of liquid that would form in a pipe. The present work provides a fundamental understanding of the thermodynamics and hydrodynamic mechanisms of this type of flow. We present a model that couples complex hydrodynamic and thermodynamic models for describing the behavior of fluids traveling in near-horizontal pipes. The model incorporates: A hydrodynamic formulation for three-phase flow in pipes A thermodynamic model capable of performing two-phase and three-phase flow calculations in an accurate, fast and reliable manner. A new theoretical approach for determining flow pattern transitions in three-phase (gas-oil-water) flow, and closure models that effectively handle different three-phase flow patterns and their transitions. The unified two-fluid model developed herein is demonstrated to be capable of handling systems exhibiting two-phase (gas-water and gas-oil) and three-phase (gas-oil-water) flow. Model predictions were compared against field and experimental data with excellent matches. The hydrodynamic model allows: 1) the determination of flow reduction due to the condensation of liquid(s) in the pipe, 2) assessment of the potential for forming substances that might affect the integrity of the pipe, and 3) evaluation of the possible measures for improving the deliverability of the pipeline.