welleng.catalog package

welleng.catalog

OSDU-interfaced casing + tubing dimensional catalogue (API Spec 5CT) plus a resolver that fills derived tubular dimensions (ID, wall, drift, yield) from (OD, weight[, grade]).

Data lives in data/{casing,tubing}.json - factual, cited-by-number API 5CT values in the same _meta + rows layout as the companion drilling-mechanics catalogues. The loader converts to SI via each file’s to_SI factors, so a resolved TubularSpec carries both imperial and SI values.

Example:

from welleng.catalog import resolve
spec = resolve(9.625, 47, grade="L80", kind="casing")
spec.id_in     # 8.681
spec.drift_in  # 8.525
spec.yield_psi # 80000
class welleng.catalog.Catalog(kind: str, doc: dict)[source]

Bases: object

A loaded, indexed dimensional catalogue for one kind.

__init__(kind: str, doc: dict)[source]
list_sizes() List[Tuple[float, float]][source]

Sorted (od_in, nominal_weight_ppf) pairs available.

classmethod load(kind: str) Catalog[source]
resolve(od_in: float, nominal_weight_ppf: float, grade: str | None = None) TubularSpec[source]
exception welleng.catalog.CatalogError[source]

Bases: KeyError

Raised when a requested tubular is not in the catalogue.

class welleng.catalog.ConnectionSpec(connection_od_in: float | None = None, connection_id_in: float | None = None, makeup_loss_in: float | None = None, coupling_length_in: float | None = None, tension_eff_pct: float | None = None, compression_eff_pct: float | None = None, internal_pressure_eff_pct: float | None = None, external_pressure_eff_pct: float | None = None, tension_strength_klb: float | None = None, compression_strength_klb: float | None = None, internal_pressure_resistance_psi: float | None = None, external_pressure_resistance_psi: float | None = None, max_bending_deg_per_100ft: float | None = None, max_load_coupling_face_klb: float | None = None, makeup_torque_min_ftlb: float | None = None, makeup_torque_opt_ftlb: float | None = None, makeup_torque_max_ftlb: float | None = None, shouldering_torque_min_ftlb: float | None = None, shouldering_torque_max_ftlb: float | None = None, delta_turn_min: float | None = None, delta_turn_max: float | None = None, connection_type: str | None = None, grade: str | None = None)[source]

Bases: object

Full connection performance record (VAM/Tenaris datasheet field set).

For API connections (STC/LTC/BTC/NUE/EUE) only the dimensional fields are populated (from API Spec 5CT Tables E.27-E.30): connection_od_in = regular coupling OD (W) and coupling_length_in = minimum length (NL).

All premium-performance fields (efficiencies, strengths, pressure resistances, make-up torques, delta-turn, bending) are proprietary, vendor/user-supplied for premium threads (VAM, Tenaris TenarisHydril, etc.) and are deliberately left None here - they are NOT vendored and must NOT be fabricated. Populate them from the user’s connection datasheet.

__init__(connection_od_in: float | None = None, connection_id_in: float | None = None, makeup_loss_in: float | None = None, coupling_length_in: float | None = None, tension_eff_pct: float | None = None, compression_eff_pct: float | None = None, internal_pressure_eff_pct: float | None = None, external_pressure_eff_pct: float | None = None, tension_strength_klb: float | None = None, compression_strength_klb: float | None = None, internal_pressure_resistance_psi: float | None = None, external_pressure_resistance_psi: float | None = None, max_bending_deg_per_100ft: float | None = None, max_load_coupling_face_klb: float | None = None, makeup_torque_min_ftlb: float | None = None, makeup_torque_opt_ftlb: float | None = None, makeup_torque_max_ftlb: float | None = None, shouldering_torque_min_ftlb: float | None = None, shouldering_torque_max_ftlb: float | None = None, delta_turn_min: float | None = None, delta_turn_max: float | None = None, connection_type: str | None = None, grade: str | None = None) None
as_dict() dict[source]
compression_eff_pct: float | None = None
compression_strength_klb: float | None = None
connection_id_in: float | None = None
connection_od_in: float | None = None
connection_type: str | None = None
coupling_length_in: float | None = None
delta_turn_max: float | None = None
delta_turn_min: float | None = None
external_pressure_eff_pct: float | None = None
external_pressure_resistance_psi: float | None = None
classmethod from_api(od_in: float, connection: str, kind: str = 'casing', grade: str | None = None) ConnectionSpec[source]

