def test_set_well_injection(self):
        from pwptemp.injection import input
        # with casings
        casings = [{
            'od': 9.5,
            'id': 8.5,
            'depth': 25.0
        }, {
            'od': 20.0,
            'id': 18.0,
            'depth': 10.0
        }]
        tdata = input.data(casings)
        depths = wellpath.get(100, 10)
        well = input.set_well(tdata, depths)
        self.assertEqual(len(well.casings[0]), len(well.casings[1]))
        self.assertEqual(len(well.md), well.zstep)
        del tdata['casings']
        for x, value in tdata.items():
            self.assertEqual(value - value, 0)

        # without casings
        tdata = input.data()
        depths = wellpath.get(100, 10)
        well = input.set_well(tdata, depths)
        self.assertEqual(len(well.md), well.zstep)
        del tdata['casings']
        for x, value in tdata.items():
            self.assertEqual(value - value, 0)
    def test_set_well(self):
        # with casings
        casings = [{
            'od': 9.5,
            'id': 8.5,
            'depth': 25.0
        }, {
            'od': 20.0,
            'id': 18.0,
            'depth': 10.0
        }]
        tdata = input.data(casings)
        depths = wellpath.get(100, 10)
        well = input.set_well(tdata, depths)
        self.assertEqual(len(well.casings[0]), len(well.casings[1]))
        self.assertEqual(len(well.md), well.zstep)
        del tdata['casings']
        for x, value in tdata.items():
            self.assertIsInstance(value, float)

        # without casings
        tdata = input.data()
        depths = wellpath.get(100, 10)
        well = input.set_well(tdata, depths)
        self.assertEqual(len(well.md), well.zstep)
        del tdata['casings']
        for x, value in tdata.items():
            self.assertIsInstance(value, float)
Beispiel #3
0
 def test_heat_coef_drilling(self):
     from pwptemp.drilling import input, heatcoefficients, initcond
     depths = wellpath.get(100, 50)
     well = input.set_well(input.data(), depths)
     ic = initcond.init_cond(well)
     well = well.define_viscosity(ic)
     well = well.define_density(ic)
     hc = heatcoefficients.heat_coef(well, 1)
     self.assertEqual(len(hc), 9)
     self.assertEqual(len(hc[0]), 4)     # len of hc_1
     self.assertEqual(len(hc[0][0]), depths.zstep)   # len of c1z
     self.assertEqual(len(hc[0][1]), depths.zstep)   # len of c1e
     self.assertEqual(len(hc[0][2]), depths.zstep)   # len of c1
     self.assertEqual(len(hc[0][3]), depths.zstep)   # len of c1t
     self.assertEqual(len(hc[1]), 4)  # len of hc_2
     self.assertEqual(len(hc[1][0]), depths.zstep)  # len of c2z
     self.assertEqual(len(hc[1][1]), depths.zstep)  # len of c2e
     self.assertEqual(len(hc[1][2]), depths.zstep)  # len of c2w
     self.assertEqual(len(hc[1][3]), depths.zstep)  # len of c2t
     self.assertEqual(len(hc[2]), 5)  # len of hc_3
     self.assertEqual(len(hc[2][0]), depths.zstep)  # len of c3z
     self.assertEqual(len(hc[2][1]), depths.zstep)  # len of c3e
     self.assertEqual(len(hc[2][2]), depths.zstep)  # len of c3w
     self.assertEqual(len(hc[2][3]), depths.zstep)  # len of c3
     self.assertEqual(len(hc[2][4]), depths.zstep)  # len of c3t
     self.assertEqual(len(hc[3]), 4)  # len of hc_4
     self.assertEqual(len(hc[3][0]), depths.zstep)  # len of c4z
     self.assertEqual(len(hc[3][1]), depths.zstep)  # len of c4e
     self.assertEqual(len(hc[3][2]), depths.zstep)  # len of c4w
     self.assertEqual(len(hc[3][3]), depths.zstep)  # len of c4t
     self.assertEqual(len(hc[4]), 4)  # len of hc_5
     self.assertEqual(len(hc[4][0]), depths.zstep)  # len of c5z
     self.assertEqual(len(hc[4][1]), depths.zstep)  # len of c5e
     self.assertEqual(len(hc[4][2]), depths.zstep)  # len of c5w
     self.assertEqual(len(hc[4][3]), depths.zstep)  # len of c5t
