Substract a value at probe location from a field

Hi all,

I have a simulation with a time-dependent pressure field around an object in a complex 2D flow. At any given time point, the pressure variations in space around the object of interest are much smaller than the pressure variations in the whole domain, thus making it difficult to qualitatively assess the pressure distribution around the object.

Thus, I would like to visualise a relative pressure dP(t) = P(t) - Pref(t), where Pref(t) is the pressure at time t, at a manually selected position around the object (for instance at the cell whose ID number is 9272). Then, making a 2D visualisation of dP with appropriate bounds for the colormap would allow for a qualitative assessment of the pressure distibution around the object.

My problem is that I cannot manage to compute such a relative pressure.
I have tried using a Python calculator with the formula ‘P-P[9272]’, however that return an “index out of bounds” error. That’s strange, because the formula ‘P.size’ return 21000 (my total number of cells) everywhere…

I have also attempted to use macros, setting a probe at the desired point, however I do not manage to access the probe data in the Python calculator…

Note that a formula ‘P-mean(P)’ works, but then deltaP is not centered on the pressure values around the object, but on the mean pressure of the whole domain…

Thanks a lot in advance for your advice !

This should work, but you need multiple inputs for that.

I have finally managed to do it with a macro, setting up the probe anew at each time step and updating the Python calculator by hardcoding the probe value: ‘P-{:.15e}’.format(pressure_probe)’.
This works fine for an export of PNGs of all steps, which can then be recombined into a movie. But that is not practical for on-the-fly visualisation…

I would very interested to known if there is another more “interactive” solution.

Thanks !