CFD Online Discussion Forums

CFD Online Discussion Forums (https://www.cfd-online.com/Forums/)
-   OpenFOAM Pre-Processing (https://www.cfd-online.com/Forums/openfoam-pre-processing/)
-   -   SnappyHexMesh& extrudeMesh (https://www.cfd-online.com/Forums/openfoam-pre-processing/118486-snappyhexmesh-extrudemesh.html)

s.m May 28, 2013 12:17

SnappyHexMesh& extrudeMesh
 
4 Attachment(s)
hi dear fomers, i am working on multi element arifoils, i make the mesh using snappyHexMesh, then for using this mesh with simpleFoam i run "extrudeMesh"
my problem is the cprner of slat that is good till extrudeMesh didn't run.
i put the pictures before and after the extrudeMesh.
any body could help me?
thanks to all:)

nimasam May 29, 2013 09:33

Dear saide

look at this post
i think if you add several layers around your airfoil, problem will be solved
on given post there are is a test case which may help you

s.m June 2, 2013 09:02

2 Attachment(s)
Quote:

Originally Posted by nimasam (Post 430748)
Dear saide

look at this post
i think if you add several layers around your airfoil, problem will be solved
on given post there are is a test case which may help you

Hi Dear Nima,
i did what you said me, but i didn't get good results:(
i attach some pictures of the corners of the elements

nimasam June 2, 2013 10:32

dear saide :)

1) whats wrong?
2) why just two layers?

immortality June 2, 2013 11:12

Hi Saideh
this error occurred when I run blockMesh on your snappyHexMesh file:
Code:

Create time



--> FOAM FATAL IO ERROR:
Cannot open include file "/home/ehsan/Desktop/airfoil_snappyHexMesh/system/forceCoeffs" while reading dictionary "/home/ehsan/Desktop/airfoil_snappyHexMesh/system/controlDict.functions"

file: /home/ehsan/Desktop/airfoil_snappyHexMesh/system/controlDict at line 49.

    From function functionEntries::includeEntry::includeEntry(dictionary& parentDict, Istream&)
    in file db/dictionary/functionEntries/includeEntry/includeEntry.C at line 120.

FOAM exiting


nimasam June 2, 2013 11:33

-------------------------------------------------------------------

immortality June 2, 2013 11:39

:eek:dear Nima
be more patient please!
yes its related.
Saideh wanted me help her but I wasn't familiar with snappyHexMesh and the files she gave me displayed an error on blockMesh that I wrote and noticed her to her thread.:)

nimasam June 2, 2013 11:48

----------------------------------------------------------

immortality June 2, 2013 11:56

I think its better to help her than trying to answer me.:)as I know your posts were irrelevant dear Nima.:pyou didn't know whats the matter and unfortunately now persist on your mistake.its nice that people accept their mistakes than keep them!;)
anyway,please have a look into the error if you can so that I can help her by her case.:)

s.m June 2, 2013 12:01

Quote:

Originally Posted by nimasam (Post 431457)
dear saide :)

1) whats wrong?
2) why just two layers?

hi dear nima,
i think what's wrong are those cells that are in the corner of the slat. is it a good mesh for there?

nimasam June 2, 2013 12:04

Quote:

Originally Posted by immortality (Post 431460)
Hi Saideh
this error occurred when I run blockMesh on your snappyHexMesh file:
Code:

Create time



--> FOAM FATAL IO ERROR:
Cannot open include file "/home/ehsan/Desktop/airfoil_snappyHexMesh/system/forceCoeffs" while reading dictionary "/home/ehsan/Desktop/airfoil_snappyHexMesh/system/controlDict.functions"

file: /home/ehsan/Desktop/airfoil_snappyHexMesh/system/controlDict at line 49.

    From function functionEntries::includeEntry::includeEntry(dictionary& parentDict, Istream&)
    in file db/dictionary/functionEntries/includeEntry/includeEntry.C at line 120.

FOAM exiting



