Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

A question #17

Open
Vivia93 opened this issue Aug 7, 2023 · 65 comments
Open

A question #17

Vivia93 opened this issue Aug 7, 2023 · 65 comments

Comments

@Vivia93
Copy link

Vivia93 commented Aug 7, 2023

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.

@yjhp1016
Copy link
Owner

yjhp1016 commented Aug 7, 2023 via email

@Vivia93
Copy link
Author

Vivia93 commented Aug 28, 2023

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

@yjhp1016
Copy link
Owner

yjhp1016 commented Aug 28, 2023 via email

@Vivia93
Copy link
Author

Vivia93 commented Sep 1, 2023

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.

@yjhp1016
Copy link
Owner

yjhp1016 commented Sep 1, 2023 via email

@Vivia93
Copy link
Author

Vivia93 commented Sep 2, 2023

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)

@yjhp1016
Copy link
Owner

yjhp1016 commented Sep 2, 2023 via email

@Vivia93
Copy link
Author

Vivia93 commented Sep 2, 2023 via email

@yjhp1016
Copy link
Owner

yjhp1016 commented Sep 2, 2023 via email

@Vivia93
Copy link
Author

Vivia93 commented Sep 25, 2023

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?

@yjhp1016
Copy link
Owner

yjhp1016 commented Sep 25, 2023 via email

@renxiaosa00
Copy link

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
Copy link

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, 300
300*300, 1);
save('imgftb300.txt','imgftb300_2D','-ascii');
save('phase_ftb300.txt','phase_ftb300_2D','-ascii');

@yjhp1016
Copy link
Owner

yjhp1016 commented Oct 8, 2023 via email

@renxiaosa00
Copy link

杨博士您好, 我计算了水相和气相的饱和度,但是当我达到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
Copy link

看起来模拟配置中有些不太可行......你能可视化初始空气和气体的分布吗?它们的粘度是多少?您用来驱动流体的体力是多少?
……
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
Copy link

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

@yjhp1016
Copy link
Owner

yjhp1016 commented Oct 18, 2023 via email

@renxiaosa00
Copy link

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

@yjhp1016
Copy link
Owner

yjhp1016 commented Oct 18, 2023 via email

@renxiaosa00
Copy link

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

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

@yjhp1016
Copy link
Owner

yjhp1016 commented Oct 24, 2023 via email

@renxiaosa00
Copy link

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

@yjhp1016
Copy link
Owner

yjhp1016 commented Oct 24, 2023 via email

@renxiaosa00
Copy link

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

@yjhp1016
Copy link
Owner

yjhp1016 commented Oct 25, 2023 via email

@renxiaosa00
Copy link

我的颜色边界采用的默认的代码:
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颜色边界一样了

@yjhp1016
Copy link
Owner

yjhp1016 commented Oct 25, 2023 via email

@renxiaosa00
Copy link

我看后面备注是 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分别是什么意思。

@yjhp1016
Copy link
Owner

yjhp1016 commented Oct 25, 2023 via email

@hangqqq
Copy link

hangqqq commented Nov 2, 2023

Hello! I would like to ask, what is the unit of 'niu'?

@yjhp1016
Copy link
Owner

yjhp1016 commented Nov 2, 2023 via email

@renxiaosa00
Copy link

1698648606301 1698648515606 I would like to ask what is the reason for this sudden decline and the results that come out later?

How to generate the water saturation and air saturation?

@yjhp1016
Copy link
Owner

yjhp1016 commented Nov 15, 2023 via email

@renxiaosa00
Copy link

杨博士您好, 我计算了水相和气相的饱和度,但是当我达到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?

How are water_lattices and total fluid lattices defined?

@renxiaosa00
Copy link

water_lattices and total fluid lattices

您好,请问计算饱和度的时候,water_lattices and total_fluid_lattices是怎么定义的呢?我看python里面没有A[None] = int(count)的定义模式啊

@renxiaosa00
Copy link

40bea3b184dd025e80ea7371255d6fb
我总是报这样的错误额,迭代前声明total_fluid_lattices={"None":1}也不对。

@yjhp1016
Copy link
Owner

yjhp1016 commented Nov 28, 2023 via email

@renxiaosa00
Copy link

1cdcdf98b626e648ff4e3d1299f38dca
这是我定义的方式,结果不对额

@yjhp1016
Copy link
Owner

yjhp1016 commented Nov 29, 2023 via email

@renxiaosa00
Copy link

嗯,我找到办法了,也尝试成功了,谢谢老师!
ed0ba44f8cdd7ef9560dd64fc2487a53

@renxiaosa00
Copy link

老师,成图这块,我是这么搞的,总感觉不对劲,您方便的话,可以看看我是哪块出问题了嘛?我想设置的是红色水,蓝色气,左边蓝色慢慢替换红色的
image
image
image
image
image

@yjhp1016
Copy link
Owner

yjhp1016 commented Dec 8, 2023 via email

@renxiaosa00
Copy link