Build an API-connection spec: dimensional fields from 5CT only.

Fills connection_od_in (regular coupling OD W), coupling_length_in (min length NL), connection_type and grade; every premium-performance field is left None (proprietary, user-supplied - never fabricated). To also compute API TR 5C3 joint strength (which needs the pipe wall) use from_tubular().

classmethod from_tubular(spec: TubularSpec, connection: str) ConnectionSpec[source]

Build an API-connection spec from a resolved TubularSpec.

Adds API TR 5C3 tensile joint strength to the 5CT dimensional fields: for BTC with a graded spec it fills tension_strength_klb from the buttress joint strength (Eq. 59/60, turn-key). Round-thread (STC/LTC) tension is left None because its governing pull-out term needs the API 5B engaged length Let (call round_thread_joint_strength_klb() with Let). Requires spec.grade (and thus min_uts_psi) for any strength value.

grade: str | None = None
internal_pressure_eff_pct: float | None = None
internal_pressure_resistance_psi: float | None = None
makeup_loss_in: float | None = None
makeup_torque_max_ftlb: float | None = None
makeup_torque_min_ftlb: float | None = None
makeup_torque_opt_ftlb: float | None = None
max_bending_deg_per_100ft: float | None = None
max_load_coupling_face_klb: float | None = None
shouldering_torque_max_ftlb: float | None = None
shouldering_torque_min_ftlb: float | None = None
tension_eff_pct: float | None = None
tension_strength_klb: float | None = None
class welleng.catalog.CouplingCatalog(doc: dict)[source]

Bases: object

Loaded, indexed API 5CT coupling catalogue keyed by (od, connection).

__init__(doc: dict)[source]
connections() List[str][source]
classmethod load() CouplingCatalog[source]
resolve(od_in: float, connection: str) CouplingSpec[source]
class welleng.catalog.CouplingSpec(od_in: float, connection: str, kind: str, coupling_od_in: float, coupling_length_in: float, special_clearance_od_in: float | None = None, coupling_od_m: float = 0.0, coupling_length_m: float = 0.0, special_clearance_od_m: float | None = None)[source]

Bases: object

A resolved API coupling: regular OD (W), special-clearance OD (Wc), and minimum coupling length (NL), imperial + SI (API Spec 5CT).

__init__(od_in: float, connection: str, kind: str, coupling_od_in: float, coupling_length_in: float, special_clearance_od_in: float | None = None, coupling_od_m: float = 0.0, coupling_length_m: float = 0.0, special_clearance_od_m: float | None = None) None
as_dict() dict[source]
connection: str
coupling_length_in: float
coupling_length_m: float = 0.0
coupling_od_in: float
coupling_od_m: float = 0.0
kind: str
od_in: float
special_clearance_od_in: float | None = None
special_clearance_od_m: float | None = None
class welleng.catalog.TubularSpec(kind: str, od_in: float, nominal_weight_ppf: float, wall_in: float, id_in: float, drift_in: float, grade: str | None = None, yield_psi: float | None = None, plain_end_weight_ppf: float = 0.0, min_wall_pct: float = 87.5, max_yield_psi: float | None = None, min_uts_psi: float | None = None, pipe_body_yield_klb: float | None = None, internal_yield_pressure_psi: float | None = None, collapse_pressure_psi: float | None = None, od_m: float = 0.0, wall_m: float = 0.0, id_m: float = 0.0, drift_m: float = 0.0, yield_pa: float | None = None)[source]

Bases: object

A resolved tubular: as-published imperial values + SI counterparts.

Imperial fields (*_in, yield_psi) are the API 5CT facts; the SI fields (*_m, yield_pa) are converted via the file’s to_SI.

