Interesting project: DesignSPHysics fluid simulator

A subforum specific to the development of the OpenFoam-based workbenches ( Cfd https://github.com/qingfengxia/Cfd and CfdOF https://github.com/jaheyns/CfdOF )

Moderator: oliveroxtoby

thschrader
Veteran
Posts: 3129
Joined: Sat May 20, 2017 12:06 pm
Location: Germany

Re: Interesting project: DesignSPHysics fluid simulator

Post by thschrader »

Hello everyone,
the designsphysics-macro now has the possibility to add inlet/outlet
to the simulation. For instance to simulate the flow around a cylinder.
Coupling with chrono is also possible.
Problem: I have absolutely no idea how to do the setup. There are tricky
submenues. The youtube channel has a lot of examples, but no workflow
how to setup inlet/outlet with designsphysics. Any ideas? Thanks.
https://www.youtube.com/user/DualSPHysics/videos
https://projectchrono.org/
new_design.JPG
new_design.JPG (151.61 KiB) Viewed 4319 times
User avatar
johnwang
Veteran
Posts: 1345
Joined: Sun Jan 27, 2019 12:41 am

Re: Interesting project: DesignSPHysics fluid simulator

Post by johnwang »

thschrader wrote: Mon Sep 10, 2018 4:34 pm Create a new group.
This one is cool.
Last edited by johnwang on Fri Jun 05, 2020 4:16 am, edited 1 time in total.
hfc series CAE workbenches for FreeCAD (hfcNastran95, hfcMystran, hfcFrame3DD, hfcSU2 and more)
thschrader
Veteran
Posts: 3129
Joined: Sat May 20, 2017 12:06 pm
Location: Germany

Re: Interesting project: DesignSPHysics fluid simulator

Post by thschrader »

johnwang wrote: Thu Jun 04, 2020 4:14 am I wrote a Macro to open the folder which contains all the vtk/vtu result files. It adds the group and loads all the results under that group. It's a pity I can't set the display mode and field with program now.
Thanks for the hint.

dualsphysics:
Built in vtk-converter and paraview link for viewing.
postprocessing_points.JPG
postprocessing_points.JPG (17.28 KiB) Viewed 4262 times

FEM:
I use this tool for vtk-conversion (from user mamah)
ccxfrd2vtk.zip
(58.44 KiB) Downloaded 107 times
https://forum.freecadweb.org/viewtopic.php?f=18&t=11664
Copy frd-result in bin/release folder, drag with mouse over exe, conversion starts.
postprocessing_FEM.JPG
postprocessing_FEM.JPG (19.49 KiB) Viewed 4262 times
User avatar
johnwang
Veteran
Posts: 1345
Joined: Sun Jan 27, 2019 12:41 am

Re: Interesting project: DesignSPHysics fluid simulator

Post by johnwang »

thschrader wrote: Mon Sep 10, 2018 4:34 pm
Import some surface_xxx.vtk series from your dualsphysics output folder into Freecad.
Use Import with FEM Result vtk option.
Activate the FEM workbench.
Doubleclick on every surface and adjust Mode to „surface with edges“
Create a new group.
Move all surfaces into the group an hide them.

Click on Group in model-tree, run the MovingMesh macro
My macro now can set display Mode and field (default to Surface & pressure). Just run it to open the folder where vtu/vtk files are stored. A Group is created. Then select that group, run the MovingMesh macro to do animation.
hfcImportVTKfolder.FCMacro
(1.13 KiB) Downloaded 116 times
hfc series CAE workbenches for FreeCAD (hfcNastran95, hfcMystran, hfcFrame3DD, hfcSU2 and more)
thschrader
Veteran
Posts: 3129
Joined: Sat May 20, 2017 12:06 pm
Location: Germany

Re: Interesting project: DesignSPHysics fluid simulator

Post by thschrader »

@johnwang:
can you try to open the vtk/stl (in zip) with FC?
I get only one point, not the complete scene as in paraview.
vtk_and_stl_files.zip
(519.63 KiB) Downloaded 115 times
vtk35_Freecad.JPG
vtk35_Freecad.JPG (14.36 KiB) Viewed 4208 times
vtk35_Paraview.JPG
vtk35_Paraview.JPG (18.86 KiB) Viewed 4208 times
User avatar
johnwang
Veteran
Posts: 1345
Joined: Sun Jan 27, 2019 12:41 am

Re: Interesting project: DesignSPHysics fluid simulator

Post by johnwang »

thschrader wrote: Fri Jun 05, 2020 5:53 am can you try to open the vtk/stl (in zip) with FC?
Do you mean open zip directly without unzip? No.

After unzip, I can open the vtk and the stl one by one. But they are not in the same scale. stl is larger. Maybe the unit is changed, m-->mm? Is there a way to scale down the stl?
vel.jpg
vel.jpg (90.42 KiB) Viewed 4199 times
hfc series CAE workbenches for FreeCAD (hfcNastran95, hfcMystran, hfcFrame3DD, hfcSU2 and more)
thschrader
Veteran
Posts: 3129
Joined: Sat May 20, 2017 12:06 pm
Location: Germany

Re: Interesting project: DesignSPHysics fluid simulator

Post by thschrader »

johnwang wrote: Fri Jun 05, 2020 6:06 am Do you mean open zip directly without unzip? No.

After unzip, I can open the vtk and the stl one by one. But they are not in the same scale. stl is larger. Maybe the unit is changed, m-->mm? Is there a way to scale down the stl?
No, dont open zip. Unpack and load vtk/stl.

I use default units (mm) in FC. When exporting the stl and loading with paraview,
the stl is scaled up by a factor of 1000 (paraview uses m as default). You must scale it down
with Filter/transform. When reimporting the stl in FC, I have no scaling-problem.

Which import-filter for vtk do you use in FC?
User avatar
johnwang
Veteran
Posts: 1345
Joined: Sun Jan 27, 2019 12:41 am

Re: Interesting project: DesignSPHysics fluid simulator

Post by johnwang »

thschrader wrote: Which import-filter for vtk do you use in FC?
Try use the macro i provided. You have to change the Field value from pressure to Vel, or other listed.

How do i scale stl?
hfc series CAE workbenches for FreeCAD (hfcNastran95, hfcMystran, hfcFrame3DD, hfcSU2 and more)
thschrader
Veteran
Posts: 3129
Joined: Sat May 20, 2017 12:06 pm
Location: Germany

Re: Interesting project: DesignSPHysics fluid simulator

Post by thschrader »

johnwang wrote: Fri Jun 05, 2020 8:02 am How do i scale stl?
Activate the Mesh-Design wb, ==> Meshes/scale
MeshDesingWorkbench.JPG
MeshDesingWorkbench.JPG (42.94 KiB) Viewed 4160 times
User avatar
johnwang
Veteran
Posts: 1345
Joined: Sun Jan 27, 2019 12:41 am

Re: Interesting project: DesignSPHysics fluid simulator

Post by johnwang »

Open stl first
scale 0.001
import VTK

All good.
a.jpg
a.jpg (65.67 KiB) Viewed 4139 times
hfc series CAE workbenches for FreeCAD (hfcNastran95, hfcMystran, hfcFrame3DD, hfcSU2 and more)
Post Reply