CFD Online Logo CFD Online URL
www.cfd-online.com
[Sponsors]
Home > Forums > Software User Forums > OpenFOAM > OpenFOAM Running, Solving & CFD

Calculating Density in ParaView

Register Blogs Community New Posts Updated Threads Search

Like Tree5Likes
  • 2 Post By jherb
  • 1 Post By mahsankhan
  • 2 Post By Tobermory

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
Old   July 4, 2020, 14:06
Question Calculating Density in ParaView
  #1
New Member
 
Ahsan
Join Date: Nov 2019
Location: Bologna, Italy
Posts: 27
Rep Power: 7
mahsankhan is on a distinguished road
Dear Users,

Can someone please help with how to get the density in ParaView?
I am using interMixingFoam solver of OpenFOAM, and the parameters I get after the run are p, p_rgh, U, alpha.water, alpha.air, alpha.other, nut, nuTilda... but there is no rho for the density...

I want to have a density profile since my density in the domain changes as two fluids mix together. Can I get it somehow? Is there a way to achieve that?

I tried to use the calculator filter with (p-p_rgh)/(9.81*coordsZ) but this gives huge values at the bottom of the domain, probably due to a "zero" in the denominator... can someone please help me with this issue...?

Thanks a lot in advance

Have a good day!!!
mahsankhan is offline   Reply With Quote

Old   July 20, 2020, 20:43
Default
  #2
Senior Member
 
Joachim Herb
Join Date: Sep 2010
Posts: 650
Rep Power: 22
jherb is on a distinguished road
You should be able to write rho with a writeObjects function object: https://www.openfoam.com/documentati...teObjects.html
dlahaye and mahsankhan like this.
jherb is online now   Reply With Quote

Old   May 27, 2021, 09:50
Smile Alternate and faster solution
  #3
New Member
 
Ahsan
Join Date: Nov 2019
Location: Bologna, Italy
Posts: 27
Rep Power: 7
mahsankhan is on a distinguished road
Quote:
Originally Posted by jherb View Post
You should be able to write rho with a writeObjects function object: https://www.openfoam.com/documentati...teObjects.html

Thank you for your reply.
However, what you suggested would need the simulation to start over again. There exist another option:
Once you have run the OpenFOAM simulation, just open it in ParaView and apply the calculator filter like this (-p+p_rgh)/(9.81*(CoordZ)) and this will give you the density for the whole domain.
tariq likes this.
mahsankhan is offline   Reply With Quote

Old   May 28, 2021, 11:13
Default
  #4
Senior Member
 
Join Date: Apr 2020
Location: UK
Posts: 745
Rep Power: 14
Tobermory will become famous soon enough
Quote:
Originally Posted by mahsankhan View Post
Thank you for your reply.
However, what you suggested would need the simulation to start over again.
No - you misunderstood jherb - just run the solver with the -postProcess flag and the writeObjects func, and it will spit out the field for you without running any more of the simulation. Eg.:

Code:
someFoamSolver -postProcess -latestTime -func "writeObjects(h, rho)"
jherb and Balzuka like this.
Tobermory is offline   Reply With Quote

Old   May 6, 2024, 12:16
Default
  #5
New Member
 
tariq's Avatar
 
Tariq Ridwan
Join Date: Jun 2013
Location: Barcelona
Posts: 17
Rep Power: 13
tariq is on a distinguished road
Are you using an incompressible solver?
__________________
tariqridwan.github.io/
tariq is offline   Reply With Quote

Reply

Tags
density, filter, openfoam, paraview, pressure


Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are Off
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
[General] Calculating transpose of a tensor in Paraview Giri_24 ParaView 0 April 14, 2020 00:13
UDF for modifying density of mixture phase during the calculating process sola86 Fluent UDF and Scheme Programming 2 May 28, 2019 10:24
A problem about density in liquid air definition alloveyou CFX 2 June 14, 2012 15:20
paraFoam reader for OpenFOAM 1.6 smart OpenFOAM Installation 13 November 16, 2009 22:41
REAL GAS UDF brian FLUENT 6 September 11, 2006 09:23


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