diff --git a/src/InputParser/keywords/grid.jl b/src/InputParser/keywords/grid.jl index 862c0a9..1c03d8c 100644 --- a/src/InputParser/keywords/grid.jl +++ b/src/InputParser/keywords/grid.jl @@ -248,6 +248,13 @@ function parse_keyword!(data, outer_data, units, cfg, f, v::Union{Val{:DX}, Val{ data["$k"] = Δ end +function parse_keyword!(data, outer_data, units, cfg, f, v::Union{Val{:DXV}, Val{:DYV}, Val{:DZV}}) + k = unpack_val(v) + Δ = parse_deck_vector(f, Float64) + swap_unit_system_fast!(Δ, units, Val(:length)) + data["$k"] = Δ +end + function unit_type(::Union{Val{:DX}, Val{:DY}, Val{:DZ}}) return :length end diff --git a/src/InputParser/keywords/props.jl b/src/InputParser/keywords/props.jl index e2f64c1..3dba6f9 100644 --- a/src/InputParser/keywords/props.jl +++ b/src/InputParser/keywords/props.jl @@ -387,7 +387,6 @@ function parse_keyword!(data, outer_data, units, cfg, f, ::Val{:SCALECRS}) end end - function parse_keyword!(data, outer_data, units, cfg, f, ::Val{:DENSITY}) tdims = [NaN, NaN, NaN] nreg = number_of_tables(outer_data, :pvtnum) @@ -401,6 +400,33 @@ function parse_keyword!(data, outer_data, units, cfg, f, ::Val{:DENSITY}) data["DENSITY"] = out end +function parse_keyword!(data, outer_data, units, cfg, f, ::Val{:GRAVITY}) + tdims = [45.5, 1.0, 0.7773] + file_units = current_unit_system(outer_data) + if file_units == :field + rho_wat = 62.4 + rho_air = 0.076363 + elseif file_units == :lab + rho_wat = 1.0 + rho_air = 0.0012232 + elseif file_units in (:si, :metric) + rho_wat = 1000.0 + rho_air = 1.22 + else + error("Unknown unit system: $units") + end + nreg = number_of_tables(outer_data, :pvtnum) + out = [] + for i = 1:nreg + rec = read_record(f) + t = parse_defaulted_line(rec, tdims) + grav_oil = 141.15/(t[1]+131.5) + vals = [grav_oil*rho_wat, t[2]*rho_wat, t[3]*rho_air] + push!(out, vals) + end + data["DENSITY"] = out +end + function parse_keyword!(data, outer_data, units, cfg, f, ::Union{Val{:RSCONST}, Val{:RSCONSTT}}) rec = read_record(f) # TODO: This is missing units. diff --git a/src/InputParser/keywords/runspec.jl b/src/InputParser/keywords/runspec.jl index fc8a8bc..f11e9cb 100644 --- a/src/InputParser/keywords/runspec.jl +++ b/src/InputParser/keywords/runspec.jl @@ -41,6 +41,12 @@ function parse_keyword!(data, outer_data, units, cfg, f, ::Val{:WATER}) data["WATER"] = true end +function parse_keyword!(data, outer_data, units, cfg, f, ::Val{:TEMP}) + # TODO: We treat this as an alias, not sure if this is correct. + data["THERMAL"] = true + data["TEMP"] = true +end + function parse_keyword!(data, outer_data, units, cfg, f, ::Val{:OIL}) data["OIL"] = true end diff --git a/src/InputParser/keywords/schedule.jl b/src/InputParser/keywords/schedule.jl index 35ecb4d..c024d24 100644 --- a/src/InputParser/keywords/schedule.jl +++ b/src/InputParser/keywords/schedule.jl @@ -337,6 +337,14 @@ function parse_keyword!(data, outer_data, units, cfg, f, ::Val{:TUNING}) skip_records(f, 3) end +function parse_keyword!(data, outer_data, units, cfg, f, ::Val{:TUNINGDP}) + skip_records(f, 1) +end + +function parse_keyword!(data, outer_data, units, cfg, f, ::Val{:GCONTOL}) + skip_records(f, 1) +end + function parse_keyword!(data, outer_data, units, cfg, f, ::Val{:RPTSCHED}) read_record(f) end diff --git a/src/InputParser/keywords/solution.jl b/src/InputParser/keywords/solution.jl index ca8fa3d..57e2c68 100644 --- a/src/InputParser/keywords/solution.jl +++ b/src/InputParser/keywords/solution.jl @@ -90,7 +90,7 @@ function parse_keyword!(data, outer_data, units, cfg, f, ::Val{:PRESSURE}) data["PRESSURE"] = p end -function parse_keyword!(data, outer_data, units, cfg, f, ::Val{:RTEMP}) +function parse_keyword!(data, outer_data, units, cfg, f, ::Union{Val{:RTEMP}, Val{:RTEMPA}}) nreg = number_of_tables(outer_data, :eosnum) out = Float64[] for i in 1:nreg