Skip to content

Commit

Permalink
Parse diffusion keywords
Browse files Browse the repository at this point in the history
  • Loading branch information
moyner committed Aug 25, 2024
1 parent 8fa7e66 commit aa6ce42
Showing 1 changed file with 17 additions and 0 deletions.
17 changes: 17 additions & 0 deletions src/InputParser/keywords/props.jl
Original file line number Diff line number Diff line change
Expand Up @@ -405,3 +405,20 @@ end
function unit_type(::Val{:SWATINIT})
return :id
end

const DIFFUSION_TYPE = Union{Val{:DIFCCOG}, Val{:DIFFCOIL}, Val{:DIFFCGAS}, Val{:DIFFCWAT}, Val{:DIFFCWG}}

function parse_keyword!(data, outer_data, units, cfg, f, val::DIFFUSION_TYPE)
k = unpack_val(val)
# TODO: Units.
n = compositional_number_of_components(outer_data)
out = zeros(n)
val = parse_deck_vector(f)
nv = length(val)
@assert nv <= n "$k has more entries ($nv) than components ($n)"
out[1:nv] = val
if !all(isequal(0), out)
parser_message(cfg, outer_data, "$k", PARSER_JUTULDARCY_MISSING_SUPPORT)
end
data["$k"] = out
end

0 comments on commit aa6ce42

Please sign in to comment.