__init__(kind: str, od_in: float, nominal_weight_ppf: float, wall_in: float, id_in: float, drift_in: float, grade: str | None = None, yield_psi: float | None = None, plain_end_weight_ppf: float = 0.0, min_wall_pct: float = 87.5, max_yield_psi: float | None = None, min_uts_psi: float | None = None, pipe_body_yield_klb: float | None = None, internal_yield_pressure_psi: float | None = None, collapse_pressure_psi: float | None = None, od_m: float = 0.0, wall_m: float = 0.0, id_m: float = 0.0, drift_m: float = 0.0, yield_pa: float | None = None) None
as_dict() dict[source]
collapse_pressure_psi: float | None = None
drift_in: float
drift_m: float = 0.0
grade: str | None = None
id_in: float
id_m: float = 0.0
internal_yield_pressure_psi: float | None = None
kind: str
max_yield_psi: float | None = None
min_uts_psi: float | None = None
min_wall_pct: float = 87.5
nominal_weight_ppf: float
od_in: float
od_m: float = 0.0
pipe_body_yield_klb: float | None = None
plain_end_weight_ppf: float = 0.0
wall_in: float
wall_m: float = 0.0
yield_pa: float | None = None
yield_psi: float | None = None
welleng.catalog.buttress_coupling_internal_yield_psi(od_in: float, coupling_od_in: float, coupling_yield_psi: float) float[source]

Buttress coupling internal yield pressure (psi), API TR 5C3 Eq. (65).

piYc = fymnc (W - d1)/W with W the coupling OD, d1 from Eq. (67) (= Eq. 61 buttress form; see _buttress_d1_in()) and coupling min yield fymnc. Per Sec 10.1 this limits connection internal pressure only when lower than the pipe-body internal yield. Rounded to the nearest 10 psi (API tabulation convention).

welleng.catalog.buttress_coupling_thread_strength_klb(od_in: float, coupling_od_in: float, coupling_uts_psi: float) float[source]

Buttress coupling-thread tensile strength (klb), API TR 5C3 Eq. (60).

Pj = 0.95 Ajc fumnc with Ajc = (pi/4)(W^2 - d1^2) (Eq. 57), W the coupling OD, d1 from _buttress_d1_in() (Eq. 61) and coupling min tensile fumnc. The other buttress limit term (see Eq. 59). Rounded to the nearest klb.

welleng.catalog.buttress_joint_strength_klb(od_in: float, id_in: float, min_yield_psi: float, min_uts_psi: float, coupling_od_in: float | None = None, coupling_uts_psi: float | None = None) float[source]

Buttress (BTC) tensile joint strength (klb), API TR 5C3 Sec 9.2.3.

The LESSER of the pipe-thread strength (Eq. 59) and the coupling-thread strength (Eq. 60). coupling_od_in defaults to the API 5CT coupling OD (W) from the catalogue; coupling_uts_psi defaults to the pipe-body min_uts_psi (standard API couplings share the pipe grade). Rounded to the nearest klb.

welleng.catalog.buttress_pipe_thread_strength_klb(od_in: float, id_in: float, min_yield_psi: float, min_uts_psi: float) float[source]

Buttress pipe-thread tensile strength (klb), API TR 5C3 Eq. (59).

Pj = 0.95 Ap fumnp [1.008 - 0.0396 (1.083 - fymnp/fumnp) D] with Ap = (pi/4)(D^2 - d^2), pipe-body min tensile fumnp and min yield fymnp. One of the two buttress limit terms (see Eq. 60). Rounded to the nearest klb (API tabulation convention).

welleng.catalog.collapse_pressure_psi(od_in: float, wall_in: float, min_yield_psi: float, grade: str) float | None[source]

Collapse resistance (psi), API TR 5C3 8.4 four-regime design equations.

Selects yield / plastic / transition / elastic regime by the D/t ratio against the boundaries (D/t)yp Eq.(36), (D/t)pt Eq.(38), (D/t)te Eq.(40), then evaluates Eq.(35)/(37)/(39)/(41). Returns None (flagged, not guessed) if the grade’s empirical factors are not tabulated. Rounded to the nearest 10 psi.

welleng.catalog.coupling_connections() List[str][source]

All coupling/connection designations in the catalogue.

welleng.catalog.grades(kind: str = 'casing') Dict[str, dict][source]

Grade -> {'min_yield_psi': ...} table for kind.

welleng.catalog.internal_yield_pressure_psi(od_in: float, wall_in: float, min_yield_psi: float) float[source]

Minimum internal yield pressure (psi), API TR 5C3 Eq. (10) - Barlow.

piYAPI = 2*fymn*(k_wall*t)/D with k_wall = 0.875. Rounded to the nearest 10 psi (API tabulation convention).

welleng.catalog.list_sizes(kind: str = 'casing') List[Tuple[float, float]][source]

