Skip to content

WellFastModel API Reference

pyfastwell.wellflow.well_fastmodel.WellFastModel

skin_from_deviation staticmethod

skin_from_deviation(H: float, rw: float, khkv: float, deviation: float, type: str = 'rogers') -> float

calculate the skin factor from the deviation of the well from vertical, it is valid for deviations from 10 up to 75 degrees

Parameters

H: vertical thickness of the reservoir in m

rw: well radius in m

khkv: ratio of kH to kV

deviation: deviation from vertical in degrees

type: type of correlation to use, options are "rogers", "abobaker", "cinco", "besson"

Returns

skin factor (dimensionless)

Notes

references:

  1. Abobaker, A., Al-Khulaifi, Y., Al-Menhali, A. S., & Al-Menhali, M. (2021). A New Correlation for Estimating the Productivity Index of Deviated Geothermal Wells. Energies, 14(17), 5585. https://doi.org/10.3390/en14175585
  2. CH. Cinco, F.G. Miller, H.J. Ramey Jr., 1975. Unsteady-state pressure distribution created by a directionally drilled well. J. Petrol. Technol., 27 (11) (1975), pp. 1-392
  3. E.J. Rogers, M.J. Economides, 1996. The skin due to slant of deviated wells in permeability-anisotropic reservoirs International Conference on Horizontal Well Technology, Society of Petroleum Engineers
  4. Besson H., 1990. Performance of slanted and horizontal wells on an anisotropic medium. European Petroleum Conference, Society of Petroleum Engineers (1990)
  5. Hassan et al., 2021 https://www.sciencedirect.com/science/article/pii/S0920410520308317

pi_dc1d staticmethod

pi_dc1d(L: float, rw: float, kH: float, mu: float, skin: float) -> float

calculate the productivity index of a vertical well (flow rate [m3/s] for 1 bar pressure difference) in a reservoir with constant thickness (H) and permeability (k) and distance

:param L: distance between the wells in m :param rw: well radius in m :param kH: permeability times thickness in mDm :param mu: viscosity in Pas :param skin: skin factor (dimensionless) :return: productivity index in m3/s/bar

__init__

__init__(economics: GeothermalEconomics, k: float = 100.0, khkv: float = 1.0, segmentlength: float = 50.0, verbose: Optional[bool] = False) -> None

Initialize the WellFastModel with the given economics and settings. This model computes the well flow and economics based on the provided parameters. It will always create a deep copy of the well trees to avoid modifying the original well trees in the economics instance. it will also modify the production temperature based on actual temperatures in the well tree if available.

For the thickness of the reservoir, it will use the top and bottom reservoir depth from the INJ1 well.

Parameters:

economics : An instance of GeothermalEconomics containing the well trajectory and simulation results

economics_settingfile : settings file name for the economics model

k : Horizontal permeability in mD

khkv : Ratio of kH to kv

segmentlength : Segment length in meters for the WiTNO model

verbose : If True, prints additional information during computation

set_dP_BHP

set_dP_BHP(dp_BHP: float)

Set the pressure difference (dP) for the well model, and updates the flow rate accordingly. The pressure difference is the difference between the bottom hole pressure (BHP) of the producer and the injector well.

Parameters:

dp_BHP : Pressure difference in bar, which is the difference between the bottom hole pressure (BHP) of the producer and the injector well.

Notes:

raises ValueError if dp_BHP is not a positive value.

get_BHPs

get_BHPs()

get the injector and producer well BHP

Returns
BHPs [injector, producer] in bar

set_flowrate

set_flowrate(flowrate: float)

Set the flow rate for the well model, and updates the simulation results accordingly, including the actual productivity and injectivity indices

Parameters

flowrate : Flow rate in m3/h

Notes

Raises ValueError if flowrate is not a positive value. This method also updates the economics configuration with the new flow rate and recalculates the simulation results. The bottom hole pressure (BHP) for both the injector and producer wells is calculated based on the flow rate and the injectivity/productivity indices.

