The Gibbs Ensemble Monte Carlo (GEMC) technique has been used to study the clustering of water in vapour, alkanes and polyethylene, where the water clusters are in equilibrium with liquid phase water. The effect of an external electric field and ionic impurities on the clustering of water in the hydrocarbons (alkanes and polyethylene) has also been studied. The simulations of water clustering in polyethylene were made more efficient by using a connectivity altering osmotic Gibbs ensemble method. It was found that trends in the size distribution of water clusters in the hydrocarbons are similar to those found in the pure vapour, but that fewer and smaller clusters are formed as the length of the hydrocarbon chain increased. Also, large external electric fields decrease the solubility of water in hydrocarbons, whereas the presence of ionic species dramatically increases the solubility.