well answer is there: (read error carefully ;))
Code:

Cannot open include file  "/home/ehsan/Desktop/airfoil_snappyHexMesh/system/forceCoeffs" while  reading dictionary  "/home/ehsan/Desktop/airfoil_snappyHexMesh/system/controlDict.functions"
you can comment those forceDict from controlDict, it can not find it ;) in your system folder

nimasam June 2, 2013 12:12

Quote:

Originally Posted by s.m (Post 431469)
hi dear nima,
i think what's wrong are those cells that are in the corner of the slat. is it a good mesh for there?

why not ;) but i suggest to increase it to forexample 5 layers and post results here ;), i guess it will improve

s.m June 2, 2013 12:32

Quote:

Originally Posted by immortality (Post 431460)
Hi Saideh
this error occurred when I run blockMesh on your snappyHexMesh file:
Code:

Create time



--> FOAM FATAL IO ERROR:
Cannot open include file "/home/ehsan/Desktop/airfoil_snappyHexMesh/system/forceCoeffs" while reading dictionary "/home/ehsan/Desktop/airfoil_snappyHexMesh/system/controlDict.functions"

file: /home/ehsan/Desktop/airfoil_snappyHexMesh/system/controlDict at line 49.

    From function functionEntries::includeEntry::includeEntry(dictionary& parentDict, Istream&)
    in file db/dictionary/functionEntries/includeEntry/includeEntry.C at line 120.

FOAM exiting


Hi Dear ehsan,
yes i forget to put the include function that i had been written in the controlDict of airfoil_snappyHexMesh folder. sorry.
here you are, these are the complete folders in the attachment.
thank you very much :)

s.m June 2, 2013 12:37

Quote:

Originally Posted by nimasam (Post 431474)
why not ;) but i suggest to increase it to forexample 5 layers and post results here ;), i guess it will improve

Dear Nima,
i don't think so, but I’ll run the snappy with 5 layers now.

immortality June 2, 2013 13:11

dear Saideh in doing this command:
Code:

surfaceFeatureExtract -includedAngle 150 -writeObj constant/triSurface/airfoil.stl airfoil
this error displayed:
Code:

Create time

Reading surfaceFeatureExtractDict



--> FOAM FATAL IO ERROR:
cannot open file

file: /home/ehsan/Desktop/airfoil_snappyHexMesh_modified/system/surfaceFeatureExtractDict at line 0.

    From function regIOobject::readStream()
    in file db/regIOobject/regIOobjectRead.C at line 87.

FOAM exiting

ehsan@Ehsan-com:~/Desktop/airfoil_snappyHexMesh_modified$ surfaceFeatureExtract -includedAngle 150 -writeObj constant/triSurface/airfoil.stl airfoil

Usage: surfaceFeatureExtract [OPTIONS]
options:
  -case <dir>      specify alternate case directory, default is the cwd
  -dict <file>      read control dictionary from specified location
  -noFunctionObjects
                    do not execute functionObjects
  -srcDoc          display source code in browser
  -doc              display application documentation in browser
  -help            print the usage

extract and write surface features to file

Using: OpenFOAM-2.2.0 (see www.OpenFOAM.org)
Build: 2.2.0-b363e8d14789



--> FOAM FATAL ERROR:
Wrong number of arguments, expected 0 found 3
Invalid option: -writeObj
Invalid option: -includedAngle


FOAM exiting

I'm totally unfamiliar with snappyHexMesh commands if I have run it mistakenly.

s.m June 2, 2013 13:31

Quote:

Originally Posted by immortality (Post 431486)
dear Saideh in doing this command:
Code:

surfaceFeatureExtract -includedAngle 150 -writeObj constant/triSurface/airfoil.stl airfoil
this error displayed:
Code:

Create time

Reading surfaceFeatureExtractDict



--> FOAM FATAL IO ERROR:
cannot open file

