From 2a0fce226c21ea93625669d41dc1c2d2221a9d72 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Olav=20M=C3=B8yner?= Date: Thu, 7 Mar 2024 13:48:18 +0100 Subject: [PATCH] Parse WSEGVALV --- src/InputParser/keywords/grid.jl | 2 +- src/InputParser/keywords/schedule.jl | 22 ++++++++++++++++++++++ 2 files changed, 23 insertions(+), 1 deletion(-) diff --git a/src/InputParser/keywords/grid.jl b/src/InputParser/keywords/grid.jl index 138b145..b29fece 100644 --- a/src/InputParser/keywords/grid.jl +++ b/src/InputParser/keywords/grid.jl @@ -179,7 +179,7 @@ function parse_keyword!(data, outer_data, units, cfg, f, v::Union{Val{:POELCOEF} data["$k"] = vals end -function parse_keyword!(data, outer_data, units, cfg, f, v::Union{Val{:FIPNUM}, Val{:PVTNUM}, Val{:SATNUM}, Val{:EQLNUM}, Val{:ROCKNUM}, Val{:IMBNUM}, Val{:MULTNUM}}) +function parse_keyword!(data, outer_data, units, cfg, f, v::Union{Val{:FIPNUM}, Val{:PVTNUM}, Val{:SATNUM}, Val{:EQLNUM}, Val{:ROCKNUM}, Val{:IMBNUM}, Val{:MULTNUM}, Val{:FIPZON}}) k = unpack_val(v) parse_and_set_grid_data!(data, outer_data, units, cfg, f, k, T = Int) end diff --git a/src/InputParser/keywords/schedule.jl b/src/InputParser/keywords/schedule.jl index 234a292..47c1d60 100644 --- a/src/InputParser/keywords/schedule.jl +++ b/src/InputParser/keywords/schedule.jl @@ -415,6 +415,27 @@ function parse_keyword!(data, outer_data, units, cfg, f, ::Val{:WELSEGS}) data["WELSEGS"][wname] = (header = wheader, segments = segments) end +function parse_keyword!(data, outer_data, units, cfg, f, ::Val{:WSEGVALV}) + d = "Default" + defaults = [d, -1, NaN, NaN, -1, -1, -1, -1, "OPEN", -1] + @assert length(defaults) == 10 + wells = get_wells(outer_data) + compdat = parse_defaulted_group_well(f, defaults, wells, 1) + # Unit conversion + utypes = identity_unit_vector(defaults) + utypes[4] = :area + utypes[5] = :length + utypes[6] = :length + utypes[7] = :length + utypes[8] = :area + utypes[10] = :area + for cd in compdat + swap_unit_system_axes!(cd, units, utypes) + end + push_and_create!(data, "WSEGVALV", compdat) + parser_message(cfg, outer_data, "WSEGVALV", PARSER_JUTULDARCY_MISSING_SUPPORT) +end + function parse_keyword!(data, outer_data, units, cfg, f, ::Val{:COMPSEGS}) rec = read_record(f) wname = only(parse_defaulted_line(rec, ["Default"])) @@ -460,3 +481,4 @@ function parse_keyword!(data, outer_data, units, cfg, f, ::Val{:UDQ}) skip_record(f) parser_message(cfg, outer_data, "UDQ", PARSER_MISSING_SUPPORT) end +