Skip to content

Commit

Permalink
Merge pull request #13 from slimgroup/rename
Browse files Browse the repository at this point in the history
Rename
  • Loading branch information
ziyiyin97 authored Mar 10, 2023
2 parents 947483c + d64341b commit a94e085
Show file tree
Hide file tree
Showing 28 changed files with 42 additions and 42 deletions.
4 changes: 2 additions & 2 deletions .github/workflows/ci-runtest.yml
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
name: CI-JutulDarcyAD
name: CI-JutulDarcyRules

on:
# Trigger the workflow on push to main or pull request
Expand Down Expand Up @@ -29,7 +29,7 @@ jobs:
- x64

steps:
- name: Checkout JutulDarcyAD
- name: Checkout JutulDarcyRules
uses: actions/checkout@v2

- name: Setup julia
Expand Down
4 changes: 2 additions & 2 deletions Project.toml
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
name = "JutulDarcyAD"
name = "JutulDarcyRules"
uuid = "41f0c4f5-9bdd-4ef1-8c3a-d454dff2d562"
authors = ["Ziyi Yin <[email protected]>"]
version = "0.2.1"
version = "0.2.2"

This comment has been minimized.

Copy link
@mloubout

mloubout Mar 16, 2023

Member

[deps]
ChainRulesCore = "d360d2e6-b24c-11e9-a2a3-2a2ae2dbcce4"
Expand Down
6 changes: 3 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
<h1 align="center">JutulDarcyAD: auto-differentiable two-phase flow solvers based on Jutul and JutulDarcy</h1>
<h1 align="center">JutulDarcyRules: auto-differentiable two-phase flow solvers based on Jutul and JutulDarcy</h1>

[![][license-img]][license-status] [![][zenodo-img]][zenodo-status]