file: /home/ehsan/Desktop/airfoil_snappyHexMesh_modified/system/surfaceFeatureExtractDict at line 0.

    From function regIOobject::readStream()
    in file db/regIOobject/regIOobjectRead.C at line 87.

FOAM exiting

ehsan@Ehsan-com:~/Desktop/airfoil_snappyHexMesh_modified$ surfaceFeatureExtract -includedAngle 150 -writeObj constant/triSurface/airfoil.stl airfoil

Usage: surfaceFeatureExtract [OPTIONS]
options:
  -case <dir>      specify alternate case directory, default is the cwd
  -dict <file>      read control dictionary from specified location
  -noFunctionObjects
                    do not execute functionObjects
  -srcDoc          display source code in browser
  -doc              display application documentation in browser
  -help            print the usage

extract and write surface features to file

Using: OpenFOAM-2.2.0 (see www.OpenFOAM.org)
Build: 2.2.0-b363e8d14789



--> FOAM FATAL ERROR:
Wrong number of arguments, expected 0 found 3
Invalid option: -writeObj
Invalid option: -includedAngle


FOAM exiting

I'm totally unfamiliar with snappyHexMesh commands if I have run it mistakenly.

Dear ehsan, thank you very much for your kind attention.:)
i put in the attachment the airfoil_snappyHexMesh_modified2 , please open the allrun in this folder, i write in it that you just should run blockMesh and after that snappyHexMesh in two steps as you see in the allrun.txt.

s.m June 2, 2013 13:35

3 Attachment(s)
Quote:

Originally Posted by nimasam (Post 431474)
why not ;) but i suggest to increase it to forexample 5 layers and post results here ;), i guess it will improve

Dear Nima,
these pictures are the results of runningSHM with five layers..

nimasam June 2, 2013 13:59

dear saide
check which side of 3D body, are you going to extrude?
are both sides (front and back) are the same?

immortality June 2, 2013 15:47

you're welcome.Saideh it executes fine till extrudeMesh
I don't know why it doesn't open.I use OF 2.2.0
Code:

Create time

Create mesh for time = 0



--> FOAM FATAL IO ERROR:
cannot open file

file: /home/ehsan/Desktop/airfoil_simpleFoam/system/extrudeMeshDict at line 0.

    From function regIOobject::readStream()
    in file db/regIOobject/regIOobjectRead.C at line 87.

FOAM exiting


s.m June 2, 2013 16:41

Quote:

Originally Posted by immortality (Post 431503)
you're welcome.Saideh it executes fine till extrudeMesh
I don't know why it doesn't open.I use OF 2.2.0
Code:

Create time

Create mesh for time = 0



--> FOAM FATAL IO ERROR:
cannot open file

file: /home/ehsan/Desktop/airfoil_simpleFoam/system/extrudeMeshDict at line 0.

    From function regIOobject::readStream()
    in file db/regIOobject/regIOobjectRead.C at line 87.

FOAM exiting


Great! Dear ehsan as i write in the Allrun.txt
after finishing the 2th step of snappHexMesh you should go two the airfoil_simpleFoam_modified that i attach for you, in this folder you should execute "extrudeMesh", after fininshing extrudeMesh, i create polyMesh in the constant folder of airfoil_simpleFoam_modified.
p-s: before running the extrudeMesh in terminal,please copy the name of aifoil_snappyHexMesh_modified2 folder, and past it in front of (sourceCase "../(here)";)) in extrudeMeshDict. after that, execute extrudeMesh.by executing the extrudeMesh, it extrude the mesh that the name of it's folder have been written in front of sourceCase in extrudeMeshDict
tahnk you very much again:)

immortality June 2, 2013 17:02

another error occurred in performing extrudeMesh,I changed that address also:
Code:

ehsan@Ehsan-com:~/Desktop/Files/airfoil_simpleFoam_modified$ extrudeMesh
/*---------------------------------------------------------------------------*\
| =========                |                                                |
| \\      /  F ield        | OpenFOAM: The Open Source CFD Toolbox          |
|  \\    /  O peration    | Version:  2.2.0                                |
|  \\  /    A nd          | Web:      www.OpenFOAM.org                      |
|    \\/    M anipulation  |                                                |
\*---------------------------------------------------------------------------*/
Build  : 2.2.0-b363e8d14789
Exec  : extrudeMesh
Date  : Jun 03 2013
Time  : 01:26:22
Host  : "Ehsan-com"
PID    : 3143
Case  : /home/ehsan/Desktop/Files/airfoil_simpleFoam_modified
nProcs : 1
sigFpe : Enabling floating point exception trapping (FOAM_SIGFPE).
fileModificationChecking : Monitoring run-time modified files using timeStampMaster
allowSystemOperations : Disallowing user-supplied system call operations

// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
Create time

Create mesh for time = 0

Selecting extrudeModel linearNormal
Extruding from patch using model linearNormal
Collapsing edges < 0.0001 of bounding box

Extruding patches 1(front) on mesh "../aifoil_snappyHexMesh_modified2"



--> FOAM FATAL IO ERROR:
cannot find file

file: ../aifoil_snappyHexMesh_modified2/system/controlDict at line 0.

    From function regIOobject::readStream()
    in file db/regIOobject/regIOobjectRead.C at line 73.

FOAM exiting

-------
I'll continue tomorrow,bye for now :)

s.m June 2, 2013 17:08

Quote:

Originally Posted by immortality (Post 431507)
another error occurred in performing extrudeMesh,I changed that address also:
Code:

ehsan@Ehsan-com:~/Desktop/Files/airfoil_simpleFoam_modified$ extrudeMesh
/*---------------------------------------------------------------------------*\
| =========                |                                                |
| \\      /  F ield        | OpenFOAM: The Open Source CFD Toolbox          |
|  \\    /  O peration    | Version:  2.2.0                                |
|  \\  /    A nd          | Web:      www.OpenFOAM.org                      |
|    \\/    M anipulation  |                                                |
\*---------------------------------------------------------------------------*/
Build  : 2.2.0-b363e8d14789
Exec  : extrudeMesh
Date  : Jun 03 2013
Time  : 01:26:22
Host  : "Ehsan-com"
PID    : 3143
Case  : /home/ehsan/Desktop/Files/airfoil_simpleFoam_modified
nProcs : 1
sigFpe : Enabling floating point exception trapping (FOAM_SIGFPE).
fileModificationChecking : Monitoring run-time modified files using timeStampMaster
allowSystemOperations : Disallowing user-supplied system call operations

// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
Create time

Create mesh for time = 0

Selecting extrudeModel linearNormal
Extruding from patch using model linearNormal
Collapsing edges < 0.0001 of bounding box

Extruding patches 1(front) on mesh "../aifoil_snappyHexMesh_modified2"



--> FOAM FATAL IO ERROR:
cannot find file

file: ../aifoil_snappyHexMesh_modified2/system/controlDict at line 0.

    From function regIOobject::readStream()
    in file db/regIOobject/regIOobjectRead.C at line 73.

FOAM exiting

-------
I'll continue tomorrow,bye for now :)

Dear ehsan, these two folders "airfoil_snappyHexMesh_modified2" and "simpleFoam_simpleFoam_modified" should be in on folder beside each other.
thanks:)

immortality June 2, 2013 17:26

yes they are in a unique folder beside to each other.
maybe this line have any problem?
Code:

sourceCase "../aifoil_snappyHexMesh_modified2";
is it right? it doen't find controlDict.

s.m June 3, 2013 01:55

Quote:

Originally Posted by immortality (Post 431512)
yes they are in a unique folder beside to each other.
maybe this line have any problem?
Code:

sourceCase "../aifoil_snappyHexMesh_modified2";
is it right? it doen't find controlDict.

