CFD Online Discussion Forums

CFD Online Discussion Forums (https://www.cfd-online.com/Forums/)
-   ParaView (https://www.cfd-online.com/Forums/paraview/)
-   -   [General] How to Increase Z axis (https://www.cfd-online.com/Forums/paraview/182253-how-increase-z-axis.html)

jeosol January 4, 2017 17:05

How to Increase Z axis
 
Hello guys,

I am using Paraview 4.4.0 GUI and I need some help with visualization option to scale the grid in the z-direction only -- i.e., stretch the grid in this direction. I am relatively new to using Paraview and have used some other commercial viewers that allow you to scale the 3d grid in the z-direction.

My model dimensions are (x,y,z) 10000ft by 100ft by 500ft discretized into 100 by 1 by 20 grids.. I am modeling fluid flow in the X-Z direction (Z is vertical/depth) only (2-phase flow, oil and water) and want to use paraview for the visualization. I write all the vtk files correctly and the time-lapse of the water saturations in the grid block are fine. The only problem is that I want to increase the Z direction (vertical depth) before I take a snapshot or movie. in my case because X >> Z. Hope this makes sense.

Thanks for your help. Also, if there are other visualization tools I could be using, please let me know. My data type are essentially block-centered parameters.

Joshua14 January 5, 2017 13:32

jeosol,

Once your .foam file is loaded all you need to use is the calculator filter. You can either find the filter in the Filters -> Alphabetical section or if its on your toolbar.

Once the calculator filter is opened, under properties
1)Make sure Attribute Mode is set on "Point Data"
2)Select "Coordinate Results"
3)Use something along the lines of
coordsX*iHat+coordsY*jHat+0.5*coordsZ*kHat

0.5 is simply a scaler
coordsX/Y/Z is the current X/Y/Z positions
i/j/kHat is what will be your final coordinate axis (aka you can flip axis)

Hope this helps.

Joshua

jeosol January 5, 2017 14:43

1 Attachment(s)
Hi Joshua,

Thanks for your reply. I have tried to follow your instructions as best as I understood it. First of all, I am not using a .foam file (not sure what that is). I am loading my files using several .vtk files (one sample for each time step and part of the file is shown file). The files are written by a small script and have the following format. I can't upload it due to size limitations.

# vtk DataFile Version 3.0
Unstructured grid example: model dimensions 100x1x20
ASCII
DATASET UNSTRUCTURED_GRID
POINTS 16000 float
0.000 0.000 -10000.000
100.000 0.000 -10000.000
100.000 100.000 -10000.000
0.000 100.000 -10000.000
0.000 0.000 -10029.000
100.000 0.000 -10029.000
100.000 100.000 -10029.0

x-points run from 0 to 10000 while z-points indicating depth run from 10000 to around 10500.

Following your instructions, I noticed the "axis guides" on my grid did increase in size but the grid still remains the same. I have included a screenshot of my paraview with the settings on the left.

Thanks for your help.

Joshua14 January 5, 2017 14:56

Sorry about that. I made a faulty assumption that you were post processing CFD files from OpenFOAM (aka .foam).

The steps should still work for a .vtk. Its hard to see your picture. Make sure that only the calculator is visible after you hit apply else your original file will block you from being able to see that it shrinked (assuming that it did).

Joshua

jeosol January 5, 2017 15:30

1 Attachment(s)
Joshua,

You are the man. Thanks it worked okay the first time around. I had the other case/model selected so I was not able to see the one with new computed arrays. See attached file.

The axis is zoomed correctly and my animation is much better. I am doing calculations elsewhere and writing the .vtk files to be viewed with Paraview.

Thanks once again. I do appreciate your help.

Jeosol.

atthomas May 3, 2017 12:18

Quote:

Originally Posted by Joshua14 (Post 632177)
jeosol,

Once your .foam file is loaded all you need to use is the calculator filter. You can either find the filter in the Filters -> Alphabetical section or if its on your toolbar.

Once the calculator filter is opened, under properties
1)Make sure Attribute Mode is set on "Point Data"
2)Select "Coordinate Results"
3)Use something along the lines of
coordsX*iHat+coordsY*jHat+0.5*coordsZ*kHat

0.5 is simply a scaler
coordsX/Y/Z is the current X/Y/Z positions
i/j/kHat is what will be your final coordinate axis (aka you can flip axis)

