How to get the internal part of a tube

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

Sedullo
Posts: 10
Joined: Thu May 28, 2020 4:00 pm

How to get the internal part of a tube

Postby Sedullo » Tue Jun 16, 2020 2:04 pm

I have a cad geometry which is similar to a tube, my goal is to simulate a fluid inside this "tube".

I would like to create a "negative" of this geometry, basically I would like to create a cad of the fluid part. If you think about a straight tube, I would like to get a cad of the internal cylinder inside the tube.

Is that somehow possible?

The next step will be to create the stl of this negative and make a mesh out of it using snappyhexmesh in OpenFOAM.
thschrader
Posts: 2129
Joined: Sat May 20, 2017 12:06 pm
Location: Germany

Re: How to get the internal part of a tube

Postby thschrader » Tue Jun 16, 2020 4:39 pm

Do you mean something like this?
A hollow pipe in a block. You want to simulate the flow through
the pipe, but there is nothing to mesh. Because the pipe is hollow… :o
pipe.JPG
pipe.JPG (31.65 KiB) Viewed 1428 times
RatonLaveur
Posts: 977
Joined: Wed Mar 27, 2019 10:45 am

Re: How to get the internal part of a tube

Postby RatonLaveur » Sun Jul 05, 2020 8:17 pm

Well, why don't you simply build a solid cylinder representing the actual fluid volume?

In CFD in FreeCAD there are really two ways to create the domain:

A. The domain is simple enough that you can recreate it in positive.

B. You have an existing part with complex cavities, in which case you can use that existing part to carve out from a solid volume (boolean operation).
polymer
Posts: 276
Joined: Fri Sep 12, 2014 8:49 am

Re: How to get the internal part of a tube

Postby polymer » Sun Jul 05, 2020 9:14 pm

Maybe a function for creating a part from the inner Volumen could be added to FreeCad.
Two steps: first select faces of the entry/outlet, then select a face of the inner volume.

For example:
phpBB [video]
thschrader
Posts: 2129
Joined: Sat May 20, 2017 12:06 pm
Location: Germany

Re: How to get the internal part of a tube

Postby thschrader » Tue Jul 07, 2020 12:50 pm

polymer wrote: Sun Jul 05, 2020 9:14 pm Maybe a function for creating a part from the inner Volumen could be added to FreeCad.
...
You can use the defeaturing/curves wb.
fill_hole_and_mesh.JPG
fill_hole_and_mesh.JPG (103.09 KiB) Viewed 1266 times
RatonLaveur
Posts: 977
Joined: Wed Mar 27, 2019 10:45 am

Re: How to get the internal part of a tube

Postby RatonLaveur » Thu Jul 16, 2020 9:35 am

thschrader wrote: Tue Jul 07, 2020 12:50 pm You can use the defeaturing/curves wb.
ah...that is a great idea, let me suggest a little further: what if only the "necessary" tools of that workbench were integrated in the CfdOF//FEM module as a set of "Model preparation" tools ? Which would become a first step in the workflow for simulating in FreeCAD.
thschrader
Posts: 2129
Joined: Sat May 20, 2017 12:06 pm
Location: Germany

Re: How to get the internal part of a tube

Postby thschrader » Thu Jul 16, 2020 10:18 am

RatonLaveur wrote: Thu Jul 16, 2020 9:35 am
thschrader wrote: Tue Jul 07, 2020 12:50 pm You can use the defeaturing/curves wb.
ah...that is a great idea, let me suggest a little further: what if only the "necessary" tools of that workbench were integrated in the CfdOF//FEM module as a set of "Model preparation" tools ? Which would become a first step in the workflow for simulating in FreeCAD.
You can arrange your tools with "Tools/customize".
But I have never used this option, I can live with the actual workbench structure.
Tools_customize.JPG
Tools_customize.JPG (39.78 KiB) Viewed 1181 times
polymer
Posts: 276
Joined: Fri Sep 12, 2014 8:49 am

Re: How to get the internal part of a tube

Postby polymer » Thu Jul 16, 2020 10:11 pm

thschrader wrote: Tue Jul 07, 2020 12:50 pm
polymer wrote: Sun Jul 05, 2020 9:14 pm Maybe a function for creating a part from the inner Volumen could be added to FreeCad.
...
You can use the defeaturing/curves wb.
fill_hole_and_mesh.JPG
That is right and will be a quick and easy method for simple geometries like the given example. But due to partly uncomfortable usability regarding selecting inner or hidden geometries, an automatism would be helpful. See the other topic with the vacuum cleaner in the German sub-forum.
RatonLaveur
Posts: 977
Joined: Wed Mar 27, 2019 10:45 am

Re: How to get the internal part of a tube

Postby RatonLaveur » Fri Jul 17, 2020 6:20 pm

as far as I know, there's a lot of development by user realthunder regarding the selection of hidden and inner faces.
https://forum.freecadweb.org/viewtopic. ... 2&start=20
User avatar
DeepSOIC
Posts: 7843
Joined: Fri Aug 29, 2014 12:45 am
Location: Saint-Petersburg, Russia

Re: How to get the internal part of a tube

Postby DeepSOIC » Fri Jul 17, 2020 8:16 pm

My approach would be:
1. make a solid block that covers most of the tube, and leaves small protrusions of the ends of the pipework.
2. Part Cut the block with the tube
3. Part Explode and delete the block part. The fluid will remain.