Closed DMaxJ closed 4 years ago
I have a found a way to solve it. I used the following code
f_name = 'Berea.raw'
shape=[400, 400, 400]
im0 = np.fromfile(f_name, dtype='bool', sep='')
im = im0.reshape(shape)
Is there any better way to do that?
I have checked for the porosity and it shows .80354 which is alright because I did not change the downloaded file (where the pores and the solids values are altered as required by the Maximal Ball algorithm).
Reading in 3D image files is always "fun". I usually open up badly behaving files in imagej, then save as a properly formatted TIF file first. Your 2nd way is actually pretty clean. I can't imagine a better way than that...technically it's 2 lines of code:
im = np.fromfile('Berea.raw', dtype='bool', sep='')
im = im.reshape([400, 400, 400])
I used the Berea.raw and outputs using SNOW are the same as those in this example except the effective permeability. The value of K is: [945.72132788] mD, however in the example, K is: [1145.01717908] mD. I am confused about why I get different K value with the same code..
It all depends on the pore-scale conductance models used. Our code is continually evolving, and sometimes openpnm and porespy get out of sync, so it depends on what versions you are using. I realize this is not a good answer, but we only only a few people (me + 1 or 2 grad students) working on this so can't always keep up.
Hi! I used your code for extracting pore network from Berea Sandstone using SNOW algorithm and keep getting the wrong permeability K=54772 md. For loading the image i used these lines of code: f_name = 'Berea.raw' shape=[400, 400, 400] im0 = np.fromfile(f_name, dtype='bool', sep='') im = im0.reshape(shape) For calculating the permeability i copied your code and didn't change anything. Can you please help me with this problem?
I want to ask in which direction is the estimated permeability when using .raw
files? Actually, opening the .raw
file using np.fromfile
needs reshaping of the image in a way that z direction is the positioned in the first index of the reshape function which is im.reshape([z, x, y])
. Now how openpnm deals with this?
There seems to be a problem in the example here for Berea Sandstone simulation with OpenPNM and Porespy.
When the code above is executed it produces the error
The file is downloaded from the Imperial website and used without altering anything. What needs to be done to be able to read .RAW (binarized) files directly?