2D meshing
Moderator: oliveroxtoby
Forum rules
and Helpful information for the FEM forum
and Helpful information for the FEM forum
- oliveroxtoby
- Posts: 840
- Joined: Fri Dec 23, 2016 9:43 am
- Location: South Africa
2D meshing
In version 1.11.1 there has been a change to the method of creating a 2D mesh in CfdOF.
At present, CfdOF doesn't support any native 2D meshers. Instead, the way to generate a 2D mesh is to generate a 3D mesh and then extrude a single layer of cells from one of its faces. Previously this was accomplished by specifying front and back faces as special "2D bounding plane" boundary conditions, with the extrusion operation being handled in the background by CfdOF. However, this approach did not extend well to the case of generating a 'wedge' mesh for an axisymmetric analysis.
The 2D mesh extrusion is now handled explicitly as an extrusion operation defined as a mesh refinement region (CfdOF | Mesh refinement | Extrusion). This allows for the creation of both planar 2D meshes and 2D wedge meshes, but also more general extrusions such as generating 3D sectors and extrusions that extend exising meshes with layers of cells at boundary patches.
At present, CfdOF doesn't support any native 2D meshers. Instead, the way to generate a 2D mesh is to generate a 3D mesh and then extrude a single layer of cells from one of its faces. Previously this was accomplished by specifying front and back faces as special "2D bounding plane" boundary conditions, with the extrusion operation being handled in the background by CfdOF. However, this approach did not extend well to the case of generating a 'wedge' mesh for an axisymmetric analysis.
The 2D mesh extrusion is now handled explicitly as an extrusion operation defined as a mesh refinement region (CfdOF | Mesh refinement | Extrusion). This allows for the creation of both planar 2D meshes and 2D wedge meshes, but also more general extrusions such as generating 3D sectors and extrusions that extend exising meshes with layers of cells at boundary patches.
Please provide all the information requested in this post before reporting problems with CfdOF.
-
- Veteran
- Posts: 3158
- Joined: Sat May 20, 2017 12:06 pm
- Location: Germany
Re: 2D meshing
2D-meshing now:
Create additional MeshRefinement-object in model-tree, open dialog,
select Extrusion, Extrusion type=2D planar, set thickness.
Select Face, add. Run mesher, selected face is extruded to a 2D-mesh,
2 more patch entries in createPatchDict.
Example-file:
How to use these guys?
Done with
OS: Windows 10 Version 2009
Word size of FreeCAD: 64-bit
Version: 0.20.27428 (Git)
Build type: Release
Branch: master
Hash: 27460358508a2057e0ec57a418641435f12628dd
Python version: 3.8.6+
Qt version: 5.15.2
Coin version: 4.0.1
OCC version: 7.5.3
Locale: German/Germany (de_DE)
Create additional MeshRefinement-object in model-tree, open dialog,
select Extrusion, Extrusion type=2D planar, set thickness.
Select Face, add. Run mesher, selected face is extruded to a 2D-mesh,
2 more patch entries in createPatchDict.
Example-file:
How to use these guys?
Done with
OS: Windows 10 Version 2009
Word size of FreeCAD: 64-bit
Version: 0.20.27428 (Git)
Build type: Release
Branch: master
Hash: 27460358508a2057e0ec57a418641435f12628dd
Python version: 3.8.6+
Qt version: 5.15.2
Coin version: 4.0.1
OCC version: 7.5.3
Locale: German/Germany (de_DE)
-
- Veteran
- Posts: 3158
- Joined: Sat May 20, 2017 12:06 pm
- Location: Germany
Re: 2D meshing
2D-wedge-mesh axisymmetric.
-
- Veteran
- Posts: 3158
- Joined: Sat May 20, 2017 12:06 pm
- Location: Germany
Re: 2D meshing
Just updated
cfdof-wb
hisa 1.6.1
cfmesh-cfdof (1.1.2) 1.12
2D planar meshing works with naca example from above
2D wedge meshing gives back error with capsule example from above, see log
2D patch normal/rotational meshing: not tested
Done with bluecfd and
OS: Windows 10 Version 2009
Word size of FreeCAD: 64-bit
Version: 0.20.27428 (Git)
Build type: Release
Branch: master
Hash: 27460358508a2057e0ec57a418641435f12628dd
Python version: 3.8.6+
Qt version: 5.15.2
Coin version: 4.0.1
OCC version: 7.5.3
Locale: German/Germany (de_DE)
cfdof-wb
hisa 1.6.1
cfmesh-cfdof (1.1.2) 1.12
2D planar meshing works with naca example from above
2D wedge meshing gives back error with capsule example from above, see log
2D patch normal/rotational meshing: not tested
Code: Select all
--> FOAM FATAL IO ERROR:
keyword axisPt is undefined in dictionary "C:/GA-NT/Anwendungen/TS_513538/CFD/meshCase/system/extrudeMeshDict/sectorCoeffs"
file: C:/GA-NT/Anwendungen/TS_513538/CFD/meshCase/system/extrudeMeshDict/sectorCoeffs from line 28 to line 30.
From function const Foam::entry& Foam::dictionary::lookupEntry(const Foam::word&, bool, bool) const
in file db/dictionary/dictionary.C at line 799.
FOAM exiting
OS: Windows 10 Version 2009
Word size of FreeCAD: 64-bit
Version: 0.20.27428 (Git)
Build type: Release
Branch: master
Hash: 27460358508a2057e0ec57a418641435f12628dd
Python version: 3.8.6+
Qt version: 5.15.2
Coin version: 4.0.1
OCC version: 7.5.3
Locale: German/Germany (de_DE)
- oliveroxtoby
- Posts: 840
- Joined: Fri Dec 23, 2016 9:43 am
- Location: South Africa
Re: 2D meshing
Sorry - this was caused by an OpenCFD vs Foundation divergence. Should be working now.thschrader wrote: ↑Sun Mar 20, 2022 10:00 amCode: Select all
--> FOAM FATAL IO ERROR: keyword axisPt is undefined in dictionary "C:/GA-NT/Anwendungen/TS_513538/CFD/meshCase/system/extrudeMeshDict/sectorCoeffs" file: C:/GA-NT/Anwendungen/TS_513538/CFD/meshCase/system/extrudeMeshDict/sectorCoeffs from line 28 to line 30. From function const Foam::entry& Foam::dictionary::lookupEntry(const Foam::word&, bool, bool) const in file db/dictionary/dictionary.C at line 799. FOAM exiting
- adrianinsaval
- Veteran
- Posts: 5553
- Joined: Thu Apr 05, 2018 5:15 pm
Re: 2D meshing
to simulate a 2d case, what boundary conditions do I need to set for the faces parallel to the 2D plane?
- oliveroxtoby
- Posts: 840
- Joined: Fri Dec 23, 2016 9:43 am
- Location: South Africa
Re: 2D meshing
No boundary condition should be specified - these will be set automatically.adrianinsaval wrote: ↑Sat May 21, 2022 9:48 pm to simulate a 2d case, what boundary conditions do I need to set for the faces parallel to the 2D plane?
Re: 2D meshing
Hello,
I'm new to CfdOF and OpenFOAM. I worked through the demo files and it helped me a lot to understand the workflow. It is really a great WB for FreeCAD!
I was able to run all of the demo files successfully but may I ask if someone can provide a very simple demo of a 2D rotational case ? In the demo files only 2D planar is covered. I'm using the latest FreeCAD 0.20 (see below) and CfdOF 1.17.
Thanks!
OS: Windows 10 Version 2009
Word size of FreeCAD: 64-bit
Version: 0.20.29177 (Git)
Build type: Release
Branch: releases/FreeCAD-0-20
Hash: 68e337670e227889217652ddac593c93b5e8dc94
Python 3.8.10, Qt 5.15.2, Coin 4.0.1, Vtk 8.2.0, OCC 7.6.2
I'm new to CfdOF and OpenFOAM. I worked through the demo files and it helped me a lot to understand the workflow. It is really a great WB for FreeCAD!
I was able to run all of the demo files successfully but may I ask if someone can provide a very simple demo of a 2D rotational case ? In the demo files only 2D planar is covered. I'm using the latest FreeCAD 0.20 (see below) and CfdOF 1.17.
Thanks!
OS: Windows 10 Version 2009
Word size of FreeCAD: 64-bit
Version: 0.20.29177 (Git)
Build type: Release
Branch: releases/FreeCAD-0-20
Hash: 68e337670e227889217652ddac593c93b5e8dc94
Python 3.8.10, Qt 5.15.2, Coin 4.0.1, Vtk 8.2.0, OCC 7.6.2
- oliveroxtoby
- Posts: 840
- Joined: Fri Dec 23, 2016 9:43 am
- Location: South Africa
Re: 2D meshing
Thanks a lot.
How about this message, above in the current thread?I was able to run all of the demo files successfully but may I ask if someone can provide a very simple demo of a 2D rotational case ? In the demo files only 2D planar is covered. I'm using the latest FreeCAD 0.20 (see below) and CfdOF 1.17.
-
- Veteran
- Posts: 3158
- Joined: Sat May 20, 2017 12:06 pm
- Location: Germany
Re: 2D meshing
Here is an example, rotational mesh at 45 deg.
Meshing works, but sim does not run.
Maybe I do something wrong with the boundaries.
Done with
bluecfd, cfMesh-CfdOF (cfMesh 1.1.2) 1.17
Meshing works, but sim does not run.
Maybe I do something wrong with the boundaries.
Code: Select all
--> FOAM FATAL IO ERROR:
Cannot find patchField entry for patch_0_1_back
file: C:/GA-NT/Anwendungen/TS_513538/CFD/case/0/p/boundaryField from line 25 to line 47.
From function void Foam::GeometricField<Type, PatchField, GeoMesh>::Boundary::readField(const Foam::DimensionedField<TypeR, GeoMesh>&, const Foam::dictionary&) [with Type = double; PatchField = Foam::fvPatchField; GeoMesh = Foam::volMesh]
11:28:07 in file X:/OpenFOAM-8/src/OpenFOAM/fields/GeometricFields/GeometricField/GeometricBoundaryField.C at line 184.
FOAM exiting
bluecfd, cfMesh-CfdOF (cfMesh 1.1.2) 1.17
Code: Select all
OS: Windows 10 (10.0)
Word size of FreeCAD: 64-bit
Version: 0.21.29485 (Git)
Build type: Release
Branch: master
Hash: a236ca843fdd6674afb6d7ed1454fbd3b547f5ea
Python 3.8.13, Qt 5.12.9, Coin 4.0.0, Vtk 9.1.0, OCC 7.5.3
Locale: German/Germany (de_DE)
Installed mods:
* BIM
* CfdOF 1.17.0
* Curves 0.3.0
* Defeaturing_WB
* dodo
* Fasteners
* FEM_FrontISTR 0.1.0
* Manipulator 1.4.3
* Plot
* Reinforcement
* WorkFeature