pyscal.utils.interpolation
Utility function for pyscal
- pyscal.utils.interpolation.interpolate_go(go_low, go_high, parameter, h=None, tag=None)[source]
Interpolates between two gas-oil curves.
The saturation endpoints for the curves must be known by the objects. They can be estimated by estimate_sorg() etc. or can be set manually for finer control.
The interpolation algorithm is different left and right for saturation endpoints, and saturation endpoints are interpolated individually.
- Parameters:
go_low (
GasOil
) – a “low” casego_high (
GasOil
) – a “high” caseparameter (
float
) – Between 0 and 1. 0 will return the low case, 1 will return the high case. Any number in between will return an interpolated curveh (
Optional
[float
]) – Saturation step-size in interpolant. If defaulted, a value smaller than in the input curves are used, to preserve information.tag (
Optional
[str
]) – Tag to associate to the constructed object. If None it will be automatically filled. Set to empty string to ensure no tag.
- Return type:
- pyscal.utils.interpolation.interpolate_wo(wo_low, wo_high, parameter, h=None, tag=None)[source]
Interpolates between two water-oil curves.
The saturation endpoints for the curves must be known by the objects. They can be estimated by estimate_sorw() etc. or can be set manually for finer control.
The interpolation algorithm is different left and right for saturation endpoints, and saturation endpoints are interpolated individually.
- Parameters:
wo_low (
WaterOil
) – a “low” casewo_high (
WaterOil
) – a “high” caseparameter (
float
) – Between 0 and 1. 0 will return the low case, 1 will return the high case. Any number in between will return an interpolated curveh (
Optional
[float
]) – Saturation step-size in interpolant. If defaulted, a value smaller than in the input curves are used, to preserve information.tag (
Optional
[str
]) – Tag to associate to the constructed object. If None it will be automatically filled. Set to empty string to ensure no tag.
- Return type:
- pyscal.utils.interpolation.normalize_nonlinpart_go(curve)[source]
Make krg and krog functions that evaluates only on the (potentially) nonlinear part of the relperm curves, and with a normalized argument (0,1) on that interval.
For a GasOil krg curve, the nonlinear part is from sgcr to sorg. sgcr is mapped to sg=zero, and sg=1 - sorg - swl is mapped to 1. Then there is an assumed linear part from sorg to 1 which we ignore here.
For a GasOil krog curve, the nonlinear part is from 1 - sorg (mapped to zero) to sg=sgro (mapped to 1).
These endpoints must be known the the GasOil object coming in (the object can determine them using functions ‘estimate_sorg()’, ‘estimate_sgcr()’ and ‘estimate_sgro()’
If the entire curve is linear, it will not matter for this function, because this function only deals with the presumably known endpoints.
- Parameters:
curve (
GasOil
) – incoming gasoil curve set (krg and krog)- Return type:
Tuple
[Callable
,Callable
]- Returns:
tuple of functions. The first will evaluate krg on the normalized Sg interval [0,1], the second will evaluate krog on the normalized So interval [0,1].
- pyscal.utils.interpolation.normalize_nonlinpart_wo(curve)[source]
Make krw and krow functions that evaluate only on the (potentially) nonlinear part of the relperm curves, and with a normalized argument (0,1) on that interval.
For a WaterOil krw curve, the nonlinear part is from swcr to sorw. swcr is mapped to zero, and 1 - sorw is mapped to 1. Then there is an assumed linear part from sorw to 1 which we ignore here.
For a WaterOil krow curve, the nonlinear part is from 1 - sorw (mapped to zero) to swl (mapped to 1).
These endpoints must be known the the WaterOil object coming in (the object can determine them using functions estimate_sorw(), estimate_swcr() and estimate_socr()
If the entire curve is linear, it will not matter for this function, because this function only deals with the presumably known endpoints.
- Parameters:
curve (
WaterOil
) – incoming oilwater curve set (krw and krow)- Return type:
Tuple
[Callable
,Callable
]- Returns:
tuple of lambda functions. The first will evaluate krw on the normalized Sw interval [0,1], the second will evaluate krow on the normalized So interval [0,1].
- pyscal.utils.interpolation.normalize_pc(curve)[source]
Normalize the capillary pressure curve.
This is only normalized with respect to the smallest and largest saturation present in the table, not to the could-be-uncertain swirr that the object could contain, because we then have to make assumptions on the equations used to generate the data in the table.