diff --git a/tests/everest/test_data/snake_oil/jobs b/tests/everest/test_data/snake_oil/jobs new file mode 120000 index 00000000000..ba95610ece3 --- /dev/null +++ b/tests/everest/test_data/snake_oil/jobs @@ -0,0 +1 @@ +../../../../test-data/ert/snake_oil/forward_models \ No newline at end of file diff --git a/tests/everest/test_data/snake_oil/jobs/SNAKE_OIL_DIFF b/tests/everest/test_data/snake_oil/jobs/SNAKE_OIL_DIFF deleted file mode 100755 index 9f85b01110f..00000000000 --- a/tests/everest/test_data/snake_oil/jobs/SNAKE_OIL_DIFF +++ /dev/null @@ -1,4 +0,0 @@ -STDOUT snake_oil_diff.stdout -STDERR snake_oil_diff.stderr - -EXECUTABLE snake_oil_diff.py diff --git a/tests/everest/test_data/snake_oil/jobs/SNAKE_OIL_NPV b/tests/everest/test_data/snake_oil/jobs/SNAKE_OIL_NPV deleted file mode 100755 index 7ba667a9c55..00000000000 --- a/tests/everest/test_data/snake_oil/jobs/SNAKE_OIL_NPV +++ /dev/null @@ -1,4 +0,0 @@ -STDOUT snake_oil_npv.stdout -STDERR snake_oil_npv.stderr - -EXECUTABLE snake_oil_npv.py diff --git a/tests/everest/test_data/snake_oil/jobs/SNAKE_OIL_SIMULATOR b/tests/everest/test_data/snake_oil/jobs/SNAKE_OIL_SIMULATOR deleted file mode 100755 index 5eaab974f5f..00000000000 --- a/tests/everest/test_data/snake_oil/jobs/SNAKE_OIL_SIMULATOR +++ /dev/null @@ -1,4 +0,0 @@ -STDOUT snake_oil.stdout -STDERR snake_oil.stderr - -EXECUTABLE snake_oil_simulator.py diff --git a/tests/everest/test_data/snake_oil/jobs/snake_oil_diff.py b/tests/everest/test_data/snake_oil/jobs/snake_oil_diff.py deleted file mode 100755 index 2bf3c2cc092..00000000000 --- a/tests/everest/test_data/snake_oil/jobs/snake_oil_diff.py +++ /dev/null @@ -1,33 +0,0 @@ -#!/usr/bin/env python -from resdata.summary import Summary - - -def writeDiff(filename, vector1, vector2): - with open(filename, "w", encoding="utf-8") as f: - for index in range(len(vector1)): - node1 = vector1[index] - node2 = vector2[index] - - diff = node1.value - node2.value - f.write("%f\n" % diff) - - -if __name__ == "__main__": - summary = Summary("SNAKE_OIL_FIELD") - - report_step = 199 - writeDiff( - "snake_oil_opr_diff_%d.txt" % report_step, - summary["WOPR:OP1"], - summary["WOPR:OP2"], - ) - writeDiff( - "snake_oil_wpr_diff_%d.txt" % report_step, - summary["WWPR:OP1"], - summary["WWPR:OP2"], - ) - writeDiff( - "snake_oil_gpr_diff_%d.txt" % report_step, - summary["WGPR:OP1"], - summary["WGPR:OP2"], - ) diff --git a/tests/everest/test_data/snake_oil/jobs/snake_oil_npv.py b/tests/everest/test_data/snake_oil/jobs/snake_oil_npv.py deleted file mode 100755 index fb6ef338e55..00000000000 --- a/tests/everest/test_data/snake_oil/jobs/snake_oil_npv.py +++ /dev/null @@ -1,104 +0,0 @@ -#!/usr/bin/env python -from resdata.summary import Summary - -OIL_PRICES = { - "2010-01-01": 78.33, - "2010-02-01": 76.39, - "2010-03-01": 81.20, - "2010-04-01": 84.29, - "2010-05-01": 73.74, - "2010-06-01": 75.34, - "2010-07-01": 76.32, - "2010-08-01": 76.60, - "2010-09-01": 75.24, - "2010-10-01": 81.89, - "2010-11-01": 84.25, - "2010-12-01": 89.15, - "2011-01-01": 89.17, - "2011-02-01": 88.58, - "2011-03-01": 102.86, - "2011-04-01": 109.53, - "2011-05-01": 100.90, - "2011-06-01": 96.26, - "2011-07-01": 97.30, - "2011-08-01": 86.33, - "2011-09-01": 85.52, - "2011-10-01": 86.32, - "2011-11-01": 97.16, - "2011-12-01": 98.56, - "2012-01-01": 100.27, - "2012-02-01": 102.20, - "2012-03-01": 106.16, - "2012-04-01": 103.32, - "2012-05-01": 94.65, - "2012-06-01": 82.30, - "2012-07-01": 87.90, - "2012-08-01": 94.13, - "2012-09-01": 94.51, - "2012-10-01": 89.49, - "2012-11-01": 86.53, - "2012-12-01": 87.86, - "2013-01-01": 94.76, - "2013-02-01": 95.31, - "2013-03-01": 92.94, - "2013-04-01": 92.02, - "2013-05-01": 94.51, - "2013-06-01": 95.77, - "2013-07-01": 104.67, - "2013-08-01": 106.57, - "2013-09-01": 106.29, - "2013-10-01": 100.54, - "2013-11-01": 93.86, - "2013-12-01": 97.63, - "2014-01-01": 94.62, - "2014-02-01": 100.82, - "2014-03-01": 100.80, - "2014-04-01": 102.07, - "2014-05-01": 102.18, - "2014-06-01": 105.79, - "2014-07-01": 103.59, - "2014-08-01": 96.54, - "2014-09-01": 93.21, - "2014-10-01": 84.40, - "2014-11-01": 75.79, - "2014-12-01": 59.29, - "2015-01-01": 47.22, - "2015-02-01": 50.58, - "2015-03-01": 47.82, - "2015-04-01": 54.45, - "2015-05-01": 59.27, - "2015-06-01": 59.82, - "2015-07-01": 50.90, - "2015-08-01": 42.87, - "2015-09-01": 45.48, -} - -if __name__ == "__main__": - summary = Summary("SNAKE_OIL_FIELD") - start_time = summary.get_start_time() - date_ranges = summary.time_range(start_time, interval="1M") - production_sums = summary.blocked_production("FOPT", date_ranges) - - npv = 0.0 - for index in range(0, len(date_ranges) - 1): - date = date_ranges[index + 1] # end of period - production_sum = production_sums[index] - - oil_price = OIL_PRICES[date.date().strftime("%Y-%m-%d")] - - production_value = oil_price * production_sum - npv += production_value - - with open("snake_oil_npv.txt", "w", encoding="utf-8") as output_file: - output_file.write("NPV %s\n" % npv) - - if npv < 80000: - rating = "POOR" - elif 80000 <= npv < 100000: - rating = "AVERAGE" - elif 100000 <= npv < 120000: - rating = "GOOD" - else: - rating = "EXCELLENT" - - output_file.write("RATING %s\n" % rating) diff --git a/tests/everest/test_data/snake_oil/jobs/snake_oil_params.txt b/tests/everest/test_data/snake_oil/jobs/snake_oil_params.txt deleted file mode 100644 index 3868522924c..00000000000 --- a/tests/everest/test_data/snake_oil/jobs/snake_oil_params.txt +++ /dev/null @@ -1,10 +0,0 @@ -OP1_PERSISTENCE:0.15 -OP1_OCTAVES:4 -OP1_DIVERGENCE_SCALE:0.5 -OP1_OFFSET:0.0 -OP2_PERSISTENCE:0.25 -OP2_OCTAVES:7.0 -OP2_DIVERGENCE_SCALE:1.0 -OP2_OFFSET:0.0 -BPR_555_PERSISTENCE:0.25 -BPR_138_PERSISTENCE:0.35 diff --git a/tests/everest/test_data/snake_oil/jobs/snake_oil_simulator.py b/tests/everest/test_data/snake_oil/jobs/snake_oil_simulator.py deleted file mode 100755 index ed067ae1ebb..00000000000 --- a/tests/everest/test_data/snake_oil/jobs/snake_oil_simulator.py +++ /dev/null @@ -1,189 +0,0 @@ -#!/usr/bin/env python -from datetime import datetime - -from oil_reservoir_synthesizer import OilSimulator -from resdata.summary import Summary - - -def globalIndex(i, j, k, nx=10, ny=10, nz=10): - return i + nx * (j - 1) + nx * ny * (k - 1) - - -def readParameters(filename): - params = {} - with open(filename, "r", encoding="utf-8") as f: - for line in f: - key, value = line.split(":", 1) - params[key] = value.strip() - - return params - - -def runSimulator(simulator, history_simulator, time_step_count): - """@rtype: Summary""" - res_sum = Summary.writer("SNAKE_OIL_FIELD", datetime(2010, 1, 1), 10, 10, 10) - - res_sum.add_variable("FOPT") - res_sum.add_variable("FOPR") - res_sum.add_variable("FGPT") - res_sum.add_variable("FGPR") - res_sum.add_variable("FWPT") - res_sum.add_variable("FWPR") - res_sum.add_variable("FGOR") - res_sum.add_variable("FWCT") - - res_sum.add_variable("FOPTH") - res_sum.add_variable("FOPRH") - res_sum.add_variable("FGPTH") - res_sum.add_variable("FGPRH") - res_sum.add_variable("FWPTH") - res_sum.add_variable("FWPRH") - res_sum.add_variable("FGORH") - res_sum.add_variable("FWCTH") - - res_sum.add_variable("WOPR", wgname="OP1") - res_sum.add_variable("WOPR", wgname="OP2") - res_sum.add_variable("WWPR", wgname="OP1") - res_sum.add_variable("WWPR", wgname="OP2") - res_sum.add_variable("WGPR", wgname="OP1") - res_sum.add_variable("WGPR", wgname="OP2") - res_sum.add_variable("WGOR", wgname="OP1") - res_sum.add_variable("WGOR", wgname="OP2") - res_sum.add_variable("WWCT", wgname="OP1") - res_sum.add_variable("WWCT", wgname="OP2") - - res_sum.add_variable("WOPRH", wgname="OP1") - res_sum.add_variable("WOPRH", wgname="OP2") - res_sum.add_variable("WWPRH", wgname="OP1") - res_sum.add_variable("WWPRH", wgname="OP2") - res_sum.add_variable("WGPRH", wgname="OP1") - res_sum.add_variable("WGPRH", wgname="OP2") - res_sum.add_variable("WGORH", wgname="OP1") - res_sum.add_variable("WGORH", wgname="OP2") - res_sum.add_variable("WWCTH", wgname="OP1") - res_sum.add_variable("WWCTH", wgname="OP2") - - res_sum.add_variable("BPR", num=globalIndex(5, 5, 5)) - res_sum.add_variable("BPR", num=globalIndex(1, 3, 8)) - - time_map = [] - mini_step_count = 10 - total_step_count = time_step_count * mini_step_count - - for report_step in range(time_step_count): - for mini_step in range(mini_step_count): - t_step = res_sum.add_t_step( - report_step + 1, sim_days=report_step * mini_step_count + mini_step - ) - - time_map.append(t_step.get_sim_time().datetime().strftime("%d/%m/%Y")) - - simulator.step(scale=1.0 / total_step_count) - history_simulator.step(scale=1.0 / total_step_count) - - t_step["FOPR"] = simulator.fopr() - t_step["FOPT"] = simulator.fopt() - t_step["FGPR"] = simulator.fgpr() - t_step["FGPT"] = simulator.fgpt() - t_step["FWPR"] = simulator.fwpr() - t_step["FWPT"] = simulator.fwpt() - t_step["FGOR"] = simulator.fgor() - t_step["FWCT"] = simulator.fwct() - - t_step["WOPR:OP1"] = simulator.opr("OP1") - t_step["WOPR:OP2"] = simulator.opr("OP2") - - t_step["WGPR:OP1"] = simulator.gpr("OP1") - t_step["WGPR:OP2"] = simulator.gpr("OP2") - - t_step["WWPR:OP1"] = simulator.wpr("OP1") - t_step["WWPR:OP2"] = simulator.wpr("OP2") - - t_step["WGOR:OP1"] = simulator.gor("OP1") - t_step["WGOR:OP2"] = simulator.gor("OP2") - - t_step["WWCT:OP1"] = simulator.wct("OP1") - t_step["WWCT:OP2"] = simulator.wct("OP2") - - t_step["BPR:5,5,5"] = simulator.bpr("5,5,5") - t_step["BPR:1,3,8"] = simulator.bpr("1,3,8") - - t_step["FOPRH"] = history_simulator.fopr() - t_step["FOPTH"] = history_simulator.fopt() - t_step["FGPRH"] = history_simulator.fgpr() - t_step["FGPTH"] = history_simulator.fgpt() - t_step["FWPRH"] = history_simulator.fwpr() - t_step["FWPTH"] = history_simulator.fwpt() - t_step["FGORH"] = history_simulator.fgor() - t_step["FWCTH"] = history_simulator.fwct() - - t_step["WOPRH:OP1"] = history_simulator.opr("OP1") - t_step["WOPRH:OP2"] = history_simulator.opr("OP2") - - t_step["WGPRH:OP1"] = history_simulator.gpr("OP1") - t_step["WGPRH:OP2"] = history_simulator.gpr("OP2") - - t_step["WWPRH:OP1"] = history_simulator.wpr("OP1") - t_step["WWPRH:OP2"] = history_simulator.wpr("OP2") - - t_step["WGORH:OP1"] = history_simulator.gor("OP1") - t_step["WGORH:OP2"] = history_simulator.gor("OP2") - - t_step["WWCTH:OP1"] = history_simulator.wct("OP1") - t_step["WWCTH:OP2"] = history_simulator.wct("OP2") - - return res_sum, time_map - - -def roundedInt(value): - return int(round(float(value))) - - -if __name__ == "__main__": - seed = int(readParameters("seed.txt")["SEED"]) - parameters = readParameters("snake_oil_params.txt") - - op1_divergence_scale = float(parameters["OP1_DIVERGENCE_SCALE"]) - op2_divergence_scale = float(parameters["OP2_DIVERGENCE_SCALE"]) - op1_persistence = float(parameters["OP1_PERSISTENCE"]) - op2_persistence = float(parameters["OP2_PERSISTENCE"]) - op1_offset = float(parameters["OP1_OFFSET"]) - op2_offset = float(parameters["OP2_OFFSET"]) - bpr_138_persistence = float(parameters["BPR_138_PERSISTENCE"]) - bpr_555_persistence = float(parameters["BPR_555_PERSISTENCE"]) - - op1_octaves = roundedInt(parameters["OP1_OCTAVES"]) - op2_octaves = roundedInt(parameters["OP2_OCTAVES"]) - - simulator = OilSimulator() - simulator.addWell( - "OP1", - seed * 997, - persistence=op1_persistence, - octaves=op1_octaves, - divergence_scale=op1_divergence_scale, - offset=op1_offset, - ) - simulator.addWell( - "OP2", - seed * 13, - persistence=op2_persistence, - octaves=op2_octaves, - divergence_scale=op2_divergence_scale, - offset=op2_offset, - ) - simulator.addBlock("5,5,5", seed * 37, persistence=bpr_555_persistence) - simulator.addBlock("1,3,8", seed * 31, persistence=bpr_138_persistence) - - history_simulator = OilSimulator() - history_simulator.addWell("OP1", 222118781) - history_simulator.addWell("OP2", 118116362) - - report_step_count = 200 - summary, time_map = runSimulator(simulator, history_simulator, report_step_count) - - summary.fwrite() - - with open("time_map.txt", "w", encoding="utf-8") as f: - for t in time_map: - f.write("%s\n" % t)