yjhp1016 / taichi_LBM3D

A 3D sparse LBM solver implemented using Taichi
MIT License
267 stars 36 forks source link

Two phases flow in fractured porous media. #14

Open lixuekai2001 opened 1 year ago

lixuekai2001 commented 1 year ago

Hi there, I am working on the two phases flow simulation in a fractured porous media (coal sample with cleat network). Would you please advise if I can use my own 3D CT scanned model? Alternatively without the CT scan geometry, how to create a counterpart of a digital twin of porous media (with or without fractures) In Taichi graphic system?

yjhp1016 commented 1 year ago

Hi, yes, you can use your own image, you first need to convert your 3D CT image into a text based data file (0=void, 1=solid), with for z in 1..nz: for y in 1.. ny: for x in 1..nx: Also you need to build a initial phase distribution file (also text based with same ordring from geometry file above, -1 and 1 represent two phases respectively) in the cdoe change file names to your input geometry file and phase file: solid_np, phase_np = init_geo('./img_ftb131.txt','./phase_ftb131.dat')

Also remember to update nx, ny, nz in the file.

We are refactoring this code by wrapping computing kernel into class, so the user can only write ~20 lines of code to build a 2phase simualtion. @xiongxin9000 is now in charge of this task, he might be able to help you a little bit more for your quesiton. if he got some free time.

Thanks for your interest

hangqqq commented 11 months ago

Hi,I am currently conducting single-phase flow simulation. Why import the rock skeleton simulation, and after using Paraview for visualization, the displayed rock skeleton differs significantly from the porosity calculated in the txt document? 114

yjhp1016 commented 11 months ago

Hi, They should be same, do you have more information what are different? porosity? The visualization you showed is a counter-surface plot?

On Thu, 21 Sept 2023 at 09:02, hangqqq @.***> wrote:

Hi,I am currently conducting single-phase flow simulation. Why import the rock skeleton simulation, and after using Paraview for visualization, the displayed rock skeleton differs significantly from the porosity calculated in the txt document? [image: 114] https://user-images.githubusercontent.com/140054215/269537153-f91db3a3-8483-48ad-aae8-26ba049475f7.png

— Reply to this email directly, view it on GitHub https://github.com/yjhp1016/taichi_LBM3D/issues/14#issuecomment-1729057032, or unsubscribe https://github.com/notifications/unsubscribe-auth/AJEDKQHI5COBAKAYLX5BRGTX3PYBVANCNFSM6AAAAAAZLOIBEU . You are receiving this because you commented.Message ID: @.***>

hangqqq commented 11 months ago

Hi,Almost all values in the txt document are 255, but after simulation, the proportion of displayed boundaries is much smaller than that shown in the txt document.

yjhp1016 commented 11 months ago

Ah, I see, 输入图像(一般都是8bit的灰度图像)都必须要进行二值化才可以,应为作为LBM只需要有0=孔,1=固体, 所以程序把灰度图像转换成了0 1 矩阵

On Thu, 21 Sept 2023 at 09:39, hangqqq @.***> wrote:

Hi, txt文档里面几乎数值几乎都是255,但模拟之后显示的contour比例远小于txt中所显示的。 Almost all values in the txt document are 255, but after simulation, the proportion of displayed boundaries is much smaller than that shown in the txt document.

— Reply to this email directly, view it on GitHub https://github.com/yjhp1016/taichi_LBM3D/issues/14#issuecomment-1729116856, or unsubscribe https://github.com/notifications/unsubscribe-auth/AJEDKQEUEA32DBVOKLVZCATX3P4M5ANCNFSM6AAAAAAZLOIBEU . You are receiving this because you commented.Message ID: @.***>

hangqqq commented 11 months ago

Hi,The proportion of 0 in the document is only around 10, and it seems that there are many more displayed contour?And contour is displayed by a combination of 0 and 1?

1695286084408

3

yjhp1016 commented 11 months ago

porosity around 0.16 looks right, I'm a little confused by the number 10, proportion is a value between 0.0-1.0? why it is 10?

On Thu, 21 Sept 2023 at 09:54, hangqqq @.***> wrote:

Hi,The proportion of 0 in the document is only around 10, and it seems that there are many more displayed contour?And contour is displayed by a combination of 0 and 1? [image: 1695286084408] https://user-images.githubusercontent.com/140054215/269552294-e9738477-bd82-40e0-8177-34a0fdff996b.png [image: 1695286084408] https://user-images.githubusercontent.com/140054215/269552601-9f40b13e-95df-4cfe-acbb-303393612465.png

— Reply to this email directly, view it on GitHub https://github.com/yjhp1016/taichi_LBM3D/issues/14#issuecomment-1729139724, or unsubscribe https://github.com/notifications/unsubscribe-auth/AJEDKQH4BFDH5F2LQOT6MYLX3P6EFANCNFSM6AAAAAAZLOIBEU . You are receiving this because you commented.Message ID: @.***>

hangqqq commented 11 months ago

Hi,the proportion of 0 is only 16%, while the proportion of 1 is 84%. In the contour of Paraview, 1 is displayed as a skeleton, but the skeleton shown in the figure should not have 84%?

yjhp1016 commented 11 months ago

the counter plot is the iso-surface between 0 and 1. As you can see, due to the openeess at the inlet outlet boundary(not a closed manifold), probably paraview don't know what is inside or outside, so not sure how the volume is calculated.

The visulalization looks ok, if you want to further confirm this, you can visual the solid phase directly (0 and 1 voxels) over.this counter plot, you can see if the visual makes sense.

hangqqq @.***> 于 2023年9月22日周五 上午2:27写道:

Hi,the proportion of 0 is only 16%, while the proportion of 1 is 84%. In the contour of Paraview, 1 is displayed as a skeleton, but the skeleton shown in the figure should not have 84%?

— Reply to this email directly, view it on GitHub https://github.com/yjhp1016/taichi_LBM3D/issues/14#issuecomment-1730637820, or unsubscribe https://github.com/notifications/unsubscribe-auth/AJEDKQAYIKS7Y6ACEHXK2ODX3TSRLANCNFSM6AAAAAAZLOIBEU . You are receiving this because you commented.Message ID: @.***>

RiverNight666 commented 5 months ago

Hello, could you tell me how to view the two-phase displacement process (such as wetting phase displacement of non-wetting phase) in the vti file generated by lbm_solver_3d_2phase_sparse file in 2phase through paraview?

yjhp1016 commented 5 months ago

You can load all vti files together when you use open files

then you can use threshold to select phase field for water or oil only

[image: image.png]

At the same time, you can also open geometry file and use threshold to visualize solid only, and also you can make it transparent by selecting low opacity (shown below) If you want to have better visualizaton, you can use counter plot (highlighted in red below), to extract the geometry surface first, then visualize this surface only and reduce the opacity to make the oil or water inside easier to see [image: image.png]

[image: image.png]

On Wed, 20 Mar 2024 at 07:42, RiverNight666 @.***> wrote:

Hello, could you tell me how to view the two-phase displacement process (such as wetting phase displacement of non-wetting phase) in the vti file generated by lbm_solver_3d_2phase_sparse file in 2phase through paraview?

— Reply to this email directly, view it on GitHub https://github.com/yjhp1016/taichi_LBM3D/issues/14#issuecomment-2008961480, or unsubscribe https://github.com/notifications/unsubscribe-auth/AJEDKQAA7LKWD2OZTYWY4L3YZE4YBAVCNFSM6AAAAAAZLOIBEWVHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHMZDAMBYHE3DCNBYGA . You are receiving this because you commented.Message ID: @.***>