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

[General] Strange color mapping for stress

Register Blogs Community New Posts Updated Threads Search

Like Tree1Likes
  • 1 Post By Zetison

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
Old   April 16, 2014, 06:10
Default Strange color mapping for stress
  #1
New Member
 
Jon Vegard Venås
Join Date: Apr 2014
Posts: 16
Rep Power: 12
Zetison is on a distinguished road
My model simply contains four elements (each with 8 nodes with information about displacement and stress for each corner of the block) i get the following result

My modell contains discontinuity at the stresses. In the following image, the magnitude of the stress (von Mises?) is plotted



Between the first and second element it should be discontinuity in the stress. The stresses throughout the first element is supposed to be zero. Is it because the color mapping does not accept discontinuous derivatives? How can it be fixed?

Last edited by Zetison; April 16, 2014 at 11:10.
Zetison is offline   Reply With Quote

Old   April 16, 2014, 16:37
Default
  #2
Retired Super Moderator
 
Bruno Santos
Join Date: Mar 2009
Location: Lisbon, Portugal
Posts: 10,981
Blog Entries: 45
Rep Power: 128
wyldckat is a name known to allwyldckat is a name known to allwyldckat is a name known to allwyldckat is a name known to allwyldckat is a name known to allwyldckat is a name known to all
Greetings Zetison and welcome to the forum!

If I understand you correctly and if I remember finite elements correctly, the problem is that:
  1. The values you have are only located at the nodes of the elements.
  2. ParaView usually represents point data with gradients; while cell (and face) data is represented as-is.
A solution that comes to mind if for you to reduce the number of gradient colours to be used in the representation.
In ParaView 3.12.0, the 3 images in attachment tell the story:
  1. Click on the button where the mouse cursor is at, in the first image.
  2. On the 2nd picture, in the edit box surrounded by the green hand-made circle, use the value 2 or 1. Then click on the "Close" button.
  3. Problem is that you might get something what's shown in the 3rd picture.

If this is not what you're looking for, then it can get really tricky, since it really depends on the representation you're looking for. And example would be helpful.

Best regards,
Bruno
Attached Images
File Type: png Screenshot from 2014-04-16 20:29:16.png (19.3 KB, 7 views)
File Type: png Screenshot from 2014-04-16 20:30:12.png (50.5 KB, 11 views)
File Type: png Screenshot from 2014-04-16 20:30:28.png (14.3 KB, 10 views)
wyldckat is offline   Reply With Quote

Old   April 17, 2014, 03:32
Default
  #3
New Member
 
Jon Vegard Venås
Join Date: Apr 2014
Posts: 16
Rep Power: 12
Zetison is on a distinguished road
Thank you for your reply.

The problem is that since I have discontinuous stresses, each node containing this discontinuity should have 2 set of values describing the stress. The first should describe the limit of the stress as one approches the point from the first element, while the other the limit point of the stress as one approches the point from the second element. But of course, Paraview only stores one value. So to solve the problem, I have to remake the vts file.

One idea that comes to mind was to use several "pieces", but for some reason this gave the exact same problem. I have created a much more simpler example in which two cubes are connected (as "pieces"). The stress in the first cube should be zero througout the domain, while it is non zero in the other:



But as you can see, even with this idea, the problem still remains. The vts file I used is given as follows:

Code:
<?xml version="1.0"?> 
<VTKFile type="StructuredGrid" version="0.1" byte_order="BigEndian" >
  <StructuredGrid  WholeExtent="0 2 0 1 0 1">
  <Piece Extent="0 1 0 1 0 1">
    <PointData Vectors="Disp"  >
      <DataArray type="Float64" Name="Stress" NumberOfComponents="6" format="ascii">
 0 0 0 0 0 0
 0 0 0 0 0 0
 0 0 0 0 0 0
 0 0 0 0 0 0
 0 0 0 0 0 0
 0 0 0 0 0 0
 0 0 0 0 0 0
 0 0 0 0 0 0
      </DataArray>
      <DataArray type="Float32" Name="Displacement" NumberOfComponents="3" format="ascii">
 1 1 1
 1 1 1
 1 1 1
 1 1 1
 1 1 1
 1 1 1
 1 1 1
 1 1 1
      </DataArray>
    </PointData>
    <Celldata>
    </Celldata>
    <Points>
      <DataArray type="Float32" Name="Array" NumberOfComponents="3" format="ascii">
 0 0 0
 1 0 0
 0 1 0
 1 1 0
 0 0 1
 1 0 1
 0 1 1
 1 1 1
      </DataArray>
    </Points>
  </Piece> 
  <Piece Extent="1 2 0 1 0 1">
    <PointData Vectors="Disp"  >
      <DataArray type="Float64" Name="Stress" NumberOfComponents="6" format="ascii">
 0 0 0 0 0 0
 1 0 0 0 0 0
 0 1 0 0 0 0
 1 1 0 0 0 0
 0 0 1 0 0 0
 1 0 1 0 0 0
 0 1 1 0 0 0
 1 1 1 0 0 0
      </DataArray>
      <DataArray type="Float32" Name="Displacement" NumberOfComponents="3" format="ascii">
 1 1 1
 1 1 1
 1 1 1
 1 1 1
 1 1 1
 1 1 1
 1 1 1
 1 1 1
      </DataArray>
    </PointData>
    <Celldata>
    </Celldata>
    <Points>
      <DataArray type="Float32" Name="Array" NumberOfComponents="3" format="ascii">
 1 0 0
 2 0 0
 1 1 0
 2 1 0
 1 0 1
 2 0 1
 1 1 1
 2 1 1
      </DataArray>
    </Points>
  </Piece> 
  </StructuredGrid> 
