Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

updated to latest jutul and jutul darcy version, revise pyplot to pyt… #35

Open
wants to merge 1 commit into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
31 changes: 0 additions & 31 deletions Project.toml

This file was deleted.

16 changes: 0 additions & 16 deletions examples/Project.toml

This file was deleted.

4 changes: 2 additions & 2 deletions examples/Vwell_2D.jl
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
## A simple 2D example for fluid-flow simulation

using DrWatson
@quickactivate "JutulDarcyRules-example"
@quickactivate "JutulDarcyRules"

using JutulDarcyRules
using LinearAlgebra
using PyPlot
using PythonPlot

## grid size
n = (30, 1, 15)
Expand Down
4 changes: 2 additions & 2 deletions examples/basic2D.jl
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
## A simple 2D example for fluid-flow simulation

using DrWatson
@quickactivate "JutulDarcyRules-example"
@quickactivate "JutulDarcyRules"

using JutulDarcyRules
using LinearAlgebra
using PyPlot
using PythonPlot

## grid size
n = (30, 1, 15)
Expand Down
4 changes: 2 additions & 2 deletions examples/compass.jl
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
## A 2D compass example

using DrWatson
@quickactivate "JutulDarcyRules-example"
@quickactivate "JutulDarcyRules"

using JutulDarcyRules
using LinearAlgebra
using PyPlot
using PythonPlot
using Flux
using LineSearches
using JLD2
Expand Down
4 changes: 2 additions & 2 deletions examples/end2end.jl
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
## A 64×64 2D example for end-to-end inversion of a tortuous channel

using DrWatson
@quickactivate "JutulDarcyRules-example"
@quickactivate "JutulDarcyRules"

using JutulDarcyRules
using LinearAlgebra
using PyPlot
using PythonPlot
using Flux
using LineSearches
using JLD2
Expand Down
4 changes: 2 additions & 2 deletions examples/inv_2D.jl
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
## A simple 2D example for permeability inversion

using DrWatson
@quickactivate "JutulDarcyRules-example"
@quickactivate "JutulDarcyRules"

using JutulDarcyRules
using LinearAlgebra
using PyPlot
using PythonPlot
using Flux
using LineSearches

Expand Down
4 changes: 2 additions & 2 deletions examples/inv_logK.jl
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
## A simple 2D example for permeability inversion

using DrWatson
@quickactivate "JutulDarcyRules-example"
@quickactivate "JutulDarcyRules"

using JutulDarcyRules
using LinearAlgebra
using PyPlot
using PythonPlot
using Flux
using LineSearches

Expand Down
4 changes: 2 additions & 2 deletions examples/inv_tortuous.jl
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
## A 64×64 2D example for permeability inversion of a tortuous channel

using DrWatson
@quickactivate "JutulDarcyRules-example"
@quickactivate "JutulDarcyRules"

using JutulDarcyRules
using LinearAlgebra
using PyPlot
using PythonPlot
using Flux
using LineSearches
using JLD2
Expand Down
4 changes: 2 additions & 2 deletions examples/inv_trans.jl
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
## A simple 2D example for transmissibility inversion

using DrWatson
@quickactivate "JutulDarcyRules-example"
@quickactivate "JutulDarcyRules"

using JutulDarcyRules
using LinearAlgebra
using PyPlot
using PythonPlot
using Flux
using LineSearches

Expand Down
2 changes: 1 addition & 1 deletion examples/optim_K.jl
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
using DrWatson
@quickactivate "JutulDarcyRules-example"
@quickactivate "JutulDarcyRules"

using JutulDarcyRules
using Flux
Expand Down
4 changes: 2 additions & 2 deletions examples/simple_2D.jl
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
## A simple 2D example for fluid-flow simulation

using DrWatson
@quickactivate "JutulDarcyRules-example"
@quickactivate "JutulDarcyRules"
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Any reason all these example use DrWatson/quickactivate instead of only using JutulDarcyRules as a package?

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'd guess because this lets a user run the files without doing any setup (assuming they have DrWatson installed). So they can run the examples without having to install JutulDarcyRules.

Do you think we should get rid of it? It isn't a standard way to give package examples, and it may be annoying for people who don't want to install DrWatson. But it does benefit people who rely on DrWatson, and those people probably need more support than the kind of advanced users who don't want to install DrWatson.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I mean both sides have their advantages. DrWatson makes things very stable in terms of reproducibility, and it also makes it a constraint on the user as for examples, the Project.toml contains a lot of dependencies that are not actually needed for the project but only for the examples.

Fundamentally, IMO, this package is a tool, not an application, so it should be as minimal as possible to be included in people's workflow easily. That means trimming the dependencies to a minimum and, if needed, make a separate repo with a bunch of examples and applications using DrWatson. But i don't think the package itself should be using DrWatson.


using JutulDarcyRules
using LinearAlgebra
using PyPlot
using PythonPlot

## grid size
n = (30, 1, 15)
Expand Down
4 changes: 2 additions & 2 deletions src/FlowRules/Types/type_utils.jl
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@ function setup_well_model(M::jutulModel{D, T}, f::Union{jutulForce{D, T}, jutulV
select_output_variables!(model.models.Reservoir, :all)
ρ = ConstantCompressibilityDensities(p_ref = 150*bar, density_ref = [ρCO2, ρH2O], compressibility = [1e-4/bar, 1e-6/bar])
replace_variables!(model, PhaseMassDensities = ρ)
replace_variables!(model, RelativePermeabilities = BrooksCoreyRelPerm(sys, [2.0, 2.0], [0.1, 0.1], 1.0))
replace_variables!(model, RelativePermeabilities = BrooksCoreyRelativePermeabilities(sys, [2.0, 2.0], [0.1, 0.1], 1.0))
for x ∈ keys(model.models)
Jutul.select_output_variables!(model.models[x], :all)
end
Expand Down Expand Up @@ -76,6 +76,6 @@ function simple_model(M::jutulModel{D, T}; ρCO2::T=T(ρCO2), ρH2O::T=T(ρH2O))
model.primary_variables[:Pressure] = JutulDarcy.Pressure(minimum = -Inf, max_rel = nothing)
ρ = ConstantCompressibilityDensities(p_ref = 150*bar, density_ref = [ρCO2, ρH2O], compressibility = [1e-4/bar, 1e-6/bar])
replace_variables!(model, PhaseMassDensities = ρ)
replace_variables!(model, RelativePermeabilities = BrooksCoreyRelPerm(sys, [2.0, 2.0], [0.1, 0.1], 1.0))
replace_variables!(model, RelativePermeabilities = BrooksCoreyRelativePermeabilities(sys, [2.0, 2.0], [0.1, 0.1], 1.0))
return model
end