Available (od_in, nominal_weight_ppf) pairs for kind.

welleng.catalog.pipe_body_yield_klb(od_in: float, id_in: float, min_yield_psi: float) float[source]

Pipe-body yield strength (klb), API TR 5C3 Eq. (11): fymn * Ap.

Ap = (pi/4)(D^2 - d^2) is the pipe cross-sectional area. Rounded to the nearest klb (API tabulation convention).

welleng.catalog.plain_end_weight_ppf(od_in: float, wall_in: float) float[source]

Plain-end nominal mass (lb/ft) via the API formula 10.69*(D-t)*t.

Historical API plain-end mass equation (API Spec 5CT / TR 5C3): geometry only, grade-independent. Rounded to 2 dp.

welleng.catalog.resolve(od_in: float, nominal_weight_ppf: float, grade: str | None = None, kind: str = 'casing') TubularSpec[source]

Resolve a tubular’s dimensions from (OD, weight[, grade]).

Returns a TubularSpec with id_in, wall_in, drift_in (imperial + SI) and, when grade is given, yield_psi / yield_pa. Raises CatalogError with a nearest-weight suggestion on no match.

welleng.catalog.resolve_coupling(od_in: float, connection: str, kind: str = 'casing') CouplingSpec[source]

Resolve API 5CT coupling dimensions from (od_in, connection).

connection is one of STC/LTC/BTC (casing) or NUE/EUE (tubing). Returns a CouplingSpec with regular OD (W), special-clearance OD (Wc, when API tabulates one), and minimum coupling length (NL), imperial + SI. kind is validated against the connection. Raises CatalogError listing the available connections on no match.

welleng.catalog.round_thread_joint_strength_klb(od_in: float, id_in: float, min_yield_psi: float, min_uts_psi: float, engaged_thread_length_in: float | None = None, coupling_od_in: float | None = None, coupling_uts_psi: float | None = None, coupling_root_dia_in: float | None = None) float[source]

Round-thread (STC/LTC) tensile joint strength (klb), API TR 5C3 Sec 9.2.2.

The LEAST of the pipe fracture strength (Eq. 53), the pull-out strength (Eq. 54, if engaged_thread_length_in [Let] is supplied) and the coupling fracture strength (Eq. 55, if coupling_root_dia_in [d1, from API 5B Eq. 58] is supplied). Let and d1 come from API Spec 5B (not 5CT).

WARNING: pull-out normally GOVERNS (Annex J.2.2.3); with Let omitted this returns the fracture-only term, which OVERSTATES the joint strength. Supply Let for a valid rating. Rounded to the nearest klb.

welleng.catalog.round_thread_pipe_fracture_strength_klb(od_in: float, id_in: float, min_uts_psi: float) float[source]

Round-thread (STC/LTC) pipe fracture strength (klb), API TR 5C3 Eq.(53).

Pj = 0.95 Ajp fumnp with the last-perfect-thread pipe area Ajp = (pi/4)[(D - 0.1425)^2 - d^2] (Eq. 56). ONE of the three round- thread limit terms; the joint strength is the least of this, the pull-out strength (Eq. 54) and coupling fracture (Eq. 55). Rounded to nearest klb.

welleng.catalog.round_thread_pullout_strength_klb(od_in: float, id_in: float, engaged_thread_length_in: float, min_yield_psi: float, min_uts_psi: float) float[source]

Round-thread (STC/LTC) pull-out strength (klb), API TR 5C3 Eq. (54).

Pj = 0.95 Ajp Let [(0.74 D^-0.59 fumnp)/(0.5 Let + 0.14 D) + fymnp/(Let + 0.14 D)] with Ajp from Eq. (56) and Let the engaged thread length (= L4 - M, from API Spec 5B; user-supplied since API 5CT does not tabulate it). Note D^-0.59 is an EXPONENT (pdftotext drops it). Pull-out governs for most standard round-thread sizes/grades (Annex J.2.2.3). Rounded to the nearest klb.

Submodules

welleng.catalog.catalog module

API 5CT casing + tubing dimensional catalogue: loader + resolver.

The JSON data files (data/casing.json, data/tubing.json) carry the as-published imperial dimensional facts (cited to API Spec 5CT) in the same _meta + grades + rows layout as the companion drilling-mechanics catalogues (drillpipe.json et al.). This module parses them, indexes the rows by (od_in, nominal_weight_ppf) and resolves a tubular’s derived dimensions (ID, wall, drift) plus - when a grade is given - its minimum yield.

SI conversion is applied per each file’s _meta.to_SI factors: every resolved spec carries both the as-published imperial values and their SI counterparts (*_m / *_pa), so imperial-in-inches consumers (the welleng.schematic models) and SI-pure consumers are both served.

OSDU alignment (TubularComponent.1.0.0):

od_in              <-> MaximumOuterDiameter / TubularComponentNominalSize
id_in              <-> InnerDiameter
drift_in           <-> DriftDiameter
nominal_weight_ppf <-> TubularComponentNominalWeight
grade              <-> TubularComponentTubingGradeID
yield_psi          <-> TubularComponentTubingGradeStrength
(type)             <-> TubularComponentTypeID

Wall thickness is derived ((OD-ID)/2) and is not stored in OSDU.

class welleng.catalog.catalog.Catalog(kind: str, doc: dict)[source]

Bases: object

A loaded, indexed dimensional catalogue for one kind.

__init__(kind: str, doc: dict)[source]
list_sizes() List[Tuple[float, float]][source]

Sorted (od_in, nominal_weight_ppf) pairs available.

classmethod load(kind: str) Catalog[source]
resolve(od_in: float, nominal_weight_ppf: float, grade: str | None = None) TubularSpec[source]
exception welleng.catalog.catalog.CatalogError[source]

Bases: KeyError

Raised when a requested tubular is not in the catalogue.

class welleng.catalog.catalog.ConnectionSpec(connection_od_in: float | None = None, connection_id_in: float | None = None, makeup_loss_in: float | None = None, coupling_length_in: float | None = None, tension_eff_pct: float | None = None, compression_eff_pct: float | None = None, internal_pressure_eff_pct: float | None = None, external_pressure_eff_pct: float | None = None, tension_strength_klb: float | None = None, compression_strength_klb: float | None = None, internal_pressure_resistance_psi: float | None = None, external_pressure_resistance_psi: float | None = None, max_bending_deg_per_100ft: float | None = None, max_load_coupling_face_klb: float | None = None, makeup_torque_min_ftlb: float | None = None, makeup_torque_opt_ftlb: float | None = None, makeup_torque_max_ftlb: float | None = None, shouldering_torque_min_ftlb: float | None = None, shouldering_torque_max_ftlb: float | None = None, delta_turn_min: float | None = None, delta_turn_max: float | None = None, connection_type: str | None = None, grade: str | None = None)[source]

Bases: object

Full connection performance record (VAM/Tenaris datasheet field set).

For API connections (STC/LTC/BTC/NUE/EUE) only the dimensional fields are populated (from API Spec 5CT Tables E.27-E.30): connection_od_in = regular coupling OD (W) and coupling_length_in = minimum length (NL).

All premium-performance fields (efficiencies, strengths, pressure resistances, make-up torques, delta-turn, bending) are proprietary, vendor/user-supplied for premium threads (VAM, Tenaris TenarisHydril, etc.) and are deliberately left None here - they are NOT vendored and must NOT be fabricated. Populate them from the user’s connection datasheet.

__init__(connection_od_in: float | None = None, connection_id_in: float | None = None, makeup_loss_in: float | None = None, coupling_length_in: float | None = None, tension_eff_pct: float | None = None, compression_eff_pct: float | None = None, internal_pressure_eff_pct: float | None = None, external_pressure_eff_pct: float | None = None, tension_strength_klb: float | None = None, compression_strength_klb: float | None = None, internal_pressure_resistance_psi: float | None = None, external_pressure_resistance_psi: float | None = None, max_bending_deg_per_100ft: float | None = None, max_load_coupling_face_klb: float | None = None, makeup_torque_min_ftlb: float | None = None, makeup_torque_opt_ftlb: float | None = None, makeup_torque_max_ftlb: float | None = None, shouldering_torque_min_ftlb: float | None = None, shouldering_torque_max_ftlb: float | None = None, delta_turn_min: float | None = None, delta_turn_max: float | None = None, connection_type: str | None = None, grade: str | None = None) None
as_dict() dict[source]
compression_eff_pct: float | None = None
compression_strength_klb: float | None = None
connection_id_in: float | None = None
connection_od_in: float | None = None
connection_type: str | None = None
coupling_length_in: float | None = None
delta_turn_max: float | None = None
delta_turn_min: float | None = None
external_pressure_eff_pct: float | None = None
external_pressure_resistance_psi: float | None = None
classmethod from_api(od_in: float, connection: str, kind: str = 'casing', grade: str | None = None) ConnectionSpec[source]

