Source code for kappa_sdk.pvt.pvt

from typing import List, Optional, TYPE_CHECKING
from .pseudo_pressures_results import PseudoPressuresResults
from .._private._cluster_apis import ClusterAPIS
from ..pvt_type_enum import PVTTypeEnum
from .rate_conversion_results import RateConversionResults
from ..ka_context import KAContext

if TYPE_CHECKING:
    from .._private.dto_converters._pvt_dto_converter import PVTDtoConverter


[docs] class PVT:
[docs] def __init__(self, context: KAContext, id: str, name: str, technical_object_id: str, labels: Optional[List[str]], cluster_apis: ClusterAPIS, pvt_dto_converter: 'PVTDtoConverter', pvt_type: PVTTypeEnum, pvt_start_dates: List[str]) -> None: self._context = context self._id = id self._name = name self._technical_object_id = technical_object_id self._labels = labels self._cluster_apis = cluster_apis self._pvt_dto_converter = pvt_dto_converter self._pvt_type = pvt_type self._pvt_start_dates = pvt_start_dates
@property def field_id(self) -> str: """Gets the id of the field that contains this :class:`PVT`.""" return self._context.field_id @property def well_id(self) -> Optional[str]: """Gets the id of the well associated with this :class:`PVT`.""" return self._context.well_id @property def id(self) -> str: """Gets the unique id of this :class:`PVT`.""" return self._id @property def name(self) -> str: """Gets the name of this :class:`PVT`.""" return self._name @property def technical_object_id(self) -> str: """Gets the technical object id associated with this :class:`PVT`.""" return self._technical_object_id @property def labels(self) -> Optional[List[str]]: """Gets the labels associated with this :class:`PVT`.""" return self._labels @property def type(self) -> PVTTypeEnum: """Gets the type of this :class:`PVT`.""" return self._pvt_type @property def pvt_start_dates(self) -> List[str]: """Gets the list of configuration start dates for this :class:`PVT`.""" return self._pvt_start_dates
[docs] def compute_pseudo_pressures(self, temperature: float, rock_compressibility: float, pressure_range_min: float, pressure_range_max: float, pressure_range_steps: int, sw: Optional[float] = None) -> PseudoPressuresResults: """Compute pseudo-pressures for this PVT.""" dto = self._pvt_dto_converter.get_compute_pseudo_pressures_command_dto(temperature, rock_compressibility, sw, pressure_range_min, pressure_range_max, pressure_range_steps=pressure_range_steps) pseudo_pressure_query_dto = self._cluster_apis.tech_objects_api.compute_pseudo_pressures(self._technical_object_id, dto) return self._pvt_dto_converter.build_pseudo_pressures_results(pseudo_pressure_query_dto)
[docs] def convert_rates(self, field_pressures: List[List[float]], field_temperatures: List[List[float]], surface_pressures: List[List[float]], surface_temperatures: List[List[float]], standard_oil_rates: List[float], standard_gas_rates: List[float]) -> RateConversionResults: """Convert rates using this PVT.""" dto = self._pvt_dto_converter.get_rate_conversion_command_dto(field_pressures, field_temperatures, surface_pressures, surface_temperatures, standard_oil_rates, standard_gas_rates) rate_conversion_query_dto = self._cluster_apis.tech_objects_api.convert_rates(self._technical_object_id, dto) return self._pvt_dto_converter.build_rate_conversion_results(rate_conversion_query_dto)