selecting/unselecting bodies with paraview

General discussion about Elmer

selecting/unselecting bodies with paraview

Postby pilafa » 23 Oct 2012, 18:36

Hi.

Is there a way of selecting / unselecting bodies of an assembly with paraview (when a code_aster or openfoam model in opened with paraview for example, you can choose which groups you want to plot)?

I create the paraview files that way:

Code: Select all
Solver 2
  Exec Solver = String "after timestep"   
  !Exec Solver = String "after all"
  !exec interval = 1
  Equation = String "ResultOutput"
  Procedure = File "ResultOutputSolve" "ResultOutputSolver"
  Output File Name = String "paraver." !or any other output file name of your choice
  Output Format = String "vtu"
  Vtu Format = Logical True
  Scalar Field 1 = Temperature 
End


Thanks!
Pierre
pilafa
 
Posts: 56
Joined: 17 Apr 2012, 00:33
Location: Barcelona

Re: selecting/unselecting bodies with paraview

Postby mzenker » 23 Oct 2012, 19:19

Hi,

AFAIK, Elmer saves the results by node, not by group or body. Maybe this could be changed in resultoutputsolver, but this would require knowledge about how the nodes are assigned to bodies within Elmer, and how bodies are represented in vtk format.

Matthias
mzenker
 
Posts: 1615
Joined: 07 Dec 2009, 11:49
Location: Germany

Re: selecting/unselecting bodies with paraview

Postby raback » 23 Oct 2012, 20:41

Hi

If your Paraview output is new enough you could set
Code: Select all
Save Geometry Ids = Logical True

-Peter
raback
Site Admin
 
Posts: 3139
Joined: 22 Aug 2009, 11:57
Location: Espoo, Finland

Re: selecting/unselecting bodies with paraview

Postby pilafa » 17 Mar 2014, 18:21

Hi,

I re-open this old post.

I am using this version of Elmer:
MAIN: Library version: 7.0 (Rev: 6558)

I try to have the groups of solid and boundary selectable in Paraview.

Code: Select all
Solver 3
  Exec Solver = after timestep
  Equation = "result output"
  Procedure = "ResultOutputSolve" "ResultOutputSolver"
  Output File Name = "case"
  Output Format = String "vtu"
  Binary Output = True
  Single Precision = True
  Save Geometry Ids = True
  Scalar Field 1 = Pressure
  Scalar Field 2 = Temperature n
  Vector Field 1 = Velocity
  Calculate Loads=True
End


I trided with Paraview 3.10 and 4.1. But don't see any option of selecting the different groups or parts.

Thanks!
Pierre
pilafa
 
Posts: 56
Joined: 17 Apr 2012, 00:33
Location: Barcelona

Re: selecting/unselecting bodies with paraview

Postby pilafa » 18 Mar 2014, 13:47

Hi,

I found a possible solution on those slides.

I use "Save Geometry Ids = True" and the threshold filter to select entities, but it's not working very well. It seems that not all the surface have a different ID, and I have a lot of surfaces so it is difficult to mange :roll:

I have some groups in my mesh. I use them to define boundary conditions...when doing the conversion from UNV to Elmer mesh format, ElmerGrid lists those groups in mesh.name. It looks like:

Code: Select all
! ----- names for bodies -----
$ body_air = 1
$ body_cpu = 2
$ body_sink = 3
! ----- names for boundaries -----
$ open = 1
$ walls = 2
$ wall_cylindre = 3
$ wall_sink = 4
$ wall_cpu = 5


I would like to be able to select those groups. When using some other codes, Paraview allows you to see or not those groups. Is it possible with Elmer?

Also, there is no lines in the post-process. It sometimes makes difficult the visualization. Is there a way to see the lines?

Many thanks! :D
Pierre
pilafa
 
Posts: 56
Joined: 17 Apr 2012, 00:33
Location: Barcelona

Re: selecting/unselecting bodies with paraview

