Unit 10 Gas-Condensate Reservoirs/functions/materialbalance.py
def condensate_belowdew(Rs, Rv, Rsi, Rvi, Bo, Bg, Np, Gp):
    """
    Calculate the parameters for material balance plot of gas-condensate reservoirs
    below dewpoint pressure

    Input:
    Rs: array
    Rv: array
    Rsi: initial Rs, float (NOTE: if data doesn't provide, calculate it with calculate_condensate_params function)
    Rvi: initial Rv, float (from data Rv)
    Bo: array
    Bg: array
    Np: array
    Gp: array

    Material balance plots:
    * Plot 10.1: F vs Eg

    Output:
    F: array
    Eg: array

    """
    Btg = ((Bg * (1 - (Rs * Rvi))) + (Bo * (Rvi - Rv))) / (1 - (Rv * Rs)) # in RB/STB
    Bto = ((Bo * (1 - (Rv * Rsi))) + (Bg * (Rsi - Rs))) / (1 - (Rv * Rs)) # in RB/scf

    Gi = 0
    F = (Np * ((Bo - (Rs * Bg)) / (1 - (Rv * Rs)))) + ((Gp - Gi) * ((Bg - (Rv * Bo)) / (1 - (Rv * Rs))))
    Eg = Btg - Bg[0]
    return(F, Eg)

    Calculate the parameters for material balance plot of gas-condensate reservoirs
    below dewpoint pressure

    Input:
    Rs: array
    Rv: array
    Rsi: initial Rs, float (NOTE: if data doesn't provide, calculate it with calculate_condensate_params function)
    Rvi: initial Rv, float (from data Rv)
    Bo: array
    Bg: array
    Np: array
    Gp: array

    Material balance plots:
    * Plot 10.1: F vs Eg

    Output:
    F: array
    Eg: array

    
Calculate the parameters for material balance plot of gas-condensate reservoirs
below dewpoint pressure



Material balance plots:
Plot 10.1: F vs Eg

array
Eg: array
Calculate the parameters for material balance plot of gas - condensate reservoirs below dewpoint pressure Material balance plots : Plot 10 . 1 : F vs Eg array Eg : array
def condensate_belowdew(Rs, Rv, Rsi, Rvi, Bo, Bg, Np, Gp):
    Btg = ((Bg * (1 - (Rs * Rvi))) + (Bo * (Rvi - Rv))) / (1 - (Rv * Rs)) 
    Bto = ((Bo * (1 - (Rv * Rsi))) + (Bg * (Rsi - Rs))) / (1 - (Rv * Rs)) 
    Gi = 0
    F = (Np * ((Bo - (Rs * Bg)) / (1 - (Rv * Rs)))) + ((Gp - Gi) * ((Bg - (Rv * Bo)) / (1 - (Rv * Rs))))
    Eg = Btg - Bg[0]
    return(F, Eg)
def condensate_belowdew ( Rs , Rv , Rsi , Rvi , Bo , Bg , Np , Gp ) : Btg = ( ( Bg * ( 1 - ( Rs * Rvi ) ) ) + ( Bo * ( Rvi - Rv ) ) ) / ( 1 - ( Rv * Rs ) ) Bto = ( ( Bo * ( 1 - ( Rv * Rsi ) ) ) + ( Bg * ( Rsi - Rs ) ) ) / ( 1 - ( Rv * Rs ) ) Gi = 0 F = ( Np * ( ( Bo - ( Rs * Bg ) ) / ( 1 - ( Rv * Rs ) ) ) ) + ( ( Gp - Gi ) * ( ( Bg - ( Rv * Bo ) ) / ( 1 - ( Rv * Rs ) ) ) ) Eg = Btg - Bg [ 0 ] return ( F , Eg )
Calculate the parameters for material balance plot of gas-condensate reservoirs
below dewpoint pressure
Calculate the parameters for material balance plot of gas - condensate reservoirs below dewpoint pressure
"""
    Calculate the parameters for material balance plot of gas-condensate reservoirs
    below dewpoint pressure

    Input:
    Rs: array
    Rv: array
    Rsi: initial Rs, float (NOTE: if data doesn't provide, calculate it with calculate_condensate_params function)
    Rvi: initial Rv, float (from data Rv)
    Bo: array
    Bg: array
    Np: array
    Gp: array

    Material balance plots:
    * Plot 10.1: F vs Eg

    Output:
    F: array
    Eg: array

    """ # in RB/STB # in RB/scf
Rs
Rv
Rsi
Rvi
Bo
Bg
Np
Gp