Build an API-connection spec: dimensional fields from 5CT only.

Fills connection_od_in (regular coupling OD W), coupling_length_in (min length NL), connection_type and grade; every premium-performance field is left None (proprietary, user-supplied - never fabricated). To also compute API TR 5C3 joint strength (which needs the pipe wall) use from_tubular().

classmethod from_tubular(spec: TubularSpec, connection: str) ConnectionSpec[source]

Build an API-connection spec from a resolved TubularSpec.

Adds API TR 5C3 tensile joint strength to the 5CT dimensional fields: for BTC with a graded spec it fills tension_strength_klb from the buttress joint strength (Eq. 59/60, turn-key). Round-thread (STC/LTC) tension is left None because its governing pull-out term needs the API 5B engaged length Let (call round_thread_joint_strength_klb() with Let). Requires spec.grade (and thus min_uts_psi) for any strength value.

grade: str | None = None
internal_pressure_eff_pct: float | None = None
internal_pressure_resistance_psi: float | None = None
makeup_loss_in: float | None = None
makeup_torque_max_ftlb: float | None = None
makeup_torque_min_ftlb: float | None = None
makeup_torque_opt_ftlb: float | None = None
max_bending_deg_per_100ft: float | None = None
max_load_coupling_face_klb: float | None = None
shouldering_torque_max_ftlb: float | None = None
shouldering_torque_min_ftlb: float | None = None
tension_eff_pct: float | None = None
tension_strength_klb: float | None = None
class welleng.catalog.catalog.CouplingCatalog(doc: dict)[source]

Bases: object

Loaded, indexed API 5CT coupling catalogue keyed by (od, connection).

__init__(doc: dict)[source]
connections() List[str][source]
classmethod load() CouplingCatalog[source]
resolve(od_in: float, connection: str) CouplingSpec[source]
class welleng.catalog.catalog.CouplingSpec(od_in: float, connection: str, kind: str, coupling_od_in: float, coupling_length_in: float, special_clearance_od_in: float | None = None, coupling_od_m: float = 0.0, coupling_length_m: float = 0.0, special_clearance_od_m: float | None = None)[source]

Bases: object

A resolved API coupling: regular OD (W), special-clearance OD (Wc), and minimum coupling length (NL), imperial + SI (API Spec 5CT).

__init__(od_in: float, connection: str, kind: str, coupling_od_in: float, coupling_length_in: float, special_clearance_od_in: float | None = None, coupling_od_m: float = 0.0, coupling_length_m: float = 0.0, special_clearance_od_m: float | None = None) None
as_dict() dict[source]
connection: str
coupling_length_in: float
coupling_length_m: float = 0.0
coupling_od_in: float
coupling_od_m: float = 0.0
kind: str
od_in: float
special_clearance_od_in: float | None = None
special_clearance_od_m: float | None = None
class welleng.catalog.catalog.TubularSpec(kind: str, od_in: float, nominal_weight_ppf: float, wall_in: float, id_in: float, drift_in: float, grade: str | None = None, yield_psi: float | None = None, plain_end_weight_ppf: float = 0.0, min_wall_pct: float = 87.5, max_yield_psi: float | None = None, min_uts_psi: float | None = None, pipe_body_yield_klb: float | None = None, internal_yield_pressure_psi: float | None = None, collapse_pressure_psi: float | None = None, od_m: float = 0.0, wall_m: float = 0.0, id_m: float = 0.0, drift_m: float = 0.0, yield_pa: float | None = None)[source]

Bases: object

A resolved tubular: as-published imperial values + SI counterparts.

Imperial fields (*_in, yield_psi) are the API 5CT facts; the SI fields (*_m, yield_pa) are converted via the file’s to_SI.