Hope this helps.

Joshua

HI Joshua,

I was trying to achieve the same thing (stretch the Z-axis of my model). However, when i try this approach I get an error

'Coordinate output specified, but output is not polydata or unstructured grid'

Do you have any idea what would cause this?

I am using Paraview 5.0.0

Thanks,
Ariel

Joshua14 May 3, 2017 12:21

atthomas,

What kind of file are you using in ParaView (.foam, .stl, etc...). Are you doing any additional steps before stretching it?

Joshua

atthomas May 3, 2017 12:27

I am using a .vtk file. Similar to the original problem posted, I did some simulations with another software and I am trying to view the data in Paraview. My model XY dimensions are much larger so I would just like to stretch the Z axis´for better viewing.

I just opened the .vtk file, I have not done any additional steps inside of Paraview.

Cheers,
AT

Joshua14 May 3, 2017 12:35

atthomas,

It should work. I checked and it does appear that there are two resolved bugs involving vtk's in version 5.0.0. Maybe try a new version of ParaView like 5.2 or 5.3. Versions 4.1 and 4.4 should also be stable.

I'm sorry I can't pin point the issue. If I come up with anything else I will let you know. In the mean time try one of those (not all).

How did you create the *.vtk?

Joshua

atthomas May 3, 2017 12:49

ok I will try to see if I can get another version.

The file was generated by a simulation code called SHEMAT which models groundwater flow through a porous medium. My model is a simple 3 layer subsurface model. Actually a test cube of a much larger model. Below you can see what the vtk file header looks like in case that is of any help.

# vtk DataFile Version 2.0
RotTest_2_time_out_1
ASCII
DATASET RECTILINEAR_GRID
DIMENSIONS 24 45 3

Joshua14 May 3, 2017 12:59

atthomas,

Quote:

# vtk DataFile Version 2.0
RotTest_2_time_out_1
ASCII
DATASET RECTILINEAR_GRID
DIMENSIONS 24 45 3
Base on your title it shows that your .vtk is a grid (Cell based). My example is for point data.

See if you can do it by having Attribute Mode as Cell Data.

Joshua

atthomas May 3, 2017 13:08

Hi Joshua,

Thanks so much for the quick feedback. So I loaded the Paraview 4.4.0 version.

I tried the old way (got the same unstructured grid error).

I changed the attribute more to cell data but then I got a different error. maybe the syntax has to be different?

I got the following:

Syntax error: expecting a variable name; see position 0

Cheers,
AT

Joshua14 May 3, 2017 13:30

atthomas,

Do you have a *.vtk like this that doesn't work that you can share? That way I can try some things on my end instead of sending you guesses?

Joshua

atthomas May 3, 2017 16:12

Hi Joshua,

Yes no problem, I will post the .vtk file first thing tomorrow. I already left for the day and I don't have access to the files from here at home.

Cheers,
AT

atthomas May 4, 2017 05:47

Hi Joshua,

A copy of my .vtk file can be found here:
https://drive.google.com/file/d/0B2j...ew?usp=sharing

The file is a simple 3 layer geological model. There are a number of parameters that are output by the software, such as permeability, porosity etc, so that is why it's a bit large.

Cheers,
AT

Joshua14 May 4, 2017 11:19

atthomas,

Thank you for sending me the file.

It seems that ParaView does not identify that your file actually has a grid. I got it to work by running the filter "CleantoGrid" and I was able to transform the coordinates.

Hope this works on your end!
Joshua

beral May 10, 2017 03:37

Quote:

Originally Posted by atthomas (Post 647520)
HI Joshua,

I was trying to achieve the same thing (stretch the Z-axis of my model). However, when i try this approach I get an error

'Coordinate output specified, but output is not polydata or unstructured grid'

Do you have any idea what would cause this?

I am using Paraview 5.0.0

Thanks,
Ariel

Use the 'Transforming' Tool in the Display-Option. There is a line 'Scale' with the standard values (1, 1, 1). To stretch in z-direction, enter your stretch-parameter in the third value, for example (1, 1, 2) to double the z-length of your object.

Since this are display-options, the object data itself may be unchanged (didn't tested it). If you want be sure to stretch the object itself, use the 'Transform' filter. There is the same 'Scale' option.

I tried both solutions with your file and they both worked fine.


All times are GMT -4. The time now is 09:12.