I don’t have much expertise using paraView so sorry in advance if this gets trivial but I haven’t found anything useful so far.
I am trying to evaluate the outcome of a openFOAM simulation.
In this case I try to place two planes in the simulated pipe and want to plot the difference between those two on one of them (there’s an obstacle between them taking influence in the simulation), so that for any specific point the shown value is something like value.plane2 - value.plane1.
In the future, when you ask a question it helps a lot to post a link to your actual data. It makes it easier for us to answer your specific question.
I believe the best way to compute the difference is to use the Resample With Dataset filter to first combine the data of the two slices together and then use the Calculator to compute the difference. That said, this is complicated by the fact that the Resample With Dataset filter works with spatial locations, so you will have to slice once, move the slice to the location of the second slice, and then resample the original cylinder dataset. You also need to do some array renaming to keep track of the two sets of fields.
Here is the full set of instructions to achieve this.
Use the Slice filter once to create one of the slices.
Use the Rename Arrays filter on the slice to rename the fields you want to take the diff of. For example, if you have a field named field, change its name to something like field_plane1.
Use the Transform filter on the renamed arrays to move the first slice to the position of the second slice. Use the Translate property to move the slice along the axis to the location of the second slice. For example, if the two slices you want to compare are at the y=1 and y=3 planes and the Slice filter is on the y=1 plane, then set up the Transform filter to Translate [0, 2, 0] (2 units in the positive y direction).
Add the Resample With Dataset filter.
4.1 When you first create the filter, you will get a Change Input Dialog. Use this to set the Source Data Arrays input to the original cylinder dataset and the Destination Mesh to your Translated slice.
4.2 Once you’ve set the inputs, turn on advanced properties and turn on the Pass Point Arrays option. This will make available the data from both the cylinder and the first slice (which is now translated as the second slice).
Use the Calculator filter to compute the difference between the field values of the two slices.
Here is an example state file that computes the difference between two slices on the disk_out_ref.ex2 example file that comes with ParaView (in the Examples directory). This data is also a cylinder (except it is oriented along the z axes whereas it looks like yours is oriented along the y axis).
To take it one step further:
If I wanted to compare the same place in two different simulations (e.g. the same geometry but different speed for the liquid), could I also recycle this route? I guess “Transform” wouldn’t be necessary, “Rename Arrays” would be very important to be able to keep the data apart and in “Source Data Arrays” I would have to make a call for the second simulation?
Also I am not sure how I could share the simulation? I can of course attach the .pvsm file but doesn’t it link to the original simulation? Which could take hundreds of GB if I wanted to upload that as well.
Yes, you got it. The Resample With Dataset can be used to combine fields from two overlapping volumes as well.
This FAQ has some information about posting files: I want to share data here, how can I do that ? For practical considerations, it is sometimes necessary to subset your data that represents what you are trying to do.
Hi Kenneth,
I have two vtu datasets, and I have used “resample with dataset” to make the two files have the same number of cells and points. Following point 4 of your instruction, I have turned on the pass point array option. However, when I try to do MSE of density between the two vtu files using calculator, I still can only see one density as shown on the screenshot below. How can I access density of both files and compute MSE please?