def fscementing(tube):
    data['well_strings'][cs_id]['string_sections'][0]['pipe']['wt'] = new_casing_catalog.loc[numpy.where(tube > 0)[0][0], 'wt'] * tube[numpy.where(tube > 0)[0][0]]
    instance.input = convert_json(data)
    project = Converter.to_lccv_project(instance)
    ss = ScoreSolver(project=project)
    cementing_result = ss.solve_cementing_load(casing_string_id=cs_id)
    cementing_fs = cementing_result.get_api_collapse_safety_factor()
    cementing_fs = numpy.array(cementing_fs)
    return cementing_fs[:, 1].min() - collapse
def fscementing(parameters, data_):
    wt = parameters[0]
    fy = parameters[1]
    data_['well_strings'][cs_id]['string_sections'][0]['pipe']['wt'] = wt
    data_['well_strings'][cs_id]['string_sections'][0]['pipe']['grade'][
        'fymn'] = fy
    instance_ = JSONTest()
    instance_.input = convert_json(data_)
    project = Converter.to_lccv_project(instance_)
    ss = ScoreSolver(project=project)
    cementing_result = ss.solve_cementing_load(casing_string_id=cs_id)
    cementing_fs = cementing_result.get_api_collapse_safety_factor()
    cementing_fs = numpy.array(cementing_fs)

    return cementing_fs[:, 1].min() - collapse
Beispiel #3
0
from matplotlib import pyplot
from scorelib.converter import Converter
from scorelib.models.string_section import StringSectionBuilder, StringSection

from parsers.score_project_json import JSONTest, convert_json
from scripts.score_solver import ScoreSolver
from scripts.tubulars_catalog.roque_catalog_to_df import new_casing_catalog

with open("C:/casing_selection-master/scripts/score_projects/project476.json",
          'r',
          encoding="latin-1") as f:
    data = json.load(f)

instance = JSONTest()
instance.input = convert_json(data)
project = Converter.to_lccv_project(instance)

# acesso aos resultados de FS e Pf para o revestimento produtor cs_id=3
cs_id = 3
ss = ScoreSolver(project=project)
pressure_test_result = ss.solve_pressure_test(casing_string_id=cs_id)
cementing_result = ss.solve_cementing_load(casing_string_id=cs_id)
lost_returns_result = ss.solve_lost_returns(casing_string_id=cs_id)
gas_kick_result = ss.solve_gas_kick(casing_string_id=cs_id)
#full_evacuation_result = ss.solve_full_evacuation(casing_string_id=cs_id)
#partial_evacuation_result = ss.solve_partial_evacuation(casing_string_id=cs_id)
#wcd_collapse_result = ss.solve_wcd_collapse(casing_string_id=cs_id)
influx_result = ss.solve_influx(casing_string_id=cs_id)
well_full_of_gas_result = ss.solve_WellFullOfGas(casing_string_id=cs_id)
cementing_fs = cementing_result.get_api_collapse_safety_factor()
lost_returns_fs = lost_returns_result.get_api_collapse_safety_factor()