Beispiel #4
0
 def test_heat_coef_injection(self):
     from pwptemp.injection import input, heatcoefficients, initcond
     depths = wellpath.get(100, 50)
     well = input.set_well(input.data(), depths)
     ic = initcond.init_cond(well)
     well = well.define_density(ic)
     tt = ic.tto
     t3 = ic.tco
     hc = heatcoefficients.heat_coef(well, 1, tt, t3)
     self.assertEqual(len(hc), 8)
     self.assertEqual(len(hc[0]), 4)     # len of hc_1
     self.assertEqual(len(hc[0][0]), depths.zstep)   # len of c1z
     self.assertEqual(len(hc[0][1]), depths.zstep)   # len of c1e
     self.assertEqual(len(hc[0][2]), depths.zstep)   # len of c1
     self.assertEqual(len(hc[0][3]), depths.zstep)   # len of c1t
     self.assertEqual(len(hc[1]), 4)  # len of hc_2
     self.assertEqual(len(hc[1][0]), depths.zstep)  # len of c2z
     self.assertEqual(len(hc[1][1]), depths.zstep)  # len of c2e
     self.assertEqual(len(hc[1][2]), depths.zstep)  # len of c2w
     self.assertEqual(len(hc[1][3]), depths.zstep)  # len of c2t
     self.assertEqual(len(hc[2]), 4)  # len of hc_3
     self.assertEqual(len(hc[2][0]), depths.zstep)  # len of c3z
     self.assertEqual(len(hc[2][1]), depths.zstep)  # len of c3e
     self.assertEqual(len(hc[2][2]), depths.zstep)  # len of c3w
     self.assertEqual(len(hc[2][3]), depths.zstep)  # len of c3t
     self.assertEqual(len(hc[3]), 4)  # len of hc_4
     self.assertEqual(len(hc[3][0]), depths.zstep)  # len of c4z
     self.assertEqual(len(hc[3][1]), depths.zstep)  # len of c4e
     self.assertEqual(len(hc[3][2]), depths.zstep)  # len of c4w
     self.assertEqual(len(hc[3][3]), depths.zstep)  # len of c4t
     self.assertEqual(len(hc[4]), 4)  # len of hc_5
     self.assertEqual(len(hc[4][0]), depths.zstep)  # len of c5z
     self.assertEqual(len(hc[4][1]), depths.zstep)  # len of c5e
     self.assertEqual(len(hc[4][2]), depths.zstep)  # len of c5w
     self.assertEqual(len(hc[4][3]), depths.zstep)  # len of c5t
Beispiel #5
0
 def test_wellpath(self):
     depths = wellpath.get(100, 50)
     well = input.set_well(input.data(), depths)
     hc = heatcoefficients.heat_coef(well, 1)[0]
     for i in range(len(hc)):
         for j in range(len(hc[0])):
             for k in range(len(hc[0, 0])):
                 self.assertNotEqual(hc[i, j][k], 0)
 def test_get(self):
     D = wellpath.get(3000, 50)  # for Vertical well
     self.assertIsInstance(D.md, list)
     self.assertIsInstance(D.tvd, list)
     self.assertEqual(len(D.md), len(D.tvd))
     self.assertEqual(D.deltaz, 50)
     self.assertEqual(D.zstep, len(D.md))
     D = wellpath.get(3000, 50, profile='J', kop=1000,
                      eob=1800)  # for J-type well
     self.assertIsInstance(D.md, list)
     self.assertIsInstance(D.tvd, list)
     self.assertEqual(len(D.md), len(D.tvd))
     self.assertEqual(D.deltaz, 50)
     self.assertEqual(D.zstep, len(D.md))
     D = wellpath.get(3000,
                      50,
                      profile='S',
                      kop=1000,
                      eob=1800,
                      sod=2300,
                      eod=2700)  # for S-type well
     self.assertIsInstance(D.md, list)
     self.assertIsInstance(D.tvd, list)
     self.assertEqual(len(D.md), len(D.tvd))
     self.assertEqual(D.deltaz, 50)
     self.assertEqual(D.zstep, len(D.md))
     D = wellpath.get(3000, 50, profile='H1', kop=1000,
                      eob=1800)  # for H1-type well
     self.assertIsInstance(D.md, list)
     self.assertIsInstance(D.tvd, list)
     self.assertEqual(len(D.md), len(D.tvd))
     self.assertEqual(D.deltaz, 50)
     self.assertEqual(D.zstep, len(D.md))
     D = wellpath.get(3000,
                      50,
                      profile='H1',
                      kop=1000,
                      eob=1800,
                      kop2=2300,
                      eob2=2700)  # for H2-type well
     self.assertIsInstance(D.md, list)
     self.assertIsInstance(D.tvd, list)
     self.assertEqual(len(D.md), len(D.tvd))
     self.assertEqual(D.deltaz, 50)
     self.assertEqual(D.zstep, len(D.md))
 def test_load(self):
     D = wellpath.get(3000, 50)
     data = [D.md, D.tvd]
     newD = wellpath.load(data, deltaz=D.deltaz)
     self.assertIsInstance(newD.md, list)
     self.assertIsInstance(newD.tvd, list)
     self.assertEqual(len(newD.md), len(newD.tvd))
     self.assertEqual(newD.deltaz, 50)
     self.assertEqual(newD.zstep, len(newD.md))
 def test_stab_time(self):
     tdata = input.data()
     depths = wellpath.get(3000, 50)
     well = input.set_well(tdata, depths)
     st = main.stab_time(well)
     self.assertEqual(st.finaltime, len(st.tbot), len(st.tout))
     self.assertIsInstance(st.finaltime, int)
     self.assertIsInstance(st.tbot, list)
     self.assertIsInstance(st.tout, list)
