Last active
June 7, 2018 18:35
-
-
Save mayflower12/0bd95a33e58e912e9636ec12a16fa0dc to your computer and use it in GitHub Desktop.
grid preprocess for counter current spontaneous imbibition test case
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
IMG = imread('original_from_online.jpeg'); % image data | |
L = im2bw(IMG); % image data to logical data | |
I = int8(L); % convert to 8 bit integer | |
dlmwrite('spontaneous.dat', I,' ') % write ascii file, using space(' ') as delimeter | |
% open data.dat to view it | |
load spontaneous.dat | |
B=spontaneous; | |
finalmatrix=B(:, 2:577); | |
dlmwrite('cut_spontaneous.dat',finalmatrix); % cut 577 by 1 to 576 in order to be divided by 24 | |
finalfinalmatrix=finalmatrix'; % swap x and y of the matrix | |
dlmwrite('cut_and_inverted_spontaneous.dat',finalfinalmatrix); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
This method leads to a inverted geometry. Do not use.