CFD Online Logo CFD Online URL
www.cfd-online.com
[Sponsors]
Home > Forums > Software User Forums > OpenFOAM > OpenFOAM Meshing & Mesh Conversion

[Other] Structured mesh around airfoil

Register Blogs Community New Posts Updated Threads Search

Like Tree6Likes

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
Old   November 13, 2016, 14:41
Default Structured mesh around airfoil
  #1
New Member
 
Nicola Forconi
Join Date: Nov 2016
Posts: 7
Rep Power: 10
nicolafo is on a distinguished road
Hello all,
I'm trying to simulate the flow around the airfoil 23012.
Using matlab, I have created an unstructured mesh, starting from the node point of the airfoil (you can see as attachment), then achieved the .msh file i've imported in openfoam successfully. Now i have two separated problems:
The first one is: simulating the airfoil (using simpleFoam) with various attack angle under 15° to avoid the complete separation (with the advised setting in the tutorial incompressible->simpleFoam->airfoil2D), i have obtained a flow very bad almost detached and it is not possible. How can i fix it?
The second one is: I'm wondering how to create the structured mesh (maybe using snappyhexmesh), starting from my unstructured mesh. How can I create the stl?
Could you kindly help me?
Thanks in advance
Attached Images
File Type: jpg untitled.jpg (74.6 KB, 314 views)
nicolafo is offline   Reply With Quote

Old   November 13, 2016, 15:11
Default
  #2
Senior Member
 
Mikko
Join Date: Jul 2014
Location: The Hague, The Netherlands
Posts: 243
Rep Power: 13
Flowkersma is on a distinguished road
Hi Nicola,

I suggest you to firstly run simulations on well known airfoil such as NACA0012 so you know that your numerical setup is OK. Have you done mesh independence study? The radius of your mesh should be approximately 50-500 chord lengths. How about your turbulence model and first cell size (yPlus)?

SnappyHexMesh results in unstructured mesh. BlockMesh creates structured meshes but it is quite difficult to use. I would suggest you to use hyperbolic extrusion algorithm which is easy to use and results in high quality mesh. There are a few open-source softwares with hyperbolic extrusion such as Construct2D (https://sourceforge.net/projects/construct2d/), Overture (http://overtureframework.org/) and Cassiopee (http://elsa.onera.fr/Cassiopee/). Construct2D is minimal grid generator for airfoils and could suit perfectly for you.

Regards,
Mikko

Last edited by Flowkersma; November 13, 2016 at 17:46.
Flowkersma is offline   Reply With Quote

Old   November 16, 2016, 03:20
Default
  #3
New Member
 
Nicola Forconi
Join Date: Nov 2016
Posts: 7
Rep Power: 10
nicolafo is on a distinguished road
Thank you very much for answering me, with your advices i succeeded in fixing some problems.
I am using Spalart Allmaras Ras model.
Now, i am very keen on learning something else about the software you suggested me, Construct2D.
It is recommended to use it on linux or windows?
Another important question for me is the meaning of the relaxation factor inside fvsolution(or fvscheme) and the correct value for Nut and NuTilda in 0 folder (velocity=45, nu=1.5e-5, Re=3e+6, rho=1.225).
Again thank everyone who would helps.
nicolafo is offline   Reply With Quote

Old   November 16, 2016, 05:21
Default
  #4
Senior Member
 
Mikko
Join Date: Jul 2014
Location: The Hague, The Netherlands
Posts: 243
Rep Power: 13
Flowkersma is on a distinguished road
Construct2D should work with all common operating systems and it comes with already compiled binaries.

Spalart Allmaras is already decades old model so you should be able to find easily the recommended boundary conditions by googling a bit. Same goes with the under relaxation factors. If you are using a new version of the "official" OpenFOAM you can also enable SIMPLEC algorithm which allows using higher relaxation factors (e.g. here, lines 40 and 50-57).
Flowkersma is offline   Reply With Quote

Old   November 17, 2016, 11:54
Default
  #5
New Member
 
Nicola Forconi
Join Date: Nov 2016
Posts: 7
Rep Power: 10
nicolafo is on a distinguished road
I installed successfully Construct2D and running the program I have created 3 files (.p3d and .nmf) but there is no way to import the file into a in Openfoam.
How can i solve it?
nicolafo is offline   Reply With Quote

Old   November 17, 2016, 12:16
Default
  #6
Senior Member
 
Mikko
Join Date: Jul 2014
Location: The Hague, The Netherlands
Posts: 243
Rep Power: 13
Flowkersma is on a distinguished road
OpenFOAM comes with utility to convert Plot3D format to OpenFOAM. Example:
Code:
plot3dToFoam nameofyourfile.p3d -singleBlock -2D 1 -noBlank
To create the boundary patches, you can use autoPatch and createPatches utilities.
Flowkersma is offline   Reply With Quote

Old   November 17, 2016, 12:48
Default
  #7
New Member
 
Nicola Forconi
Join Date: Nov 2016
Posts: 7
Rep Power: 10
nicolafo is on a distinguished road
Yes, thanks again.
Now i have a great structured mesh but with only one patch inside constant/polymesh called "wall".
At least I need other two patch/boundary in order to manage a simulation, i mean FrontAndBack and velocity-inlet.
How can i enter the nFaces and startFace setting?

I have also used the autoPatch utilities but it creates automatically several patch, maybe useless.
Attached Images
File Type: jpg Screenshot (90).jpg (194.7 KB, 247 views)
File Type: jpg Screenshot (91).jpg (71.8 KB, 107 views)
nicolafo is offline   Reply With Quote

Old   November 18, 2016, 04:24
Default
  #8
Senior Member
 
Mikko
Join Date: Jul 2014
Location: The Hague, The Netherlands
Posts: 243
Rep Power: 13
Flowkersma is on a distinguished road
If you look at the utilities that I mentioned in my previous post, you will be able to do everything you need. Firstly, split the mesh with autoPatch and then "collect" and rename the relevant to patches to desired boundaries with createPatches utility. You will need at least three patches: farfield, frontAndBack and walls.
Flowkersma is offline   Reply With Quote

Old   November 18, 2016, 08:28
Default
  #9
New Member
 
Nicola Forconi
Join Date: Nov 2016
Posts: 7
Rep Power: 10
nicolafo is on a distinguished road
I have already tried what you had suggested me.
autoPatch created 296 patch inside boundary
Then I added createPatchDict in system folder, but running createPatch in the terminal, I got an error as you can see as attachment.
Before using createPatches utilities should I modify polyMesh/Boundary ?
Is it corrected the file i have created?
Thanks again and again.
Attached Images
File Type: jpg Screenshot (93).jpg (62.6 KB, 69 views)
File Type: jpg Screenshot (94).jpg (64.2 KB, 44 views)
nicolafo is offline   Reply With Quote

Old   November 22, 2016, 08:17
Default
  #10
New Member
 
Nicola Forconi
Join Date: Nov 2016
Posts: 7
Rep Power: 10
nicolafo is on a distinguished road
I really do not know how to solve it...
nicolafo is offline   Reply With Quote

Old   November 22, 2016, 08:50
Default
  #11
Senior Member
 
Mikko
Join Date: Jul 2014
Location: The Hague, The Netherlands
Posts: 243
Rep Power: 13
Flowkersma is on a distinguished road
Here are the steps to a mesh for naca0012 with blunt trailing edge (o-grid). You can find the .dat file from the Construct2d sample_airfoils directory.

1. Run Construct2D and create the mesh
Code:
construct2d path/to/construct2d/directory/sample_airfoils/naca0012.dat
grid
smth
quit
2. Create a OpenFOAM directory and move the mesh file (naca0012.p3d) in it. Convert the mesh to OpenFOAM format by executing
Code:
plot3dToFoam naca0012.p3d -2D 1 -singleBlock -noBlank
3. Divide the single boundary patch to several patches.
Code:
autoPatch 45 -overwrite
4. Create createPatchDict file to system folder and write following in it:
Quote:
/*--------------------------------*- C++ -*----------------------------------*\
| ========= | |
| \\ / F ield | OpenFOAM: The Open Source CFD Toolbox |
| \\ / O peration | Version: 3.0.1 |
| \\ / A nd | Web: www.OpenFOAM.org |
| \\/ M anipulation | |
\*---------------------------------------------------------------------------*/
FoamFile
{
version 2.0;
format ascii;
class dictionary;
object createPatchDict;
}
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //

pointSync false;

patches
(
{
name walls;
patchInfo
{
type wall;
}
constructFrom patches;
patches (auto0);
}
{
name frontAndBack;
patchInfo
{
type empty;
}
constructFrom patches;
patches (auto1 auto2);
}
{
name farfield;
patchInfo
{
type patch;
}
constructFrom patches;
patches (auto3);
}

);

// ************************************************** *********************** //
5. Merge and rename patches
Quote:
createPatch -overwrite
Your mesh is now ready. Note that you have only one boundary for the inlet and outlet. You can use OpenFOAM's "inletOutlet" boundary condition for velocity and turbulence variables and "outletInlet" for pressure (see).
Flowkersma is offline   Reply With Quote

Old   November 22, 2016, 10:05
Thumbs up
  #12
New Member
 
Nicola Forconi
Join Date: Nov 2016
Posts: 7
Rep Power: 10
nicolafo is on a distinguished road
Finally it works perfectly!
Thanks you very much for your kind availability!
Ramzy1990 likes this.
nicolafo is offline   Reply With Quote

Old   August 14, 2019, 05:24
Default
  #13
Senior Member
 
chandra shekhar pant
Join Date: Oct 2010
Posts: 220
Rep Power: 17
chandra shekhar pant is on a distinguished road
Hello Flowkersma,


This post helped me a lot to create the mesh. Thanks a lot! I had a query regarding this, I need a blunt aerofoil to study the effect of cavitation thus I use interPhaseChangeFoam. In this I need to explicity mention the outlet boundary condition for pressure (fixed value) and for inlet fixed velocity value hence is it possible to have different boundary patches for inlet and outlet? Or in other words could I have 4 patches instead of 3?


Many thanks!
chandra shekhar pant is offline   Reply With Quote

Old   August 14, 2019, 08:39
Default
  #14
Senior Member
 
Mikko
Join Date: Jul 2014
Location: The Hague, The Netherlands
Posts: 243
Rep Power: 13
Flowkersma is on a distinguished road
Hi chandra shekhar pant,

You can use the OpenFOAM utilities topoSet and createPatch to split the farfield patch.
  1. Create a faceSet the from the patch (patchToFace).
  2. Split the faceSet at the desired location (boxToFace source for instance)
  3. Convert the faceSet to boundary patch with createPatch utility by setting "constructFrom set".

Best, Mikko
Flowkersma is offline   Reply With Quote

Old   August 14, 2019, 08:48
Default
  #15
Senior Member
 
chandra shekhar pant
Join Date: Oct 2010
Posts: 220
Rep Power: 17
chandra shekhar pant is on a distinguished road
Many thanks for your prompt reply. But since, I am a OpenFoam beginner and have a feeling that I don't understand that completely. Will it be possible for you to simplify this post? In which directory, may be system (where the createPatchDict)? It will be very helpful and kind if could elucidate the post as you have explained earlier.



Thanks again for the help.
chandra shekhar pant is offline   Reply With Quote

Old   August 14, 2019, 11:47
Default
  #16
Senior Member
 
chandra shekhar pant
Join Date: Oct 2010
Posts: 220
Rep Power: 17
chandra shekhar pant is on a distinguished road
Thanks for letting me know the way, after getting your clue I am trying it. Hope it will work.


Thanks!
chandra shekhar pant is offline   Reply With Quote

Old   August 18, 2019, 11:23
Default
  #17
Senior Member
 
chandra shekhar pant
Join Date: Oct 2010
Posts: 220
Rep Power: 17
chandra shekhar pant is on a distinguished road
Hello Mikko,


I am finding it difficult to write the topoSet, thus won't it be possible if I directly change the createPatch (which you had written in the post). Lets say I put the auto4 to outlet and auto3 as inlet? Although not sure about the notations "auto". Sorry for bothering you again and again.



Thanks!
chandra shekhar pant is offline   Reply With Quote

Old   February 3, 2021, 10:44
Default How can I find out which parts belong to each other?
  #18
New Member
 
Alex
Join Date: Feb 2021
Posts: 5
Rep Power: 5
sepbub is on a distinguished road
Hello together!
After using autopatch 45 I'll get unfortunatly 6 patches:
Code:
Create time

Create polyMesh for time = 0

Mesh read in = 0.16 s


Feature:45
minCos :0.707107

Assigned 34551 faces to patch auto0

Assigned 34551 faces to patch auto1

Assigned 198 faces to patch auto2

Assigned 123 faces to patch auto3

Assigned 1 faces to patch auto4

Assigned 125 faces to patch auto5

Assigned 349 faces to patch auto6

End
Now i have two questions:
1. Why do the differ by using autpatch?
2. How can I find out which patches belong to which part of the mesh. The opening in paraFoam give me a segmentation fault?
Moreover the automatic patches dont looking good to me. I cannot imagine why one patch only has 1 face.

Thank you!
P.S. Sorry I am completly new in OpenFoam, maybe there is just an easy mistake
sepbub is offline   Reply With Quote

Old   February 3, 2021, 14:51
Default
  #19
Senior Member
 
Mikko
Join Date: Jul 2014
Location: The Hague, The Netherlands
Posts: 243
Rep Power: 13
Flowkersma is on a distinguished road
Hi Alexander,

1. autoPatch divides the boundary faces based on the feature angle that you give it as an input. If you are using a different airfoil than the one that I am using above, you may get more patches. Try using exactly the same airfoil or try to increase the feature angle from 45 to 85 degrees.
2. Can you open any OpenFOAM case with paraFoam or is the crash related to this case only? You can try using ParaView's native reader by running following commands in the case directory:
Code:
touch foam.foam
paraview foam.foam

Best, Mikko
sepbub likes this.
Flowkersma is offline   Reply With Quote

Old   March 3, 2021, 18:31
Default
  #20
Member
 
Join Date: Feb 2021
Posts: 30
Rep Power: 5
afa13 is on a distinguished road
Quote:
Originally Posted by Flowkersma View Post
Hi chandra shekhar pant,

You can use the OpenFOAM utilities topoSet and createPatch to split the farfield patch.
  1. Create a faceSet the from the patch (patchToFace).
  2. Split the faceSet at the desired location (boxToFace source for instance)
  3. Convert the faceSet to boundary patch with createPatch utility by setting "constructFrom set".

Best, Mikko

Hi Mikko,
Can you please elaborate on this? after having created the mesh, used autoPatach, and createPatch, what are the next commands?
Thank you
afa13 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
SU2 AOA optimization 454514566@qq.com SU2 9 March 7, 2022 17:17
Volume mesh for Cyclone separator Rajan Pointwise & Gridgen 17 May 4, 2014 06:38
[snappyHexMesh] How to Do External Mesh for Airfoil sHM msuaeronautics OpenFOAM Meshing & Mesh Conversion 1 September 23, 2012 05:00
[ICEM] Unstructure Meshing Around Imported Plot3D Structured Mesh ICEM kawamatt2 ANSYS Meshing & Geometry 17 December 20, 2011 12:45
[snappyHexMesh] snappyHexMesh won't work - zeros everywhere! sc298 OpenFOAM Meshing & Mesh Conversion 2 March 27, 2011 22:11


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