Beispiel #9
0
 def test_temp_calc(self):
     tdata = input.data()
     depths = wellpath.get(3000, 50)
     well = input.set_well(tdata, depths)
     ic = initcond.init_cond(well)
     hc = heatcoefficients.heat_coef(well, 1)
     tdist = linearsystem.temp_calc(well, ic, hc)
     self.assertEqual(len(tdist.tdsi), len(tdist.ta), len(tdist.tr))
     self.assertEqual(len(tdist.tr), len(tdist.tcsg), len(tdist.tsr))
Beispiel #10
0
 def test_temp_time(self):
     tdata = input.data()
     depths = wellpath.get(3000, 50)
     well = input.set_well(tdata, depths)
     td = main.temp_time(24, well)
     eff = analysis.param_effect(td, well)
     final = round(eff.cc + eff.hs + eff.t1, 1)
     self.assertEqual(final, round(eff.t2, 1))
     self.assertIsInstance(eff.cc, float)
     self.assertIsInstance(eff.hs, float)
Beispiel #11
0
 def test_temp_time(self):
     tdata = input.data()
     depths = wellpath.get(3000, 50)
     well = input.set_well(tdata, depths)
     eff = analysis.hs_effect(well)
     self.assertIsInstance(eff.ds_rot1, float)
     self.assertIsInstance(eff.fric1, float)
     self.assertIsInstance(eff.ds_rot2, float)
     self.assertIsInstance(eff.fric2, float)
     self.assertIsInstance(eff.hsr, float)
 def test_temp_calc_drilling(self):
     from pwptemp.drilling import input, initcond, heatcoefficients, linearsystem
     tdata = input.data()
     depths = wellpath.get(3000, 50)
     well = input.set_well(tdata, depths)
     ic = initcond.init_cond(well)
     well = well.define_viscosity(ic)
     well = well.define_density(ic, cond=0)
     hc = heatcoefficients.heat_coef(well, 1)
     tdist = linearsystem.temp_calc(well, ic, hc)
     self.assertEqual(len(tdist.tdsi), len(tdist.ta), len(tdist.tr))
     self.assertEqual(len(tdist.tr), len(tdist.tcsg), len(tdist.tsr))
 def test_temp_calc_injection(self):
     from pwptemp.injection import input, initcond, heatcoefficients, linearsystem
     tdata = input.data()
     depths = wellpath.get(3000, 50)
     well = input.set_well(tdata, depths)
     ic = initcond.init_cond(well)
     tt = ic.tto
     tc = ic.tco
     well = well.define_density(ic, cond=0)
     hc = heatcoefficients.heat_coef(well, 1, tt, tc)
     tdist = linearsystem.temp_calc(well, ic, hc)
     self.assertEqual(len(tdist.tft), len(tdist.ta), len(tdist.tr))
     self.assertEqual(len(tdist.tr), len(tdist.tc), len(tdist.tsr))
