Hi Olav,
I added the density part to the well from the conversations you shared on how to make the rates similar to CMG, however, I am still having a result lesser than the surface rates in CMG.
I have attached the code with the edit and the screen shot of the result.
I hope to hear from you soon.
Thank you,
Augustine
close all
clear
clc
mrstModule add compositional deckformat ad-core ad-props
%% Load and convert deck
current_dir = fileparts(mfilename('fullpath'));
fn = fullfile(current_dir, 'GASWAT.DATA');
deck = readEclipseDeck(fn);
deck = convertDeckUnits(deck);
gravity reset on
%% Grid
nx = 160; ny = 1; nz = 1;
Lx = 3000; Ly = 300; Lz = 6;
G = cartGrid([nx, ny, nz], [Lx Ly Lz]);
G.nodes.coords(:,3) = G.nodes.coords(:,3) + 2885;
G = computeGeometry(G);
%% Rock properties (anisotropic)
k = [100, 100, 10] * milli * darcy; % [kx, ky, kz]
rock.perm = repmat(k, G.cells.num, 1);
rock.poro = repmat(0.3, G.cells.num, 1);
cr = 3.36E-06 / psia;
pR = 40 * barsa;
pv_r = poreVolume(G, rock);
pv = @(p) pv_r .* exp(cr .* (p - pR));
%% Fluid and EOS
fluid = initDeckADIFluid(deck);
fluid.rhoOS = 1000; % Oil phase surface density [kg/m^3]
fluid.rhoGS = 2; % Gas phase surface density [kg/m^3]
eos = initDeckEOSModel(deck);
sw_tab = [0.2, 0.2899, 0.3778, 0.4667, 0.5556, 0.6444, 0.7, 0.7333, 0.8222, 0.9111, 1.0];
krw_tab = [0, 0.0022, 0.018, 0.0607, 0.1438, 0.2809, 0.4089, 0.4855, 0.7709, 0.95, 0.9999];
fluid.krO = @(sw) interpTable(sw_tab, krw_tab, sw);
sg_tab = [0.0006, 0.05, 0.0889, 0.1778, 0.2667, 0.3556, 0.4444, 0.5333, 0.6222, 0.65, 0.7111, 0.8];
krg_tab = [0, 0, 0.001, 0.01, 0.03, 0.05, 0.1, 0.2, 0.35, 0.39, 0.56, 0.9999];
fluid.krG = @(sg) interpTable(sg_tab, krg_tab, sg);
%% Model
model = NaturalVariablesCompositionalModel(G, rock, fluid, eos.fluid, 'water', false);
% model.EOSModel.PropertyModel.volumeShift = [0.174, -0.03];
ncomp = eos.fluid.getNumberOfComponents();
%% Initial state
z0 = [0.005 0.005 0.000 0.15 0.84]; % CO2, H2, H2S, CH4, H2O
T = 60 + 273.15; % K
p = 40 * barsa; % Initial pressure
state0 = initCompositionalState(G, p, T, [0.5, 0.5], z0, eos);
%% Wells
W = struct([]);
radius = 0.2;
% Producer
W = verticalWell(W, G, rock, 160, 1, 1, ...
'Type', 'bhp', 'Val', 38*barsa, ...
'Radius', radius, 'Sign', -1, ...
'Name', 'P', 'refDepth', 2888);
% Injector
W = verticalWell(W, G, rock, 1, 1, 1, ...
'Type', 'bhp', 'Val', 42*barsa, ...
'Radius', radius, 'Sign', 1, ...
'Name', 'INJ', 'refDepth', 2888);
% Injection composition
[W.components] = deal([0.2 0.78 0.00 0.01 0.01]);
[W.compi] = deal([0, 1]);
for i = 1:numel(W)
W(i).rhoS = [fluid.rhoOS, fluid.rhoGS];
end
%% Schedule
numSteps = 360;
totTime = 360 * day;
dt = repmat(totTime / numSteps, [numSteps, 1]);
schedule = simpleSchedule(dt, 'W', W);
%% Simulation
[wellSols, states, schedulereport] = simulateScheduleAD(state0, model, schedule);
plotWellSols(wellSols, dt);