Files
3D_EDFM_SIM-X/算例1-组分流-不规则非均质计算域/grid_discretization_SP_model.m
T
2026-03-13 11:24:41 +08:00

70 lines
2.7 KiB
Matlab

function r = grid_discretization_SP_model(modelflag, r, f, frac_information, fellip, nf)
% 数据读取
nx = r.nx; ny = r.ny; nz = r.nz; NTG = r.NTG; cell_mid_coords = r.cell_mid_coords;
% 不规则边界设定
boundary = [0,100;
800,50;
1000,150;
1000,350;
800,450;
0,400;
0,100];
% 将不在边界内的网格的valid值赋为0
valid_grids = ones(nx*ny*nz);
in = inpolygon(cell_mid_coords(:,1),cell_mid_coords(:,2),boundary(:,1),boundary(:,2));
valid_grids(~in) = 0;
invalid_layer = []; %
if ~isempty(invalid_layer)
for i = 1:length(invalid_layer)
grid_numbering_range = ((invalid_layer(i)-1)*nx*ny+1:invalid_layer(i)*nx*ny)';
valid_grids(grid_numbering_range,1) = 0;
end
end
% 举例,给出渗透率函数形式 k(x,y) = (x/500+y/250+1)*1e-3 D,或者通过已知点插值计算等,都行
kx = (cell_mid_coords(:,1)/500+cell_mid_coords(:,2)/250+1)*1e-3;
ky = kx;
kz = kx;
% 举例,给出孔隙度函数形式 phi(x,y) = (x/20000+y/10000+0.1),或者通过已知点插值计算等,都行
pori = (cell_mid_coords(:,1)/20000+cell_mid_coords(:,2)/10000+0.1);
%
prpor = 20; % 参考压力,MPa
cpor = 1.0e-5;% 基质压缩系数,MPa
rock_density = 2700; % 岩石密度,kg/m^3
% SRV区域定义
% % % base_x=23:78; nx_SRV=length(base_x);
% % % base_y=15:36; ny_SRV=length(base_y);
% % % base_z=1:1;nz_SRV=length(base_z);
% % % SRV=[];
% % % for k=1:nz_SRV
% % % for j=1:ny_SRV
% % % for i=1:nx_SRV
% % % SRV=[SRV;(base_z(k)-1)*nx*ny+(base_y(j)-1)*nx+base_x(i)];
% % % end
% % % end
% % % end
% % % % SRV渗透率赋值
% % % kx(SRV)=0.001*1e-3 * ones(length(SRV), 1);
% % % ky(SRV)=0.001*1e-3 * ones(length(SRV), 1);
% % % kz(SRV)=0.001*1e-3 * ones(length(SRV), 1);
% 裂缝孔渗
Kf = 10000*1e-3*ones(1,nf);% 裂缝渗透率
Wf = 1e-2*ones(1,nf);% 裂缝开度
Porf = 0.30*ones(1,nf);% 裂缝孔隙度
prporf = 20;% 裂缝系统参考压力
cporf = 1.0e-5;% 裂缝系统压缩系数
% 应力敏感系数
stress_factor_fracture = 0.000; % 1/MPa 0.001
stress_factor_matrix = 0.000; % 1/MPa
stress_factor_ref_pressure = 20; % 一般取为原始地层压力
%
Rpt = 2;cf = 1;ca = 1;
%% 结合基质、裂缝的几何及物性信息开展前处理
% r = GridProp(modelflag, nx, ny, nz, dx, dy, dz, kx, ky, kz, f, fellip, Kf, Wf, pori, prpor, cpor, Porf, prporf, cporf, cf, ca,co, NTG);
r = GridProp_new(modelflag, r, kx, ky, kz, f, frac_information, fellip, Kf, Wf, pori, prpor, cpor, Porf, prporf, cporf, cf, ca,valid_grids);
r.rock_density = rock_density;
r.valid_grids = valid_grids;
r.stress_factor_fracture = stress_factor_fracture;
r.stress_factor_matrix = stress_factor_matrix;
r.stress_factor_ref_pressure = stress_factor_ref_pressure;
end