</VTKFile>
The result of your solution is given below, and is abviously not satisfactory



Are you using Paraview 4.1.0? I guess it could be smart to have the same version
Zetison is offline   Reply With Quote

Old   April 19, 2014, 09:24
Default
  #4
Retired Super Moderator
 
Bruno Santos
Join Date: Mar 2009
Location: Lisbon, Portugal
Posts: 10,981
Blog Entries: 45
Rep Power: 128
wyldckat is a name known to allwyldckat is a name known to allwyldckat is a name known to allwyldckat is a name known to allwyldckat is a name known to allwyldckat is a name known to all
Hi Zetison,

Since you didn't specify which ParaView version you were using, I went with the one easiest for me to use.

Either way, as I mentioned before, you're trying to represent node data, therefore using the surface representation will not give you the results you want to see.
Attached are 2 ideas:
  1. You can use the wireframe representation, but it's not that great either.
  2. Or you can use the Glyph filter and use the settings shown in the second image. This way you get a more accurate representation.
    Note: the "Properties" tab was moved on top of the "Pipeline Browser" simply for the image snapshot.
Best regards,
Bruno
Attached Images
File Type: jpg wireframe.jpg (84.3 KB, 5 views)
File Type: jpg Screenshot from 2014-04-19 13:19:10.jpg (48.7 KB, 7 views)
wyldckat is offline   Reply With Quote

Old   April 23, 2014, 11:19
Default
  #5
New Member
 
Jon Vegard Venås
Join Date: Apr 2014
Posts: 16
Rep Power: 12
Zetison is on a distinguished road
I see. But the surface representation is actually the only thing I am interested in. It gives a better view of how the stress is distributed over a surface of a domain.

If I make each element in a seperate VTS file, and view these files together in the same worksheet, I get the following result



Visually, the above picture represent exactly the represenation I want. However, my modell contains several thousan elements, and it is absurd to make so many vts files to visualize one object. Is it really no way to have this in one file?
Zetison is offline   Reply With Quote

Old   April 25, 2014, 14:21
Default
  #6
Retired Super Moderator
 
Bruno Santos
Join Date: Mar 2009
Location: Lisbon, Portugal
Posts: 10,981
Blog Entries: 45
Rep Power: 128
wyldckat is a name known to allwyldckat is a name known to allwyldckat is a name known to allwyldckat is a name known to allwyldckat is a name known to allwyldckat is a name known to all
Hi Zetison,

OK, I've finally figured out, at least part of the issue.
  1. I didn't notice that you have 2 VTK pieces, one for each cube. That means you defined values for 16 points and not just for 12 points.
  2. You're using a structured grid. This means that there can only be one data value per point, i.e. VTK will merge data from overlapping points.
  3. Even if you use several pieces, the structured system in VTK will enforce that there can be only one data value per point.
I have not tried either one of the following possible solutions, but here's what I can figure out:
  1. You can try to use an unstructured grid instead of a structured one. Then you can repeat points and assign the values the you want for each point.
  2. Use a pseudo-structured grid, where you'll need to introduce ghost cells between each cell, with cell thickness of nearly 0.0... something like 1e-8. I tried to do this manually, but failed miserably
  3. Or you can use multi-block datasets... which would be rather cumbersome, as it would mean that you would have a million or so files (one per cell), all referenced by a single ".vtm" file...


I actually went ahead with the creation of a proof-of-concept of the unstructured grid, by using:
  1. the "Shrink" filter to shrink the cells by a factor of 0.9999 (edit: factor of 1.0 would have been enough);
  2. used "File -> Save Data" and saved to a ".vtu" file.
