Skip to content

Commit

Permalink
quickfix according to jutulexamples
Browse files Browse the repository at this point in the history
  • Loading branch information
ziyiyin97 committed Mar 23, 2023
1 parent 24f7269 commit 4476f98
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 3 deletions.
4 changes: 2 additions & 2 deletions Project.toml
Original file line number Diff line number Diff line change
Expand Up @@ -15,8 +15,8 @@ Statistics = "10745b16-79ce-11e8-11f9-7d13ad32a3b2"
[compat]
ChainRulesCore = "1"
Flux = "0.12, 0.13"
Jutul = "0.2.2"
JutulDarcy = "0.2.1"
Jutul = "=0.2.2"
JutulDarcy = "=0.2.1"
Optim = "1"
julia = "1"

Expand Down
1 change: 1 addition & 0 deletions src/FlowRules/Types/type_utils.jl
Original file line number Diff line number Diff line change
Expand Up @@ -71,6 +71,7 @@ function simple_model(M::jutulModel{D, T}; ρCO2::T=T(ρCO2), ρH2O::T=T(ρH2O))
g = CartesianMesh(M.n, M.d .* M.n)
G = discretized_domain_tpfv_flow(tpfv_geometry(g), porosity = M.ϕ, permeability = M.K)
model = SimulationModel(G, sys, output_level = :all)
model.primary_variables[:Pressure] = JutulDarcy.Pressure(minimum = -Inf, max_rel = nothing)
ρ = ConstantCompressibilityDensities(p_ref = 100*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))
Expand Down
2 changes: 1 addition & 1 deletion test/test_gradient.jl
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ g1 = gradient(()->misfit(x0, ϕ, q1, states1), Flux.params(x0, ϕ))

@testset "Taylor-series gradient test of simple jutulModeling" begin
grad_test(x0->misfit(x0, ϕ, q1, states1), x0, dx/1.5, g1[x0])
grad_test->misfit(x0, ϕ, q1, states1), ϕ, dϕ/1e2, g1[ϕ])
grad_test->misfit(x0, ϕ, q1, states1), ϕ, dϕ*0.0023, g1[ϕ])
end

states2 = S(x, q2)
Expand Down

0 comments on commit 4476f98

Please sign in to comment.