Postby raback » 19 Mar 2014, 11:03

Hi

I haven't found a way to impelement the groups in vtu format. The format is specified in
http://www.vtk.org/VTK/img/file-formats.pdf, see page 14->.
Perhaps somebody can tell how it should be done?

You can save only bulk and only boundaries, or mask the saving. These are sometimes useful.

-Peter
raback
Site Admin
 
Posts: 3139
Joined: 22 Aug 2009, 11:57
Location: Espoo, Finland

Re: selecting/unselecting bodies with paraview

Postby Martina » 19 Mar 2014, 22:14

Hi Pierre,

I don't know what you mean by "groups" or "seeing lines", but why don't you define an additional variable which you set in the Initial (Boundary?) Condition to different values for your different groups (bodies ?)). Then you could use the Threshold function of paraview on this variable to select one.

Martina
Martina
 
Posts: 39
Joined: 17 Apr 2013, 14:06

Re: selecting/unselecting bodies with paraview

Postby pilafa » 24 Mar 2014, 13:59

Hi,

Finally, I managed to do what I wanted: selecting only some entities (see image attached).
I used the Threshold filter with the "Geometry Ids" value. It's not straightforward because you have to figure out which entity has which number assign to it, but it do the job! :geek:

Martina wrote:I don't know what you mean by "groups" or "seeing lines"


I mean the groups I defined to apply my boundary conditions. For example, I have a group for the cylindres (I impose T and u on the cylinder) and one for the CPU and one for the heat sink, etc...those groups have an id number assigned, and I know which one because it is defined in "mesh.name" file.

Martina wrote:why don't you define an additional variable which you set in the Initial (Boundary?) Condition to different values for your different groups (bodies ?)). Then you could use the Threshold function of paraview on this variable to select one.


Good idea. You mean defining a "dummy" variable just the select them easily? How can I do that?

Tanks,
Pierre
Attachments
anim2.0039.png
anim2.0039.png (95.38 KiB) Viewed 3009 times
pilafa
 
Posts: 56
Joined: 17 Apr 2012, 00:33
Location: Barcelona

Re: selecting/unselecting bodies with paraview

Postby Martina » 02 Apr 2014, 10:28

Hi Pierre,

sorry, I still don't understand what you understand by "groups".
In the sif-file there is Body's and Boundary Conditions, but I don't see what you mean by group, several Boundary Conditions?
Anyway, if you can do with "Geometry Id's" what you want, you are probably done? I think it should be not too difficult to translate between the Geometry Id's and the Boundary-Condition numbers in the sif-file, at least in my case the main body has GeometryID=1 and then the Boundary Condition 1/2/3 in the sif have GeometryID 101/102/103 and so on.
With respect to the dummy variable: you could simply create a variable by running a Dummy, SaveMaterial or SaveBoundaryCondition Solver and assign them a value.
For example
Code: Select all
Boundary Conditions 1
  dummyvar = Real 1.0
...
Boundary Condition 2
  dummyvar = Real 1.0
....
Boundary Condition 3
  dummyvar = Real 2.0
....

Then in paraview you could use either the Threshold filter or use Edit → Find Data, find Cell, GeometryIDs is = … or dummyvar = ..., Run Extract Selection to select what you want.

Martina
Martina
 
Posts: 39
Joined: 17 Apr 2013, 14:06

Re: selecting/unselecting bodies with paraview

Postby Wil » 05 Mar 2017, 00:25

Good afternoon, Dear Martina,

I tried to set up a model in the way you suggested.... using a dummy variable in my case 'b' to select different boundaries in Paraview.
But it does not work... cant find 'b' in Paraview (only see 'potential' and 'GeometryIds'). Here my .sif file and the model as .zip
Code: Select all
Header
  CHECK KEYWORDS Warn
  Mesh DB "." "."
  Include Path ""
  Results Directory ""
End

