def __call__(self):
     zin = np.array([self.LC, (1. - self.LC)])
     z, z_mass = Tools_Convert.frac_input(self.MM, zin, self.base)
     return (self.p, self.T, z, z_mass)
===================================
        @(PRESSURE, TEMPERATURE, GLOBAL MOLAR FRACTION): These are the conditions you are interested to evaluate 
===================================

LEGEND:
p: Interested pressure (evaluate the enthalpy for this pressure) [Pa]
T: Interested temperature (evaluate the enthalpy considering this isotherm) [K]
OCR: oil-circulation ratio [-]: it is a mass fraction of oil per total mass mixture
z_mass: global mass fraction 
z: global molar fraction
'''
p = 0.3e5  # <=============================== change here
T = (30. + 273.15)  # <=============================== change here
LC, base = 0.40, 'mass'  # <=============================== change here
zin = np.array([LC, (1. - LC)])
z, z_mass = Tools_Convert.frac_input(MM, zin, base)
'''
=======================================
         CREATING OBJECTS - [to a better identification, all objects' names are followed by "_obj"]
=======================================
'''
rr_obj = RachfordRice()
eos_obj = PengRobinsonEos(pC, Tc, AcF, omega_a, omega_b, kij)

michelsen_obj = Michelsen()
flash_obj = Flash(max_iter=50, tolerance=1.0e-13, print_statistics=False)
prop_obj = Properties(pC, Tc, AcF, omega_a, omega_b, kij)


def getting_the_results_from_FlashAlgorithm_main(p, T, pC, Tc, AcF, z):
    initial_K_values = calculate_K_values_wilson(p, T, pC, Tc, AcF)
Exemplo n.º 3
0
        Building the isotherm and molar concentration to feed the code. Why does it necessary?
        
        Because Pb = Pb @(T, z): We want Pb for a specific global molar fraction and isotherm 
=========================================================================================================

LEGEND:
T: Interested temperature (evaluate the enthalpy considering this isotherm) [K]
LC: Lighter component of your binary mixture
base: It is the base of your fraction, i.e., you must specify 'molar' ou 'mass'
z_mass: global {mass} fraction 
z: global {molar} fraction
'''
T = 520.  #(40. + 273.15)   # <=================================== change here
LC, base = 0.10, 'mass'  # <=============================== change here
zin = np.array([LC, (1. - LC)])
z, z_mass = Tools_Convert.frac_input(BubbleP.MM, zin, base)
'''
=========================================================================================================
        CHANGE HERE (II)

        BUILDING A RANGE: this 4 lines below it is necessary to create a range of pressure necessary in...
                          ... executable() function.
                          To do this it's necessary to import the function calculate_pressure_guess()...
                          ... from BubbleP.py
                          
                          VERY IMPORTANT!: the step size determines how close we are to the correct root. So,
                                           smaller step produces more precise results  
=========================================================================================================

LEGEND:
pG: Guess pressure [Pa] - It is necessary to initialize the search for correct bubble pressure