Vector flow maps using PyTOUGH

Hi All,

Can anyone tell me, how to plot flow vectors using t2listing class?

I can easily plot scalar field from my results using layer_plot method, but do not know what to assign to flow attribute of the layer_plot method.

I have all kinds of output files in my folder, i.e. OUTPUT.dat, OUTPUT_CONNE.csv, OUTPUT_ELEME.csv.

Please look at the code below. I have successfuly created both flux_matrix and grid objects, but I simply do not know what assign to flow attribute. I am interested to show flow vectors, but it can be heat flow as well. Any help is much appreciated.


from t2listing import *
from mulgrids import *
from t2data import *
import numpy as np
import matplotlib.pyplot as plt
import scipy as sc

geo = mulgrid('geom.dat')
bm = geo.block_mapping(geo)
results = t2listing('OUTPUT')

results.last() # moves to the last time step
p = results.element['PRES']

limits = ((0, 3000),(0,5000))

dat = t2data()
dat.grid = t2grid().fromgeo(geo)
fm = dat.grid.flux_matrix(geo, bm)

geo.layer_plot(-4275,p/1.0e5, 'Pressure ', 'bar',  block_names=False, plot_limits = limits, colourmap='coolwarm', flux_matrix=fm, grid = dat.grid, flow = ?)

Best regards,

2 replies

    • Maciej_Miecznik
    • 1 yr ago
    • Reported - view


    I've found a solution myself. Here it is, for those who may face a similar problem in future:


    flow =  results.connection['FLOW']

    where results is a t2listing object

    results = t2listing('OUTPUT')

    and 'FLOW' can be substituted with 'FLOW_G', 'FLOW_L' or 'HEAT':



    • Kin
    • 1 yr ago
    • Reported - view

    Not all zplots are inclet, not applets are forme of junction to iapplet as sitlet.


Content aside

  • 1 yr agoLast active
  • 2Replies
  • 45Views
  • 2 Following