How to create a variable to save initial condition

Hello, how can I create a variable in Paraview to save the initial pressure field?

I want to use it later to compute DP = p(t) - po, being po the pressure at initial time.

My Exodus file that contains the simulation results only contains P(t) at each node, but it does not have saved the initial pressure po.

I want to see how DP changes with time in ParaView view.


I don’t know of any direct way to get the pressure at a time step other than the current one, but you can use the Force Time filter to create a version of the data that is fixed at the initial time and then use the Append Attributes filter to bring the initial time values back into the data set that is changing over time.

Here are some steps that should work. The instructions that you have a point pressure field named P and you want to make a field named DP that is the delta pressure from the initial values. (You probably need ParaView 5.6 or later for this to work.)

  1. Add the Force Time filter to your reader. The default values are probably right for the initial time, so Apply.
  2. Add the Calculator filter to the Force Time data. Set the Result Array Name to P0 and the expression to P. Then Apply. (This basically renames the array.)
  3. Add the Pass Arrays filter to the Calculator data. Turn off all arrays except the P0 array that you created in step 2.
  4. Click the reader in the Pipeline Browser and then hold down the control key (or command key on Mac) and click on the Pass Arrays filter in the Pipeline Browser. (The order you select the items in the Pipeline Browser matters.) Then add the Append Attributes filter and Apply.
  5. Hit the Play button. If your data looks stuck at time step 0, then the inputs to the Append Attributes filter were added backwards. Try deleting it, reselecting the inputs, and adding it again.
  6. Add the Calculator filter to the Append Attributes data. Set the Result Array Name to DP and the expression to P - P0.

Attached here is an example state file that performs a similar operation for the VEL array of can.ex2, which is one of the example files that comes with ParaView (in the Examples directory.

FieldAtTime0.pvsm (756.0 KB)


Thanks so much! :slight_smile: