<jupyter_start><jupyter_text><jupyter_code>#@title Phase enevelopes of oil and gas
#@markdown Demonstration of phase envelopes of gas and oil
%%capture
!git clone https://github.com/EvenSol/NeqSim-Colab.git
!pip install py4j
!pip install NeqSim-Colab/lib/neqsim-0.0.1-py3-none-any.whl
import neqsim
import time
time.sleep(3)
from neqsim.thermo.thermoTools import *
import matplotlib
import numpy as np
import matplotlib.pyplot as plt
import math
%matplotlib inline
#@title Wax formation in oil and gas production
#@markdown This video gives an intriduction to wax behaviout in oil and gas production
from IPython.display import YouTubeVideo
YouTubeVideo('9vne-gWFQBw', width=600, height=400)<jupyter_output><empty_output><jupyter_text>Calculation of vol% wax in oil and wax formation temperatureCalculation of amount of wax formation temperature<jupyter_code>nitrogen = 0.5 #@param {type:"number"}
CO2 = 2.5 #@param {type:"number"}
methane = 30.0  #@param {type:"number"}
ethane = 10.0  #@param {type:"number"}
propane =  5.0 #@param {type:"number"}
ibutane =  1.25 #@param {type:"number"}
nbutane =  1.25 #@param {type:"number"}
ipentane =  0.25 #@param {type:"number"}
npentane = 0.25 #@param {type:"number"}
nhexane =  0.125 #@param {type:"number"}
C7 =  50.225 #@param {type:"number"}
C7Molarmass =  410.0 #@param {type:"number"}
C7Density =  900.2 #@param {type:"number"}

fluid1 = fluid('srk')
fluid1.addComponent("nitrogen", nitrogen)
fluid1.addComponent("CO2", CO2)
fluid1.addComponent("methane", methane)
fluid1.addComponent("ethane", ethane)
fluid1.addComponent("propane", propane)
fluid1.addComponent("i-butane", ibutane)
fluid1.addComponent("n-butane", nbutane)
fluid1.addComponent("i-pentane", ipentane)
fluid1.addComponent("n-pentane", npentane)
fluid1.addComponent("n-hexane", nhexane)
fluid1.addPlusFraction("C7", C7, C7Molarmass/1000.0, C7Density/1000.0)
fluid1.getCharacterization().characterisePlusFraction()
fluid1.getWaxModel().addTBPWax();
fluid1.addSolidComplexPhase("wax");
fluid1.setMultiphaseWaxCheck(true);

TPflash(fluid1)

print('wt% wax ', fluid1.getWtFraction(testSystem.getPhaseIndexOfPhase("wax"))<jupyter_output><empty_output>
{'fraction_non_alphanumeric': 0.1412037037037037, 'fraction_numerical': 0.04259259259259259, 'mean_word_length': 7.003703703703704, 'pattern_counts': {'":': 0, '<': 9, '<?xml version=': 0, '>': 9, 'https://': 1, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'chain_length': '2', 'dir': 'jupyter-structured-clean-dedup', 'id': '539911', 'license': 'Apache-2.0', 'n_tokens_mistral': 849, 'n_tokens_neox': 787, 'n_words': 177, 'path': 'notebooks/fluidflow/wax_formation_in_oil_and_gas_production.ipynb', 'repo_name': 'EvenSol/testneqsim', 'size': '2160'}