Skip to content

Commit

Permalink
feat: ✨ compute Leverett J-function with CapPressure class
Browse files Browse the repository at this point in the history
  • Loading branch information
djmaxus committed Oct 29, 2024
1 parent 08654cc commit 312d54d
Showing 1 changed file with 16 additions and 6 deletions.
22 changes: 16 additions & 6 deletions src/CapPressure.m
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@
if nargin==0
return;
end

obj.contact_angle = contact_angle;
obj.surface_tension = surface_tension;
obj.leverett_j = leverett_j;
Expand All @@ -38,20 +38,30 @@
arguments
obj (1,1) CapPressure
pc (1,1) double
poro double {mustBePositive}
poro double {mustBeNonnegative}
perm double {mustBeNonnegative}
end

perm = obj.transform_perm(poro,perm);

lj = pc ./ obj.mult .* sqrt(perm./poro);

lj = obj.inv_lj(pc,poro,perm);
lj = min(lj,obj.leverett_j.data(1,2));
lj = max(lj,obj.leverett_j.data(end,2));

sw = obj.leverett_j.inv(lj);
end

function lj = inv_lj(obj,pc,poro,perm)
arguments
obj (1,1) CapPressure
pc double
poro double {mustBeNonnegative}
perm double {mustBeNonnegative}
end

perm = obj.transform_perm(poro,perm);

lj = pc ./ obj.mult .* sqrt(perm./poro);
end

function dpc_dsw = deriv(obj,sw,poro,perm)
arguments
obj (1,1) CapPressure
Expand Down

0 comments on commit 312d54d

Please sign in to comment.