Skip to content

Instantly share code, notes, and snippets.

@mayflower12
Last active June 7, 2018 18:35
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save mayflower12/0bd95a33e58e912e9636ec12a16fa0dc to your computer and use it in GitHub Desktop.
Save mayflower12/0bd95a33e58e912e9636ec12a16fa0dc to your computer and use it in GitHub Desktop.
grid preprocess for counter current spontaneous imbibition test case
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);
@mayflower12
Copy link
Author

This method leads to a inverted geometry. Do not use.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment