Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

publish the latest version #56

Merged
merged 15 commits into from
Oct 16, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 6 additions & 0 deletions .github/dependabot.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
version: 2
updates:
- package-ecosystem: "github-actions"
directory: "/"
schedule:
interval: "weekly"
1 change: 0 additions & 1 deletion .github/workflows/matlab-ci.yml
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
name: MATLAB CI checks
on:
push:
branches: [ "main", "dev" ]
pull_request:
branches: [ "main", "dev" ]
workflow_dispatch:
Expand Down
1 change: 1 addition & 0 deletions .github/workflows/release-please.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@ on:
push:
branches:
- dev
workflow_dispatch:

permissions:
contents: write
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/webpage.yml
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ jobs:
- name: Checkout
uses: actions/checkout@v4
- name: Setup Pages
uses: actions/configure-pages@v4
uses: actions/configure-pages@v5
- name: Build with Jekyll
uses: actions/jekyll-build-pages@v1
with:
Expand Down
16 changes: 16 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,21 @@
# Changelog

## [0.6.3](https://github.com/ImperialCollegeLondon/StrataTrapper/compare/v0.6.2...v0.6.3) (2024-10-16)


### Documentation

* :memo: Add link to `StrataTrapper-models` ([24e55d6](https://github.com/ImperialCollegeLondon/StrataTrapper/commit/24e55d64b9443e30b34b83358cdfbd2b38eff4bd))

## [0.6.2](https://github.com/ImperialCollegeLondon/StrataTrapper/compare/v0.6.1...v0.6.2) (2024-08-19)


### Bug Fixes

* :adhesive_bandage: waitbar initialization ([ad0c2af](https://github.com/ImperialCollegeLondon/StrataTrapper/commit/ad0c2af657d6f1670516967809ac7f3517f7479c))
* :bug: `mask`-narrowed post-processing ([81b247b](https://github.com/ImperialCollegeLondon/StrataTrapper/commit/81b247b244776ea4acf0b183711be93022a222bf))
* :bug: relative permeability upscaling ([b2b15f7](https://github.com/ImperialCollegeLondon/StrataTrapper/commit/b2b15f7e5e55f23c2eb88382f2889b67ab8ecb7b))

## [0.6.1](https://github.com/ImperialCollegeLondon/StrataTrapper/compare/v0.6.0...v0.6.1) (2024-08-13)


Expand Down
12 changes: 8 additions & 4 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,8 +1,6 @@
# Field scale model generation and upscaling [toolkit](https://github.com/ImperialCollegeLondon/StrataTrapper)
# Field scale model generation and upscaling toolkit

![build](https://github.com/ImperialCollegeLondon/StrataTrapper/actions/workflows/matlab-ci.yml/badge.svg?branch=dev)

![StrataTrapper logo](./img/StrataTrapper.jpg)
Repository: [github.com/ImperialCollegeLondon/StrataTrapper](https://github.com/ImperialCollegeLondon/StrataTrapper)

* [The StrataTrapper codes](#the-stratatrapper-codes)
* [Structure](#structure)
Expand All @@ -11,13 +9,19 @@
* [Contributing](#contributing)
* [References](#references)

![StrataTrapper logo](./img/StrataTrapper.jpg)

![build](https://github.com/ImperialCollegeLondon/StrataTrapper/actions/workflows/matlab-ci.yml/badge.svg?branch=dev)

## The StrataTrapper codes

This is the StrataTrapper **upscaling toolkit**.
It can also generate heterogeneous fine-scale models with specific correlation lengths to re-upscale given coarse-scale two-phase flow models.

Another tool is the **reduced-physics model** [CO2GraVISim](https://github.com/ajobutler/CO2GraVISim).

In [`StrataTrapper-models`](https://github.com/ImperialCollegeLondon/StrataTrapper-models) repository, we publish field-scale models upscaled with StrataTrapper.

## Structure

Top-level scripts and functions are in the repository root, and the rest is in [`src/`](src) folder.
Expand Down
18 changes: 8 additions & 10 deletions src/upscale.m
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@
max_iterations = calc_endpoint*1000 + ~calc_endpoint*2;

for iteration_num=1:max_iterations
[pc_mid_tot, sw_mid, pc_mid, invaded_mat_mid, converged] = mip_iteration(...
[pc_mid_tot, sw_mid, pc_mid, sub_sw, converged] = mip_iteration(...
sw_target, dr, entry_pressures, porosities, permeabilities, pc_mid, ...
Nz_sub, Nx_sub, Ny_sub,...
params.cap_pressure,...
Expand All @@ -49,10 +49,8 @@
sw_upscaled(index_saturation) = sw_mid;
pc_upscaled(index_saturation) = pc_mid_tot;

sw = invaded_mat_mid .* sw_mid + ~invaded_mat_mid .* 1;

kg_mat_local = params.krg.func(1-sw);
kw_mat_local = params.krw.func(sw);
kg_mat_local = params.krg.func(1-sub_sw);
kw_mat_local = params.krw.func(sub_sw);

kg_mat_local = kg_mat_local.*permeabilities;
kw_mat_local = kw_mat_local.*permeabilities;
Expand Down Expand Up @@ -83,7 +81,7 @@

end

function [pc_mid_tot, sw_mid, pc_mid, invaded_mat_mid, converged] = mip_iteration(...
function [pc_mid_tot, sw_mid, pc_mid, sub_sw, converged] = mip_iteration(...
sw_target, dr, entry_pressures, porosities, permeabilities, pc_mid,...
Nz_sub, Nx_sub, Ny_sub, ...
cap_pressure,...
Expand All @@ -96,11 +94,11 @@
pore_volumes = porosities .* sub_volume;
pore_volume = sum(pore_volumes,'all');

sub_sw_mid = invaded_mat_mid .* cap_pressure.inv(pc_mid,porosities,permeabilities) + ~invaded_mat_mid .* 1;
sub_sw_mid(~isfinite(sub_sw_mid)) = 1;
sw_mid = sum(sub_sw_mid.*pore_volumes,'all')/pore_volume;
sub_sw = invaded_mat_mid .* cap_pressure.inv(pc_mid,porosities,permeabilities) + ~invaded_mat_mid .* 1;
sub_sw(~isfinite(sub_sw)) = 1;
sw_mid = sum(sub_sw.*pore_volumes,'all')/pore_volume;

pc_mid_tot = sum((1-sub_sw_mid).*pore_volumes.*pc_mid,"all")/(pore_volume*(1-sw_mid));
pc_mid_tot = sum((1-sub_sw).*pore_volumes.*pc_mid,"all")/(pore_volume*(1-sw_mid));

if sw_mid >=1
pc_mid_tot = pc_mid;
Expand Down
6 changes: 3 additions & 3 deletions strata_trapper.m
Original file line number Diff line number Diff line change
Expand Up @@ -50,9 +50,9 @@
end
end

krw(:,:,saturations<=params.sw_resid) = 0;
krw(mask,:,saturations<=params.sw_resid) = 0;
krg(krg<0) = 0;
krg(:,:,saturations>=1)=0;
krg(mask,:,saturations>=1)=0;

strata_trapped = struct(...
'permeability', perm_upscaled, ...
Expand All @@ -78,7 +78,7 @@ function parforWaitbar(~,max_iterations,~)
start_time = tic();

last_reported_state = state;
last_reported_time = start_time;
last_reported_time = 0;
return;
end

Expand Down
2 changes: 1 addition & 1 deletion version.txt
Original file line number Diff line number Diff line change
@@ -1 +1 @@
0.6.1
0.6.3
Loading