嗯,好的,可视化这块似乎是我的模拟出问题了,把骨架当做孔隙了,所以一直显示不对劲。我换了数据结构后,再次模拟的时候,niu_l niu_g都是0.1,然后改变fx fy capA,psi_solid后,二氧化碳饱和度总是出现突然上升,比如模拟一段时间后CO2饱和度是0.5,下一步直接就0.9了,请问这种是一般因为什么原因啊?

@renxiaosa00
Copy link

image
这是我的孔隙结构,然后,设置niu_l = 0.1, niu_g = 0.1,psi_solid = 0.7, fx=5e-3 fy=-5e-3,CapA = 2e-3模拟结果CO2饱和度会突然饱和,改变capA分别为2e-2 or 2e-1,都会发生这样的突然饱和,这种情况在流动上显示的是,刚开始在孔隙流动,突然下一步就饱和了,这个一般是要怎么根据结构调整参数呢,我看psi_solid 范围是【-1,1】这个对应实际角度是怎么个换算关系呢?还有capA,fx,fy的实际应用范围是什么样呢?

@yjhp1016
Copy link
Owner

yjhp1016 commented Dec 9, 2023 via email

@renxiaosa00
Copy link

image
这是我的边界条件,孔隙结构不对称。目前fx=5e-4确实还没crash。还有fx fy 设置的值其中存在负的,这表示是什么意思呢?

@yjhp1016
Copy link
Owner

yjhp1016 commented Dec 9, 2023 via email

@renxiaosa00
Copy link

老师,请问,
(1)如果想尝试入口到出口,也就是x方向上不同的压力对于这个模拟的效果,根据孔隙结构不对称,所以需要设置bc_x_left=1(固定压力边界条件),然后改变rho_bcxl力的大小,是吗?那此时外部压力fx跟固定压力边界条件有什么关系呢?
(2)如果想尝试不同速度对模拟的效果,bc_x_left=2(固定速度边界条件),需要给定vx_bcxl, vy_bcxl, vz_bcxl这三个速度变量值。例子中bc_x_left, rho_bcxl, vx_bcxl, vy_bcxl, vz_bcxl = 1, 1.0, 0.0e-5, 0.0, 0.0,指的是bc_x_left=1选择了周期性边界条件,rho_bcxl设置x方向的压力是1,vx_bcxl, vy_bcxl, vz_bcxl 三个方向组合的速度分别是 0.0e-5, 0.0, 0.0。
(3)外部压力和(1)里面的固定压力边界下改变rho_bcxl这个力有什么关系呢?

@renxiaosa00
Copy link

老师,如果可以的话,我可以申请添加您联系方式么?我的QQ是1379289573,微信rxs137,邮箱rxsjiayou@163.com,您方便的话可以任选其中一个进行交流。

@renxiaosa00
Copy link

image
mo'ni模拟的时候,出口这块感觉应该还没流到这块,但是这块相已经改变了。请问这个是什么原因呢?

@yjhp1016
Copy link
Owner

yjhp1016 commented Dec 10, 2023 via email

@renxiaosa00
Copy link

老师,请问bodyforce的三个变量fx, fy, fz,rho,vx_bcxl, vy_bcxl, vz_bcxl 三个方向组合的速度,capA, psi_solid对应的物理量单位是怎么换算的呢?可以参考哪个说明手册呢?

@yjhp1016
Copy link
Owner

yjhp1016 commented Dec 11, 2023 via email

@renxiaosa00
Copy link

好的,谢谢老师!有一个关于粘度比的设置问题,我看颜色梯度模型基本上都是设置的粘度比,而本程序中是直接设置了粘度,并且粘度不同也不是代表不同的流体,不同的流体是通过相文件控制的,那么这块如果要设置不同的粘度比的话,是怎么进行固定一个设置另一个的呢?并且目前的粘度都是0.1,这个跟实际的比如谷歌搜的二氧化碳,水的粘度是怎么对照的呢?

@yjhp1016
Copy link
Owner

yjhp1016 commented Dec 19, 2023 via email

@renxiaosa00
Copy link

老师,我按照您的建议,其余参数不变,设置了不同的capA,发现CO2饱和度增加的结果好像有些不对,结论是capA越小,CO2饱和度增加地越快。比如下面图是不同地capA:2e-3 2e-2 2e-1,看结论反而是2e-3的CO2增长的越快,我看一般都是capA越大CO2增长地越快,但这个怎么反过来了?
image

@yjhp1016
Copy link
Owner

yjhp1016 commented Jan 1, 2024 via email

@Vivia93
Copy link
Author

Vivia93 commented Jan 19, 2024

X4$R~D{5TWXJRF%Y9BEY1{G
请问为什么我模拟出来表面张力系数越大,速度越大呢?表面张力系数我取的是0.005和0.003
0.003:
image
0.005:
image

@yjhp1016
Copy link
Owner

yjhp1016 commented Jan 19, 2024 via email

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants