CFD Online Logo CFD Online URL
www.cfd-online.com
[Sponsors]
Home > Forums > Software User Forums > OpenFOAM > OpenFOAM Community Contributions

[cfMesh] Duct Simulation

Register Blogs Community New Posts Updated Threads Search

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
Old   January 2, 2022, 18:18
Default Duct Simulation
  #1
New Member
 
Deutschland
Join Date: Jan 2022
Posts: 12
Rep Power: 4
Sebastian Maier is on a distinguished road
Hello Everyone,

I just started working with Openfoam and wanted to simulate my first case.
For this purpose I have designed a duct in an external CAD program and exported it as a stl. file, which I would like to mesh with cfMesh. For this I have additionally downloaded OpenFOAMv2106.
Now I have several problems. my stl. file has only one region, but I need to define an inlet/outlet and walls. I am not quite sure how to do this in Openfoam. Furthermore, the geometry of my stl. file currently has triangles that end in infinite small areas, I don't know if this could lead to additional problems.

Is there a general procedure to prepare the geometry for such cases?

Best Regards,

Sebastian
Sebastian Maier is offline   Reply With Quote

Old   January 3, 2022, 09:08
Default
  #2
Senior Member
 
Domenico Lahaye
Join Date: Dec 2013
Posts: 722
Blog Entries: 1
Rep Power: 17
dlahaye is on a distinguished road
In short: the idea is to (1/3) save the STL per patch, (2/3) annotate the STL per patch with boundary information and (3/3) concatenate the separate STL files into a new STL file.

More elaborate explanation follows:

OpenFoam: Salome/cfMesh Users Guide

This note discusses the use of Salome to generate of the input data that the package cfMesh requires to perform volumetric mesh generation. These notes complement [1,2].
The input that cfMesh requires consists of the following two elements:
(1/2): the triangulation of the surface (surface mesh) of the geometry;
(2/2) a dictionary file that contains the name of the surface mesh and parameter settings that control the mesh generation.
The cfMesh native format for the surface triangulation is the FMS format. The STL format is also supported. The STL format however results in larger files. In what follows we discuss how to create the surface mesh and the dictionary. We include the possibility to generate of the surface mesh using Comsol Multiphysics as an intermediate tool.

1/ Creation or reading of geometry in Salome

The geometry can be created using the geometry module of Salome. Alternatively, the geometry can be read from file (in STEP, IGES, BREP or STL) using again the geometry module. In the geometry module that patches can be given names (e.g. inlet, outlet and walls). Note that Comsol Multiphysics unfortunately does not allow export to other formats than STL. (It is unclear at the moment whether the STL format is viable to use in the following. It is also unclear at the moment whether or not Comsol allows to export the geometry per patch.)

2/ Generation of surface triangulation in FMS format using Salome/Python

To generate and export the surface triangulation from Salome, proceed as follows:
1. generate a triangulation in Salome, within the Mesh module.
2. import the salomeToSurf.py script. The Load Script option exists inside the File menu. The location of this script is given in [3]
3. select the surface you want to export, by highlighting it in the project tree, and write:
triSurf().writeFms("surfaceName.fms") in the python console.
This executes the script with the selected mesh as its argument, and writes the FMS file with the given name into the directory where Salome is installed. You can also provide an absolute path to get the fms file written to the desired location.

3/ Generation of surface triangulation in STL format of surface using STL per patch

The surface mesh can alternatively by created in STL format per patch. From the CAD modeling tool, export the surface per patch. Make sure that the STL file per patch has a begin/end sequence. Make sure that each patch has its name attached to it. Concatenate all the individual STL files into a single final STL file.

4/ Setting up the dictionary file

For both the anode baking furnace and the blast hot stove, dictionary files for cfMesh already exists. Please copy from those.

5/ (irrelevant for OpenFoam users) Avoiding polyhedral elements in case that the mesh is to be used by Comsol Multiphysics

To avoid polyhedral cells to be generated by cfMesh (because Comsol does not support them), place the following line into the meshDict dictionary file;

decomposePolyhedraIntoTetsAndPyrs true

References

