taichi_LBM3D icon indicating copy to clipboard operation
taichi_LBM3D copied to clipboard

A question

Open Vivia93 opened this issue 1 year ago • 65 comments

Dear author,

Hello. Thank you very much for publishing your work. I am greatly benefited from studying. In the post-processing stage, I have a question. When processing a group in Paraview, I chose the "rho" option, but the images in each step did not change. What is the reason for this? Is it a normal phenomenon?

I hope to receive your answer.

Vivia93 avatar Aug 07 '23 06:08 Vivia93

Hi, thanks for your interest. I think there are two things you can check:

  1. if you are using uniform bodyforce to drive the fluid and periodic boundary conditions, there might not be too much change on rho, especially for channel flow.

  2. you probably need to click rescale button in paraview to make sure the visualization range is reasonable for your data at different times. Initially the rho is uniform everywhere, but they might become not uniform after several time steps, now you need to click this rescale button to make visualization scale consistent to your "current data range". [image: image.png]

Thanks, if you have any questions, please let me know

On Mon, 7 Aug 2023 at 07:54, Vivia93 @.***> wrote:

Dear author,

Hello. Thank you very much for publishing your work. I am greatly benefited from studying. In the post-processing stage, I have a question. When processing a group in Paraview, I chose the "rho" option, but the images in each step did not change. What is the reason for this? Is it a normal phenomenon?

I hope to receive your answer.

— Reply to this email directly, view it on GitHub https://github.com/yjhp1016/taichi_LBM3D/issues/17, or unsubscribe https://github.com/notifications/unsubscribe-auth/AJEDKQH6X7EIZ7U7OX6CHMLXUCGMFANCNFSM6AAAAAA3GQ26VE . You are receiving this because you are subscribed to this thread.Message ID: @.***>

yjhp1016 avatar Aug 07 '23 08:08 yjhp1016

Hello,Dr.Yang,

Thank you very much for your answer. I have a question that I would like to ask. In the lbm_solver_3d_2phase.py file,I want to simulate gas (non wetting phase) entering water saturated rocks (wetting phase),but the code does not specify the density used to replace the fluid, so I only changed the viscosity of the fluid. From the simulation results, it can be seen that there is not much change in density. If possible, can we express the density used to drive the fluid? 5 40

Vivia93 avatar Aug 28 '23 12:08 Vivia93

Hi,

Please don't use density to define different phases, this LBM two phase code is a color gradient method, so we have another variable phi to represent the ratio of water/oil at every lattice. this phi is updated with a convection-diffusion equation, the velocity field is calculated using normal LBM, so there are two input file, in code lbm_solver_3d_2phase.py, find the line: solid_np, phase_np = init_geo('./img_ftb131.txt', './phase_ftb131.dat')

This is the line to define geometry, and initial water/oil distribution (phase_ftb131.dat, 1=water, -1=oil), more details can be found in paper attached with this email, this code actually is a Taichi implementation of this paper, please refer to this paper for more details.

On Mon, 28 Aug 2023 at 13:39, Vivia93 @.***> wrote:

Hello,Dr.Yang,

Thank you very much for your answer. I have a question that I would like to ask. In the lbm_solver_3d_2phase.py file,I want to simulate gas (non wetting phase) entering water saturated rocks (wetting phase),but the code does not specify the density used to replace the fluid, so I only changed the viscosity of the fluid. From the simulation results, it can be seen that there is not much change in density. If possible, can we express the density used to drive the fluid? [image: 5] https://user-images.githubusercontent.com/130535694/263704107-e18cb487-76a9-4dfd-ae0d-67c0f09b7bcd.jpg [image: 40] https://user-images.githubusercontent.com/130535694/263704142-2df4471c-c961-46ec-bce8-d30edeccd3c8.jpg

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

yjhp1016 avatar Aug 28 '23 20:08 yjhp1016

Hello Dr. Yang,

Thank you for your answer. May I ask if it is possible to calculate the saturation of the water and gas phases in the lbm_solver_3d_2phase.py file, and then use this to calculate the relative permeability?

In the phase file, I defined 1 as the water phase and -1 as the gas phase.. You mentioned that psi represents the water/air ratio (the original code is water/oil). Can I use psi to calculate the relative permeability?

Looking forward to your reply.

Vivia93 avatar Sep 01 '23 09:09 Vivia93

Hi,

phi is a measure of water/oil ratio at each lattice. If you want to calculate saturation, you need to iterate all fluid lattice, count how many fluid lattices with phi>0 then use this number to divide total fluid lattice number, you will get the water saturation :-)

Jianhui

On Fri, 1 Sept 2023 at 10:47, Vivia93 @.***> wrote:

Hello Dr. Yang,

Thank you for your answer. May I ask if it is possible to calculate the saturation of the water and gas phases in the lbm_solver_3d_2phase.py file, and then use this to calculate the relative permeability?

In the phase file, I defined 1 as the water phase and -1 as the gas phase.. You mentioned that psi represents the water/air ratio (the original code is water/oil). Can I use psi to calculate the relative permeability?

Looking forward to your reply.

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

yjhp1016 avatar Sep 01 '23 09:09 yjhp1016

Hello Dr. Yang, I calculated the saturation of the water and gas phases, but when I reached 200 steps, I suddenly encountered an error, and the output vtk file was also incorrect. May I ask what caused this issue?

1693643508(1) 1693643759(1) 1693643812(1) 1693644032(1) 1693644068(1)

Vivia93 avatar Sep 02 '23 08:09 Vivia93

Looks like there is something not quite feasible in simulation configuration... Can you visualize the distribution of initial air and gas? what are their viscosity? What's the bodyforce you're using to drive the fluid?

On Sat, 2 Sept 2023 at 09:42, Vivia93 @.***> wrote:

Hello Dr. Yang, I calculated the saturation of the water and gas phases, but when I reached 200 steps, I suddenly encountered an error, and the output vtk file was also incorrect. May I ask what caused this issue?

[image: 1693643508(1)] https://user-images.githubusercontent.com/130535694/265192516-ac2074d8-21de-4e3e-8eb4-d6c85ce37540.png [image: 1693643759(1)] https://user-images.githubusercontent.com/130535694/265192663-d7c062b2-95a2-4c1e-bc13-9e273234b11c.png [image: 1693643812(1)] https://user-images.githubusercontent.com/130535694/265192761-9a102276-bc81-4a48-a1b8-8497e5786cf3.png [image: 1693644032(1)] https://user-images.githubusercontent.com/130535694/265193114-b50fa352-2c35-4fcf-80b8-0fc370390258.png [image: 1693644068(1)] https://user-images.githubusercontent.com/130535694/265193129-8b08a239-6f56-48dd-a4bd-4a62810c9ac1.png

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

yjhp1016 avatar Sep 02 '23 08:09 yjhp1016

I set the viscosity of air and water separately

niu_l = 0.001         #psi>0 niu_g = 0.000018         #psi<0

And I also set the phase. txt to represent the initial two-phase distribution, as my model is 150x150x150, the 150 points in the two-phase file I set are a group, with six points in one group being the gas phase and the other being the water phase.

I have not modified the bodyforce used to drive the fluid.

ext_f[None] = ti.Vector([fx,fy,fz])

叶落何翩翩 @.***

 