Then edited the file with a text editor and modified it to suit the data you're using in this example, file named "test2.vtu":
Code:
<VTKFile type="UnstructuredGrid" version="0.1" byte_order="LittleEndian">
  <UnstructuredGrid>
    <Piece NumberOfPoints="16" NumberOfCells="2">
      <PointData>
        <DataArray type="Float64" Name="Stress" NumberOfComponents="6" format="ascii" RangeMin="0" RangeMax="1.7320508076">
          0 0 0 0 0 0
          0 0 0 0 0 0
          0 0 0 0 0 0
          0 0 0 0 0 0
          0 0 0 0 0 0
          0 0 0 0 0 0
          0 0 0 0 0 0
          0 0 0 0 0 0
          0 0 0 0 0 0
          1 0 0 0 0 0
          1 1 0 0 0 0
          0 1 0 0 0 0
          0 0 1 0 0 0
          1 0 1 0 0 0
          1 1 1 0 0 0
          0 1 1 0 0 0
        </DataArray>
        <DataArray type="Float32" Name="Displacement" NumberOfComponents="3" format="ascii" RangeMin="1.7320508076" RangeMax="1.7320508076">
          1 1 1 1 1 1
          1 1 1 1 1 1
          1 1 1 1 1 1
          1 1 1 1 1 1
          1 1 1 1 1 1
          1 1 1 1 1 1
          1 1 1 1 1 1
          1 1 1 1 1 1
        </DataArray>
      </PointData>
      <CellData>
      </CellData>
      <Points>
        <DataArray type="Float32" Name="Points" NumberOfComponents="3" format="ascii" RangeMin="8.6602538191e-05" RangeMax="2.4494081284">
          0.0 0.0 0.0
          1.0 0.0 0.0
          1.0 1.0 0.0
          0.0 1.0 0.0
          0.0 0.0 1.0
          1.0 0.0 1.0
          1.0 1.0 1.0
          0.0 1.0 1.0
          1.0 0.0 0.0
          2.0 0.0 0.0
          2.0 1.0 0.0
          1.0 1.0 0.0
          1.0 0.0 1.0
          2.0 0.0 1.0
          2.0 1.0 1.0
          1.0 1.0 1.0
        </DataArray>
      </Points>
      <Cells>
        <DataArray type="Int64" Name="connectivity" format="ascii" RangeMin="0" RangeMax="15">
          0 1 2 3 4 5
          6 7 8 9 10 11
          12 13 14 15
        </DataArray>
        <DataArray type="Int64" Name="offsets" format="ascii" RangeMin="8" RangeMax="16">
          8 16
        </DataArray>
        <DataArray type="UInt8" Name="types" format="ascii" RangeMin="12" RangeMax="12">
          12 12
        </DataArray>
      </Cells>
    </Piece>
  </UnstructuredGrid>
</VTKFile>
And I got the same result as you showed in the previous post:


Best regards,
Bruno
Attached Images
File Type: jpg test2_vtu.jpg (74.0 KB, 47 views)

Last edited by wyldckat; April 25, 2014 at 15:11. Reason: changed the descrition in the proof-of-concept and added the "edit:" comment
wyldckat is offline   Reply With Quote

Old   April 26, 2014, 09:45
Default
  #7
New Member
 
Jon Vegard Venås
Join Date: Apr 2014
Posts: 16
Rep Power: 12
Zetison is on a distinguished road
It works perfectly! Thank you!

Is it any reason for choosing the somewhat random numbers 1.7320508076 and so on for the ranges?
Zetison is offline   Reply With Quote

Old   April 26, 2014, 10:02
Default
  #8
Retired Super Moderator
 
Bruno Santos
Join Date: Mar 2009
Location: Lisbon, Portugal
Posts: 10,981
Blog Entries: 45
Rep Power: 128
wyldckat is a name known to allwyldckat is a name known to allwyldckat is a name known to allwyldckat is a name known to allwyldckat is a name known to allwyldckat is a name known to all
The field being represented in the image is the magnitude of the "Stress" field. For the point that has the "Stress" vector (1 1 1 0 0 0), means that the magnitude is:
Code:
sqrt(1^2 + 1^2 + 1^2 + 0^2 + 0^2 + 0^2) = 1.732050808
wyldckat is offline   Reply With Quote

Old   April 26, 2014, 10:11
Default
  #9
New Member
 
Jon Vegard Venås
Join Date: Apr 2014
Posts: 16
Rep Power: 12
Zetison is on a distinguished road
Isn't the magnitude of the stress given as von Mises Stress in paraView?
Zetison is offline   Reply With Quote

