Skip to content

Commit adf1dc6

Browse files
committed
feat(options): ✨ porosity/permeability thresholds
Optionally provide arbitrary minima to cut off smallest porosities/permeabilities when upscaling.
1 parent 73f5da7 commit adf1dc6

File tree

2 files changed

+18
-0
lines changed

2 files changed

+18
-0
lines changed

src/Options.m

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,11 +4,21 @@
44
sat_tol (1,1) double {mustBeNonnegative} = 1e-4
55
hydrostatic_correction (1,1) logical = false
66
m_save_mip_step (1,1) {mustBeOfClass(m_save_mip_step,'logical')} = false;
7+
m_perm_threshold_mD (1,3) double {mustBeNonnegative} = [0,0,0];
8+
m_poro_threshold (1,1) double {mustBeNonnegative} = 0;
79
end
810

911
methods % builders
1012
function self = save_mip_step(self,flag)
1113
self.m_save_mip_step = flag;
1214
end
15+
16+
function self = perm_threshold_mD(self,value)
17+
self.m_perm_threshold_mD = value;
18+
end
19+
20+
function self = poro_threshold(self,value)
21+
self.m_poro_threshold = value;
22+
end
1323
end
1424
end

src/upscale.m

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,14 @@
77

88
mip(1:length(saturations)) = struct('sw',nan,'sub_sw',[]);
99

10+
% apply thresholds before proceeding
11+
small_poro = porosities < options.m_poro_threshold;
12+
porosities = porosities .* (~small_poro) + options.m_poro_threshold .* small_poro;
13+
14+
perm_threshold = reshape(options.m_perm_threshold_mD,[1,1,1,3])*milli*darcy;
15+
small_Kabs = permeabilities < perm_threshold;
16+
permeabilities = permeabilities .* (~small_Kabs) + perm_threshold .* small_Kabs;
17+
1018
if isscalar(porosities)
1119
poro_upscaled = porosities(1);
1220
perm_upscaled = reshape(permeabilities(:,:,1,:),1,3);

0 commit comments

Comments
 (0)