after finishig the analysis in airfoil_snappyHexMesh you now have "1,2,3,4" folders, yes?
now go to the airfoil_simpleFoam and write the name of the folder that you run the snappyHexMesh in it that is contain of "1,2,3,4" folders.
after this come to airfoil_simpleFoam that is contain "0,constant,system" and run extrudeMesh, and simpleFoam at the end.

s.m June 3, 2013 01:58

2 Attachment(s)
Quote:

Originally Posted by nimasam (Post 431496)
dear saide
check which side of 3D body, are you going to extrude?
are both sides (front and back) are the same?

Dear Nima i have extruded the front face, would you please take look at extrudeMeshDict in the attachment?

s.m June 3, 2013 02:08

Quote:

Originally Posted by s.m (Post 431508)
Dear ehsan, these two folders "airfoil_snappyHexMesh_modified2" and "simpleFoam_simpleFoam_modified" should be in on folder beside each other.
thanks:)

this error is because of you run the extrudeMesh in a wrong folder. you should go to the airfoil_simpleFoam then run the extrudeMesh there to give you polyMesh, in the constant folder of it.

immortality June 3, 2013 03:29

Hi Saideh
I run the command in true folder but there are only "1,2,3" folders in airfoil_snappyHexMesh_modified2.
which version are you using?
there is an error on snapEdge:
Code:

ehsan@Ehsan-com:~/Desktop/Files/airfoil_snappyHexMesh_modified2$ snapEdge
snapEdge: command not found

what does do this command?

nimasam June 3, 2013 05:14

Quote:

Originally Posted by s.m (Post 431553)
Dear Nima i have extruded the front face, would you please take look at extrudeMeshDict in the attachment?

your extrudeMeshDict are completely right :), did you check your mesh before extrusion? check whether it is front and back are the same

s.m June 3, 2013 07:57

Quote:

Originally Posted by immortality (Post 431570)
Hi Saideh
I run the command in true folder but there are only "1,2,3" folders in airfoil_snappyHexMesh_modified2.
which version are you using?
there is an error on snapEdge:
Code:

ehsan@Ehsan-com:~/Desktop/Files/airfoil_snappyHexMesh_modified2$ snapEdge
snapEdge: command not found

what does do this command?

openFoam does not have snapEdge dictionary you should compile it to your openFoam before running the snapEdge in the terminal.
it doesn't necessary for this multi element airfoil. run snappyHexMesh without the snapEdge. so it should create 3 folders for you.

s.m June 3, 2013 08:00

5 Attachment(s)
Quote:

Originally Posted by nimasam (Post 431591)
your extrudeMeshDict are completely right :), did you check your mesh before extrusion? check whether it is front and back are the same

yes i check the mesh, after finishing the SHM. the picture that i put in the 1th post is before layering , after layering and after extrudeMesh.
would you please take a look on my snappHexMesh file?

immortality June 3, 2013 10:05

how to compile snapEdge?
now its running for 30 minutes.
the problem is on the values?
how is the order of coefficients?flap,main,slat from above to bottom?
what is Cl(f) and Cl(r)?
Code:

Cm    = 0.377331
    Cd    = 0.165487
    Cl    = 0.234554
    Cl(f) = 0.494607
    Cl(r) = -0.260054


nimasam June 3, 2013 13:36

Quote:

Originally Posted by s.m (Post 431614)
yes i check the mesh, after finishing the SHM. the picture that i put in the 1th post is before layering , after layering and after extrudeMesh.
would you please take a look on my snappHexMesh file?

1- i know there is difference in mesh shape before and after extrusion :) you insist on it several times ;), my question was whether front and back face before extrusion after snappyHexMesh have the same shape :D
still waiting for your response :D
2- your snappyHexMesh is fine enough

s.m June 4, 2013 01:27

4 Attachment(s)
Quote:

Originally Posted by nimasam (Post 431735)
1- i know there is difference in mesh shape before and after extrusion :) you insist on it several times ;), my question was whether front and back face before extrusion after snappyHexMesh have the same shape :D
still waiting for your response :D
2- your snappyHexMesh is fine enough

