IRP=41 User-Defined relative permeability function

Users may use a relative permeability function defined by themselves without touching the TOUGH4 source codes. The input parameters are the same as other functions through variables RP(1)-RP(10) of data record ROCKS.1.2 and ROCKS.1.2.1. The function must be defined in the PYTHON file: TOUGH_python_module.py. A function named RelpFunction() is already included in the the PYTHON file. Users need to modify this function to their own function. Following is the template of the function:

def RelpFunction(double_array, int_array):

relpm = np.zeros(3, dtype='float64')

RelpParam=np.zeros(10, dtype='float64')

sg=double_array[13] # gas saturation

sl=double_array[14] # liquid saturation

nph=int_array[6] # phase number, 2 phase or 3 phase

nmat=int_array[7] # rock index defined in tough4 input for i in range(0,10):

RelpParam[i]=double_array[i]

#perform relative permeability calculations at following lines:

#results of relative permeabilities stored in

#relpm[0]: gas phase; relpm[1]:aqueous phase; relpm(2): oil phase

return relpm

During runtime, the PYTHON file must be stored at the same location where TOUGH4 executable is located.

Last updated