-
Notifications
You must be signed in to change notification settings - Fork 38
Description
from t2data import*
import numpy as np
定义网格尺寸
dx = [1000.]*10 # x 方向 10 块,每块 1000 米
dy = [800.]*12 # y 方向 12 块,每块 800 米
dz = np.logspace(1., 2., 15) # z 方向 15 层,厚度从 10 到 100 米
创建矩形几何网格
geo = mulgrid().rectangular(dx, dy, dz, atmos_type=0, convention=0)
geo.write('geom.dat')
检查几何网格
geo.check(fix=True)
print(f"Number of connections: {geo.num_connections}") # 确认连接数量
创建 t2data 对象并生成 TOUGH2 网格
dat = t2data()
dat.grid = t2grid().fromgeo(geo)
定义岩石类型(确保热导率非零)
rt = rocktype(
name='ROCK1',
permeability=[1e-15, 1e-15, 1e-15],
porosity=0.2,
density=2500,
specific_heat=900,
conductivity=2.5 # 非零热导率
)
dat.grid.add_rocktype(rt)
for block in dat.grid.blocklist:
block.rocktype = rt
设置模拟参数
dat.parameter['tstart'] = 0.0
dat.parameter['tstop'] = 3.156e7 # 1 年
dat.parameter['dt'] = 1e5 # 初始时间步长
dat.parameter['print_level'] = 2
dat.parameter['eos'] = 'EOS1'
设置 MOP 参数
dat.parameter['option'] = [0] * 25
dat.parameter['option'][1] = 1 # 牛顿-拉夫森法
dat.parameter['option'][2] = 2 # 严格收敛
dat.parameter['option'][7] = 1 # 开启热传导
dat.parameter['option'][11] = 4 # 自动时间步长
dat.parameter['option'][16] = 1 # 详细输出
dat.parameter['option'][21] = 1 # EOS1 兼容
dat.write('MESH')
This is the code I wrote, how should I replace "rock" with "heat transfer area"?