------------------ 原始邮件 ------------------ 发件人: "yjhp1016/taichi_LBM3D" @.>; 发送时间: 2023年9月2日(星期六) 下午4:46 @.>; @.@.>; 主题: Re: [yjhp1016/taichi_LBM3D] A question (Issue #17)

Looks like there is something not quite feasible in simulation configuration... Can you visualize the distribution of initial air and gas? what are their viscosity? What's the bodyforce you're using to drive the fluid?

On Sat, 2 Sept 2023 at 09:42, Vivia93 @.***> wrote:

> Hello Dr. Yang, > I calculated the saturation of the water and gas phases, but when I > reached 200 steps, I suddenly encountered an error, and the output vtk file > was also incorrect. May I ask what caused this issue? > > [image: 1693643508(1)] > <https://user-images.githubusercontent.com/130535694/265192516-ac2074d8-21de-4e3e-8eb4-d6c85ce37540.png> > [image: 1693643759(1)] > <https://user-images.githubusercontent.com/130535694/265192663-d7c062b2-95a2-4c1e-bc13-9e273234b11c.png> > [image: 1693643812(1)] > <https://user-images.githubusercontent.com/130535694/265192761-9a102276-bc81-4a48-a1b8-8497e5786cf3.png> > [image: 1693644032(1)] > <https://user-images.githubusercontent.com/130535694/265193114-b50fa352-2c35-4fcf-80b8-0fc370390258.png> > [image: 1693644068(1)] > <https://user-images.githubusercontent.com/130535694/265193129-8b08a239-6f56-48dd-a4bd-4a62810c9ac1.png> > > — > Reply to this email directly, view it on GitHub > <https://github.com/yjhp1016/taichi_LBM3D/issues/17#issuecomment-1703766774>, > or unsubscribe > <https://github.com/notifications/unsubscribe-auth/AJEDKQGX37CGWYR2CTVSKTLXYLWORANCNFSM6AAAAAA3GQ26VE> > . > You are receiving this because you commented.Message ID: > @.***> >

— Reply to this email directly, view it on GitHub, or unsubscribe. You are receiving this because you authored the thread.Message ID: @.***>

Vivia93 avatar Sep 02 '23 09:09 Vivia93

Hi,

The reason is you're using too small viscosity. The fluid part of this two phase LBM is a normal MRT-LBM, I won't use any viscosity smaller than 0.01. And viscosity contrast between two phases will greatly impact the stability of your simulation. So I suggest you''re using same viscosity for two phrases and keep them larger than 0.01. If you're problem is capillary dominate (very low capillary number < 1e-4), this is fine, as the dominating force is capillary not viscous/inertia, but if your problem is inertia dominate (capillary number > 1e-3), you probably can't use this two phase LBM, you need to try some other approaches.

On Sat, 2 Sept 2023 at 10:04, Vivia93 @.***> wrote:

I set the viscosity of air and water separately

niu_l = 0.001         #psi>0 niu_g = 0.000018         #psi<0

And I also set the phase. txt to represent the initial two-phase distribution, as my model is 150x150x150, the 150 points in the two-phase file I set are a group, with six points in one group being the gas phase and the other being the water phase.

I have not modified the bodyforce used to drive the fluid.

ext_f[None] = ti.Vector([fx,fy,fz])

叶落何翩翩 @.***

 

------------------ 原始邮件 ------------------ 发件人: "yjhp1016/taichi_LBM3D" @.>; 发送时间: 2023年9月2日(星期六) 下午4:46 @.>; @.@.>; 主题: Re: [yjhp1016/taichi_LBM3D] A question (Issue #17)

Looks like there is something not quite feasible in simulation configuration... Can you visualize the distribution of initial air and gas? what are their viscosity? What's the bodyforce you're using to drive the fluid?

On Sat, 2 Sept 2023 at 09:42, Vivia93 @.***> wrote:

> Hello Dr. Yang, > I calculated the saturation of the water and gas phases, but when I > reached 200 steps, I suddenly encountered an error, and the output vtk file > was also incorrect. May I ask what caused this issue? > > [image: 1693643508(1)] > < https://user-images.githubusercontent.com/130535694/265192516-ac2074d8-21de-4e3e-8eb4-d6c85ce37540.png>

> [image: 1693643759(1)] > < https://user-images.githubusercontent.com/130535694/265192663-d7c062b2-95a2-4c1e-bc13-9e273234b11c.png>

> [image: 1693643812(1)] > < https://user-images.githubusercontent.com/130535694/265192761-9a102276-bc81-4a48-a1b8-8497e5786cf3.png>

> [image: 1693644032(1)] > < https://user-images.githubusercontent.com/130535694/265193114-b50fa352-2c35-4fcf-80b8-0fc370390258.png>

> [image: 1693644068(1)] > < https://user-images.githubusercontent.com/130535694/265193129-8b08a239-6f56-48dd-a4bd-4a62810c9ac1.png>

> > — > Reply to this email directly, view it on GitHub > < https://github.com/yjhp1016/taichi_LBM3D/issues/17#issuecomment-1703766774>,

> or unsubscribe > < https://github.com/notifications/unsubscribe-auth/AJEDKQGX37CGWYR2CTVSKTLXYLWORANCNFSM6AAAAAA3GQ26VE>

> . > You are receiving this because you commented.Message ID: > @.***> >

— Reply to this email directly, view it on GitHub, or unsubscribe. You are receiving this because you authored the thread.Message ID: @.***>

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

yjhp1016 avatar Sep 02 '23 09:09 yjhp1016

Hello,Dr.Yang,

In the two-phase flow simulation, I found that you set CapA=0.005, and I reset this parameter to CapA=0.0005 during the simulation. I have noticed that the displacement speed has increased. Is there any basis or range for the value of CapA parameter?

Vivia93 avatar Sep 25 '23 05:09 Vivia93

Hu, this is what we expect. small CapA means smaller surface tension, also means smaller capillary force, so it's easier to push the interface. If we use a very big CapA, it will make numerical stability issue, so I will keep CapA between 0.0 - 0.1

Vivia93 @.***> 于 2023年9月25日周一 上午6:46写道:

Hello,Dr.Yang,

In the two-phase flow simulation, I found that you set CapA=0.005, and I reset this parameter to CapA=0.0005 during the simulation. I have noticed that the displacement speed has increased. Is there any basis or range for the value of CapA parameter?

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

yjhp1016 avatar Sep 25 '23 07:09 yjhp1016

solid_np,phase_np = init_geo('./img_ftb131.txt' ,'./phase_ftb131.dat')这是定义几何形状和初始水/油分布的线(phase_ftb131.dat,1=水,-1=油)

您好,请问您是如何将数据转换为需要的solid_np,phase_np = init_geo('./img_ftb131.txt' ,'./phase_ftb131.dat')这是定义几何形状和初始水/油分布的线(phase_ftb131.dat,1=水,-1=油)这2个文件的呢?img_ftb131是先按照切片数为第一层循环,然后按照行为第二层循环,再按照列为第三层循环进行读取CT的数据嘛?同样的,phase_ftb131相分布数据,是同样的顺序,然后将第一个切片的像素为0的位置设置为1,其余位置是-1,其余切片不用设置1和-1嘛?

renxiaosa00 avatar Oct 08 '23 01:10 renxiaosa00

img_ftb131和phase_ftb131的matlab生成如下:

clc;clear;close all; % 将二值化0和128的bmp转换为2D的imgftb300 % 将每一个CT大小的前6行赋值为1形成1D的phase_ftb300

ImgPath = "自己的路径" matFiles = dir(fullfile(ImgPath,'*.bmp')); imgftb300 = []; phase_ftb300 = []; phase_ftb300_i= ones(300, 300);% 数字自己决定大小 phase_ftb300_i(1:6,:) = -1;%原始测试数据是前6行

lens = size(matFiles); for i = 1 : lens dataRes = imread(fullfile(ImgPath,matFiles(i).name)); dataRes(dataRes == 128) = 255;%自己的数据是128,故替换为255 imgftb300(:,:,i) = dataRes; phase_ftb300(:,:,i) = phase_ftb300_i; imagesc(dataRes);

end

imgftb300_2D = reshape(imgftb300, 300300, 300); phase_ftb300_2D = reshape(phase_ftb300, 300300*300, 1); save('imgftb300.txt','imgftb300_2D','-ascii'); save('phase_ftb300.txt','phase_ftb300_2D','-ascii');

renxiaosa00 avatar Oct 08 '23 06:10 renxiaosa00

你好,solid_np 和 phase_np 都是按照一样的顺序组织的: 比如如果solid_np 是一个三维数组 那么文件image_ftb131.txt 里面的顺序是: for k in range(nz): for j in range(ny): for i in range(xn): print(solid_np[i,j,k])

同样的顺序也用于 phase_ftb131.dat 上。 区别就是在img_ftb131.txt 也就是Geometry 的定义中 0 = Void, 1 = Solid,

第二个文件phase_ftb131.dat 是定义初始的油水分布的, -1 = non-wetting phase, 1 = wetting phase, 对于solid 的位置,phase 可以随便写1 或者 -1

如果有不清楚的可以在问我 On Sun, 8 Oct 2023 at 02:59, renxiaosa00 @.***> wrote:

solid_np,phase_np = init_geo('./img_ftb131.txt' ,'./phase_ftb131.dat')这是定义几何形状和初始水/油分布的线(phase_ftb131.dat,1=水,-1=油)

您好,请问您是如何将数据转换为需要的solid_np,phase_np = init_geo('./img_ftb131.txt' ,'./phase_ftb131.dat')这是定义几何形状和初始水/油分布的线(phase_ftb131.dat,1=水,-1=油)这2个文件的呢?img_ftb131是先按照切片数为第一层循环,然后按照行为第二层循环,再按照列为第三层循环进行读取CT的数据嘛?同样的,phase_ftb131相分布数据,是同样的顺序,然后将第一个切片的像素为0的位置设置为1,其余位置是-1,其余切片不用设置1和-1嘛?

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

yjhp1016 avatar Oct 08 '23 11:10 yjhp1016

杨博士您好, 我计算了水相和气相的饱和度,但是当我达到200步时,突然遇到错误,并且输出vtk文件也不正确。请问这个问题是什么原因造成的呢?

1693643508(1) 1693643759(1) 1693643812(1) 1693644032(1) 1693644068(1) What is the purpose of calculating the water lattices and saturations? This is to calculate these parameters whether it converges or not?

renxiaosa00 avatar Oct 18 '23 01:10 renxiaosa00

看起来模拟配置中有些不太可行......你能可视化初始空气和气体的分布吗?它们的粘度是多少?您用来驱动流体的体力是多少? …… On Sat, 2 Sept 2023 at 09:42, Vivia93 @.> wrote: Hello Dr. Yang, I calculated the saturation of the water and gas phases, but when I reached 200 steps, I suddenly encountered an error, and the output vtk file was also incorrect. May I ask what caused this issue? [image: 1693643508(1)] https://user-images.githubusercontent.com/130535694/265192516-ac2074d8-21de-4e3e-8eb4-d6c85ce37540.png [image: 1693643759(1)] https://user-images.githubusercontent.com/130535694/265192663-d7c062b2-95a2-4c1e-bc13-9e273234b11c.png [image: 1693643812(1)] https://user-images.githubusercontent.com/130535694/265192761-9a102276-bc81-4a48-a1b8-8497e5786cf3.png [image: 1693644032(1)] https://user-images.githubusercontent.com/130535694/265193114-b50fa352-2c35-4fcf-80b8-0fc370390258.png [image: 1693644068(1)] https://user-images.githubusercontent.com/130535694/265193129-8b08a239-6f56-48dd-a4bd-4a62810c9ac1.png — Reply to this email directly, view it on GitHub <#17 (comment)>, or unsubscribe https://github.com/notifications/unsubscribe-auth/AJEDKQGX37CGWYR2CTVSKTLXYLWORANCNFSM6AAAAAA3GQ26VE . You are receiving this because you commented.Message ID: @.>

我是为了计算二氧化碳进入水的过程,参数设置如下: nx,ny,nz = 150.150.150 fx,fy,fz = 5e-5, -2e-5, 0.0 niu_l = .05 niu_g = .2 psi_solid = .7 CapA = 0.0005 模拟了80w次,最终的流动结果如下: a0cb74f781882e4e7809375b9a13b93 裁剪一半后流动最终结果如下: 318ff071130e8618b5d85d10f2dd9a3 整个phase的流动状态是一个视频,没法上传,就是刚开始流动的时候,出口也有了二氧化碳的变化,比较奇怪,也不清楚这些是什么状态,需要根据观察什么状态修整参数。还有,打印哪些数值稳定的参数呢?因为目前就计算了4个,rho似乎也没什么变化,只有phase velocity 有变化,也没有压力参数

renxiaosa00 avatar Oct 18 '23 01:10 renxiaosa00

我是计算二氧化碳进入水的两相流模拟过程,数据大小也是150150150

renxiaosa00 avatar Oct 18 '23 02:10 renxiaosa00

这个看上去应该是最后几步有发散的情况,应该是设置的有点问题,我用的粘度0.1 两相都一样,体力1e-3, 表面张力CapA 2e-3 周期边界加固定颜色边界,你试试看

renxiaosa00 @.***> 于 2023年10月18日周三 上午2:45写道:

杨博士您好, 我计算了水相和气相的饱和度,但是当我达到200步时,突然遇到错误,并且输出vtk文件也不正确。请问这个问题是什么原因造成的呢?

[image: 1693643508(1)] https://user-images.githubusercontent.com/130535694/265192516-ac2074d8-21de-4e3e-8eb4-d6c85ce37540.png [image: 1693643759(1)] https://user-images.githubusercontent.com/130535694/265192663-d7c062b2-95a2-4c1e-bc13-9e273234b11c.png [image: 1693643812(1)] https://user-images.githubusercontent.com/130535694/265192761-9a102276-bc81-4a48-a1b8-8497e5786cf3.png [image: 1693644032(1)] https://user-images.githubusercontent.com/130535694/265193114-b50fa352-2c35-4fcf-80b8-0fc370390258.png [image: 1693644068(1)] https://user-images.githubusercontent.com/130535694/265193129-8b08a239-6f56-48dd-a4bd-4a62810c9ac1.png What is the purpose of calculating the water lattices and saturations? This is to calculate these parameters whether it converges or not?

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

yjhp1016 avatar Oct 18 '23 07:10 yjhp1016

好的,谢谢您! (1)“体力1e-3”指的是fx fy 嘛? (2)周期边界加固定颜色指的是边界条件的bcxr嘛?比如说以下图片的设置这块嘛 image

renxiaosa00 avatar Oct 18 '23 07:10 renxiaosa00

体力是指fx, 或者fy, 或者fz, 例子中我给fx fy 都加了力,是为了让诸如过程快一些,从多个方向都有流动,正常模拟实验状态的画,只用定义一个方向的f, 取决于你想从哪个方向注入

你上面给出的就是周期边界了,因为没有选取任何边界使用压力或者速度边界条件,默认就是周期

颜色边界是让某一个inlet, outlet 固定颜色,是再这里定义, 下面就是X 方向的左面定义为固定颜色,为non-wetting 相,也就是从periodic 流动回来的在这里会被重新定义为non-wetting, 也就是如果X_left是inlet, 我们这里只注入non-wetting bc_psi_x_left, psi_x_left = 1, -1.0 # boundary condition for phase-field: 0 = periodic, bc_psi_x_right, psi_x_right = 0, 1.0 # 1 = constant value on the boundary, value = -1.0 phase1 or 1.0 = phase 2 bc_psi_y_left, psi_y_left = 0, 1.0 bc_psi_y_right, psi_y_right = 0, 1.0 bc_psi_z_left, psi_z_left = 0, 1.0 bc_psi_z_right, psi_z_right = 0, 1.0

On Wed, 18 Oct 2023 at 08:36, renxiaosa00 @.***> wrote:

好的,谢谢您! (1)“体力1e-3”指的是fx fy 嘛? (2)周期边界加固定颜色指的是边界条件的bcxr嘛?比如说以下图片的设置这块嘛 [image: image] https://user-images.githubusercontent.com/36992106/276147806-a9d39b81-1364-42fa-8a33-5859f626a424.png

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

yjhp1016 avatar Oct 18 '23 08:10 yjhp1016

您好,我按照您的建议设置参数如下: 28c9685189324582d4601d0fd80db2e 得到的phase结果迭代0时如下: 1b7af426cce19012a46d1e358200ccb 中间过程结果如下: ec23bfbe9bffb5a58edf3c2340dccb1 f6f46bdaae68d568177b887a8b0b5b7 最后的结果是: 735f793fa244416a55f167bb111ee0d

假设入口是二氧化碳蓝色,水是红色,但流动的时候,理论上应该是蓝色二氧化碳慢慢驱出红色水,但是这个怎么出现的是灰色的相呢?请问这个是我的结果计算错了嘛还是出现什么别的设置的问题了?最后谢谢老师,期待您的指导!

renxiaosa00 avatar Oct 24 '23 07:10 renxiaosa00

应该是你可视化的问题,不应该用counter, 用threshold,只画phi 小于零的就能看到,然后让geometry部分opacity 调成半透明就能看到了应该

renxiaosa00 @.***> 于 2023年10月24日周二 上午8:17写道:

您好,我按照您的建议设置参数如下: [image: 28c9685189324582d4601d0fd80db2e] https://user-images.githubusercontent.com/36992106/277577035-9c20265c-f098-471a-8ecf-6d337d7e08df.jpg 得到的phase结果迭代0时如下: [image: 1b7af426cce19012a46d1e358200ccb] https://user-images.githubusercontent.com/36992106/277577153-0a50c856-cfc5-4742-b490-935fe71e16c6.jpg 中间过程结果如下: [image: ec23bfbe9bffb5a58edf3c2340dccb1] https://user-images.githubusercontent.com/36992106/277577215-f16ea31a-51aa-4836-8af5-90c4d7a9f227.jpg [image: f6f46bdaae68d568177b887a8b0b5b7] https://user-images.githubusercontent.com/36992106/277577254-434b2728-8a5b-4ff8-9b22-2568cc87d907.jpg 最后的结果是: [image: 735f793fa244416a55f167bb111ee0d] https://user-images.githubusercontent.com/36992106/277577305-f24a3e4b-284f-421d-bbf0-d552278d729e.jpg

假设入口是二氧化碳蓝色,水是红色,但流动的时候,理论上应该是蓝色二氧化碳慢慢驱出红色水,但是这个怎么出现的是灰色的相呢?请问这个是我的结果计算错了嘛还是出现什么别的设置的问题了?最后谢谢老师,期待您的指导!

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

yjhp1016 avatar Oct 24 '23 07:10 yjhp1016

68c876d5a933e36998707402bf6d24f c72a90993d5c5e31cd68c041ee047a1 我设置了threshold,但是好像选择的opacity不太对,只要这块不是1,图像就没了,似乎是没找对geometry部分opacity,请问这个是在哪里找到的呢?我搜的可视化方法基本上很少有这个介绍。

renxiaosa00 avatar Oct 24 '23 08:10 renxiaosa00

你的模拟结果看起来好像是可以的,你先不要可视化geometry, 你把trehsold 选只可视化<0 的部分(phi), opacity 选1 然后从file, 选择文件,再重新打开一个结果文件,选择geoemtry 标签,这时候你可以使用counter 来可视化geometry 的表面,然后对这个表面选opacity 0.5左右(你自己尝试一个合适的值),就能差不多可视化出来多孔介质里面流体流动情况了。这个属于paraview操作的小trick 的问题 😀

On Tue, 24 Oct 2023 at 09:18, renxiaosa00 @.***> wrote:

[image: 68c876d5a933e36998707402bf6d24f] https://user-images.githubusercontent.com/36992106/277593217-174787fc-4b10-45d7-ab2f-eb80b079795a.jpg [image: c72a90993d5c5e31cd68c041ee047a1] https://user-images.githubusercontent.com/36992106/277593255-43e15465-efab-492d-9af9-ccb655f040b6.jpg

我设置了threshold,但是好像选择的opacity不太对,只要这块不是1,图像就没了,似乎是没找对geometry部分opacity,请问这个是在哪里找到的呢?我搜的可视化方法基本上很少有这个介绍。

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

yjhp1016 avatar Oct 24 '23 14:10 yjhp1016

好的,谢谢您的指导,我属实是第一次接触多相流,真是太感谢您的指导了!就是我的出口总是在刚开始迭代的时候就产生相的变化,按理说刚开始二氧化碳进入孔隙的时候左边入口才开始慢慢移动,右边出口不该出现二氧化碳的,但是无论我怎么尝试,刚开始进入二氧化碳时,出口总是有二氧化碳存在,之前也听您解释过这个原因,但是改参数总也不知道哪些值往哪些方向改,就有些不知所措了

renxiaosa00 avatar Oct 25 '23 01:10 renxiaosa00

应该是右边像左边一样也需要使用固定颜色边界,你试试看

renxiaosa00 @.***> 于 2023年10月25日周三 上午2:10写道:

好的,谢谢您的指导,我属实是第一次接触多相流,真是太感谢您的指导了!就是我的出口总是在刚开始迭代的时候就产生相的变化,按理说刚开始二氧化碳进入孔隙的时候左边入口才开始慢慢移动,右边出口不该出现二氧化碳的,但是无论我怎么尝试,刚开始进入二氧化碳时,出口总是有二氧化碳存在,之前也听您解释过这个原因,但是改参数总也不知道哪些值往哪些方向改,就有些不知所措了

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

yjhp1016 avatar Oct 25 '23 06:10 yjhp1016

我的颜色边界采用的默认的代码: bc_psi_x_left, psi_x_left = 1, -1.0 bc_psi_x_right, psi_x_right = 0, 1.0 bc_psi_y_left, psi_y_left = 0, 1.0 bc_psi_y_right, psi_y_right = 0, 1.0 bc_psi_z_left, psi_z_left = 0, 1.0 bc_psi_z_right, psi_z_right = 0, 1.0 “右边像左边一样也需要使用固定颜色边界”指的是不是bc_psi_x_right, psi_x_right = 1, -1.0啊?这样就能跟左边的bc_psi_x_left, psi_x_left颜色边界一样了

renxiaosa00 avatar Oct 25 '23 07:10 renxiaosa00

把第二行改成1 1.0 意思是使用固定颜色边界,边界上的颜色固定为1.0

renxiaosa00 @.***> 于 2023年10月25日周三 上午8:03写道:

我的颜色边界采用的默认的代码: bc_psi_x_left, psi_x_left = 1, -1.0 bc_psi_x_right, psi_x_right = 0, 1.0 bc_psi_y_left, psi_y_left = 0, 1.0 bc_psi_y_right, psi_y_right = 0, 1.0 bc_psi_z_left, psi_z_left = 0, 1.0 bc_psi_z_right, psi_z_right = 0, 1.0 “右边像左边一样也需要使用固定颜色边界”指的是不是bc_psi_x_right, psi_x_right = 1, -1.0啊?这样就能跟左边的bc_psi_x_left, psi_x_left颜色边界一样了

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

yjhp1016 avatar Oct 25 '23 07:10 yjhp1016

我看后面备注是 1 = constant value on the boundary, value = -1.0 phase1 or 1.0 = phase 2,那么是不是bc_psi_x_right, psi_x_right = 1, 2.0啊?毕竟刚开始的初始条件右边出口按理说得是phase 2-水,左边入口才是-1对应的二氧化碳吧?是不是变量我理解错了,比如bc_psi是设置颜色的,psi是设置别的什么参数的?其实我没太搞懂pis_x/y/z, psi_solid分别是什么意思。

renxiaosa00 avatar Oct 25 '23 07:10 renxiaosa00

颜色LBM 使用phi 来表示non-wetting phase 或者wetting phase, phi的值一般介于-1.0 到 1.0 之间,我们一般可以简单的认为小于零的就是non-wetting phase, 大于0的是wetting phase (也和接触角有关,接触角变了也可能这两个反过来)。我那里写的-1.0 = phase 1 意思就是-1.0 表示non wetting phase, 1.0 = phase 2 意思是1.0 表示phase 2 (wetting phase). 所以这里第二行改为1 1.0 意思就是右边使用颜色边界,边界上固定为phi = 1.0 (也就是wetting phase)

On Wed, 25 Oct 2023 at 08:40, renxiaosa00 @.***> wrote:

我看后面备注是 1 = constant value on the boundary, value = -1.0 phase1 or 1.0 = phase 2,那么是不是bc_psi_x_right, psi_x_right = 1, 2.0啊?毕竟刚开始的初始条件右边出口按理说得是phase 2-水,左边入口才是-1对应的二氧化碳吧?是不是变量我理解错了,比如bc_psi是设置颜色的,psi是设置别的什么参数的?其实我没太搞懂pis_x/y/z, psi_solid分别是什么意思。

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

yjhp1016 avatar Oct 25 '23 08:10 yjhp1016