From 14fa27dfb5352bebb845ccec5a4917fed1358573 Mon Sep 17 00:00:00 2001 From: Maksim Elizarev Date: Tue, 16 Jul 2024 17:25:27 +0100 Subject: [PATCH] fix: :zap: move curves post-processing to `downscale_upscale` + removed calls to `monotonize` --- src/downscale_upscale.m | 4 ++++ strata_trapper.m | 11 +++-------- {src => util}/monotonize.m | 0 3 files changed, 7 insertions(+), 8 deletions(-) rename {src => util}/monotonize.m (100%) diff --git a/src/downscale_upscale.m b/src/downscale_upscale.m index b6aeda3..6de26be 100644 --- a/src/downscale_upscale.m +++ b/src/downscale_upscale.m @@ -21,4 +21,8 @@ subscale_dims, sub_porosity, sub_permeability, sub_entry_pressures ... ); +pc_upscaled = interp1(sw_upscaled,pc_upscaled,saturations,"linear","extrap"); +krw = interp1(sw_upscaled, krw', saturations, "linear","extrap")'; +krg = interp1(sw_upscaled, krg', saturations, "linear","extrap")'; + end diff --git a/strata_trapper.m b/strata_trapper.m index df51c8b..8f4137c 100644 --- a/strata_trapper.m +++ b/strata_trapper.m @@ -41,15 +41,10 @@ poro_upscaled(cell_index) = porosity; perm_upscaled(cell_index,:) = Kabs; - cap_pres_upscaled(cell_index,:) = interp1(sw_upscaled,pc_upscaled,saturations,"linear","extrap"); + cap_pres_upscaled(cell_index,:) = pc_upscaled; - for i = 1:3 - krw_cell(i,:) = monotonize(sw_upscaled, krw_cell(i,:), 1); - krg_cell(i,:) = monotonize(sw_upscaled, krg_cell(i,:), -1); - end - - krw(cell_index,:,:) = interp1(sw_upscaled, krw_cell', saturations, "linear")'; - krg(cell_index,:,:) = interp1(sw_upscaled, krg_cell', saturations, "linear")'; + krw(cell_index,:,:) = krw_cell; + krg(cell_index,:,:) = krg_cell; if enable_waitbar send(wb_queue,cell_index); diff --git a/src/monotonize.m b/util/monotonize.m similarity index 100% rename from src/monotonize.m rename to util/monotonize.m