Simulation
  Max Output Level = 5
  Coordinate System = Cartesian
  Coordinate Mapping(3) = 1 2 3
  Simulation Type = Steady state
  Steady State Max Iterations = 1
  Output Intervals = 1
  Timestepping Method = BDF
  BDF Order = 1
  Solver Input File = case.sif
  Post File = case.vtu
End

Constants
  Gravity(4) = 0 -1 0 9.82
  Stefan Boltzmann = 5.67e-08
  Permittivity of Vacuum = 8.8542e-12
  Boltzmann Constant = 1.3807e-23
  Unit Charge = 1.602e-19
End

Body 1
  Target Bodies(1) = 1
  Name = "Body Property 1"
  Equation = 1
  Material = 1
End

Solver 2
  Equation = Electrostatics
  Variable = Potential
  Procedure = "StatElecSolve" "StatElecSolver"
  Exec Solver = Always
  Stabilize = True
  Bubbles = False
  Lumped Mass Matrix = False
  Optimize Bandwidth = True
  Steady State Convergence Tolerance = 1.0e-5
  Nonlinear System Convergence Tolerance = 1.0e-7
  Nonlinear System Max Iterations = 20
  Nonlinear System Newton After Iterations = 3
  Nonlinear System Newton After Tolerance = 1.0e-3
  Nonlinear System Relaxation Factor = 1
  Linear System Solver = Iterative
  Linear System Iterative Method = BiCGStab
  Linear System Max Iterations = 500
  Linear System Convergence Tolerance = 1.0e-10
  BiCGstabl polynomial degree = 2
  Linear System Preconditioning = Diagonal
  Linear System ILUT Tolerance = 1.0e-3
  Linear System Abort Not Converged = False
  Linear System Residual Output = 1
  Linear System Precondition Recompute = 1
End

Solver 1
  Equation = Result Output
  Output Format = Vtu
  Procedure = "ResultOutputSolve" "ResultOutputSolver"
  Output File Name = case
  Exec Solver = After Simulation
End

Equation 1
  Name = "Equation 1"
  Active Solvers(2) = 2 1
End

Material 1
  Name = "Air (room temperature)"
  Viscosity = 1.983e-5
  Heat expansion Coefficient = 3.43e-3
  Heat Conductivity = 0.0257
  Relative Permittivity = 1.00059
  Sound speed = 343.0
  Heat Capacity = 1005.0
  Density = 1.205
End

Boundary Condition 1
  Target Boundaries(1) = 1
  Name = "BoundaryCondition 1"
b = Real 1.0
End

Boundary Condition 2
  Target Boundaries(1) = 2
  Name = "BoundaryCondition 2"
b = Real 2.0
End

I tried also to specify 'b' as variable in 'Result Output'... but no luck.

raback wrote:Hi

I haven't found a way to impelement the groups in vtu format. The format is specified in
http://www.vtk.org/VTK/img/file-formats.pdf, see page 14->.
Perhaps somebody can tell how it should be done?

You can save only bulk and only boundaries, or mask the saving. These are sometimes useful.

-Peter

It is possible to use names from .unv files to access boundaries an domains (viewtopic.php?f=7&t=4220&p=15341&hilit=use+names&sid=672c2b3d95ee5d3a7dc948f110917fd1#p14925 keyword:'Use Mesh Names = True'). It would be very usefull to export these names also for the use in Paraview (keyword:"Export Mesh Names"??).
The GeomIds are nice but can vary if I cange my geometry and use the above mentioned names in Elmer.... It would be very very helpfull when we could use the same names for groups during mesh-creation, model set-up in Elmer and postprocessing!!
Thanks in advance,
Wil
Attachments
export.zip
(151.01 KiB) Downloaded 45 times
Wil
 
Posts: 61
Joined: 10 Jan 2014, 13:26
Location: Austria

Next

Return to General

Who is online

Users browsing this forum: No registered users and 2 guests