Page 1 of 2

2D meshing

Posted: Tue Mar 01, 2022 6:28 am
by oliveroxtoby
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.

Re: 2D meshing

Posted: Tue Mar 01, 2022 4:31 pm
by thschrader
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:
naca2412.FCStd
(384.53 KiB) Downloaded 49 times
pic1.JPG
pic1.JPG (97.23 KiB) Viewed 2686 times


How to use these guys?
pic2.JPG
pic2.JPG (69.35 KiB) Viewed 2686 times

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)

Re: 2D meshing

Posted: Sun Mar 06, 2022 2:01 pm
by thschrader
2D-wedge-mesh axisymmetric.
blue_origin_capsule.FCStd
(845.44 KiB) Downloaded 47 times
capsule_reentry.JPG
capsule_reentry.JPG (71.18 KiB) Viewed 2335 times

Re: 2D meshing

Posted: Sun Mar 20, 2022 10:00 am
by thschrader
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

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
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)

Re: 2D meshing

Posted: Sun Mar 20, 2022 7:32 pm
by oliveroxtoby
thschrader wrote: Sun Mar 20, 2022 10:00 am

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
Sorry - this was caused by an OpenCFD vs Foundation divergence. Should be working now.

Re: 2D meshing

Posted: Sat May 21, 2022 9:48 pm
by adrianinsaval
to simulate a 2d case, what boundary conditions do I need to set for the faces parallel to the 2D plane?

Re: 2D meshing

Posted: Sun May 22, 2022 6:27 pm
by oliveroxtoby
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?
No boundary condition should be specified - these will be set automatically.

Re: 2D meshing

Posted: Sun Jul 10, 2022 8:02 am
by CFD-ROC
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

Re: 2D meshing

Posted: Tue Jul 12, 2022 7:53 pm
by oliveroxtoby
CFD-ROC wrote: Sun Jul 10, 2022 8:02 am 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!
Thanks a lot.
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.
How about this message, above in the current thread?

Re: 2D meshing

Posted: Fri Jul 15, 2022 9:35 am
by thschrader
Here is an example, rotational mesh at 45 deg.
Meshing works, but sim does not run.
Maybe I do something wrong with the boundaries.
curved_wing.FCStd
(249.74 KiB) Downloaded 6 times

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
Done with
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
curvedwing.JPG
curvedwing.JPG (81.54 KiB) Viewed 371 times