yes, it would be nice to be able to do this simulations.
Cross section river profiles
Forum rules
and Helpful information
and Helpful information
IMPORTANT: Please click here and read this first, before asking for help
Also, be nice to others! Read the FreeCAD code of conduct!
Also, be nice to others! Read the FreeCAD code of conduct!
- microelly2
- Veteran
- Posts: 4688
- Joined: Tue Nov 12, 2013 4:06 pm
- Contact:
-
- Veteran
- Posts: 3157
- Joined: Sat May 20, 2017 12:06 pm
- Location: Germany
Re: Cross section river profiles
Ok, here is a short description.microelly2 wrote: ↑Tue Jan 09, 2018 8:32 pmyes, it would be nice to be able to do this simulations.
Geometry:
I used chakkrees macro to import the csv-Data (the profiles) posted by canislupus.
Then connected the profiles with Dwire and loft them. Thats the riverbed. file: Simulation:
To construct the flow-channel I used a cube (red), from which I subtracted the
riverbed-body. The remaining shape (green) is the flow channel with the riverbed-profile
at the bottom. This body was used for meshing/simulating with the cfd-of-wb (openfoam).
mesher: cfmesh
solver: interfoam, 2-phase water/air
blue: inlet, red: outlet, violet cube: initialization-zone (here starts the water)
total simulation-time 10 sec, timestep 0,01 sec, output every 0,1 sec ==> 100 timesteps for animation
runtime simulation 4 hours on my laptop.
Animation:
After finishing the simulation you can import the results in paraview and start the animation.
The animation can be saved as vtk-files. I imported the first 20 vtk-files in FC and used a macro
from the user gift, to make the mesh moving.
https://forum.freecadweb.org/viewtopic.php?f=13&t=26107
The model tree looks a little bit weird, because I played with the geometry
Re: Cross section river profiles
That's a lot of work
...Yikes, a lot of time for such a short animation. Granted I have no FEA experience and elementarily grasp that there ALOT of number crunching going on. Is there a way to make all this more seamless (besides fidgeting with the model). Meaning can the animation script be made seamless?
Alone you go faster. Together we go farther
Please mark thread [Solved]
Want to contribute back to FC? Checkout:
'good first issues' | Open TODOs and FIXMEs | How to Help FreeCAD | How to report Bugs
Please mark thread [Solved]
Want to contribute back to FC? Checkout:
'good first issues' | Open TODOs and FIXMEs | How to Help FreeCAD | How to report Bugs
-
- Veteran
- Posts: 3157
- Joined: Sat May 20, 2017 12:06 pm
- Location: Germany
Re: Cross section river profiles
For a seamless animation you have several options:Kunda1 wrote: ↑Tue Jan 09, 2018 11:48 pm
That's a lot of work...Yikes, a lot of time for such a short animation. Granted I have no FEA experience and elementarily grasp that there ALOT of number crunching going on. Is there a way to make all this more seamless (besides fidgeting with the model). Meaning can the animation script be made seamless?
Increase the number of FEM-cells (finer mesh). Use a shorter time-step. As far as I know you
need a minimum of 30 frame-rates to see a seamless motion (lets say on TV). In this simulation every
0,1 sec a result was plotted. So the frame rate is to low (10 frames per second).
Using a finer mesh is difficult, please have a look at the video. The guy used 216000 cells and a time-step
of only 0,0001 sec! That gave a courant number of 0,4, and that is the critical parameter.
In timestep-calculations the fluid-particle must remain in one FEM-cell during one timestep, the courant-number
is <1. If the fluid-particle passes more than one cell (courant-number >1), the openfoam-solver stops with
error. So: if you refine the mesh you must parallel use a shorter timestep, which boosts the calculation-time.
https://www.youtube.com/watch?v=7qRW4v_0cSw
https://en.wikipedia.org/wiki/Courant%E ... _condition
https://www.cfd-online.com/Forums/openf ... umber.html
Or I must edit the macro from gift (which is pretty short) to get a faster run through the vtks.
But i have no python skills...
- oliveroxtoby
- Posts: 837
- Joined: Fri Dec 23, 2016 9:43 am
- Location: South Africa
Re: Cross section river profiles
Really nice to see CfdOF being put through its paces for free-surface flow
Also, you might get a somewhat cleaner looking animation with a bit less effort if you generate it directly from Paraview, using the contour filter to visualise the free surface.
Just to point out one thing: for multiphase, the timestep is actually adjusted automatically to fulfil a stable Courant number criterion as the simulation progresses, so it is not necessary to do any hand-calculations. The specified time step size is just the initial value that is used at the start of the simulation and is not critical at all. Of course, this should be made clearer in the interface.thschrader wrote: ↑Wed Jan 10, 2018 12:37 am Using a finer mesh is difficult, please have a look at the video. The guy used 216000 cells and a time-step
of only 0,0001 sec! That gave a courant number of 0,4, and that is the critical parameter.
In timestep-calculations the fluid-particle must remain in one FEM-cell during one timestep, the courant-number
is <1. If the fluid-particle passes more than one cell (courant-number >1), the openfoam-solver stops with
error. So: if you refine the mesh you must parallel use a shorter timestep, which boosts the calculation-time.
https://www.youtube.com/watch?v=7qRW4v_0cSw
https://en.wikipedia.org/wiki/Courant%E ... _condition
https://www.cfd-online.com/Forums/openf ... umber.html
Or I must edit the macro from gift (which is pretty short) to get a faster run through the vtks.
But i have no python skills...
simulation_macro.JPG
Also, you might get a somewhat cleaner looking animation with a bit less effort if you generate it directly from Paraview, using the contour filter to visualise the free surface.
Please provide all the information requested in this post before reporting problems with CfdOF.
-
- Veteran
- Posts: 3157
- Joined: Sat May 20, 2017 12:06 pm
- Location: Germany
Re: Cross section river profiles
Hi Oliver,
thanks about the courant-number info.
BTW: whats the drag-coefficient of the millennium falcon?
How did you do the simulation?
https://twitter.com/ex_mente/status/936562984914210816
thanks about the courant-number info.
BTW: whats the drag-coefficient of the millennium falcon?
How did you do the simulation?
https://twitter.com/ex_mente/status/936562984914210816
Re: Cross section river profiles
hint hint nudge nudgeoliveroxtoby wrote: ↑Wed Jan 10, 2018 5:36 am Also, you might get a somewhat cleaner looking animation with a bit less effort if you generate it directly from Paraview, using the contour filter to visualise the free surface.
Alone you go faster. Together we go farther
Please mark thread [Solved]
Want to contribute back to FC? Checkout:
'good first issues' | Open TODOs and FIXMEs | How to Help FreeCAD | How to report Bugs
Please mark thread [Solved]
Want to contribute back to FC? Checkout:
'good first issues' | Open TODOs and FIXMEs | How to Help FreeCAD | How to report Bugs
-
- Veteran
- Posts: 3157
- Joined: Sat May 20, 2017 12:06 pm
- Location: Germany
- oliveroxtoby
- Posts: 837
- Joined: Fri Dec 23, 2016 9:43 am
- Location: South Africa
Re: Cross section river profiles
File | Save Animation generates nice smooth videos (assuming you use a sufficient frame rate).thschrader wrote: ↑Wed Jan 10, 2018 12:26 pm Hi Kunda1,
I know the filtering-options of paraview. But every data-set of every time-step
is so big, that the loading-time produces a non-seamless motion.
Thomas
floodingFC.gif
Please provide all the information requested in this post before reporting problems with CfdOF.
-
- Veteran
- Posts: 3157
- Joined: Sat May 20, 2017 12:06 pm
- Location: Germany
Re: Cross section river profiles
You see the first 1,7 sec of animation. My little lame-duck-laptop
worked the whole night, this morning I stopped the calculation.
Using 364000 FEM-cells and a frame rate of 33 frames/sec you
get a relativly seamless motion. I need more computing power...
The inlet-speed is too high. The water presses against the upper wall
of the flow-channel at the beginning (the flat circle).
regards Thomas