CFD Online Logo CFD Online URL
www.cfd-online.com
[Sponsors]
Home > Forums > Visualization & Post-Processing Software > ParaView

[General] How to Increase Z axis

Register Blogs Members List Search Today's Posts Mark Forums Read

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
Old   January 4, 2017, 18:05
Default How to Increase Z axis
  #1
New Member
 
Join Date: Jan 2017
Posts: 5
Rep Power: 9
jeosol is on a distinguished road
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.
jeosol is offline   Reply With Quote

Old   January 5, 2017, 14:32
Default
  #2
Member
 
Joshua
Join Date: Dec 2016
Location: St. Louis, Missouri
Posts: 91
Rep Power: 9
Joshua14 is on a distinguished road
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
Joshua14 is offline   Reply With Quote

Old   January 5, 2017, 15:43
Default
  #3
New Member
 
Join Date: Jan 2017
Posts: 5
Rep Power: 9
jeosol is on a distinguished road
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.
Attached Images
File Type: jpg Screenshot from 2017-01-05 13-29-48.jpg (55.3 KB, 68 views)
jeosol is offline   Reply With Quote

Old   January 5, 2017, 15:56
Default
  #4
Member
 
Joshua
Join Date: Dec 2016
Location: St. Louis, Missouri
Posts: 91
Rep Power: 9
Joshua14 is on a distinguished road
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
Joshua14 is offline   Reply With Quote

Old   January 5, 2017, 16:30
Default
  #5
New Member
 
Join Date: Jan 2017
Posts: 5
Rep Power: 9
jeosol is on a distinguished road
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.
Attached Images
File Type: jpg Screenshot from 2017-01-05 14-29-24.jpg (63.3 KB, 47 views)
jeosol is offline   Reply With Quote

Old   May 3, 2017, 13:18
Default
  #6
New Member
 
Tremayne Thomas
Join Date: May 2017
Posts: 6
Rep Power: 8
atthomas is on a distinguished road
Quote:
Originally Posted by Joshua14 View Post
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
atthomas is offline   Reply With Quote

Old   May 3, 2017, 13:21
Default
  #7
Member
 
Joshua
Join Date: Dec 2016
Location: St. Louis, Missouri
Posts: 91
Rep Power: 9
Joshua14 is on a distinguished road
atthomas,

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

Joshua
Joshua14 is offline   Reply With Quote

Old   May 3, 2017, 13:27
Default
  #8
New Member
 
Tremayne Thomas
Join Date: May 2017
Posts: 6
Rep Power: 8
atthomas is on a distinguished road
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
atthomas is offline   Reply With Quote

Old   May 3, 2017, 13:35
Default
  #9
Member
 
Joshua
Join Date: Dec 2016
Location: St. Louis, Missouri
Posts: 91
Rep Power: 9
Joshua14 is on a distinguished road
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
Joshua14 is offline   Reply With Quote

Old   May 3, 2017, 13:49
Default
  #10
New Member
 
Tremayne Thomas
Join Date: May 2017
Posts: 6
Rep Power: 8
atthomas is on a distinguished road
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
atthomas is offline   Reply With Quote

Old   May 3, 2017, 13:59
Default
  #11
Member
 
Joshua
Join Date: Dec 2016
Location: St. Louis, Missouri
Posts: 91
Rep Power: 9
Joshua14 is on a distinguished road
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
Joshua14 is offline   Reply With Quote

Old   May 3, 2017, 14:08
Default
  #12
New Member
 
Tremayne Thomas
Join Date: May 2017
Posts: 6
Rep Power: 8
atthomas is on a distinguished road
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
atthomas is offline   Reply With Quote

Old   May 3, 2017, 14:30
Default
  #13
Member
 
Joshua
Join Date: Dec 2016
Location: St. Louis, Missouri
Posts: 91
Rep Power: 9
Joshua14 is on a distinguished road
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
Joshua14 is offline   Reply With Quote

Old   May 3, 2017, 17:12
Default
  #14
New Member
 
Tremayne Thomas
Join Date: May 2017
Posts: 6
Rep Power: 8
atthomas is on a distinguished road
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 is offline   Reply With Quote

Old   May 4, 2017, 06:47
Default
  #15
New Member
 
Tremayne Thomas
Join Date: May 2017
Posts: 6
Rep Power: 8
atthomas is on a distinguished road
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
atthomas is offline   Reply With Quote

Old   May 4, 2017, 12:19
Default
  #16
Member
 
Joshua
Join Date: Dec 2016
Location: St. Louis, Missouri
Posts: 91
Rep Power: 9
Joshua14 is on a distinguished road
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
Joshua14 is offline   Reply With Quote

Old   May 10, 2017, 04:37
Default
  #17
New Member
 
Join Date: Jan 2017
Location: Germany
Posts: 19
Rep Power: 9
beral is on a distinguished road
Quote:
Originally Posted by atthomas View Post
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.
beral is offline   Reply With Quote

Reply

Tags
fluid flow, paraview, scale z-axis

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are Off
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
[DesignModeler] axis display disparity of model and triad ram881973 ANSYS Meshing & Geometry 14 November 18, 2020 02:21
[blockMesh] Wierd behaviour of blockMesh creating axis in wedge rcastilla OpenFOAM Meshing & Mesh Conversion 1 December 4, 2018 07:24
[General] how to increase thickness of axis and ticks in Paraview 5 swap_9068 ParaView 0 September 17, 2018 07:08
[Other] dynamic Mesh with angular velocity not parallel to x axis donQi OpenFOAM Meshing & Mesh Conversion 5 October 3, 2014 00:19
Axis treatment in axisymmetrical problem Jakob1 OpenFOAM Pre-Processing 2 August 25, 2014 04:09


All times are GMT -4. The time now is 06:53.