CFD Online Logo CFD Online URL
www.cfd-online.com
[Sponsors]
Home > Forums > Software User Forums > OpenFOAM > OpenFOAM Meshing & Mesh Conversion > OpenFOAM Native Meshers: snappyHexMesh and Others

stl doesn't appear after snappy process

Register Blogs Members List Search Today's Posts Mark Forums Read

Reply
 
LinkBack Thread Tools Display Modes
Old   May 18, 2018, 03:50
Default stl doesn't appear after snappy process
  #1
New Member
 
Join Date: Mar 2018
Posts: 13
Rep Power: 2
zizou1 is on a distinguished road
Hi all,
OF has just finished running the snappy but I can't see my stl file snapped in Paraview.
Theese are the steps I've done:
-copied the stl file in Trisurface folder;
-copied SnappyHexMeshDict and surfaceFeatureExtractDict in the system directory and changed the name of the object;
-started running with Allrun.

Here are the dictionaries:
FoamFile
{
version 2.0;
format ascii;
class dictionary;
object snappyHexMeshDict;
}
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //

castellatedMesh true;
snap true;
addLayers false;

geometry
{
butterflyValve.stl
{
type triSurfaceMesh;
scale 0.00276;
name butterflyValve;
}

castellatedMeshControls
{
maxLocalCells 10000;
maxGlobalCells 200000;
minRefinementCells 10;
maxLoadUnbalance 0.10;

nCellsBetweenLevels 3;

features
(
{
file "butterflyValve.eMesh";
scale 0.00276;
level 6;
}
);

snapControls
{
nSmoothPatch 3;
tolerance 2.0;
nSolveIter 30;
nRelaxIter 5;
nFeatureSnapIter 10;
implicitFeatureSnap false;
explicitFeatureSnap true;
multiRegionFeatureSnap false;
}


addLayersControls
{
relativeSizes true;


layers
{
"(lowerWall|butterflyValve).*"
{
nSurfaceLayers 1;
}
}

expansionRatio 1.0;

finalLayerThickness 0.3;

minThickness 0.1;

nGrow 0;

featureAngle 60;

slipFeatureAngle 30;

nRelaxIter 3;

nSmoothSurfaceNormals 1;

nSmoothNormals 3;

nSmoothThickness 10;

maxFaceThicknessRatio 0.5;

maxThicknessToMedialRatio 0.3;

minMedianAxisAngle 90;

nBufferCellsNoExtrude 0;

nLayerIter 50;
}


writeFlags
(
scalarLevels
layerSets
layerFields
);


mergeTolerance 1e-6;



FoamFile
{
version 2.0;
format ascii;
class dictionary;
object surfaceFeatureExtractDict;
}
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //

butterflyValve.stl
{
extractionMethod extractFromSurface;

extractFromSurfaceCoeffs
{
includedAngle 150;
}

subsetFeatures
{
nonManifoldEdges no;
openEdges yes;
}
writeObj yes;
}


"Allrun"

#!/bin/sh
cd ${0%/*} || exit 1 # Run from this directory

# Source tutorial run functions
. $WM_PROJECT_DIR/bin/tools/RunFunctions

runApplication surfaceFeatureExtract

runApplication blockMesh

runApplication decomposePar
runParallel snappyHexMesh -overwrite

#- For non-parallel running
#cp -r 0.orig 0 > /dev/null 2>&1

#- For parallel running
ls -d processor* | xargs -I {} rm -rf ./{}/0
ls -d processor* | xargs -I {} cp -r 0 ./{}/0

runParallel patchSummary
runParallel potentialFoam
runParallel $(getApplication)

runApplication reconstructParMesh -constant
runApplication reconstructPar -latestTime

///////

Any ideas of where the mistakes are?
Thanks
zizou1 is offline   Reply With Quote

Old   May 18, 2018, 04:37
Default
  #2
New Member
 
anonymous
Join Date: Jan 2016
Posts: 17
Rep Power: 4
simrego is on a distinguished road
Hi!


You mean, you wanna see your mesh and stl files together?


Btw I can't see your "locationInMesh" entry in your SHMDict. If you had any errors in your log files please post them.
simrego is offline   Reply With Quote

Old   May 18, 2018, 06:15
Default
  #3
New Member
 
Join Date: Mar 2018
Posts: 13
Rep Power: 2
zizou1 is on a distinguished road
snappyHexMesh > log.snappyHexMesh


--> FOAM FATAL IO ERROR:
keyword castellatedMeshControls is undefined in dictionary "D:/blueCFD-Core-2016/ofuser-of4/run/pipe/system/snappyHexMeshDict"

file: D:/blueCFD-Core-2016/ofuser-of4/run/pipe/system/snappyHexMeshDict from line 17 to line 114.

From function const Foam::dictionary& Foam::dictionary::subDict(const Foam::word&) const
in file db/dictionary/dictionary.C at line 642.

FOAM exiting


decomposePar > log.decomposePar


--> FOAM FATAL ERROR:
Case is already decomposed with 4 domains, use the -force option or manually
remove processor directories before decomposing. e.g.,
rm -rf D:/blueCFD-Core-2016/ofuser-of4/run/pipe/processor*


From function int main(int, char**)
in file decomposePar.C at line 393.

FOAM exiting

reconstructParMesh > log.reconstructParMesh


--> FOAM FATAL ERROR:
Your current settings specify ASCII writing with 6 digits precision.
Your merging tolerance (1e-007) is finer than this.
Please change your writeFormat to binary or increase the writePrecision
or adjust the merge tolerance (-mergeTol).

From function int main(int, char**)
in file reconstructParMesh.C at line 516.

FOAM exiting

potentialFoam > log.potentialFoam


--> FOAM FATAL IO ERROR:
keyword potentialFlow is undefined in dictionary "D:/blueCFD-Core-2016/ofuser-of4/run/pipe/system/fvSolution"

file: D:/blueCFD-Core-2016/ofuser-of4/run/pipe/system/fvSolution at line 22.

From function const Foam::dictionary& Foam::dictionary::subDict(const Foam::word&) const
in file db/dictionary/dictionary.C at line 642.

That's all.
The locationInMesh must be set to any specific coordinates?
zizou1 is offline   Reply With Quote

Old   May 18, 2018, 06:30
Default
  #4
New Member
 
anonymous
Join Date: Jan 2016
Posts: 17
Rep Power: 4
simrego is on a distinguished road
There are many errors. First of all i think you miss the closing bracket for the geometry entry in your SHMDict.
The locationInMesh tells shm which part of the mesh should be kept (the stl will cut the domain into 2 or more parts, and you have to mark which one do you want to use)


Also use decomposePar -force, or delete the processor directories before you run decomposePar


And in controlDict set 7 digits precision or decrease your merging tolerance in reconstructParMesh. But if you use reconstructPar -latestTime, you don't need reconstructParMesh before that.


And there are also problems with potentialFoam. I think you should skip this part if you learning openFOAM, and when u understand the basics, you can do more fancy stuff.


For the meshing just run these:


blockMesh
decomposePar -force # -force delete your processor directories if you have.
mpirun -np numberOfProcessors snappyHexMesh -parallel -overwrite #replace numberOfProcessors with the number of processors you have (i mean how much you use)
reconstructParMesh -constant



if it's fine, you can go to the solving phase.
simrego is offline   Reply With Quote

Old   May 18, 2018, 06:45
Talking
  #5
New Member
 
Join Date: Mar 2018
Posts: 13
Rep Power: 2
zizou1 is on a distinguished road
Lovely simrego!
I'll go for this and then let's see what happens!
Thanks
zizou1 is offline   Reply With Quote

Old   May 18, 2018, 10:54
Default
  #6
New Member
 
Join Date: Mar 2018
Posts: 13
Rep Power: 2
zizou1 is on a distinguished road
Dear simrego,
this is what comes out after the snappy has been run:

Exec : SnappyHexMesh -parallel -overwrite
Date : May 18 2018
Time : 16:52:57
Host : "PANDI-PC"
PID : 3996
Case : D:/blueCFD-Core-2016/ofuser-of4/run/pipe
nProcs : 4
Slaves :
3
(
"PANDI-PC.1988"
"PANDI-PC.6348"
"PANDI-PC.3024"
)

Pstream initialized with:
floatTransfer : 0
nProcsSimpleSum : 0
commsType : nonBlocking
polling iterations : 0
SigFpe : Enabling floating point exception trapping (FOAM_SIGFPE).
fileModificationChecking : Monitoring run-time modified files using timeStampMaster
allowSystemOperations : Allowing user-supplied system call operations

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

Create mesh for time = 0

Read mesh in = 1.017 s

Overall mesh bounding box : (-0.07 -0.07 0) (0.07 0.07 2)
Relative tolerance : 1e-006
Absolute matching distance : 2.009776e-006

butterflyValve.stl : using scale 0.00276
Reading refinement surfaces.
[1]
[3]
[0]



[1]
[3]
[0]

[2]


[1]

[3]
[0]
--> FOAM FATAL IO ERROR:
[2]
--> FOAM FATAL IO ERROR:
--> FOAM FATAL IO ERROR:




[1]
[2]
[3]
[0]
keyword refinementSurfaces is undefined in dictionary "IOstream.castellatedMeshControls"
--> FOAM FATAL IO ERROR:
keyword refinementSurfaces is undefined in dictionary "IOstream.castellatedMeshControls"
keyword refinementSurfaces is undefined in dictionary "D:/blueCFD-Core-2016/ofuser-of4/run/pipe/system/snappyHexMeshDict.castellatedMeshControls"




[1]
[2]
[0]

[3]
keyword refinementSurfaces is undefined in dictionary "IOstream.castellatedMeshControls"

[1]


file:
[2]
IOstream.castellatedMeshControls

from line
[2]
[3]
0
file:
file:
to line
IOstream.castellatedMeshControls
0
IOstream.castellatedMeshControls
.
from line

[1]
from line
[1]
0
0
From function
to line
to line
const Foam::dictionary& Foam::dictionary::subDict(const Foam::word&) const
0

0
.
[1]
.

in file

[2]
db/dictionary/dictionary.C
[3]

at line

[2]
[0]
642
[3]
From function
file:
.
From function
const Foam::dictionary& Foam::dictionary::subDict(const Foam::word&) const
const Foam::dictionary& Foam::dictionary::subDict(const Foam::word&) const

D:/blueCFD-Core-2016/ofuser-of4/run/pipe/system/snappyHexMeshDict.castellatedMeshControls

[1]
from line
[3]

FOAM parallel run exiting
33
in file
[1]
to line
db/dictionary/dictionary.C

49
at line
.
642

.
[0]


[3]
FOAM parallel run exiting
[0]
[3]
From function

const Foam::dictionary& Foam::dictionary::subDict(const Foam::word&) const
[0]

in file
[2]
db/dictionary/dictionary.C
in file
at line
db/dictionary/dictionary.C
642
at line
job aborted:
[ranks] message

[0] terminated

[1] application aborted
aborting MPI_COMM_WORLD (comm=0x44000000), error 1, comm rank 1

[2] terminated

[3] application aborted
aborting MPI_COMM_WORLD (comm=0x44000000), error 1, comm rank 3

---- error analysis -----

[1,3] on PANDI-PC
SnappyHexMesh aborted the job. abort code 1

---- error analysis -----
zizou1 is offline   Reply With Quote

Old   May 18, 2018, 12:52
Default
  #7
New Member
 
anonymous
Join Date: Jan 2016
Posts: 17
Rep Power: 4
simrego is on a distinguished road
--> FOAM FATAL IO ERROR:
keyword refinementSurfaces is undefined in dictionary "IOstream.castellatedMeshControls"


In the castellatedMeshControls you miss the refinementSurfaces entry
You need something like this:

Code:
refinementSurfaces
{
        butterflyValve
        {
            // Surface-wise min and max refinement level
            level (5 6); 

            // Optional specification of patch type (default is wall). No
            // constraint types (cyclic, symmetry) etc. are allowed.
            //patchInfo
            //{
            //   type wall;
            //    inGroups (motorBikeGroup);
            //}
        }
}
You can play with the levels. level (5 6) means the SHM will cut the cells 5 times which intersected by the surface, 6 means it will cut 6 times where the angle is greater than the "resolveFeatureAngle", which entry also missing, i'm not sure if it is needed or it has a default value. You should read this link:
https://cfd.direct/openfoam/user-guide/snappyhexmesh/

Then analize this code and try to understand the meaning of the lines. I think for the begining just replace your dict with this one, and only modify only the following:
https://github.com/OpenFOAM/OpenFOAM...ppyHexMeshDict
castellatedMesh true; // This will cut the cells (you can see in the prev link.), and then u can enable snap if you understand what's happening in the castellation phase, and then enable add layers. I think like this it's easier to understand what's going on in the different phases. Of course later you can do everything for the first time, but i'm not sure if you know what are you doing exactly yet.
snap false;
addLayers false;

geometry { ... };
features { ... };
refinementSurfaces { ... };
refinementRegions { //You can leave it empty now. };
layers { ... };

Then you can play with the parameters and try to understand the meaning of them if they are not clear from the comments.
For the first time snappyHexMesh is a mess for everyone I think. But if you understand the main parts once, it will be much easier.


Sorry for this long post, i hope i wrote something useful for you. I could make the SHMDict for you, but it's better if you figure out yourself. If you feel that you totally lost, just ask me, and I'll try to help you (maybe it's better in private). Good luck!
(And also sorry for my english. )
simrego is offline   Reply With Quote

Old   Today, 13:01
Default
  #8
New Member
 
Join Date: Mar 2018
Posts: 13
Rep Power: 2
zizou1 is on a distinguished road
Dear simrego,
thank you very much for the time spent for me.
Actually the snappy problem is almost solved. Now i'm trying to run icofoam in the snapped pipe, but at the end of the process Paraview outputs a message saying that the mesh points are much more than the fields (p and U) points/cells. I don't know if the problem is in my code or somewhere else.
zizou1 is offline   Reply With Quote

Reply

Thread Tools
Display Modes

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 On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
Creating waterproof STL using snappyHexMesh or salome Tobi OpenFOAM Native Meshers: snappyHexMesh and Others 37 November 25, 2017 13:38
STL on Gmsh + Mesh on Snappy adrieno OpenFOAM Meshing & Mesh Conversion 3 May 20, 2016 12:22
The fl process could not be started because of UDF majid_kamyab Fluent UDF and Scheme Programming 6 December 15, 2015 09:42
Using snappy on a propeller stl - not working orkavic OpenFOAM Native Meshers: snappyHexMesh and Others 2 January 21, 2014 03:35
Snappy mesh- stl file Joanna Huang OpenFOAM Native Meshers: snappyHexMesh and Others 1 January 14, 2013 14:00


All times are GMT -4. The time now is 19:26.