Beispiel #14
0
 def test_temp_time(self):
     tdata = input.data()
     depths = wellpath.get(3000, 50)
     well = input.set_well(tdata, depths)
     td = main.temp_time(24, well)
     self.assertEqual(len(td.tdsi), len(td.ta), len(td.tr))
     self.assertEqual(len(td.tcsg), len(td.tsr), len(td.tfm))
     self.assertEqual(td.time, 24)
     self.assertIsInstance(td.tdsi, list)
     self.assertIsInstance(td.ta, list)
     self.assertIsInstance(td.tr, list)
     self.assertIsInstance(td.tcsg, list)
     self.assertIsInstance(td.tsr, list)
     self.assertIsInstance(td.tfm, list)
Beispiel #15
0
 def test_temp_time_drilling(self):
     from pwptemp.drilling import input, main
     tdata = input.data()
     depths = wellpath.get(1000)
     well = input.set_well(tdata, depths)
     td = main.temp_time(2, well)
     self.assertEqual(len(td.tdsi), len(td.ta), len(td.tr))
     self.assertEqual(len(td.tcsg), len(td.tsr), len(td.tfm))
     self.assertEqual(td.time, 2)
     self.assertIsInstance(td.tdsi, list)
     self.assertIsInstance(td.ta, list)
     self.assertIsInstance(td.tr, list)
     self.assertIsInstance(td.tcsg, list)
     self.assertIsInstance(td.tsr, list)
     self.assertIsInstance(td.tfm, list)
Beispiel #16
0
 def test_temp_time_injection(self):
     from pwptemp.injection import input, main
     tdata = input.data()
     depths = wellpath.get(1000)
     well = input.set_well(tdata, depths)
     td = main.temp_time(2, well)
     self.assertEqual(len(td.tft), len(td.ta), len(td.tr))
     self.assertEqual(len(td.tc), len(td.tsr), len(td.tfm))
     self.assertEqual(td.time, 2)
     self.assertIsInstance(td.tft, list)
     self.assertIsInstance(td.ta, list)
     self.assertIsInstance(td.tr, list)
     self.assertIsInstance(td.tc, list)
     self.assertIsInstance(td.tsr, list)
     self.assertIsInstance(td.tfm, list)
Beispiel #17
0
 def test_init_cond(self):
     tdata = input.data()
     depths = wellpath.get(100, 10)
     well = input.set_well(tdata, depths)
     ic = initcond.init_cond(well)
     a = ic.tdsio
     b = ic.tdso
     c = ic.tao
     d = ic.tcsgo
     e = ic.tsro
     f = ic.tfm
     self.assertIsInstance(a, list)
     self.assertIsInstance(b, list)
     self.assertIsInstance(c, list)
     self.assertIsInstance(d, list)
     self.assertIsInstance(e, list)
     self.assertIsInstance(f, list)
Beispiel #18
0
 def test_init_cond_injection(self):
     from pwptemp.injection import input, initcond
     tdata = input.data()
     depths = wellpath.get(100, 10)
     well = input.set_well(tdata, depths)
     ic = initcond.init_cond(well)
     a = ic.tfto
     b = ic.tto
     c = ic.tao
     d = ic.tco
     e = ic.tsro
     f = ic.tfm
     self.assertIsInstance(a, list)
     self.assertIsInstance(b, list)
     self.assertIsInstance(c, list)
     self.assertIsInstance(d, list)
     self.assertIsInstance(e, list)
     self.assertIsInstance(f, list)
