Hi! I'm kinda very desperate because I've tried everything, revised it many times and I continue to be stuck on it for the last month. I kindly ask for your help.
So, I'm trying to do a Compositional Simulation 1D in a quadratic domain and solve it with natural variables, it runs normally without errors but the result ploted doesnt change a thing, it's like I've never made any difference for adding an well or even changing pressure. The boundary conditions consider the reservoir being isolated without replacing fluid in it.
mrstModule add compositional ad-props ad-core
%===============SET UP PROBLEM====================
%TODO: mudar grid
nx = 50;
ny = 50;
nz = 1;
% Quadratic domain
dims = [nx, ny, nz]; %number of cells in each coordinate direction.
pdims = [1000, 1000, 10]; %physical size in units of meters of the computational domain
G = cartGrid(dims, pdims);
G = computeGeometry(G);
% Generate permeability
K=160*ones(G.cartDims);
K=K(G.cells.indexMap);
rock = makeRock(G, K*milli*darcy, 0.3); %grid, perm, poro
figure;
plotCellData(G, K);
colorbar;
title('Permeability [mD]');
%===============SET UP COMPOSITIONAL MODEL====================
names = {'Metano' 'Butano'};
% Critical temperatures
Tcrit = [190.6, 408.1];
% Critical pressure
Pcrit = [45.40, 36.00]*101325;
% Critical volumes
Vcrit = [0.0990, 0.2630]*1e-3;
% Acentric factors
acentricFactors = [0.013, 0.1956];
% Mass of components (as MRST uses strict SI, this is in kg/mol)
molarMass = [16.0430, 58.1240]*1e-3;
% Initialize fluid
fluid = CompositionalFluid(names, Tcrit, Pcrit, Vcrit, acentricFactors, molarMass);
%=============SET UP INITIAL STATE============================
Pres = 50*0.0689476*barsa;
totTime = 10*year;
pv = poreVolume(G, rock);
%boundary condition structure as defined by function ‘pside’
%bc = pside([], G, 'West' , Pres);
%W = verticalWell([], G, rock, nx/2+1, ny/2+1, 1:nz,'Type', 'rate', 'Val', 10000*meter^3/day,'comp_i',[1,0]);
W = verticalWell([], G, rock, nx/2, ny/2, 1:nz, 'sign',-1,'Type', 'rate', 'Val', -10000*meter^3/day,'comp_i',[1,0]);
plotWell(G, W, 'color', 'k');
flowfluid = initSimpleADIFluid('phases','OG','rho', [1000, 500], ...
'mu', [1, 1]*centi*poise, ...
'n', [2, 2], ...
'c', [1e-5, 0]/barsa);
ncomp = fluid.getNumberOfComponents();
s0 = [1, 0];
state0 = initState(G,W, Pres, s0); %Initialise state object for reservoir and wells.
T = 288.71; %K
state0.T = repmat(T, G.cells.num, 1);
state0.components = repmat([0.85 0.15], G.cells.num, 1);
dt = rampupTimesteps(totTime, 75*day, 12);
schedule = simpleSchedule(dt);
%================SOLVE WITH NATURAL VARIABLES==========
model = NaturalVariablesCompositionalModel(G, rock, flowfluid, fluid, 'water', false);
nls = NonLinearSolver('useRelaxation', true);
[~, states, report] = simulateScheduleAD(state0, model, schedule, 'nonlinearsolver', nls);
%=================LAUNCH PLOT=========================
mrstModule add mrst-gui
figure;
plotToolbar(G, states)
title('Natural variables')