Open pierecnlnd opened 8 months ago
Yes, but you will need a mulgrid geometry file for your mesh. Then you can do 2D layer or slice visualization of any quantity using the mulgrid layer_plot()
and slice_plot()
methods, or export to VTK files for 3D visualization.
Thank you, sir. Actually, I am still learning to use mulgrid but I already use software like Petrasim to create grid geometry. Is there any methods that you can recommend to convert either from mulgrid to .dat (Petrasim) or vice versa?
If by ".dat" you mean the TOUGH2 input data file, then PyTOUGH does have methods for converting between .dat and mulgrid. If you have a mulgrid geometry you can use the t2grid.fromgeo()
method to create the grid inside the .dat file. If you have a .dat file you can reverse-engineer a mulgrid geometry using the t2grid.rectgeo()
method, but only if your grid is rectangular.
If by ".dat" you mean the TOUGH2 input data file, then PyTOUGH does have methods for converting between .dat and mulgrid. If you have a mulgrid geometry you can use the
t2grid.fromgeo()
method to create the grid inside the .dat file. If you have a .dat file you can reverse-engineer a mulgrid geometry using thet2grid.rectgeo()
method, but only if your grid is rectangular.
Hello dear Adrian,
Can you please give us the full syntax of 't2grid.rectgeo()' ? My TOUGH2 input data file is named INFILE.dat
I tried the following syntax but got errors dat.grid=t2grid().rectgeo(origin_block =None, atmos_volume =1.e25, remove_inactive =True, atmos_type =2, justify ='r',spaces =True, layer_snap =0.1, block_order =None,convention = 2, chars = ascii_lowercase + ascii_uppercase)
That syntax looks ok. The obvious thing that can go wrong with rectgeo()
is that the grid is not actually rectangular (e.g. it has areas of local refinement). What kind of errors did you get?
That syntax looks ok. The obvious thing that can go wrong with
rectgeo()
is that the grid is not actually rectangular (e.g. it has areas of local refinement). What kind of errors did you get?
Hello Adrian,
this is the most revealant error i encounter
ValueError: All-NaN slice encountered
It looks like maybe your input file doesn't have block centres in the grid? You will definitely need those before you can make a geometry from it.
I am seeking to read a .dat file and visualize the mesh static data in actual x, y, and z coordinates. Are there any built-in methods available in PyTough that I can utilize for this purpose?