-
Notifications
You must be signed in to change notification settings - Fork 13
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #19 from sintefmath/parse
Support for parsing and simulating .DATA files
- Loading branch information
Showing
36 changed files
with
3,633 additions
and
92 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,19 +1,22 @@ | ||
name = "JutulDarcy" | ||
uuid = "82210473-ab04-4dce-b31b-11573c4f8e0a" | ||
authors = ["Olav Møyner <[email protected]>"] | ||
version = "0.2.7" | ||
version = "0.2.8" | ||
This comment has been minimized.
Sorry, something went wrong. |
||
|
||
[deps] | ||
AlgebraicMultigrid = "2169fc97-5a83-5252-b627-83903c6c433c" | ||
DataStructures = "864edb3b-99cc-5e75-8d2d-829cb0a9cfe8" | ||
Dates = "ade2ca70-3891-5945-98fb-dc099432e06a" | ||
DelimitedFiles = "8bb1440f-4735-579b-a4ab-409b98df4dab" | ||
ForwardDiff = "f6369f11-7733-5829-9624-2563aa707210" | ||
Jutul = "2b460a1a-8a2b-45b2-b125-b5c536396eb9" | ||
Krylov = "ba0b0d4f-ebba-5204-a429-3ac8c609bfb7" | ||
LinearAlgebra = "37e2e46d-f89d-539d-b4ee-838fcccc9c8e" | ||
LoopVectorization = "bdcacae8-1622-11e9-2a5c-532679323890" | ||
MAT = "23992714-dd62-5051-b70f-ba57cb901cac" | ||
MultiComponentFlash = "35e5bd01-9722-4017-9deb-64a5d32478ff" | ||
OrderedCollections = "bac558e1-5e72-5ebc-8fee-abe8a469f55d" | ||
Parsers = "69de0a69-1ddd-5017-9359-2bf0b02dc9f0" | ||
Polyester = "f517fe37-dbe3-4b94-8317-1923a5111588" | ||
PrecompileTools = "aea7be01-6a6a-4083-8856-8a6e6704d82a" | ||
SparseArrays = "2f01184e-e22b-5df5-ae63-d93ebab69eaf" | ||
|
@@ -23,44 +26,47 @@ TestItems = "1c621080-faea-4a02-84b6-bbd5e436b8fe" | |
TimerOutputs = "a759f4b9-e2f1-59dc-863e-4aeb61b1ea8f" | ||
Tullio = "bc48ee85-29a4-5162-ae0b-a64e1601d4bc" | ||
|
||
[weakdeps] | ||
GLMakie = "e9467ef8-e4e7-5192-8a1a-b1aee30e663a" | ||
HYPRE = "b5ffcf37-a2bd-41ab-a3da-4bd9bc8ad771" | ||
MPI = "da04e1cc-30fd-572f-bb4f-1f8673147195" | ||
PartitionedArrays = "5a9dfac6-5c52-46f7-8278-5e2210713be9" | ||
|
||
[extensions] | ||
JutulDarcyGLMakieExt = "GLMakie" | ||
JutulDarcyHYPREExt = "HYPRE" | ||
JutulDarcyPartitionedArraysExt = ["PartitionedArrays", "MPI", "HYPRE"] | ||
|
||
[compat] | ||
AlgebraicMultigrid = "0.5.1" | ||
DataStructures = "0.18.13" | ||
DelimitedFiles = "1.9.1" | ||
ForwardDiff = "0.10.30" | ||
Jutul = "0.2.10" | ||
HYPRE = "1.4.0" | ||
Jutul = "0.2.12" | ||
Krylov = "0.9.1" | ||
LoopVectorization = "0.12.115" | ||
MAT = "0.10.3" | ||
MultiComponentFlash = "1.1.3" | ||
OrderedCollections = "1.6.2" | ||
Parsers = "2.7.1" | ||
PartitionedArrays = "0.3.2" | ||
Polyester = "0.6.11, 0.7.3" | ||
PrecompileTools = "1.0.1" | ||
PartitionedArrays = "0.3.2" | ||
StaticArrays = "1.4.4" | ||
TestItems = "0.1.0" | ||
TimerOutputs = "0.5.19" | ||
Tullio = "0.3.4" | ||
HYPRE = "1.4.0" | ||
julia = "1.7" | ||
Krylov = "0.9.1" | ||
|
||
[extras] | ||
TestItemRunner = "f8b46487-2199-4994-9208-9a1283c18c0a" | ||
TestItems = "1c621080-faea-4a02-84b6-bbd5e436b8fe" | ||
Test = "8dfed614-e22c-5e08-85e1-65c5234f0b40" | ||
GLMakie = "e9467ef8-e4e7-5192-8a1a-b1aee30e663a" | ||
HYPRE = "b5ffcf37-a2bd-41ab-a3da-4bd9bc8ad771" | ||
PartitionedArrays = "5a9dfac6-5c52-46f7-8278-5e2210713be9" | ||
MPI = "da04e1cc-30fd-572f-bb4f-1f8673147195" | ||
PartitionedArrays = "5a9dfac6-5c52-46f7-8278-5e2210713be9" | ||
Test = "8dfed614-e22c-5e08-85e1-65c5234f0b40" | ||
TestItemRunner = "f8b46487-2199-4994-9208-9a1283c18c0a" | ||
TestItems = "1c621080-faea-4a02-84b6-bbd5e436b8fe" | ||
|
||
[targets] | ||
test = ["Test", "TestItemRunner", "TestItems", "HYPRE", "MPI", "PartitionedArrays"] | ||
|
||
[weakdeps] | ||
GLMakie = "e9467ef8-e4e7-5192-8a1a-b1aee30e663a" | ||
HYPRE = "b5ffcf37-a2bd-41ab-a3da-4bd9bc8ad771" | ||
PartitionedArrays = "5a9dfac6-5c52-46f7-8278-5e2210713be9" | ||
MPI = "da04e1cc-30fd-572f-bb4f-1f8673147195" | ||
|
||
[extensions] | ||
JutulDarcyGLMakieExt = "GLMakie" | ||
JutulDarcyHYPREExt = "HYPRE" | ||
JutulDarcyPartitionedArraysExt = ["PartitionedArrays", "MPI", "HYPRE"] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
module InputParser | ||
using Parsers, DelimitedFiles, Jutul, OrderedCollections, Dates | ||
export parse_data_file | ||
|
||
include("deckinput/parser.jl") | ||
end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,62 @@ | ||
|
||
function parse_keyword!(data, outer_data, units, cfg, f, ::Val{:INIT}) | ||
data["INIT"] = true | ||
end | ||
|
||
function parse_keyword!(data, outer_data, units, cfg, f, ::Val{:COORDSYS}) | ||
read_record(f) | ||
@warn "COORDSYS skipped." | ||
end | ||
|
||
function parse_keyword!(data, outer_data, units, cfg, f, ::Val{:COORD}) | ||
coord = parse_deck_matrix(f, Float64) | ||
coord = swap_unit_system!(coord, units, Val(:length)) | ||
data["COORD"] = coord | ||
end | ||
|
||
function parse_keyword!(data, outer_data, units, cfg, f, ::Val{:ZCORN}) | ||
zcorn = parse_deck_vector(f, Float64) | ||
zcorn = swap_unit_system!(zcorn, units, Val(:length)) | ||
data["ZCORN"] = zcorn | ||
end | ||
|
||
function parse_keyword!(data, outer_data, units, cfg, f, v::Union{Val{:PERMX}, Val{:PERMY}, Val{:PERMZ}}) | ||
k = unpack_val(v) | ||
vals = parse_grid_vector(f, get_cartdims(outer_data), Float64) | ||
vals = swap_unit_system!(vals, units, Val(:permeability)) | ||
data["$k"] = vals | ||
end | ||
|
||
function parse_keyword!(data, outer_data, units, cfg, f, ::Val{:PORO}) | ||
data["PORO"] = parse_grid_vector(f, get_cartdims(outer_data), Float64) | ||
end | ||
|
||
function parse_keyword!(data, outer_data, units, cfg, f, ::Val{:NTG}) | ||
data["NTG"] = parse_grid_vector(f, get_cartdims(outer_data), Float64) | ||
end | ||
|
||
function parse_keyword!(data, outer_data, units, cfg, f, v::Union{Val{:DX}, Val{:DY}, Val{:DZ}}) | ||
k = unpack_val(v) | ||
data["$k"] = parse_grid_vector(f, get_cartdims(outer_data), Float64) | ||
end | ||
|
||
function parse_keyword!(data, outer_data, units, cfg, f, ::Val{:TOPS}) | ||
tops = parse_deck_vector(f, Float64) | ||
data["TOPS"] = swap_unit_system!(tops, units, Val(:length)) | ||
end | ||
|
||
function parse_keyword!(data, outer_data, units, cfg, f, ::Val{:DIMENS}) | ||
rec = read_record(f) | ||
to_int = x -> Parsers.parse(Int, x) | ||
d = to_int.(filter!(x -> length(x) > 0, split(only(rec), DECK_SPLIT_REGEX))) | ||
data["DIMENS"] = d | ||
set_cartdims!(outer_data, d) | ||
end | ||
|
||
function parse_keyword!(data, outer_data, units, cfg, f, ::Val{:SPECGRID}) | ||
rec = read_record(f) | ||
tdims = [1, 1, 1, 1, "F"] | ||
data["SPECGRID"] = parse_defaulted_line(rec, tdims) | ||
set_cartdims!(outer_data, data["SPECGRID"][1:3]) | ||
end | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,8 @@ | ||
include("runspec.jl") | ||
include("grid.jl") | ||
include("props.jl") | ||
include("regions.jl") | ||
include("schedule.jl") | ||
include("solution.jl") | ||
include("summary.jl") | ||
include("special.jl") |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,88 @@ | ||
|
||
function parse_keyword!(data, outer_data, units, cfg, f, ::Val{:RPTPROPS}) | ||
read_record(f) | ||
end | ||
|
||
function parse_keyword!(data, outer_data, units, cfg, f, v::Union{Val{:SWOF}, Val{:SGOF}}) | ||
k = unpack_val(v) | ||
sat_tab = parse_saturation_table(f, outer_data) | ||
for tab in sat_tab | ||
swap_unit_system_axes!(tab, units, (:identity, :identity, :identity, :pressure)) | ||
end | ||
data["$k"] = sat_tab | ||
end | ||
|
||
|
||
function parse_keyword!(data, outer_data, units, cfg, f, ::Val{:PVDG}) | ||
pvdg = parse_dead_pvt_table(f, outer_data) | ||
for tab in pvdg | ||
swap_unit_system_axes!(tab, units, (:pressure, :gas_formation_volume_factor, :viscosity)) | ||
end | ||
data["PVDG"] = pvdg | ||
end | ||
|
||
function parse_keyword!(data, outer_data, units, cfg, f, ::Val{:PVTO}) | ||
pvto = parse_live_pvt_table(f, outer_data) | ||
for tab in pvto | ||
swap_unit_system_axes!(tab["data"], units, (:pressure, :liquid_formation_volume_factor, :viscosity)) | ||
swap_unit_system!(tab["key"], units, :u_rs) | ||
end | ||
data["PVTO"] = pvto | ||
end | ||
|
||
function parse_keyword!(data, outer_data, units, cfg, f, ::Val{:PVTW}) | ||
rec = read_record(f) | ||
tdims = [NaN, NaN, NaN, NaN, NaN] | ||
utypes = (:pressure, :liquid_formation_volume_factor, :compressibility, :viscosity, :compressibility) | ||
nreg = number_of_tables(outer_data, :pvt) | ||
out = [] | ||
for i = 1:nreg | ||
t = parse_defaulted_line(rec, tdims) | ||
swap_unit_system_axes!(t, units, utypes) | ||
@assert all(isfinite, t) "PVTW cannot be defaulted, found defaulted record in region $i" | ||
push!(out, t) | ||
end | ||
data["PVTW"] = out | ||
end | ||
|
||
function parse_keyword!(data, outer_data, units, cfg, f, ::Val{:PVCDO}) | ||
rec = read_record(f) | ||
tdims = [NaN, NaN, NaN, NaN, NaN] | ||
utypes = (:pressure, :liquid_formation_volume_factor, :compressibility, :viscosity, :compressibility) | ||
nreg = number_of_tables(outer_data, :pvt) | ||
out = [] | ||
for i = 1:nreg | ||
t = parse_defaulted_line(rec, tdims) | ||
swap_unit_system_axes!(t, units, utypes) | ||
@assert all(isfinite, t) "PVCDO cannot be defaulted, found defaulted record in region $i" | ||
push!(out, t) | ||
end | ||
data["PVCDO"] = out | ||
end | ||
|
||
function parse_keyword!(data, outer_data, units, cfg, f, ::Val{:ROCK}) | ||
rec = read_record(f) | ||
tdims = [NaN, NaN, NaN, NaN, NaN, NaN] | ||
utypes = [:pressure, :compressibility, :compressibility, :compressibility, :id, :id] | ||
out = [] | ||
nreg = number_of_tables(outer_data, :pvt) | ||
for i = 1:nreg | ||
l = parse_defaulted_line(rec, tdims) | ||
swap_unit_system_axes!(l, units, utypes) | ||
push!(out, l) | ||
end | ||
data["ROCK"] = out | ||
end | ||
|
||
function parse_keyword!(data, outer_data, units, cfg, f, ::Val{:DENSITY}) | ||
rec = read_record(f) | ||
tdims = [NaN, NaN, NaN] | ||
nreg = number_of_tables(outer_data, :pvt) | ||
out = [] | ||
for i = 1:nreg | ||
t = parse_defaulted_line(rec, tdims) | ||
swap_unit_system!(t, units, :density) | ||
push!(out, t) | ||
end | ||
data["DENSITY"] = out | ||
end |
Empty file.
Oops, something went wrong.
1 comment
on commit dfd4f51
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Registration pull request created: JuliaRegistries/General/89193
After the above pull request is merged, it is recommended that a tag is created on this repository for the registered package version.
This will be done automatically if the Julia TagBot GitHub Action is installed, or can be done manually through the github interface, or via:
git tag -a v0.2.8 -m "<description of version>" dfd4f51fc43df74e5a8a8de5932c46971e9b41f9
git push origin v0.2.8
@JuliaRegistrator register