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

[snappyHexMesh] Using stl files with boundaryField

Register Blogs Community New Posts Updated Threads Search

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
Old   January 18, 2021, 13:04
Default Using stl files with boundaryField
  #1
New Member
 
John Wooten, PhD
Join Date: Dec 2020
Location: Oak Ridge TN
Posts: 18
Rep Power: 5
Woo37830 is on a distinguished road
I am trying to combine the roomWithRotatingFan ( minus the fan ), with the hotRoom tutorial. My problem is that I'm getting an error about finding patchField entries for various pieces. I'm using openFoam 2012, BTW.

blockMeshDict contains:
scale 1;

vertices
(
( -6.0 -0.5 -0.1)
( 0.5 -0.5 -0.1)
( 0.5 5.0 -0.1)
( -6.0 5.0 -0.1)
( -6.0 -0.5 2.9)
( 0.5 -0.5 2.9)
( 0.5 5.0 2.9)
( -6.0 5.0 2.9)
);

blocks
(
hex (0 1 2 3 4 5 6 7) (65 55 30) simpleGrading (1 1 1)
);

edges
(
);

boundary
(
allBoundary
{
type patch;
faces
(
(3 7 6 2)
(0 4 7 3)
(2 6 5 1)
(1 5 4 0)
(0 3 2 1)
(4 5 6 7)
);
}
);

IN snappyHexMeshDict I have:

castellatedMesh true;
snap true;
addLayers false;

geometry
{
inlet.stl{ type triSurfaceMesh; name inlet;}
outlet.stl{ type triSurfaceMesh; name outlet;}
fixedWalls.stl{ type triSurfaceMesh; name fixedWalls;}
floor.stl{ type triSurfaceMesh; name floor;}
ceiling.stl{ type triSurfaceMesh; name ceiling;}
avatar.stl{ type triSurfaceMesh; name avatar;}
}

castellatedMeshControls
{
maxLocalCells 100000;
maxGlobalCells 8000000;
minRefinementCells 0;
maxLoadUnbalance 0.10;
nCellsBetweenLevels 2;

features
(
{ file "inlet.eMesh"; level 0;}
{ file "outlet.eMesh"; level 0;}
{ file "fixedWalls.eMesh"; level 0;}
{ file "avatar.eMesh"; level 1;}
{ file "floor.eMesh"; level 1;}
{ file "ceiling.eMesh"; level 1;}
);

refinementSurfaces
{
inlet{ level (0 0);}
outlet{ level (0 0);}
fixedWalls{ level (0 0);}
avatar{ level (1 1);}
floor{ level (1 1);}
ceiling{ level (1 1);}
}

resolveFeatureAngle 30;

refinementRegions
{
}

locationInMesh (0.1 0.0 0.01);
allowFreeStandingZoneFaces false;
}

surfaceFeatureExtractDict contains:

inlet.stl
{
extractionMethod extractFromSurface;
includedAngle 150;
}
outlet.stl
{
extractionMethod extractFromSurface;
includedAngle 150;
}
fixedWalls.stl
{
extractionMethod extractFromSurface;
includedAngle 150;
}
avatar.stl
{
extractionMethod extractFromSurface;
includedAngle 150;
}
floor.stl
{
extractionMethod extractFromSurface;
includedAngle 150;
}
ceiling.stl
{
extractionMethod extractFromSurface;
includedAngle 150;
}

And in 0.orig:

dimensions [0 1 -1 0 0 0 0];

internalField uniform (0 0 0);

boundaryField
{
floor
{
type noSlip;
}

ceiling
{
type noSlip;
}

fixedWalls
{
type noSlip;
}
}

Any help identifying where I'm missing something or a place to look to clarify this would be appreciated.
Woo37830 is offline   Reply With Quote

Old   January 20, 2021, 10:26
Default
  #2
Member
 
Petros Ampatzidis
Join Date: Oct 2018
Location: Bath, UK
Posts: 64
Rep Power: 7
petros is on a distinguished road
Hi,

What is the error message that you get? From a first glance, it seems that you're missing the outlet and avatar patches in the 0.org directory.
petros is offline   Reply With Quote

Old   January 20, 2021, 10:36
Default Error message
  #3
New Member
 
John Wooten, PhD
Join Date: Dec 2020
Location: Oak Ridge TN
Posts: 18
Rep Power: 5
Woo37830 is on a distinguished road
Cannot find patchField entry for all allBoundary.
I added avatar and inlet, ceiling and floor to snappyHexMeshDict and to surfaceFeatureExtractDict and still get same error
When surfaceFeatureExtraction runs it shows allBoundary as created.
Woo37830 is offline   Reply With Quote

Old   January 20, 2021, 11:01
Default
  #4
Member
 
Petros Ampatzidis
Join Date: Oct 2018
Location: Bath, UK
Posts: 64
Rep Power: 7
petros is on a distinguished road
I see. The problem is that you have to remove the allBoundary entry. This is supposed to be done after you run

Code:
snappyHexMesh -overwrite
If you do run snappy with -overwrite and still get the allBoundary patch then it might help to run createPatch as it removes any patches with zero faces.

Best,
Petros
petros is offline   Reply With Quote

Old   January 20, 2021, 11:33
Default Removing allBoundary
  #5
New Member
 
