ICP=41 User-Defined capillary pressure function

Users may use a capillary pressure function defined by themselves without touching the TOUGH4 source codes. The input parameters are the same as other functions through variables CP(1)-CP(13) of data record ROCKS.1.3 and ROCKS.1.3.1. The function must be defined in the PYTHON file: TOUGH_python_module.py. A function named CapiFunction() 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 CapiFunction(double_array, int_array):

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

CapiParam=np.zeros(13, 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,13):

CapiParam[i]=double_array[i]

#capillary pressure calculation parameters: CapiParam[0-12], input through record ROCKS.1.3

#performcapillary pressure calculations at following lines:

#results of capillary pressures stored in capiP[0]: :gas/aqu; capiP[2]:gas/oil

return capiP

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

Last updated