How to use the massflow/mesh command without a mesh .stl file

Min Zhang's picture
Submitted by Min Zhang on Wed, 03/13/2019 - 01:53

I have a complicated geometry and I want to count the particle through any cross-sections (which is basically a plane).

I was thinking to define a plane (for example the "region" command can define a "plane") and then use this massflow/mesh command. I thought it should be straightforward.

But I realized that massflow/mesh command must have a "mesh" and must be based on "fix mesh/surface" command.
It seems that "fix mesh/surface" command should be based on a .stl file. However, I don't have the .stl file for any complicated cross-sections. I only have the .stl files for inlet, outlet, walls.

I am looking for solutions and suggestions.

Thanks!

richti83's picture

richti83 | Wed, 03/13/2019 - 08:54

in ParaView just create a Source -> Plane where you would define the plane in liggghts. Than attach a Filter->Delaunay2D (to convert vtkQuat Element to a triangle), Than File->Save Data as stl.

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

Min Zhang's picture

Min Zhang | Wed, 03/13/2019 - 16:49

I don't know why I cannot save as .stl file, but I can save as .vtk file. I think .vtk file also works for LIGGGHTS "fix mesh/surface" command. Thanks!!

Min Zhang's picture

Min Zhang | Wed, 03/13/2019 - 17:34

fix pos_x_2_test1 all mesh/surface file ../DEM/geom/pos_x_2_larger.vtk type 1

Reading VTK file '../DEM/geom/pos_x_2_larger.vtk'
ERROR: Expecting ASCII VTK mesh file, cannot continue (../input_mesh_tri.cpp:200)

Min Zhang's picture

Min Zhang | Thu, 03/14/2019 - 16:52

Then, I used another version of Paraview on Mac.
I can export both .stl and .vtk data.

--------------------------------------------------------------------------------------------------------------
.vtk data seems correct.
# vtk DataFile Version 4.2
vtk output
ASCII
DATASET POLYDATA
POINTS 4 float
2 2.19 0 2 0 0 2 2.19 0.4
2 0 0.4
METADATA
INFORMATION 2
NAME L2_NORM_RANGE LOCATION vtkDataArray
DATA 2 2 2.99267
NAME L2_NORM_FINITE_RANGE LOCATION vtkDataArray
DATA 2 2 2.99267

POINT_DATA 4
NORMALS Normals float
-1 0 0 -1 0 0 -1 0 0
-1 0 0
METADATA
INFORMATION 2
NAME L2_NORM_RANGE LOCATION vtkDataArray
DATA 2 1 1
NAME L2_NORM_FINITE_RANGE LOCATION vtkDataArray
DATA 2 1 1

TEXTURE_COORDINATES TextureCoordinates 2 float
0 0 1 0 0 1 1 1
METADATA
INFORMATION 2
NAME L2_NORM_RANGE LOCATION vtkDataArray
DATA 2 0 1.41421
NAME L2_NORM_FINITE_RANGE LOCATION vtkDataArray
DATA 2 0 1.41421
--------------------------------------------------------------------------------------------------------------

--------------------------------------------------------------------------------------------------------------
But the .stl data has only two lines:
solid ascii
endsolid
--------------------------------------------------------------------------------------------------------------

Do you have any suggestions?

richti83's picture

richti83 | Fri, 03/15/2019 - 07:06

I used paraview 5.4.1, make sure to select the delauny2d filter in the pipeline browser before you use store data and that you hit apply after adding the filter to the pipeline.

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

Min Zhang's picture

Min Zhang | Fri, 03/15/2019 - 18:25

I know the reasons now.
I have been trying to create a YZ plane (using Source/Plane) and use Delaunay2d filter. I got nothing (literally no file saved at all) when I saved data as a .stl file (but I do have the correct data inside when I saved as .vtk data).

I just realized that when I use the Delaunay2d filter, there is one property called "Projection Plane Mode" with only two options (XY Plane and Best-Fitting Plane) and the default option is XY Plane.
When I tried to create a YZ plane (using Source/Plane) and use the "Best-Fitting Plane", it still doesn't work and I got nothing.

Then, I decided to do this:
Step 1: Create an XY plane instead of a YZ plane using Source/Plane.
Step 2: Use Delaunay2d filter.
Step 3: surfaceTransformPoints -rotate '( (1 0 0) (0 0 1) )' pos_x_0.stl pos_x_0.stl, to exchange X and Z axis (essentially to tranform XY plane to be YZ plane).
Step 4: when the x-position is not zero, I also need to use: surfaceTransformPoints -translate '(1 0 0 )' pos_x_05.stl pos_x_05.stl to finally get what I want.

It is working! Finally, I got the plane .stl file I want!
Anyway, thank you so much for all your help!!

Next step would be to try to use it in LIGGGHTS.
It is working in LIGGGHTS!

-----------------------------------------------------------------------------------------------------------------------------
I have another concern in mind.
Just as I said in my original post, my geometry is complicated and the cross-sections are also very complicated. By complication, I mean these cross-sections are not perfectly rectangular and it could be anything.
Currently, the cross-section .stl files I am using are rectangular and is a little bit larger than the real cross-section of my simulation geometry.
I do think it should be fine, isn't it?

Thanks!!

Min Zhang's picture

Min Zhang | Mon, 03/18/2019 - 18:18

I have ONLY TWO triangles for my cross-section .stl files. So I am thinking does it matter with the evaluation of particle count/mass through this cross-section?

richti83's picture

richti83 | Tue, 03/19/2019 - 09:00

This is not a problem, as LIGGGHTS knows the mass of every particle it just counts when the center of a particle crosses the mesh. so dm/dt is invariant of A_mesh.

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

Min Zhang's picture

Min Zhang | Wed, 03/20/2019 - 03:19

I have a patch called "inlet" whose physical position is x=0. I used "surfaceMeshTriangulate -patches '(inlet)' inlet.stl" to get the "inlet.stl" file and I used this file to evaluate both the total particle count/mass and particle count/mass rate through this cross-section.

In addition, based on the above processes, I got another .stl file at position x=0 (who has two triangles and whose dimension is a little bit larger than inlet.stl) and I also used this .stl file.

I found that some time steps, the particle count are the same but sometimes are not.