Skip to content

Commit

Permalink
Support for AQUCHWAT
Browse files Browse the repository at this point in the history
  • Loading branch information
moyner committed Aug 24, 2024
1 parent 0548197 commit 7d9cb63
Show file tree
Hide file tree
Showing 3 changed files with 66 additions and 0 deletions.
43 changes: 43 additions & 0 deletions src/InputParser/keywords/solution.jl
Original file line number Diff line number Diff line change
Expand Up @@ -217,3 +217,46 @@ function parse_keyword!(data, outer_data, units, cfg, f, ::Val{:FIELDSEP})
end
data["FIELDSEP"] = out
end


function parse_keyword!(data, outer_data, units, cfg, f, ::Val{:AQUCHWAT})
n = aquifer_dimensions(outer_data, :NANAQU)
def_and_u = [
(1, :id),
(NaN, :length),
("PRESSURE", :id),
(0.0, :pressure),
(0.0, :aquifer_transmissibility),
(1, :id),
(0.0, :concentration),
(NaN, :pressure),
(NaN, :pressure),
("NO", :id),
(-Inf, :liquid_rate_surface),
(Inf, :liquid_rate_surface),
("NO", :id),
(0, :id),
(NaN, :relative_temperature),
]
def = map(first, def_and_u)
eunits = map(last, def_and_u)
out = []
for i = 1:n
rec = read_record(f)
result = parse_defaulted_line(rec, def)
bc_type = result[3]
if bc_type == "PRESSURE"
u = :pressure
else
@assert bc_type == "HEAD"
u = :length
parser_message(cfg, outer_data, AQUCHWAT, "AQUCHWAT: HEAD option is not fully supported. This option is not supported in JutulDarcy solvers.")
end
for j in [4, 8, 9]
eunits[j] = u
end
swap_unit_system_axes!(result, units, eunits)
push!(out, result)
end
data["AQUCHWAT"] = out
end
4 changes: 4 additions & 0 deletions src/InputParser/units.jl
Original file line number Diff line number Diff line change
Expand Up @@ -331,3 +331,7 @@ function deck_unit(sys::DeckUnitSystem, ::Val{:thermal_expansion_c2})
u = deck_unit(sys, :absolute_temperature_numeric)
return 1.0/u^2
end

function deck_unit(sys::DeckUnitSystem, ::Val{:aquifer_transmissibility})
return deck_unit(sys, :transmissibility)/deck_unit(sys, :viscosity)
end
19 changes: 19 additions & 0 deletions src/InputParser/utils.jl
Original file line number Diff line number Diff line change
Expand Up @@ -478,6 +478,25 @@ function number_of_tables(outer_data, t::Symbol)
error(":$t is not known")
end

function aquifer_dimensions(outer_data, t::Symbol)
rs = outer_data["RUNSPEC"]
aqudims = get(rs, "AQUDIMS", [1, 1, 1, 36, 1, 1, 0, 0])
if t == :MXNAQN || t == :NANAQU
return max(aqudims[1], aqudims[5])
elseif t == :MXNAQC || t == :NCAMAX
return max(aqudims[2], aqudims[6])
elseif t == :NIFTBL
return aqudims[3]
elseif t == :NRIFTB
return aquadims[4]
elseif t == :MXNALI
return aquadims[7]
elseif t == :MXAAQL
return aquadims[8]
end
error(":$t is not known")
end

function compositional_number_of_components(outer_data)
return outer_data["RUNSPEC"]["COMPS"]
end
Expand Down

0 comments on commit 7d9cb63

Please sign in to comment.