-
Notifications
You must be signed in to change notification settings - Fork 38
Adding generators example
acroucher edited this page Sep 24, 2014
·
5 revisions
geo = mulgrid('gmodel.dat')
dat = t2data('model.dat')
dat.parameter['max_timesteps'] = 300
dat.parameter['print_interval'] = dat.parameter['max_timesteps'] / 10
dat.parameter['option'][16] = 5 # time step control
upflow_centre = np.array([15000., 21000.])
upflow_radius = 1200.
totalheat = 10.e6
layer = geo.layerlist[-1] # bottom layer
cols = [col for col in geo.columnlist if
np.linalg.norm(col.centre - upflow_centre) <= upflow_radius]
totalarea = sum([col.area for col in cols])
q = totalheat / totalarea
dat.clear_generators()
for col in cols:
blockname = geo.block_name(layer.name, col.name)
gen = t2generator(name = ' q' + col.name, block = blockname,
type = 'HEAT', gx = q * col.area)
dat.add_generator(gen)
dat.write()