<jupyter_start><jupyter_text>Make a Oil objectFirst create an instance of **oil** object with all the necessary attributes<jupyter_code>oil1 = bl.oil(formation='mir',api=31,rsb=675,sg_gas=0.95,temp=180)<jupyter_output><empty_output><jupyter_text>Make pvt table from correlationsBy default, there are built-in some correlations to build a black oil pvt<jupyter_code>oil1.correlations<jupyter_output><empty_output><jupyter_text>By calling the `pvt_from_correlation` method, a pvt table is constructed with the correlations above.<jupyter_code>oil1.pvt_from_correlations()
oil1.pvt<jupyter_output><empty_output><jupyter_text>Different correlations and pressure rangeIf you like to use different correlation and a different pressure range you can explicitly set<jupyter_code>oil1.correlations['bo'] = 'vazquez_beggs'
oil1.correlations
oil1.pvt_from_correlations(start_pressure=750, end_pressure=4200, n=10)<jupyter_output><empty_output><jupyter_text>PVT ClassIf you have already a PVT table you can incorporate to a **oil** class. `oil_pvt` object is a subclass of `pandas.DataFrame` in which you can upload a table with the `pressure` column to make inperpolation. In the case you use the `pvt_from_correlations` method, it is actually a `oil_pvt` class<jupyter_code>type(oil1.pvt)
oil1.pvt.interpolate([3300,2500],['muo','rs'])
oil1.pvt.interpolate([2140,3300],['rs','muo'])
oil1.pvt.interpolate([2140,3300])<jupyter_output><empty_output><jupyter_text>Make a pvt table<jupyter_code>d = {'pressure':[0,100,200,300,400,500,704],'rs':[0,20,30,50,60,100,120]}
p = bl.pvt(d)
print(type(p))
p
d = {'pressure':[0,100,200,300,400,500,704],'rs':[0,20,30,50,60,100,120]}
p = bl.pvt(d)
p.plot()
rs=675
api=31
sg_gas=0.95
temp = 180
y_co2 = 0.2
y_h2s = 0.1
pb = 1800
p = 2000
bg = 0.00123 #by/pcn
pb_cor = bl.pb(rs=rs,
               temp=temp,
               sg_gas=sg_gas,
               api=api,
               y_co2=y_co2,
               y_h2s=y_h2s,
               multiple=False,
               correction=True,
               method='standing')
pb_cor
rs_cor=bl.rs(p=p,
             temp=temp,
             sg_gas=sg_gas,
             api=api,
             pb=pb,
             multiple=True,
             method=['standing','laster','glaso','vazquez_beggs'])
rs_cor
_p = np.linspace(264,5000,50)
rs_cor=bl.rs(p=_p,
             temp=temp,
             sg_gas=sg_gas,
             api=api,
             pb=pb, 
             rsb=450,
             multiple=False,
             methods='standing')
rs_cor.plot()
bo_cor=bl.bo(p=_p,
             rs=rs_cor['rs'].values,
             temp=temp,
             sg_gas=sg_gas,
             api=api,
             pb=pb,
             multiple=False,
             method='glaso')
bo_cor.plot()
co_cor=bl.co(p=_p, 
             rs=rs_cor['rs'].values, 
             temp=temp, 
             pb=pb, 
             sg_gas=sg_gas, 
             api=api,
             bo=bo_cor['bo'],
             bg=np.full(_p.shape,bg), 
             method_above_pb='petrosky', 
             method_below_pb='mccain')
co_cor.plot()
help(bl.co)
rho_cor=bl.rho_oil(p=_p,
                   co=co_cor['co'].values,
                   bo=bo_cor['bo'].values,
                   rs=rs_cor['rs'].values,
                   api=api,
                   pb=pb)
rho_cor.plot()
_muod = bl.muod(temp=temp,api=api, method=['beal','beggs','glaso'])
_muod
muo_cor=bl.muo(p=_p,
    rs=rs_cor['rs'].values,
    temp=temp,
    api=api,
    pb=pb,
    method_below_pb='beggs',
    method_above_pb='beal',
    method_dead = 'beal'
    )

muo_cor.plot()
h=None
g=type(h)
isinstance(h,type(None))
g<jupyter_output><empty_output>
{'fraction_non_alphanumeric': 0.1357853982300885, 'fraction_numerical': 0.04701327433628318, 'mean_word_length': 2.8976293103448274, 'pattern_counts': {'":': 0, '<': 25, '<?xml version=': 0, '>': 25, 'https://': 0, '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': '6', 'dir': 'jupyter-structured-clean-dedup', 'id': '165707', 'license': 'MIT', 'n_tokens_mistral': 1490, 'n_tokens_neox': 1342, 'n_words': 227, 'path': 'docs/examples/old_examples/oil_pvt.ipynb', 'repo_name': 'scuervo91/pvtpy', 'size': '3616'}