__init__(kind: str, od_in: float, nominal_weight_ppf: float, wall_in: float, id_in: float, drift_in: float, grade: str | None = None, yield_psi: float | None = None, plain_end_weight_ppf: float = 0.0, min_wall_pct: float = 87.5, max_yield_psi: float | None = None, min_uts_psi: float | None = None, pipe_body_yield_klb: float | None = None, internal_yield_pressure_psi: float | None = None, collapse_pressure_psi: float | None = None, od_m: float = 0.0, wall_m: float = 0.0, id_m: float = 0.0, drift_m: float = 0.0, yield_pa: float | None = None) None
as_dict() dict[source]
collapse_pressure_psi: float | None = None
drift_in: float
drift_m: float = 0.0
grade: str | None = None
id_in: float
id_m: float = 0.0
internal_yield_pressure_psi: float | None = None
kind: str
max_yield_psi: float | None = None
min_uts_psi: float | None = None
min_wall_pct: float = 87.5
nominal_weight_ppf: float
od_in: float
od_m: float = 0.0
pipe_body_yield_klb: float | None = None
plain_end_weight_ppf: float = 0.0
wall_in: float
wall_m: float = 0.0
yield_pa: float | None = None
yield_psi: float | None = None
welleng.catalog.catalog.buttress_coupling_internal_yield_psi(od_in: float, coupling_od_in: float, coupling_yield_psi: float) float[source]

Buttress coupling internal yield pressure (psi), API TR 5C3 Eq. (65).

piYc = fymnc (W - d1)/W with W the coupling OD, d1 from Eq. (67) (= Eq. 61 buttress form; see _buttress_d1_in()) and coupling min yield fymnc. Per Sec 10.1 this limits connection internal pressure only when lower than the pipe-body internal yield. Rounded to the nearest 10 psi (API tabulation convention).

welleng.catalog.catalog.buttress_coupling_thread_strength_klb(od_in: float, coupling_od_in: float, coupling_uts_psi: float) float[source]

Buttress coupling-thread tensile strength (klb), API TR 5C3 Eq. (60).

Pj = 0.95 Ajc fumnc with Ajc = (pi/4)(W^2 - d1^2) (Eq. 57), W the coupling OD, d1 from _buttress_d1_in() (Eq. 61) and coupling min tensile fumnc. The other buttress limit term (see Eq. 59). Rounded to the nearest klb.

welleng.catalog.catalog.buttress_joint_strength_klb(od_in: float, id_in: float, min_yield_psi: float, min_uts_psi: float, coupling_od_in: float | None = None, coupling_uts_psi: float | None = None) float[source]

Buttress (BTC) tensile joint strength (klb), API TR 5C3 Sec 9.2.3.

The LESSER of the pipe-thread strength (Eq. 59) and the coupling-thread strength (Eq. 60). coupling_od_in defaults to the API 5CT coupling OD (W) from the catalogue; coupling_uts_psi defaults to the pipe-body min_uts_psi (standard API couplings share the pipe grade). Rounded to the nearest klb.

welleng.catalog.catalog.buttress_pipe_thread_strength_klb(od_in: float, id_in: float, min_yield_psi: float, min_uts_psi: float) float[source]

Buttress pipe-thread tensile strength (klb), API TR 5C3 Eq. (59).

Pj = 0.95 Ap fumnp [1.008 - 0.0396 (1.083 - fymnp/fumnp) D] with Ap = (pi/4)(D^2 - d^2), pipe-body min tensile fumnp and min yield fymnp. One of the two buttress limit terms (see Eq. 60). Rounded to the nearest klb (API tabulation convention).

welleng.catalog.catalog.collapse_pressure_psi(od_in: float, wall_in: float, min_yield_psi: float, grade: str) float | None[source]

Collapse resistance (psi), API TR 5C3 8.4 four-regime design equations.

Selects yield / plastic / transition / elastic regime by the D/t ratio against the boundaries (D/t)yp Eq.(36), (D/t)pt Eq.(38), (D/t)te Eq.(40), then evaluates Eq.(35)/(37)/(39)/(41). Returns None (flagged, not guessed) if the grade’s empirical factors are not tabulated. Rounded to the nearest 10 psi.

welleng.catalog.catalog.coupling_connections() List[str][source]

All coupling/connection designations in the catalogue.

welleng.catalog.catalog.grades(kind: str = 'casing') Dict[str, dict][source]

Grade -> {'min_yield_psi': ...} table for kind.

welleng.catalog.catalog.internal_yield_pressure_psi(od_in: float, wall_in: float, min_yield_psi: float) float[source]

