Volume fraction and/or mass flow rate

Submitted by msandli on Fri, 05/30/2014 - 17:53

Please move to appropriate section.

I have a small simulation of particles flowing through a wire mesh structure, and I'm interested in calculating the mass flow rate and volume fraction of particles at certain cross sections. I *think* I understand how to calculate mass flow rate by setting up small regions and dumping particle count and velocity from that region. I assume that volume fraction works in a similar fashion, except I only need to know the size of my particles and my dump region.

What I'm wondering is this - is it possible to do these things in Paraview? I can set up planes and slices and such, but I can't seem to extract much useful information out of them.

Further on down the road, what I would like to do would be to plot contours of volume fraction at certain planes, and plot the volume fraction along the vertical axis so I can see how high the particles are piling up on top of the screen, based on particle size, wire size, etc. Can Paraview do any of this?

ckloss's picture

ckloss | Fri, 06/06/2014 - 16:34

Hi msandli,

I dont know how to do this in paraview, but there is a LIGGGHTS feature to do this: fix massflow/mesh

Cheers
Christoph

richti83's picture

richti83 | Thu, 06/12/2014 - 14:43

In Paraview use Clip Filter (combine two planes or use the box in the dropdown menu)
Than attach a Python-Programmable Filter to your clip (Or, If I understand you right, you allready dumped the particles in the measurement region seperatly in your inputskript, to you liggghts/vtk whatever dumpfiles)
In The PPF write this code (It sum's the particle mass (you need to dump ! (or calculate in the loop from your density & volume):

import math
input = self.GetInputDataObject(0, 0)
output = self.GetOutputDataObject(0)
fielddata=input.GetFieldData()
COUNT=input.GetNumberOfPoints()
pd=input.GetPointData()
m=0
v=0
v0=3.02 #change to volume of your measuremt region
#fname="black.csv"
#f = open(fname, 'a')
for i in xrange(COUNT):

m=m+pd.GetArray("Mass").GetValue(i)
r=pd.GetArray("radius").GetValue(i)
vp=math.pi*4.0/3.0*r*r*r
v=v+vp

m/=1000
p=v/v0
r=m/v
#print r
outputarray = vtk.vtkStringArray()
outputarray.SetName("Text")
outputarray.SetNumberOfTuples(1)
outputarray.SetValue(0,"%1.3ft\n%1.3fm3\np=%1.3f" % (m,v,p))
output.GetRowData().AddArray(outputarray)
#f.write("%f,%f,%f\n" % (simtime,m,v))
#f.close

This way you will get an OnScreenDisplay in the 3D View, feel free to adjust the script to your needs (change the outputarray to float and Plot selection over time)
Don't forget to adjust the v0 ("water-volume" of the measurement region to get reasonable solid fraction)

Best,
Christian.

I'm not an associate of DCS GmbH and not a core developer of LIGGGHTS®
ResearchGate | Contact

NTT1508 | Tue, 11/25/2014 - 09:14

Thank Richti very much for your great and active contribution to a wide range of discussions. I am a learner of LIGGGHTS and very happy to know that it can hanndle many problems.