CFD Online Discussion Forums

CFD Online Discussion Forums (https://www.cfd-online.com/Forums/)
-   ParaView (https://www.cfd-online.com/Forums/paraview/)
-   -   [OpenFOAM] How to access a variable at two different time instances in Paraview (https://www.cfd-online.com/Forums/paraview/189048-how-access-variable-two-different-time-instances-paraview.html)

Prat991 June 12, 2017 04:14

How to access a variable at two different time instances in Paraview
 
Hello All,

Is there a way to use Programmable filter or any other filter in PARAVIEW on a variable at two different time instances? for example I have to calculate difference of scalar variable pressure p between current time instance and last time instance.

Thank you in advance.

tomf June 13, 2017 06:00

Hi,

I would not know about such a filter, since most of the time the data is stored on the mesh including the current time step. If it is only about the difference between the current and the final time step I would suggest copying the pressure field of the final time step to every time-step that you want the result for and than call it pEnd, or pFinal, or whatever you like and than make a simple calculator filter for the visualization.

Best regards,
Tom

Prat991 June 13, 2017 07:56

Hi Tom,

Thank you very much for your reply. I think i worte in a confusing way, SORRY for that, I want to calculate difference of scalar variable pressure p between CURRENT time instance and PREVIOUS time instance for all the time intervals FOR THE PURPOSE OF VISUALIZATION IN PARAVIEW for multiphase simulation.

in the form of algebra : mag((p-oldTime(p))/deltaT()

I have already calculated the pressure change wrt time at every timestep as a post processing function..... Now I want to Visualize this on the model in paraview.

Can you or anyone can give suggestions how to do this?

tomf June 13, 2017 08:04

Hi,

this confuses me a lot:
Quote:

Originally Posted by Prat991 (Post 652991)
I have already calculated the pressure change wrt time at every timestep as a post processing function..... Now I want to Visualize this on the model in paraview.

Hi, does this mean you have a variable for each time step? In that case you should be able to visualize it like any other variable. Perhaps you should share some screenshots or exact details of what you have available.

Regards,
Tom

Prat991 June 13, 2017 08:35

Quote:

Originally Posted by tomf (Post 652993)
Hi,

this confuses me a lot:


Hi, does this mean you have a variable for each time step? In that case you should be able to visualize it like any other variable. Perhaps you should share some screenshots or exact details of what you have available.

Regards,
Tom

Hi, i can explain you taking a simple case of multiphase dambreak... I am running this damBreak case in a compressibleInterform. In its conrtoldict i have added postprocessing function - swak4Foam for the calculation of pressure change with respect to time i.e "mag((p-oldTime(p))/deltaT())".

This with generate the result data in postprocressing folder in .dat format which will give Excel graphs at the end of the run....

Now, seperately, I also want to visually see this change of pressure with respect to time in paraview.... but I dont know how to access presssre values of the mesh for previous time instance and subtract it to current time instance in paraview..

I dont know which screenshot I can put to clarify more...

Thank you.

Regards,
Pratik

tomf June 13, 2017 08:57

Ok, this is completely different from what I thought you had. So these .dat files are just integral data? Not for every mesh point? Than I am afraid you cannot do what you want with that data.

I would not know if one can combine .dat data with separate mesh information in ParaView. I would suggest clearly explaining this in the ParaView forum instead of the OpenFOAM one and maybe someone can help you there.

On this thread there might be someone who can help you find a way to get the data you want in a format that ParaView can work with, maybe a VTK format is possible? You would need the VTK format for the relevant patch and than put the value of your time derivatives in there for each time step from the .dat file. You can start to have a look by running foamToVTK and try to work from there.

Best regards,
Tom

Prat991 June 13, 2017 09:16

Hi Tom, thanks for your suggestion, but that is quite complex and way out of reach as I am beginner.

At this moment we can keep the post processing data seperately. Lets assume we dont have any post processing data.(Please, sorry i brought that into all this)


So we have only openfoam generated data after run of comprissibleInterform. When we apply .foam file in paraview we will see pressure values on mesh at current time instance only for each time interval. Now similarly I want to visualize dp/dt i.e. [ (current pressure values - previous time instance pressure values)/current time step] for each time interval.

will it be anyhow possible in paraview?



Thank you.

Regards,
Pratik


All times are GMT -4. The time now is 10:05.