about Hex at blockMeshDict
Hello everyone,
Could you explain to me about hex ? for instance : blocks ( hex (0 1 5 4 12 13 17 16) (23 8 1) simpleGrading (1 1 1) hex (2 3 7 6 14 15 19 18) (19 8 1) simpleGrading (1 1 1) ... I dont know about (23 8 1), do you know? please tell me, thank you!:) |
Hi,
(23 8 1) in this case means 23 cells in the first direction (x or x1, however you want to call it), 8 cells in the second direction (y or x2) and 1 cell in the third direction (z or x3) You can find the details here: https://cfd.direct/openfoam/user-guide/blockmesh/ Cheers, Antimony |
Thank you for your explain.
oh i see, that is to get the grid in 1 box or 1 volume ? best, arisna Quote:
|
Those 3 numbers of cells in the x, y, and z directions only apply to a single hex. In your example, you have 2 hexes with each one having the same numbers of cells in the y and z directions, but different numbers of cells in the x direction. You would want the y and z cell numbers to be the same if you intended to connect the two hexes as a single mesh object. This approach is called face matching with the alternative being face merging; however, without seeing the rest of your blockMeshDict it is impossible to tell if this is the case. If you have more questions, you should post the entire blockMeshDict in a code block so it's easy to read.
|
flow on the sharp crested triangle weir
http://file:///home/ceren/%C4%B0ndirilenler/images.pngi have a triangle weir. i am trying execute blockmeshdict. this is 3D. i cant do that unfortunately.
have you done it before or like this? i need guidance.. :confused: https://www.cfd-online.com/Forums/da...BJRU5ErkJggg== https://swmm5.org/2016/09/04/weir-ba...-and-infoswmm/https://swmm5.org/2016/09/04/weir-background-equations-for-swmm5-and-infoswmm/ https://www.cfd-online.com/Forums/da...BJRU5ErkJggg== |
Hi Ceren,
Can you post the details of your geometry and the blockMeshDict that you attempted to use? Then I can try to help you. As an initial suggestion though, if you want to make a triangular shaped hex region, you need to collapse nodes on top of each other so that 2 pairs of nodes overlap. This is demonstrated in the OpenFOAM User Guide (see image below). https://cdn.cfd.direct/docs/user-gui...g/user394x.png Your blockMeshDict entries for such a hex would be something like... hex (0 1 2 3 4 5 5 4) and the "collapsed" patch has an area of zero, which means you should give it the empty boundary condition for files in your 0 directory. The patches describing the hex faces should be something like... (0 1 2 3) (1 2 5 5) (0 3 4 4) (0 1 5 4) (2 5 4 3) (4 5 5 4) A more complete description can be found at... https://cfd.direct/openfoam/user-guide/v6-blockmesh/ ...and looking at section 5.3.5 Creating blocks with fewer than 8 vertices. Best, Andrew |
Also, it might make some sense to just make a large rectangular channel using blockMesh and then import an .stl surface file that has your weir geometry using snappyHexMesh. I had forgotten what a triangle weir looks like and it might be a bit annoying to do using blockMesh alone.
You can make a 3D solid in a program like Autodesk's Inventor and then export it as an .stl file (stereolithography file, which makes a surface out of triangles using unit normal vectors and the coordinates of the triangle corner points). However, before using snappyHexMesh, you would need to extract data from the .stl file using the surfaceFeatureExtract command. Also, your .stl file would need to be placed in <yourCaseDirectory>/constant/trisurface and then you need surfaceFeatureExtractDict in <yourCaseDirectory>/system along with all of the other necessary files. Then you can build the case with the following commands... blockMesh surfaceFeatureExtract snappyHexMesh setFields If your model is very complex in terms of the amount cells you want to use or you want to refine certain regions a lot, then you can run snappyHexMesh in parallel as follows... decomposePar -copyZero mpirun -np <numberOfProcessors> snappyHexMesh -parallel reconstructParMesh -mergeTol 1e-06 -time <lastestTime> reconstructPar -time <latestTime> In the above commands, "latestTime" = (number of snappyHexMesh operations)*(time step from controlDict). The 3 possible snappyHexMesh operations are "castellatedMesh", "snap", and "addLayers", which are specified to be either true or false at the beginning of snappyHexMeshDict. The number of these operations that are set to be true is the amount to use when determining "latestTime". Good luck! |
https://swmm5.files.wordpress.com/2016/09/image0096.jpg
hi Andrew, thank you for your answer. i tried adding picture. i am checking over your writing. I hope I can solve this problem. thanks again. ceren |
Triangular Weir Example
1 Attachment(s)
Hey Ceren,
I had a chance to look over the triangular weir problem a bit more and make a demonstration of how to execute the suggestions I gave in my previous post. I attached the case directory I created so you can directly see everything discussed below. I used Autodesk's Inventor to draw the triangular weir shape with lines to create a closed shape outline and then extruded this shape as a 3D solid. Next I used the export option to save the model as an .stl file, which is how it should be saved for use with OpenFOAM. The image below illustrates the result of these steps. Triangle Weir Outline with Extruded 3D Solid: https://i.imgur.com/ArvAVrY.png To create this example, the weirOverflow tutorial, for which the path should be something like ./OpenFOAM-x.x/tutorials/multiphase/interFoam/RAS/weirOverflow, where x.x is the version number, was copied and heavily modified to create what I hope is a reasonably straightforward example. In the constant directory, a directory named triSurface was added. Then the weir .stl file, TriangleWeir.stl, was placed in the triSurface directory. Additionally, the gravity file g was adjusted to be (0 0 -9.81) so that the acceleration vector was acting in the negative z-axis direction instead of the negative y-axis direction. This was necessary based on the coordinate system I chose to draw the triangle weir in. Next, the geometry and initial condition files were modified as described below. Note that the files decomposePar, meshQualityDict, surfaceFeatureExtractDict, and snappyHexMeshDict were added to the system directory of the tutorial. Also, the headers and all comments were omitted for each file in this post to save space, but they are included in the attached case files. Additionally, the domain was resized to be 2.0 m long (x-direction), 1.0 m wide (y-direction), and 1.0 m tall (z-direction) with the weir (25 mm thick in x-dir., 1.0 m wide in y-dir., 0.5 m tall in z-dir. with a 90 degree triangle that had its bottom 0.25 m above the bottom of the channel) placed in the middle of the channel. In the system directory, the following files were modified or added: blockMeshDict: Code:
convertToMeters 1; Code:
defaultFieldValues Code:
// Which of the steps to run Code:
// Include defaults parameters from master dictionary Code:
TriangleWeir.stl Code:
numberOfSubdomains 32; include/initialConditions: Code:
inletFlowRate 0.02451; https://i.imgur.com/K2G3JAw.jpg alpha.water: Code:
#include "include/initialConditions" Code:
#include "include/initialConditions" Code:
#include "include/initialConditions" Code:
dimensions [0 2 -1 0 0 0 0]; Code:
#include "include/initialConditions" Code:
#include "include/initialConditions" Code:
rm -r 0 https://i.imgur.com/EKQswNi.png Finally, a pretty result image! This image was generated for the system state at 9 seconds of simulated time (I changed the writeInterval parameter in ./system/controlDict to be 1 instead of 2). Also, the surface was shaded according to the velocity magnitude. https://i.imgur.com/fABDVRQ.png |
All times are GMT -4. The time now is 08:00. |