Minimum internal yield pressure (psi), API TR 5C3 Eq. (10) - Barlow.

piYAPI = 2*fymn*(k_wall*t)/D with k_wall = 0.875. Rounded to the nearest 10 psi (API tabulation convention).

welleng.catalog.catalog.list_sizes(kind: str = 'casing') List[Tuple[float, float]][source]

Available (od_in, nominal_weight_ppf) pairs for kind.

welleng.catalog.catalog.pipe_body_yield_klb(od_in: float, id_in: float, min_yield_psi: float) float[source]

Pipe-body yield strength (klb), API TR 5C3 Eq. (11): fymn * Ap.

Ap = (pi/4)(D^2 - d^2) is the pipe cross-sectional area. Rounded to the nearest klb (API tabulation convention).

welleng.catalog.catalog.plain_end_weight_ppf(od_in: float, wall_in: float) float[source]

Plain-end nominal mass (lb/ft) via the API formula 10.69*(D-t)*t.

Historical API plain-end mass equation (API Spec 5CT / TR 5C3): geometry only, grade-independent. Rounded to 2 dp.

welleng.catalog.catalog.resolve(od_in: float, nominal_weight_ppf: float, grade: str | None = None, kind: str = 'casing') TubularSpec[source]

Resolve a tubular’s dimensions from (OD, weight[, grade]).

Returns a TubularSpec with id_in, wall_in, drift_in (imperial + SI) and, when grade is given, yield_psi / yield_pa. Raises CatalogError with a nearest-weight suggestion on no match.

welleng.catalog.catalog.resolve_coupling(od_in: float, connection: str, kind: str = 'casing') CouplingSpec[source]

Resolve API 5CT coupling dimensions from (od_in, connection).

connection is one of STC/LTC/BTC (casing) or NUE/EUE (tubing). Returns a CouplingSpec with regular OD (W), special-clearance OD (Wc, when API tabulates one), and minimum coupling length (NL), imperial + SI. kind is validated against the connection. Raises CatalogError listing the available connections on no match.

welleng.catalog.catalog.round_thread_joint_strength_klb(od_in: float, id_in: float, min_yield_psi: float, min_uts_psi: float, engaged_thread_length_in: float | None = None, coupling_od_in: float | None = None, coupling_uts_psi: float | None = None, coupling_root_dia_in: float | None = None) float[source]

Round-thread (STC/LTC) tensile joint strength (klb), API TR 5C3 Sec 9.2.2.

The LEAST of the pipe fracture strength (Eq. 53), the pull-out strength (Eq. 54, if engaged_thread_length_in [Let] is supplied) and the coupling fracture strength (Eq. 55, if coupling_root_dia_in [d1, from API 5B Eq. 58] is supplied). Let and d1 come from API Spec 5B (not 5CT).

WARNING: pull-out normally GOVERNS (Annex J.2.2.3); with Let omitted this returns the fracture-only term, which OVERSTATES the joint strength. Supply Let for a valid rating. Rounded to the nearest klb.

welleng.catalog.catalog.round_thread_pipe_fracture_strength_klb(od_in: float, id_in: float, min_uts_psi: float) float[source]

Round-thread (STC/LTC) pipe fracture strength (klb), API TR 5C3 Eq.(53).

Pj = 0.95 Ajp fumnp with the last-perfect-thread pipe area Ajp = (pi/4)[(D - 0.1425)^2 - d^2] (Eq. 56). ONE of the three round- thread limit terms; the joint strength is the least of this, the pull-out strength (Eq. 54) and coupling fracture (Eq. 55). Rounded to nearest klb.

welleng.catalog.catalog.round_thread_pullout_strength_klb(od_in: float, id_in: float, engaged_thread_length_in: float, min_yield_psi: float, min_uts_psi: float) float[source]

Round-thread (STC/LTC) pull-out strength (klb), API TR 5C3 Eq. (54).

Pj = 0.95 Ajp Let [(0.74 D^-0.59 fumnp)/(0.5 Let + 0.14 D) + fymnp/(Let + 0.14 D)] with Ajp from Eq. (56) and Let the engaged thread length (= L4 - M, from API Spec 5B; user-supplied since API 5CT does not tabulate it). Note D^-0.59 is an EXPONENT (pdftotext drops it). Pull-out governs for most standard round-thread sizes/grades (Annex J.2.2.3). Rounded to the nearest klb.