def define_inj_plot():
    time = request.args.get("time")
    depth = request.args.get("depth")
    wd = request.args.get("wd")
    well_profile = request.args.get("well_profile")
    kop = request.args.get("kop")
    eob = request.args.get("eob")
    build_angle = request.args.get("build_angle")
    kop2 = request.args.get("kop2")
    eob2 = request.args.get("eob2")
    sod = request.args.get("sod")
    eod = request.args.get("eod")
    plot_type = request.args.get("plot_type")
    dt_tft = request.args.get("dt_tft")
    dt_ta = request.args.get("dt_ta")
    dt_tr = request.args.get("dt_tr")
    dt_tc = request.args.get("dt_tc")
    dt_tfm = request.args.get("dt_tfm")
    dt_tsr = request.args.get("dt_tsr")

    # TUBULAR
    n_casings = request.args.get("n_casings")
    dro = request.args.get("dro")
    dri = request.args.get("dri")
    dto = request.args.get("dto")
    dti = request.args.get("dti")

    # OPERATIONAL PARAMETERS
    tin = request.args.get("tin")
    q = request.args.get("q")

    # DENSITIES
    rhof = request.args.get("rhof")
    rhot = request.args.get("rhot")
    rhoc = request.args.get("rhoc")
    rhor = request.args.get("rhor")
    rhofm = request.args.get("rhofm")
    rhow = request.args.get("rhow")
    rhocem = request.args.get("rhocem")

    wtg = request.args.get("wtg")
    gt = request.args.get("gt")

    if time is None:
        time = 2
        depth = 3000
        wd = 150
        well_profile = "V"
        kop = 600
        eob = 1500
        build_angle = 40
        kop2 = 1800
        eob2 = 2300
        sod = 2000
        eod = 2600
        plot_type = 1
        dt_tft = True
        dt_ta = False
        dt_tr = False
        dt_tc = False
        dt_tfm = True
        dt_tsr = False
        n_casings = 0

        # TUBULAR
        casings_list = []
        dro = 21
        dri = 17.716
        dto = 4.5
        dti = 4

        # OPERATIONAL PARAMETERS
        tin = 20
        q = 144  # injection rate, m3/d

        # DENSITIES
        rhof = 1.198  # injection fluid density, sg
        rhot = 7.6
        rhoc = 7.8
        rhor = 7.8
        rhofm = 2.245
        rhow = 1.029
        rhocem = 2.7

        wtg = -0.005
        gt = 0.0238

    else:
        time = float(time)
        depth = float(depth)
        wd = float(wd)
        well_profile = str(well_profile)
        kop = float(kop)
        eob = float(eob)
        build_angle = int(build_angle)
        kop2 = float(kop2)
        eob2 = float(eob2)
        sod = float(sod)
        eod = float(eod)
        plot_type = int(plot_type)
        dt_tft = bool(dt_tft)
        dt_ta = bool(dt_ta)
        dt_tr = bool(dt_tr)
        dt_tc = bool(dt_tc)
        dt_tfm = bool(dt_tfm)
        dt_tsr = bool(dt_tsr)
        n_casings = int(n_casings)

        # TUBULAR
        casings_list = []
        for i in range(1, n_casings + 1):
            csg_dict = {
                "od": float(request.args.get("od" + str(i))),
                "id": float(request.args.get("id" + str(i))),
                "depth": float(request.args.get("depth" + str(i)))
            }
            casings_list.append(csg_dict)
        dro = float(dro)
        dri = float(dri)
        dto = float(dto)
        dti = float(dti)

        # OPERATIONAL PARAMETERS
        tin = float(tin)
        q = float(q)

        # DENSITIES
        rhof = float(rhof)
        rhot = float(rhot)
        rhoc = float(rhoc)
        rhor = float(rhor)
        rhofm = float(rhofm)
        rhow = float(rhow)
        rhocem = float(rhocem)

        wtg = float(wtg)
        gt = float(gt)

    inputs = {
        'time': time,
        'depth': depth,
        'wd': wd,
        'well_profile': well_profile,
        'kop': kop,
        'eob': eob,
        'build_angle': build_angle,
        'kop2': kop2,
        'eob2': eob2,
        'sod': sod,
        'eod': eod,
        'plot_type': plot_type,
        'n_casings': n_casings
    }

    # Others parameters: the ones which should be used for the attribute 'change_inputs'
    others = {
        'wd': wd,
        'q': q,
        'tin': tin,
        'rhof': rhof,
        'rhot': rhot,
        'rhoc': rhoc,
        'rhor': rhor,
        'rhofm': rhofm,
        'rhow': rhow,
        'rhocem': rhocem,
        'dro': dro,
        'dri': dri,
        'dto': dto,
        'dti': dti,
        'wtg': wtg,
        'gt': gt
    }

    inputs.update(others)  # Merge 'others' into the 'inputs' dictionary

    error_raised = error_messages(
        inputs
    )  # Checking process for warning messages depending on the inputs

    if error_raised == 0:
        if plot_type != 5:
            temp = pti.temp(time,
                            mdt=depth,
                            casings=casings_list,
                            profile=well_profile,
                            change_input=others,
                            build_angle=build_angle,
                            kop=kop,
                            eob=eob,
                            kop2=kop2,
                            eob2=eob2,
                            sod=sod,
                            eod=eod)

        if plot_type == 1:
            fig1 = create_figure1(temp)
        if plot_type == 4:
            fig1 = create_figure4(temp.behavior())
        if plot_type == 5:
            temp = pti.temp(time,
                            mdt=depth,
                            log=True,
                            profile=well_profile,
                            change_input=others,
                            build_angle=build_angle,
                            kop=kop,
                            eob=eob,
                            kop2=kop2,
                            eob2=eob2,
                            sod=sod,
                            eod=eod)
            fig1 = create_figure5(temp,
                                  tft=dt_tft,
                                  ta=dt_ta,
                                  tr=dt_tr,
                                  tc=dt_tc,
                                  tfm=dt_tfm,
                                  tsr=dt_tsr)

        wellpath = get(depth,
                       profile=well_profile,
                       build_angle=build_angle,
                       kop=kop,
                       eob=eob,
                       kop2=kop2,
                       eob2=eob2,
                       sod=sod,
                       eod=eod)
        fig2 = plot_wellpath(wellpath)

        p = row(fig2, fig1)

    else:
        p = figure(sizing_mode='stretch_both')

    return p, inputs