Expand All @@ -22,5 +22,5 @@ SLIM public GitHub account, [https://github.com/slimgroup](https://github.com/sl
[ChainRules.jl]:https://github.com/JuliaDiff/ChainRules.jl
[license-status]:LICENSE
[license-img]:http://img.shields.io/badge/license-MIT-brightgreen.svg?style=flat?style=plastic
[zenodo-status]:https://doi.org/10.5281/zenodo.7587717
[zenodo-img]:https://zenodo.org/badge/DOI/10.5281/zenodo.7587717.svg?style=plastic
[zenodo-status]:https://zenodo.org/badge/latestdoi/594128866
[zenodo-img]:https://zenodo.org/badge/594128866.svg?style=plastic
2 changes: 1 addition & 1 deletion examples/Project.toml
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
name = "JutulDarcyAD-example"
name = "JutulDarcyRules-example"
authors = ["Ziyi Yin"]

[deps]
Expand Down
6 changes: 3 additions & 3 deletions examples/Vwell_2D.jl
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
## A simple 2D example for fluid-flow simulation

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

using JutulDarcyAD
using JutulDarcyRules
using LinearAlgebra
using PyPlot

Expand Down Expand Up @@ -52,6 +52,6 @@ subplot(1,2,2);
imshow(reshape(Pressure(states0.states[end]), n[1], n[end])'); colorbar(); title("pressure")

exist_co2 = sum(Saturations(states.states[end]) .* states.states[end].state[:Reservoir][:PhaseMassDensities][1,:] .* model.ϕ) * prod(model.d)
inj_co2 = JutulDarcyAD.ρCO2 * q.irate * JutulDarcyAD.day * sum(tstep)
inj_co2 = JutulDarcyRules.ρCO2 * q.irate * JutulDarcyRules.day * sum(tstep)

norm(exist_co2-inj_co2)/norm(exist_co2+inj_co2)
6 changes: 3 additions & 3 deletions examples/basic2D.jl
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
## A simple 2D example for fluid-flow simulation

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

using JutulDarcyAD
using JutulDarcyRules
using LinearAlgebra
using PyPlot

Expand Down Expand Up @@ -52,6 +52,6 @@ subplot(1,2,2);
imshow(reshape(Pressure(states0.states[end]), n[1], n[end])'); colorbar(); title("pressure")

exist_co2 = sum(Saturations(states.states[end]) .* states.states[end].state[:Reservoir][:PhaseMassDensities][1,:] .* model.ϕ) * prod(model.d)
inj_co2 = JutulDarcyAD.ρCO2 * q.irate * JutulDarcyAD.day * sum(tstep)
inj_co2 = JutulDarcyRules.ρCO2 * q.irate * JutulDarcyRules.day * sum(tstep)

norm(exist_co2-inj_co2)/norm(exist_co2+inj_co2)
4 changes: 2 additions & 2 deletions examples/compass.jl
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
## A 2D compass example

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

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

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

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

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

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

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

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

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

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

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

using JutulDarcyAD
using JutulDarcyRules
using LinearAlgebra
using PyPlot
using Flux
Expand Down
4 changes: 2 additions & 2 deletions examples/optim_K.jl
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
using DrWatson
@quickactivate "JutulDarcyAD-example"
@quickactivate "JutulDarcyRules-example"

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

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

using JutulDarcyAD
using JutulDarcyRules
using LinearAlgebra
using PyPlot

Expand Down
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
10 changes: 5 additions & 5 deletions src/JutulDarcyAD.jl → src/JutulDarcyRules.jl
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
__precompile__()
module JutulDarcyAD
module JutulDarcyRules

export JutulDarcyADPATH, Darcy, md
export JutulDarcyRulesPATH, Darcy, md

using LinearAlgebra
using Statistics
Expand All @@ -19,7 +19,7 @@ module JutulDarcyAD
import LinearAlgebra: norm, dot
import ChainRulesCore: rrule

JutulDarcyADPATH = dirname(pathof(JutulDarcyAD))
JutulDarcyRulesPATH = dirname(pathof(JutulDarcyRules))

visCO2 = 1e-4
visH2O = 1e-3
Expand All @@ -33,6 +33,6 @@ module JutulDarcyAD
const day = 24*3600.0

include("PropertyConversion/PropertyConversion.jl")
include("FlowAD/FlowAD.jl")
include("FlowRules/FlowRules.jl")

end # module JutulDarcyAD
end # module JutulDarcyRules
2 changes: 1 addition & 1 deletion test/runtests.jl
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
using Test
using Jutul
using JutulDarcyAD
using JutulDarcyRules
using Flux
using Printf
using Random
Expand Down
8 changes: 4 additions & 4 deletions test/test_jutulModeling.jl
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ x0 = log.(KtoTrans(CartesianMesh(model0), model0.K))
states = S(x, q)
for i = 1:length(states.states)
exist_co2 = sum(Saturations(states.states[i]) .* states.states[i].state[:Reservoir][:PhaseMassDensities][1,:] .* model.ϕ) * prod(model.d)
inj_co2 = JutulDarcyAD.ρCO2 * q.irate * JutulDarcyAD.day * sum(tstep[1:i])
inj_co2 = JutulDarcyRules.ρCO2 * q.irate * JutulDarcyRules.day * sum(tstep[1:i])
@test isapprox(exist_co2, inj_co2) rtol=1e-3
end
end
Expand All @@ -20,7 +20,7 @@ end
states = S(x, q1)
for i = 1:length(states.states)
exist_co2 = sum(Saturations(states.states[i]) .* states.states[i].state[:PhaseMassDensities][1,:] .* model.ϕ) * prod(model.d)
inj_co2 = JutulDarcyAD.ρCO2 * q.irate * JutulDarcyAD.day * sum(S.tstep[1:i])
inj_co2 = JutulDarcyRules.ρCO2 * q.irate * JutulDarcyRules.day * sum(S.tstep[1:i])
@test isapprox(exist_co2, inj_co2) rtol=1e-3
end
end
Expand All @@ -33,7 +33,7 @@ end
states_end = S(x, q2; state0=states)
for i = 1:length(states_end.states)
exist_co2 = sum(Saturations(states_end.states[i]) .* states_end.states[i].state[:Reservoir][:PhaseMassDensities][1,:] .* model.ϕ) * prod(model.d)
inj_co2 = JutulDarcyAD.ρCO2 * q2.irate * JutulDarcyAD.day * sum(S.tstep[1:i])
inj_co2 = JutulDarcyRules.ρCO2 * q2.irate * JutulDarcyRules.day * sum(S.tstep[1:i])
@test isapprox(exist_co2-pre_co2, inj_co2) rtol=1e-3
end
end
Expand All @@ -42,7 +42,7 @@ end
states = S(x, q2)
for i = 1:length(states.states)
exist_co2 = sum(Saturations(states.states[i]) .* states.states[i].state[:Reservoir][:PhaseMassDensities][1,:] .* model.ϕ) * prod(model.d)
inj_co2 = JutulDarcyAD.ρCO2 * q.irate * JutulDarcyAD.day * sum(tstep[1:i])
inj_co2 = JutulDarcyRules.ρCO2 * q.irate * JutulDarcyRules.day * sum(tstep[1:i])
@test isapprox(exist_co2, inj_co2) rtol=1e-3
end
end
2 changes: 1 addition & 1 deletion test/test_jutulState.jl
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,6 @@ model, model0, q, q1, q2, init_state, init_state_simple, tstep = test_config();

@info "test translation"
half_init_state = init_state(vec(init_state) ./ 2)
JutulDarcyAD.check_valid_state(half_init_state)
JutulDarcyRules.check_valid_state(half_init_state)
@test vec(half_init_state) == 0.5 * vec(init_state)
end
2 changes: 1 addition & 1 deletion test/test_utils.jl
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ function test_config()
q = jutulForce(irate, inj_loc)
q1 = jutulSource(irate, [inj_loc, prod_loc])
q2 = jutulVWell(irate, inj_loc[1:2]; startz = 9 * d[3], endz = 11 * d[3])
state0 = jutulState(JutulDarcyAD.setup_well_model(model, q, tstep)[3])
state0 = jutulState(JutulDarcyRules.setup_well_model(model, q, tstep)[3])
state1 = jutulSimpleState(model)
return model, model0, q, q1, q2, state0, state1, tstep
end
Expand Down

1 comment on commit a94e085

@JuliaRegistrator
Copy link

Choose a reason for hiding this comment

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

Error while trying to register: "Tag with name v0.2.2 already exists and points to a different commit"

Please sign in to comment.