Old   April 26, 2014, 10:21
Default
  #10
Retired Super Moderator
 
Bruno Santos
Join Date: Mar 2009
Location: Lisbon, Portugal
Posts: 10,981
Blog Entries: 45
Rep Power: 128
wyldckat is a name known to allwyldckat is a name known to allwyldckat is a name known to allwyldckat is a name known to allwyldckat is a name known to allwyldckat is a name known to all
Quote:
Originally Posted by Zetison View Post
Isn't the magnitude of the stress given as von Mises Stress in paraView?
Uhm... depends on which exact equation you're referring to!? Because if you want the one explained here: http://en.wikipedia.org/wiki/Von_Mis...al_formulation - then you will have to use the "Calculator" filter to do this calculation.

Either way, the usual calculation of magnitude automatically made in ParaView for tensors and vectors is the square root of the sum of the square values of each component, as implied in my previous post.
wyldckat is offline   Reply With Quote

Old   April 26, 2014, 10:45
Default
  #11
New Member
 
Jon Vegard Venås
Join Date: Apr 2014
Posts: 16
Rep Power: 12
Zetison is on a distinguished road
It was only my theory since if I add 6 components and call the input "Stress", the components are automatically labeled XX, YY, ZZ, XY, YZ, XZ (which refer to sigma_XX and so on). When I added a 7th component with von Mises stress, the labels went from 1 to 7, and the plot of von Mises stress was (as far as I could see) identical to the plot of the magnitude of the stress...
Zetison is offline   Reply With Quote

Old   April 26, 2014, 10:58
Default
  #12
Retired Super Moderator
 
Bruno Santos
Join Date: Mar 2009
Location: Lisbon, Portugal
Posts: 10,981
Blog Entries: 45
Rep Power: 128
wyldckat is a name known to allwyldckat is a name known to allwyldckat is a name known to allwyldckat is a name known to allwyldckat is a name known to allwyldckat is a name known to all
Quote:
Originally Posted by Zetison View Post
the components are automatically labeled XX, YY, ZZ, XY, YZ, XZ (which refer to sigma_XX and so on).
This must be only a convention for upper matrix data representation. For a 3x3 matrix, the first 3 would be the diagonal and the other 3 the upper triangle; this is probably assuming the matrix is symmetric. If you have 9 elements, it should give the identification for the whole matrix.
This is because ParaView is a general purpose 3D data representation application, therefore it cannot do by default such calculations without further interaction by the user.
wyldckat is offline   Reply With Quote

Old   April 26, 2014, 14:46
Default
  #13
New Member
 
Jon Vegard Venås
Join Date: Apr 2014
Posts: 16
Rep Power: 12
Zetison is on a distinguished road
Ok. Thanks for the information! You have been very helpfull.

One finale question if you have time: Since I want to also add the von Mises stress such that I have 7 components, is it possible to name each component with XX, YY, ZZ, YZ, XZ, XY and von Mises, and skip the magnitude label?
wyldckat likes this.
Zetison is offline   Reply With Quote

Old   April 28, 2014, 16:53
Default
  #14
Retired Super Moderator
 
Bruno Santos
Join Date: Mar 2009
Location: Lisbon, Portugal
Posts: 10,981
Blog Entries: 45
Rep Power: 128
wyldckat is a name known to allwyldckat is a name known to allwyldckat is a name known to allwyldckat is a name known to allwyldckat is a name known to allwyldckat is a name known to all
Quote:
Originally Posted by Zetison View Post
One finale question if you have time: Since I want to also add the von Mises stress such that I have 7 components, is it possible to name each component with XX, YY, ZZ, YZ, XZ, XY and von Mises, and skip the magnitude label?
AFAIK, it's not possible to do that. As I wrote before, the naming is automatic and there is no control over it.

The best that can be done is to have one field with the 6 components of "Stress" and another field just for the "von Mises" result.
wyldckat is offline   Reply With Quote

Reply


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
Strange Nut behaviour with K-OmegaSST nicolarre OpenFOAM Running, Solving & CFD 12 March 19, 2019 21:35
[mesh manipulation] Strange results after using refineMesh on radial 2D-Mesh Zarchias OpenFOAM Meshing & Mesh Conversion 1 October 30, 2018 11:57
Strange STL when using cuttingPlane C-L OpenFOAM Post-Processing 2 September 26, 2017 06:44
[blockMesh] Strange non-hexahedral cells? maka15 OpenFOAM Meshing & Mesh Conversion 3 May 19, 2016 09:56
Strange residuals behaviour xxxx Main CFD Forum 1 July 13, 2013 15:40


All times are GMT -4. The time now is 14:41.