John Wooten, PhD
Join Date: Dec 2020
Location: Oak Ridge TN
Posts: 18
Rep Power: 5
Woo37830 is on a distinguished road
I'm sorry, do you mean that blockMeshDict should NOT have:

scale 1;

vertices
(
( -6.0 -0.5 -0.1)
( 0.5 -0.5 -0.1)
( 0.5 5.0 -0.1)
( -6.0 5.0 -0.1)
( -6.0 -0.5 2.9)
( 0.5 -0.5 2.9)
( 0.5 5.0 2.9)
( -6.0 5.0 2.9)
);

blocks
(
hex (0 1 2 3 4 5 6 7) (65 55 30) simpleGrading (1 1 1)
);

edges
(
);

boundary
(
allBoundary
{
type patch;
faces
(
(3 7 6 2)
(0 4 7 3)
(2 6 5 1)
(1 5 4 0)
(0 3 2 1)
(4 5 6 7)
);
}
);

// ************************************************** *********************** //

Or, do you mean it should have that but remove it after running snappyHexMesh -overwrite?

I do run createPatch. Here is the last part of file I process with:

echo "Running blockMesh"
runApplication blockMesh
if [[ -e "constant/triMesh" ]]
then
echo "Running snappyHexMesh"
runApplication snappyHexMesh -overwrite

# - force removal of fields generated by snappy
rm -rf 0

# renumber the mesh
runApplication renumberMesh -overwrite

# - create the inlet/outlet and AMI patches
runApplication createPatch -overwrite
fi
echo "0/T.orig copied to 0/T"
cp 0/T.orig 0/T
echo "Running setFields"
runApplication setFields
# - set the initial fields
restore0
#----------------------------------------------
#runApplication decomposePar
#runParallel $(getApplication)
#runApplication reconstructPar
echo "Run $(getApplication)"
runApplication $(getApplication)
#----------------------------------------------
# convert output files to vtk for ParaView
foamToVTK



I really appreciate your help, BTW!
Woo37830 is offline   Reply With Quote

Old   January 20, 2021, 11:42
Default Removing allBoundary
  #6
New Member
 
John Wooten, PhD
Join Date: Dec 2020
Location: Oak Ridge TN
Posts: 18
Rep Power: 5
Woo37830 is on a distinguished road
If I remove allBoundary in blockMeshDict entirely from the beginning i get:

Code:
--> FOAM FATAL ERROR: (openfoam-2012)
Cannot find file "points" in directory "polyMesh" in times "0" down to constant
Woo37830 is offline   Reply With Quote

Old   January 20, 2021, 11:54
Default
  #7
Member
 
Petros Ampatzidis
Join Date: Oct 2018
Location: Bath, UK
Posts: 64
Rep Power: 7
petros is on a distinguished road
No you shouldn't remove the allBoundary entry from blockMeshDict. This creates the background mesh where snappyHexMesh will work on.

I will try to summarise the key points you need to satisfy:
  • Your allBoundary box should be larger than your stl geometries
  • You should place the locationMesh in snappyHexMesh inside your main geometry
  • Then I think snappyHexMesh -overwrite will do the job

In any case, if you study carefully the rotatingFanInRoom tutorial I am sure you will find your answers.

Best,
Petros
petros is offline   Reply With Quote

Old   January 20, 2021, 11:55
Default Explanation would be helpful
  #8
New Member
 
John Wooten, PhD
Join Date: Dec 2020
Location: Oak Ridge TN
Posts: 18
Rep Power: 5
Woo37830 is on a distinguished road
I think the problem I'm having is that I started with a tutorial hotRoom.

In that the simple box vertices, edges, faces etc. are in blockMeshDict and allBoundary referred to those. I'm trying to move to solving the same problem, but using stl files as input. Thus, the original blockMeshDict doesn't really describe the geometry as it is in the stl files. So, if I have stl files for floor, ceiling, and fixedWalls, how to I write blockMesh to handle that? I'm trying to automate feeding in different sets of stl files describing ceiling, floor, and fixed walls, then produce if necessary the blockMeshDict, etc. then run pimpleFoalm on the model generated this way.

Any suggestions on how to accomplish this?
Woo37830 is offline   Reply With Quote

Old   January 20, 2021, 11:58
Default
  #9
Member
 
Petros Ampatzidis
Join Date: Oct 2018
Location: Bath, UK
Posts: 64
Rep Power: 7
petros is on a distinguished road
See my previous post. I think it has all the information. All in all, you need to adjust your background mesh to enclose your stl geometry.
petros is offline   Reply With Quote

Reply

Tags
blockmeshdict block mesh, boundaryfield, patch


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
[snappyHexMesh] How do I put STL files in interFoam? smj7467 OpenFOAM Meshing & Mesh Conversion 1 January 13, 2021 10:06
[snappyHexMesh] With FreeCAD: creating waterproof STL files? robob OpenFOAM Meshing & Mesh Conversion 11 April 29, 2018 11:33
OF 1.6 | Ubuntu 9.10 (64bit) | GLIBCXX_3.4.11 not found piprus OpenFOAM Installation 22 February 25, 2010 13:43
[OpenFOAM] ParaView 3.6.1 & 3.7.0: Can't view STL files johannes ParaView 2 December 3, 2009 14:07
Problems in compiling paraview in Suse 10.3 platform chiven OpenFOAM Installation 3 December 1, 2009 07:21


All times are GMT -4. The time now is 05:13.