Skip to content
This repository has been archived by the owner on Feb 14, 2024. It is now read-only.

Commit

Permalink
Update bl_parameters.jl
Browse files Browse the repository at this point in the history
  • Loading branch information
moyner committed Apr 18, 2022
1 parent 507bcf8 commit de75f2f
Showing 1 changed file with 40 additions and 22 deletions.
62 changes: 40 additions & 22 deletions darcy/pluto/bl_parameters.jl
Original file line number Diff line number Diff line change
Expand Up @@ -39,8 +39,15 @@ Set up BL scenario

# ╔═╡ 963b3405-b02c-4190-8078-2edf15a0a03e
md"""
##### LaTeX
We solve the Buckley-Levrett problem with $\lambda_o = S^N/\mu$ and $\lambda_w = S^N$
##### Buckley-Leverett problem
Conservation of mass:
$$\frac{\partial \rho_\alpha S_\alpha \phi}{\partial t} + \nabla \cdot v_\alpha = q_\alpha, \alpha \in \{w, o\}$$
Fluxes are given by Darcy's law:
$$v_t = -K (\lambda_w + \lambda_o) \nabla p, \quad v_\alpha = \frac{\lambda_\alpha}{\lambda_w + \lambda_o} v_t$$
We solve the Buckley-Levrett problem with $\lambda_o = S^N/\mu$ and $\lambda_w = S^N$. The displacement can be stable or unstable depending on the viscosity ratio.
"""

# ╔═╡ d6a3bac0-b5dd-4fcf-bf36-afbd57bc7be7
Expand Down Expand Up @@ -69,16 +76,19 @@ begin
P = setup_well(g, K, [(nx, 1, 1)], name = :Producer)
I = setup_well(g, K, [(1, 1, 1)], name = :Injector)
sys = ImmiscibleSystem((AqueousPhase(), LiquidPhase()))
model, parameters = setup_reservoir_model(g, sys, wells = [I, P], block_backend = false)
model, parameters = setup_reservoir_model(g, sys, wells = [I, P],
block_backend = false)
kr = BrooksCoreyRelPerm(2, nkr)
μ = ConstantVariables([1, mu].*1e-3)
replace_variables!(model, RelativePermeabilities = kr, PhaseViscosities = μ)

model = replace_variables!(model, RelativePermeabilities = kr,
PhaseViscosities = μ)
nothing
end

# ╔═╡ 17d3061a-bd02-4379-b198-ebc9ac040496
begin
state0 = setup_reservoir_state(model, Pressure = 150*1e5, Saturations = [0.0, 1.0])
state0 = setup_reservoir_state(model, Pressure = 150*1e5,
Saturations = [0.0, 1.0])
day = 3600*24.0
T = 1000*day
nt = 50
Expand All @@ -105,32 +115,40 @@ end

# ╔═╡ 7f3d7a62-65e9-4d64-add7-f0fb81669327
begin
sim, config = setup_reservoir_simulator(model, state0, parameters, info_level = -1)
states, reports = simulate(sim, dt, forces = forces, config = config);
sim, config = setup_reservoir_simulator(model, state0, parameters,
info_level = -1)
states, reports = simulate(sim, dt, forces = forces,
config = config);
s_w = hcat(map(x -> x[:Reservoir][:Saturations][1, :], states)...);
end;

# ╔═╡ 265591ef-549c-4c69-a585-690ab0965203
plot_title = "$nx cells, Corey exp $nkr, viscosity ratio $mu"
plot_title = "$nx cells, Corey exp $nkr, viscosity ratio $mu, pvi $pvi"

# ╔═╡ 21b7dd5c-ef28-4729-bbdf-62fc67a9b91c
plot(s_w, color = :black, title = plot_title, label = nothing)
# ╔═╡ d667ebe9-7b1e-4066-bc5c-8f92b570a5b4
md"""
plot type: $(@bind plot_type Select(["lines", "contour"]))
"""

# ╔═╡ 940cfa2a-868c-42da-9039-b0ceef35ed73
contourf(s_w, title = plot_title)
# ╔═╡ 21b7dd5c-ef28-4729-bbdf-62fc67a9b91c
if plot_type == "lines"
plot(s_w, color = :black, title = plot_title, label = nothing, ylim=(0,1))
else
contourf(s_w, title = plot_title)
end

# ╔═╡ Cell order:
# ╠═e25f84e0-b7e4-11ec-215a-15d61473a706
# ╠═6ac645bd-fcff-4923-ae5d-a51ef19e8817
# ╠═5f179657-8ec1-43f0-8f16-2f08d87f7ad2
# ╟─b53d1c1f-9217-4658-8915-b9e2235e8870
# ╟─3d207ba8-23fa-4c65-8da0-c17756018143
# ╟─e25f84e0-b7e4-11ec-215a-15d61473a706
# ╟─6ac645bd-fcff-4923-ae5d-a51ef19e8817
# ╟─5f179657-8ec1-43f0-8f16-2f08d87f7ad2
# ╠═b53d1c1f-9217-4658-8915-b9e2235e8870
# ╠═3d207ba8-23fa-4c65-8da0-c17756018143
# ╟─931359ca-7d00-4d4e-b9f1-fce440c3d3b9
# ╟─17d3061a-bd02-4379-b198-ebc9ac040496
# ╟─7f3d7a62-65e9-4d64-add7-f0fb81669327
# ╠═17d3061a-bd02-4379-b198-ebc9ac040496
# ╠═7f3d7a62-65e9-4d64-add7-f0fb81669327
# ╠═265591ef-549c-4c69-a585-690ab0965203
# ╟─963b3405-b02c-4190-8078-2edf15a0a03e
# ╟─d6a3bac0-b5dd-4fcf-bf36-afbd57bc7be7
# ╟─7ce78aae-5ba4-41f0-be79-6eef9ef7da58
# ╠═21b7dd5c-ef28-4729-bbdf-62fc67a9b91c
# ╠═940cfa2a-868c-42da-9039-b0ceef35ed73
# ╟─d667ebe9-7b1e-4066-bc5c-8f92b570a5b4
# ╟─21b7dd5c-ef28-4729-bbdf-62fc67a9b91c

0 comments on commit de75f2f

Please sign in to comment.