Beispiel #20
0
def plot():
    time = request.args.get("time")
    depth = request.args.get("depth")
    wd = request.args.get("wd")
    well_profile = request.args.get("well_profile")
    kop = request.args.get("kop")
    eob = request.args.get("eob")
    build_angle = request.args.get("build_angle")
    kop2 = request.args.get("kop2")
    eob2 = request.args.get("eob2")
    sod = request.args.get("sod")
    eod = request.args.get("eod")
    plot_type = request.args.get("plot_type")
    plot_md = request.args.get("plot_md")
    deltat = request.args.get("deltat")
    dt_tdsi = request.args.get("dt_tdsi")
    dt_ta = request.args.get("dt_ta")
    dt_tr = request.args.get("dt_tr")
    dt_tcsg = request.args.get("dt_tcsg")
    dt_tfm = request.args.get("dt_tfm")
    dt_tsr = request.args.get("dt_tsr")

    # TUBULAR
    n_casings = request.args.get("n_casings")
    dro = request.args.get("dro")
    dri = request.args.get("dri")
    ddo = request.args.get("ddo")
    ddi = request.args.get("ddi")

    # OPERATIONAL PARAMETERS
    tin = request.args.get("tin")
    q = request.args.get("q")
    rpm = request.args.get("rpm")
    t = request.args.get("t")
    tbit = request.args.get("tbit")
    wob = request.args.get("wob")
    rop = request.args.get("rop")
    an = request.args.get("an")

    # DENSITIES
    rhol = request.args.get("rhol")
    rhod = request.args.get("rhod")
    rhoc = request.args.get("rhoc")
    rhor = request.args.get("rhor")
    rhofm = request.args.get("rhofm")
    rhow = request.args.get("rhow")
    rhocem = request.args.get("rhocem")

    wtg = request.args.get("wtg")
    gt = request.args.get("gt")

    if time is None:
        time = 5
        depth = 3000
        wd = 150
        well_profile = "V"
        kop = 600
        eob = 1500
        build_angle = 40
        kop2 = 1800
        eob2 = 2300
        sod = 2000
        eod = 2600
        plot_type = 1
        plot_md = 1
        deltat = 1
        dt_tdsi = True
        dt_ta = False
        dt_tr = False
        dt_tcsg = False
        dt_tfm = True
        dt_tsr = False
        n_casings = 0

        # TUBULAR
        casings_list = []
        dro = 21
        dri = 17.716
        ddo = 4.5
        ddi = 4

        # OPERATIONAL PARAMETERS
        tin = 20
        q = 794.933
        rpm = 100
        t = 2
        tbit = 1.35
        wob = 22.41
        rop = 14.4
        an = 3100

        # DENSITIES
        rhol = 1.198
        rhod = 7.6
        rhoc = 7.8
        rhor = 7.8
        rhofm = 2.245
        rhow = 1.029
        rhocem = 2.7

        wtg = -0.005
        gt = 0.0238

    else:
        time = float(time)
        depth = float(depth)
        wd = float(wd)
        well_profile = str(well_profile)
        kop = float(kop)
        eob = float(eob)
        build_angle = int(build_angle)
        kop2 = float(kop2)
        eob2 = float(eob2)
        sod = float(sod)
        eod = float(eod)
        plot_type = int(plot_type)
        plot_md = float(plot_md)
        deltat = float(deltat)
        dt_tdsi = bool(dt_tdsi)
        dt_ta = bool(dt_ta)
        dt_tr = bool(dt_tr)
        dt_tcsg = bool(dt_tcsg)
        dt_tfm = bool(dt_tfm)
        dt_tsr = bool(dt_tsr)
        n_casings = int(n_casings)

        # TUBULAR
        casings_list = []
        for i in range(1, n_casings+1):
            csg_dict = {"od": float(request.args.get("od" + str(i))), "id": float(request.args.get("id" + str(i))),
                        "depth": float(request.args.get("depth" + str(i)))}
            casings_list.append(csg_dict)
        dro = float(dro)
        dri = float(dri)
        ddo = float(ddo)
        ddi = float(ddi)

        # OPERATIONAL PARAMETERS
        tin = float(tin)
        q = float(q)
        rpm = float(rpm)
        t = float(t)
        tbit = float(tbit)
        wob = float(wob)
        rop = float(rop)
        an = float(an)

        # DENSITIES
        rhol = float(rhol)
        rhod = float(rhod)
        rhoc = float(rhoc)
        rhor = float(rhor)
        rhofm = float(rhofm)
        rhow = float(rhow)
        rhocem = float(rhocem)

        wtg = float(wtg)
        gt = float(gt)

    inputs = {'time':time, 'depth':depth, 'wd':wd, 'well_profile':well_profile, 'kop':kop, 'eob':eob,
              'build_angle':build_angle, 'kop2':kop2, 'eob2':eob2, 'sod':sod, 'eod':eod, 'plot_type':plot_type,
              'plot_md':plot_md, 'deltat':deltat, 'n_casings':n_casings}

    # Others parameters: the ones which should be used for the attribute 'change_inputs'
    others = {'wd':wd, 'tin':tin, 'q':q, 'rpm':rpm, 't':t, 'tbit':tbit, 'wob':wob, 'rop':rop, 'an':an, 'rhol':rhol,
              'rhod':rhod, 'rhoc':rhoc, 'rhor':rhor, 'rhofm':rhofm, 'rhow':rhow, 'rhocem':rhocem, 'dro':dro, 'dri':dri,
              'ddo':ddo, 'ddi':ddi, 'wtg':wtg, 'gt':gt}

    inputs.update(others)  # Merge 'others' into the 'inputs' dictionary

    error_raised = error_messages(inputs)  # Checking process for warning messages depending on the inputs

    if error_raised == 0:
        if plot_type != 5:
            temp = ptd.temp(time, mdt=depth, casings=casings_list, profile=well_profile, change_input=others,
                            build_angle=build_angle, kop=kop, eob=eob, kop2=kop2, eob2=eob2, sod=sod, eod=eod)

        if plot_type == 1:
            fig1 = create_figure1(temp)
        if plot_type == 2:
            fig1 = create_figure2(temp, plot_md)
        if plot_type == 3:
            fig1 = create_figure3(temp)
        if plot_type == 4:
            fig1 = create_figure4(temp.stab())
        if plot_type == 5:
            temps = ptd.temps(time, deltat, mdt=depth, profile=well_profile, change_input=others, build_angle=build_angle,
                              kop=kop, eob=eob, kop2=kop2, eob2=eob2, sod=sod, eod=eod)
            fig1 = create_figure5(temps, tdsi=dt_tdsi, ta=dt_ta, tr=dt_tr, tcsg=dt_tcsg, tfm=dt_tfm, tsr=dt_tsr)

        wellpath = get(depth, profile=well_profile, build_angle=build_angle, kop=kop, eob=eob, kop2=kop2,
                                       eob2=eob2, sod=sod, eod=eod)
        fig2 = plot_wellpath(wellpath)

        p = row(fig2, fig1)

    else:
        p = figure(sizing_mode='stretch_both')

    return p, inputs