Skip to content

pywellgeo.welltrajectory

pywellgeo.welltrajectory.trajectory_base.TrajectoryBase

TrajectoryBase creates the well trajectory from the control file WXYZ and platfrom data it does not support detailed well trajectory input files or trajectoryinstance varying with sample number this should be implemented in the read method of the derived class, currently only supported for TrajectoryDc1d.py

read

read(
    trajectoryfile: str,
    trajectoryinstance: Optional[Dc1dwell] = None,
) -> Dict[
    str, Dict[str, Union[WellTreeTNO, Dict[str, float64]]]
]

Base method for reading. Overwritten by all derived classes. Method signature differs between derived classes, but to use polymorphism later on the code full signature is as it is defined here. :param trajectoryfile: str, path to well trajectory file :param trajectoryinstance: Dc1dwell/Dict, instance of well trajectory object :return: Dict, dictionary containing all trajectories for all wells

getdefaultwellstates

getdefaultwellstates()

Get the default well states for the wells in the well trajectory

:return: dictionary with the well names and the state of the well (prod or inj)

temploss_all

temploss_all(
    qvol: Series,
    templist: List[Series],
    salinity: Union[float, int],
    wells_and_states: Optional[Dict[str, str]] = None,
    reftime: int = 1,
    k: int = 3,
    at: Optional[float] = 1.2e-06,
    wellradius: Optional[float] = None,
) -> List[Series]

Calculate the temeperature losses for the production wells in the well trajectory, for a given flowrate

:param qvol: volumetric flow rate m3/s :param templist: temperature of the wells in C :param salinity: fixed salinity in ppm :param wells_and_states: dictionary with the well names and the state of the well (prod or inj), same length as templist :param wellradius: radius of each of the wells, if None it will take the radius of the main wellbore :param reftime: reference time for the temperature losses in years :param k: rock thermal conductivity W/mK :param at: rock thermal diffusivity m2/s :return: temperature losses, list with same length as templist

temploss

temploss(
    well: str,
    qvols: Series,
    temp: Series,
    salinity: Union[float, int],
    time: int,
    k: int,
    at: float,
    wellradius: float,
) -> Series

Calculate the production heat loss of the wells W/m, assuming one year of operation and taking the main branch as representative

:param well: considered production well :param qvols: volumetric flow rate m3/s :param temp: bottom hole temperature of the well in C :param salinity: fixed salinity in ppm :param time: reference time for the temperature losses in seconds :param k: rock thermal conductivity W/mK :param at: rock thermal diffusivity m2/s :param wellradius: radius of the well in m :return: temperature losses in C :return:

friction_all

friction_all(
    qvol: Series,
    templist: List[Series],
    salinity: float,
    tubingdiameter_inch: float,
    roughness_minch: float,
    wells_and_states: Optional[Dict[str, str]] = None,
) -> Series

Calculate the friction losses for the wells in the well trajectory, for a given flowrate, for branching wells the flowrate is assumed to be equally distributed over the branches

:param qvol: volumetric flow rate m3/s :param templist: temperature of the wells in C :param salinity: fixed salinity in ppm :param tubingdiameter_inch: tubing diameter in inch of the wells :param roughness_minch: roughness in milli-inch of the wells :param wells_and_states: dictionary with the well names and the state of the well (prod or inj) :return: total pressure losses for flow rate in bar, but will store as members of the well trajectory dpsum, dp_frictioninj, dp_frictionprod, dpsyphon, dpsum = dp_frictioninj + dp_frictionprod + dpsyphon

friction

friction(
    Qmass: Series,
    density: Series,
    viscosity: Series,
    tubingdiameter_inch: float,
    roughness_minch: float,
    well: str,
) -> Series

The friction losses are calculated according to turbulent flow assuming a that all Qmass is flowing through the well. The algorithm takes into accoun that for the deeper sections flow can be divided over multiple branches. To this end, two section length with different flowrates are assumed. The first (main) section sustains all flow, the part wherte multiple branches occur the flow is assumed equally distributed over the number of existing branches in the well description

:param Qmass: mass flow rate kg/s :param density: density kg /m3 :param viscosity: viscosity Pas :param tubingdiameter_inch: tubing diameter in inch :param roughness_minch: roughness in milli-inch :param well: wellname :return: Pressure losses for flow rate bar

res_mainTVD

res_mainTVD(well: str) -> float64

:param well: wellname :return: tvd of end of the main branch for the well

plot

plot(fname: str)

Plot the well trajectory (the wells in the well trajectory, to the basename of the file (excluding extention)

:param fname: filename