set_k_khkv

set_k_khkv(k: float, khkv: float, tryscale: bool = True)

Set the permeability and khkv for the well model. this will also update the WiTNO instance. It is couputationally expensive to set the permeability and khkv, so it should be done only when necessary, unless tryscale is True. If tryscale is True, it will scale the injectivity and productivity indices only if khkv is not altered.

Parameters:

k: Permeability in mD

khkv: ratio of kH to kv

tryscale: If True, it will simply scale the II and PI, if khkv is not altered

getSkinFactors_dc1d

getSkinFactors_dc1d(L: float, rw: float) -> Tuple[float, float]

Get the skin factors for the injector and producer wells for use in DC1D based on the current well model. This method will use the WiTNO instance to calculate the skin factors for both wells. It will be consistent with the well distance (L) and well radius (rw), as to be used in the DC1D model.

Parameters:

L : Distance between the wells in meters rw : Well radius in meters

Returns:

A tuple containing the skin factors for the injector and producer wells (skin_inj, skin_prod) and the ratio of actual II and II for a vertical injector well.

Notes:

The skin factor is a dimensionless number that represents the effect of near-wellbore conditions on the flow of fluid into or out of a well. A positive skin factor indicates a reduction in flow efficiency, while a negative skin factor indicates an enhancement in flow efficiency. The skin factors are calculated based on the current flow rate and the well model.

compute_economics

compute_economics()

Compute the economics of the well model using the configured parameters. This method will use the actual simulation results (which can be actualized by set_flowrate) and other parameters to calculate the NPV, LCOE, cash flow, simdata, wells, wellresults, COP, power, surface production temperature, DT_effective, and DP_loop.

Returns:

A tuple containing NPV [EUR], LCOE [EUR/kWh], cash flow [pd.dataframe], simdata, wells, wellresults, COP[-], power [MW], surface production temperature [C], DT_effective [C], DP_loop [bar]

Notes:

This method will print the NPV, LCOE, COP, and power output if verbose is set to True. The NPV is the net present value of the project, LCOE is the levelized cost of heat, COP is the coefficient of performance, and power is the power output in MW. The cash flow is also returned, which is the cash flow pandas dataframe of the project over the simulation period. :raises RuntimeError: If the economics model has not been set up correctly or if the simulation results are not available.

plot_trajectories

plot_trajectories(outdir: Optional[str] = None)

Plot the well trajectory and save it to a file if specified. This method will plot the well trajectories in 3D and 2D projections.

Parameters:

outdir : If provided, the plot will be saved to the trajectory file base name in the specified outdir. Provide "" to save to the default directory.

run_coldfront

run_coldfront(simyears: float, rockdens: float = 2700.0, rockcap: float = 1000.0, porosity: float = 0.21, loadhours=8760, maxlength: float = 20, gridrange: float = 2000, ncell: int = 200) -> Coldfront

Run the cold front model for the well model. This method will create a Coldfront instance and run the cold front model for the specified number of years. The cold front model will use the well injection temperature, salinity, rock density, rock heat capacity, porosity, and flow rate to calculate the cold front propagation in the reservoir. It does not take into thermal diffusivity in the reservoir and over and underburden layers.

Parameters

simyears : Number of years to run the cold front model

rockdens : Rock density in kg/m3

rockcap : Rock heat capacity in J/(kg*K)

porosity : Porosity of the rock

loadhours : load hours

maxlength : Maximum length of the cold front in meters

gridrange : Range of the grid for the cold front model in meters

ncell : Number of cells for the flow grid in the cold front model (in x and y direction)

Returns:

None

plot_coldfront

plot_coldfront(outdir: Optional[str] = None, title: Optional[str] = None)

Plot the perforated section of the wells and cold front and save it to a file if specified.

Parameters

outdir : if provided, the plot will be saved to this directory.

title : if provided, the plot title, otherwise automatically generated

Notes:

raises RuntimeError: If the cold front model has not been run yet.