of course they have the same shape, i attach some picture from front and back views of my snappyHexMesh

s.m June 4, 2013 01:52

5 Attachment(s)
Quote:

Originally Posted by immortality (Post 431666)
how to compile snapEdge?
now its running for 30 minutes.
the problem is on the values?
how is the order of coefficients?flap,main,slat from above to bottom?
what is Cl(f) and Cl(r)?
Code:

Cm    = 0.377331
    Cd    = 0.165487
    Cl    = 0.234554
    Cl(f) = 0.494607
    Cl(r) = -0.260054



i write three function for three element separately, so you should get three group result for "cd, cl and cm" as i know the cl for main element should reach 2.44, and 0.24 for flap.

nimasam June 4, 2013 05:14

Quote:

Originally Posted by s.m (Post 431799)
of course they have the same shape, i attach some picture from front and back views of my snappyHexMesh

i have no more clue :) in my mind, be lucky in your simulation,
if you stick in simulation with free software, maybe you want to use other free software such as salome, netgen, gmsh and like that for your simulation :) and import it to OpenFOAM

s.m June 4, 2013 05:41

Quote:

Originally Posted by nimasam (Post 431847)
i have no more clue :) in my mind, be lucky in your simulation,
if you stick in simulation with free software, maybe you want to use other free software such as salome, netgen, gmsh and like that for your simulation :) and import it to OpenFOAM

you mean what is happen after running extrudeMesh is because of my mesh?

nimasam June 4, 2013 05:48

Quote:

Originally Posted by s.m (Post 431861)
you mean what is happen after running extrudeMesh is because of my mesh?

i mean that you can create your mesh some where else :D with less sophisticated problem :D

but now, i remember, maybe there is another clue ;)
before, extrude Mesh use following command:
Quote:

flattenMesh
check whether it helps or not :)

Dadou January 29, 2014 01:53

Quote:

Originally Posted by immortality (Post 431486)
dear Saideh in doing this command:
Code:

surfaceFeatureExtract -includedAngle 150 -writeObj constant/triSurface/airfoil.stl airfoil
this error displayed:
Code:

Create time

Reading surfaceFeatureExtractDict



--> FOAM FATAL IO ERROR:
cannot open file

file: /home/ehsan/Desktop/airfoil_snappyHexMesh_modified/system/surfaceFeatureExtractDict at line 0.

    From function regIOobject::readStream()
    in file db/regIOobject/regIOobjectRead.C at line 87.

FOAM exiting

ehsan@Ehsan-com:~/Desktop/airfoil_snappyHexMesh_modified$ surfaceFeatureExtract -includedAngle 150 -writeObj constant/triSurface/airfoil.stl airfoil

Usage: surfaceFeatureExtract [OPTIONS]
options:
  -case <dir>      specify alternate case directory, default is the cwd
  -dict <file>      read control dictionary from specified location
  -noFunctionObjects
                    do not execute functionObjects
  -srcDoc          display source code in browser
  -doc              display application documentation in browser
  -help            print the usage

extract and write surface features to file

Using: OpenFOAM-2.2.0 (see www.OpenFOAM.org)
Build: 2.2.0-b363e8d14789



--> FOAM FATAL ERROR:
Wrong number of arguments, expected 0 found 3
Invalid option: -writeObj
Invalid option: -includedAngle


FOAM exiting

I'm totally unfamiliar with snappyHexMesh commands if I have run it mistakenly.


Hello,

Did you solve this problem? Because I have the same problem and I can't solve it. I tried to look it up in the forum but nothing new or really helpfull.

Thank you

Dadou

nimasam January 29, 2014 02:30

well, you may want to add surfaceFeatureExtractDict to your system folder, and edit it appropriately

Dadou January 29, 2014 03:14

Quote:

Originally Posted by nimasam (Post 472263)
well, you may want to add surfaceFeatureExtractDict to your system folder, and edit it appropriately

Thank you

Regards,


All times are GMT -4. The time now is 11:30.