[1]: How can I change the mesh structure generated by cfMesh
[2]: https://openfoamwiki.net/index.php/T...arametrization
[3]: location of Python script in the cfMesh source code: modules/cfmesh/python/Salome/salomeTriSurf.py
[4]: “Working With cfMesh” by Beg at Sheffield https://www.sheffield.ac.uk/polopoly...ith_cfMesh.pdf
[5]: https://curiosityfluids.com/2019/02/...-your-meshing/
[6]: very well explained: https://curiosityfluids.com/2019/02/...-your-meshing/
dlahaye is offline   Reply With Quote

Old   January 6, 2022, 06:38
Default
  #3
Member
 
philip lu
Join Date: Aug 2019
Posts: 87
Rep Power: 6
philiplu is on a distinguished road
hello, thank you, dlahaye, for the guidelines.
I've a small question:

my preference: first save surfs as "iges", then in other tools, convert them to "stl", where I can
- further refine each surf or
- simly use default setting in "iges2stl"

so i wonder if "further refine" can expedite the meshing in cfmesh?(even it's just e.g. a "plane"), or it's not necessary to do so?

thank you in advance, if you or someone can give me some hints
philip
philiplu is offline   Reply With Quote

Old   January 6, 2022, 11:09
Default
  #4
Senior Member
 
Domenico Lahaye
Join Date: Dec 2013
Posts: 722
Blog Entries: 1
Rep Power: 17
dlahaye is on a distinguished road
Not sure. I image, however, that cfMesh constructs its own surface mesh. This implies that further refining the STL in case of planar surfaces add no information.
dlahaye is offline   Reply With Quote

Old   January 7, 2022, 06:08
Default
  #5
Member
 
philip lu
Join Date: Aug 2019
Posts: 87
Rep Power: 6
philiplu is on a distinguished road
hello, dlahaye,
many thanx for the reply. Actually when using SHM, I got already this question.

regards, thanks
philip
philiplu is offline   Reply With Quote

Old   January 7, 2022, 09:30
Default
  #6
New Member
 
Deutschland
Join Date: Jan 2022
Posts: 12
Rep Power: 4
Sebastian Maier is on a distinguished road
hello

thank you also from me for the detailed guide. I needed a few days to fight my way through. was very helpful.
Sebastian Maier is offline   Reply With Quote

Old   January 31, 2022, 13:49
Default
  #7
New Member
 
Deutschland
Join Date: Jan 2022
Posts: 12
Rep Power: 4
Sebastian Maier is on a distinguished road
Hey everyone,

im working with cfMesh now for a view days and i encountered some problems, especially with the boundary layer.

for a given yPlus value, I have calculated the first cell height. furthermore, the boundary layer thickness is known. With these values I wanted to define my boundary layer.
Here I am not aware if this is possible in cfMesh at all. I am not that experienced with it yet, so I could be wrong.

I had tried to determine the value of the first cell via maxFirstLayerThickness. But this is much smaller than expected (see figure 1). furthermore i didn't find a way to specify the total boundary layer thickness. is this to be controlled by maxFirstLayerThickness and thicknessRatio ?
furthermore, there is a "wavy pattern" along the boundary layer instead of a uniform boundary layer (see picture 2), the reason for which is also unknown to me.

is there a possibility to make this more smooth ?

i posted my code below

Best regards,

Sebastian

Code:
maxCellSize 0.01;		// [m]

boundaryCellSize 0.005;

boundaryLayers
{
    
    nLayers 6;

    thicknessRatio 1.15;

    maxFirstLayerThickness 0.00129;  
    
    optimiseLayer 1;
    
}
Attached Images
File Type: png FirstCellHeight.png (12.4 KB, 17 views)
File Type: png boundaryLayerDuct.png (58.6 KB, 20 views)
Sebastian Maier is offline   Reply With Quote

Reply


Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are Off
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
write bc data and read it for other simulation jdp810 SU2 1 May 8, 2021 17:04
Unsteady simulation of rotating duct SRF or Sliding mesh Alisa_W FLUENT 7 January 22, 2019 06:34
restarting paused transient simulation using reactingFoam JMDag2004 OpenFOAM Running, Solving & CFD 1 August 10, 2015 10:15
Flow coming from Industrial radial fan simulation in duct crixman OpenFOAM Running, Solving & CFD 2 November 10, 2014 04:05
Fan simulation with inlet and outlet duct for finding fan curve chaudhry_hashim FLUENT 0 August 6, 2014 10:49


All times are GMT -4. The time now is 12:46.