Good afternoon,
I have been trying to adapt the code by Xiong et al. to my problem, but have faced some challenges, according to the comments in green below. Sample code attached.
The produced error for the scenarios (1) and (2) that do not work are shown below. I was wondering if you could provide some recommendations to help resolve this.
flowfluid = initSimpleADIFluid('phases','WG', 'blackoil', false, 'mu',[muW_R, muG_R], 'rho',[rhoW_R, rhoG_R], 'n',[2, 2]);
ECPAmixture = ECPATableCompositionalMixture({'Water','Carbondioxide'}); %This works
%ECPAmixture = ECPATableCompositionalMixture({'Carbondioxide','Water'}); % (1) Does not work when components are swapped
%ECPAmixture = ECPATableCompositionalMixture({'Water','Carbondioxide','Hydrogen'}); % (2) Does not work when >2 components are present, even though standard and CPA properties/parameters for Hydrogen have been added to the eCPAPropFluidsStructs file
Error
Unable to perform assignment because the size of the left side is 1-by-1 and the size of the right side is 0-by-0.
Error in ECPAEquationOfStateModel/getPhaseMixCoefficients (line 717)
st(:,i) = st(:,i) + bsxfun(@times, x(:,j) .* bic{j,i}, G(j,i));
Error in eCPAphaseStabilityTest>getFugacity (line 201)
[A, B, acti] = model.getPhaseMixCoefficients(xy, T, bic, a);
Error in eCPAphaseStabilityTest>checkStability (line 137)
[f_z, v_z] = getFugacity(eos, T, z, p, insidePhaseIsVapor);
Error in eCPAphaseStabilityTest (line 82)
[y, S_V, isTrivialV, K_V] = checkStability(eos, z, K, p, T, true, active, opt);
Error in ECPAEquationOfStateModel/performPhaseStabilityTest (line 457)
[stable, x, y, K] = eCPAphaseStabilityTest(model, z, P, T, K);
Error in ECPAEquationOfStateModel/stepFunction (line 300)
model.performPhaseStabilityTest(state.pressure(initSingle), state.T(initSingle),...
Error in NonLinearSolver/solveMinistep (line 374)
model.stepFunction(state, state0, dt, drivingForces, ...
Error in NonLinearSolver/solveTimestep (line 210)
solveMinistep(solver, model, state, state0_inner, dt, drivingForces);
Error in eCPAstandaloneFlash (line 52)
[state, report] = solver.solveTimestep(state, 1, EOSModel);
Error in eCPAgetEOSComponent (line 28)
[L, ~, ~, ~, ~, rhoL, rhoV] = eCPAstandaloneFlash(p, T, z, model.EOSModel);
Error in ECPAGenericOverallCompositionModel/validateModel (line 103)
c = eCPAgetEOSComponent(model, p, T, name, ci);
Error in Z_CPA_WJ (line 25)
ECPAoverall = ECPAoverall.validateModel();
Kind regards,
Williams
On Wednesday, June 19, 2024 at 2:47:29 PM UTC+1 Knut-Andreas Lie wrote: