2020-02-11 14:20:53 -06:00
|
|
|
"""
|
|
|
|
ResInsight SimulationWell
|
|
|
|
"""
|
|
|
|
import grpc
|
|
|
|
|
2020-08-19 00:30:51 -05:00
|
|
|
import SimulationWell_pb2
|
|
|
|
import SimulationWell_pb2_grpc
|
2020-02-11 14:20:53 -06:00
|
|
|
|
2020-08-19 00:30:51 -05:00
|
|
|
import Properties_pb2
|
|
|
|
import Properties_pb2_grpc
|
2020-02-11 14:20:53 -06:00
|
|
|
|
2021-01-21 03:45:37 -06:00
|
|
|
from .resinsight_classes import SimulationWell
|
2020-02-21 05:10:02 -06:00
|
|
|
|
2020-08-19 00:30:51 -05:00
|
|
|
from .pdmobject import PdmObjectBase, add_method
|
2020-02-21 05:10:02 -06:00
|
|
|
|
2020-08-19 00:30:51 -05:00
|
|
|
import rips.case
|
2020-04-16 09:06:18 -05:00
|
|
|
|
2020-08-21 02:57:48 -05:00
|
|
|
|
2020-02-21 05:10:02 -06:00
|
|
|
@add_method(SimulationWell)
|
|
|
|
def __custom_init__(self, pb2_object, channel):
|
|
|
|
self._simulation_well_stub = SimulationWell_pb2_grpc.SimulationWellStub(channel)
|
|
|
|
|
2020-04-16 09:06:18 -05:00
|
|
|
|
2020-02-21 05:10:02 -06:00
|
|
|
@add_method(SimulationWell)
|
|
|
|
def status(self, timestep):
|
2020-04-16 09:06:18 -05:00
|
|
|
"""Get simulation well status
|
|
|
|
|
|
|
|
**SimulationWellStatus class description**::
|
|
|
|
|
|
|
|
Parameter | Description | Type
|
|
|
|
----------- | ------------------------------------------------------------- | -----
|
|
|
|
well_type | Well type as string | string
|
|
|
|
is_open | True if simulation well is open at the specified time step | bool
|
|
|
|
|
|
|
|
Arguments:
|
|
|
|
timestep(int): Time step index
|
|
|
|
|
|
|
|
"""
|
2020-02-21 05:10:02 -06:00
|
|
|
sim_well_request = SimulationWell_pb2.SimulationWellRequest(case_id=self.case().id,
|
|
|
|
well_name=self.name,
|
|
|
|
timestep=timestep)
|
|
|
|
return self._simulation_well_stub.GetSimulationWellStatus(sim_well_request)
|
|
|
|
|
2020-04-16 09:06:18 -05:00
|
|
|
|
2020-02-21 05:10:02 -06:00
|
|
|
@add_method(SimulationWell)
|
|
|
|
def cells(self, timestep):
|
2020-04-16 09:06:18 -05:00
|
|
|
"""Get reservoir cells the simulation well is defined for
|
|
|
|
|
|
|
|
**SimulationWellCellInfo class description**::
|
|
|
|
|
|
|
|
Parameter | Description | Type
|
|
|
|
----------- | --------------------------------------------------------- | -----
|
|
|
|
ijk | Cell IJK location | Vec3i
|
|
|
|
grid_index | Grid index | int
|
|
|
|
is_open | True if connection to is open at the specified time step | bool
|
|
|
|
branch_id | | int
|
|
|
|
segment_id | | int
|
|
|
|
|
|
|
|
Arguments:
|
|
|
|
timestep(int): Time step index
|
|
|
|
|
|
|
|
Returns:
|
|
|
|
List of SimulationWellCellInfo
|
|
|
|
|
|
|
|
"""
|
2020-02-21 05:10:02 -06:00
|
|
|
sim_well_request = SimulationWell_pb2.SimulationWellRequest(case_id=self.case().id,
|
|
|
|
well_name=self.name,
|
|
|
|
timestep=timestep)
|
|
|
|
return self._simulation_well_stub.GetSimulationWellCells(sim_well_request).data
|
|
|
|
|
2020-04-16 09:06:18 -05:00
|
|
|
|
2020-02-21 05:10:02 -06:00
|
|
|
@add_method(SimulationWell)
|
|
|
|
def case(self):
|
|
|
|
return self.ancestor(rips.case.Case)
|