BlockMesh cellSet refineMesh
refineMesh by default refines the whole mesh. Use
refineMesh -dict to refine according to the dictionary. |
Thank you very much for your h
Thank you very much for your help. This has been the fine but important information, I needed.
In my refineMeshDict above seems to be a little mistake. The third refinement direction should be named as "normal", not "tan3": directions ( tan1 tan2 normal ); |
refineMesh tetrahedral
Quote:
Does refineMesh utility works on tetrahedral mesh? If no, is there any other utility available in OpenFOAM to do that? Hrushikesh |
how does tan1, tan2 get calculated while refining Mesh?
I am new to CFD so couldnt get how does it calculate... please help me out.. Thanks |
Solution for a faster refinement
Hello Mattijs,
I am using refineHexMesh to refine different parts of my domain. Since I have around 10 different refinement parts, after the first few, it starts getting really slow. My assumption is due to the entire domain being under consideration for refinements. Can I isolate it with sets and just include that region during refinement so that the process is much faster then later combine these sets or merge it into the main mesh file? Challenger |
Hi there,
as you are using the refineMesh utility I would like to ask you, how to use it. I found out, that the "refineMeshDict" has to be in the system/ folder. When I start refineMesh -dict it says that the file user-1.7.1/run/cases/mesh/constant/polyMesh/sets/c0 at line 0. cannot be found. The mesh was created with the blockMesh-command and is simply a box. How do i get the sets "c0" and so on? Thanks for your help! |
Quote:
In order to refine a mesh, you need to specify which part or which cells are being selected. To do this, use the command setSets, this creates set which are later used by the refineMeshDict to refine the mesh. then include this set name in the refineMeshDict in order to refine those cells. setSet requires a batch file the file is just an info on which cells are selected. this is what I do, cellSet ref new boxToCell (-10 -35.0 -10) (10 35 87.6) > refinement setSet -batch refinement -latestTime refineMesh -dict the dict should include the refinement set name. in this case its ref Hope that helped. Cheers! |
Hi challenger!
Thanks! Yes, it helps! I just started with the cellSetDict to create the sets which should be the same what you are doing with cellSet command. I just refined my first "little area". Now I'll see how it works with multiple cellSets and maybe I'll have a great weekend ;) Greetings! |
Quote:
Could you explain me how I can refine a specific region in a cavity? What can I do exactly? Thanks in advance! |
Foamers!
Do anybody know what to specify if I want to have an extra refined mesh in a region? By default, refineMesh divides cells in 4 for a 2D case, or by 8 for a 3D case. I would like the refinement to be better than this. Thanks! |
you can run it twice, or as often as you need it...
|
1 Attachment(s)
Tried, but doesnt serve my purpose of increasing the cell resolution in the central part (as seen in screenshot where I ran the utility three times)
|
1 Attachment(s)
I do it quite often, but maybe different. You can see it in the attachment. I have several cellSet Files with some space in between them. So I run cellSet (with file 1) refineMesh, then the next CellSet and again refineMesh and so on..
edit: and maybe switch of decompose polyhedrons in paraview... Attachment 18230 |
Ok! It will serve my purpose, and you screenshot is exactly what I am looking for :).
How did you automate this? I need to do it maybe 8 times, and modifying the dict files each time is not a good solution. How do you create your cellSets? Do you have a cellSetDict you manually edit for each refinement? Ideally, I could create the sets from the command line so I can include it in my shell script... Thanks! |
Yes i use a script.
You need several cellSet files called cellSetDict.1, cellSetDict.2 .... I created them manually. Then I use the following script (credits to the one who wrote it, I actually don't know) Code:
refineMeshByCellSet() Greetings |
Hello,
I donīt know how to go on. what I did so far: snappyHexMesh -overwrite --> creation of the mesh (creation of folder 0 ) insideCells refine.stl cellSet --> creation of a set of cells from the mesh refineMesh -dict --> refinement of the cells in the set cellSet (creation of folder 1) everything is fine, the mesh is refined Afterwards I want to do a refinement again (the .stl-file covers a part of the first .stl-file) insideCells refine2.stl cellSet2 refineMesh -dict (I changed the name cellSet to cellSet2 in the refineMeshDict) I get the following error: Create time Create polyMesh for time = 1 #0 Foam::error::printStack(Foam::Ostream&) in "/home/OpenFOAM/OpenFOAM-2.1.1/platforms/linux64GccDPOpt/lib/libOpenFOAM.so" #1 Foam::sigFpe::sigHandler(int) in "/home/OpenFOAM/OpenFOAM-2.1.1/platforms/linux64GccDPOpt/lib/libOpenFOAM.so" #2 in "/lib64/libc.so.6" #3 in "/home/OpenFOAM/OpenFOAM-2.1.1/platforms/linux64GccDPOpt/bin/refineMesh" #4 in "/home/OpenFOAM/OpenFOAM-2.1.1/platforms/linux64GccDPOpt/bin/refineMesh" #5 __libc_start_main in "/lib64/libc.so.6" #6 at /usr/src/packages/BUILD/glibc-2.11.2/csu/../sysdeps/x86_64/elf/start.S:116 Gleitkomma-Ausnahme can anybody help? What do I have to change when I want to refine the mesh twice? Thanks a lot idefix |
Quote:
I don't really like this behaviour, but this post of yours saved my day! I assumed that refineMesh uses the dictionary by default, and that the -dict option is used to point to an alternative dictionary. |
Problems in refineMesh
Hello Foamers,
I am new to openfoam and thus am struggling with some commands. I had created a mesh in Salome and imported it into Openfoam. I have run one analysis and now want to refine my mesh. But when i am using 'refineMesh -overwrite' command it terminates with "Aborted- Core Dumped". A bunch of files are written in my case directory but the mesh is not refined (verified this using checkMesh). I am using OF-2.2.2 Can anyone please suggest what i am doing wrong. Thank you in advance for your help! :) |
Hello,
do you want to refine your whole mesh or only a part? |
I suppose that this utility is not valid if I want to refine along x and y direction but not along z direction because keeping the first cell height is a must.
In that case, what utility can I use? Maybe Mesquite? |
I had created a tetrahedral mesh and want to refine the whole mesh. I looked through the code of refineMesh and from what I understand it runs for hexahedral mesh only. . Is that so?
|
Actually you can refine along x and y but not along z. That's what the refineMeshDict is for.
In the source folder of refineMesh you find a commented version of the dictionary. This is the case for most utilities in OpenFOAM. So, check out $FOAM_APP/utilities/mesh/manipulation/refineMesh |
problems with refinemesh
hi Iīm new in openFoam, Iīm trying to model a vessel to find the resistance coefficients, using the snappyhexmesh, I have some problems to make a refinement in the box where the ship should go using refinemesh but I canīt do it, need some help
|
Hi David,
Welcome to the forum. First of all, please do no double or triple post almost identical questions across multiple theads. Secondly, you do not describe what you have tried and how you have failed. Please read the following link, as it will make your succes on forum more probable: http://www.cfd-online.com/Forums/ope...-get-help.html Kind regards, Niels |
refining region inside blockMesh
Quote:
I saw your post and I think you can help me. I am using OF2.1.1. I am using blockMesh to generate mesh and now I want to refine a specific region inside it... so what should I get or do.. please any help because I am so confused best regards, Sandy13, |
Hello Sandy13,
could you give me some more information? how is the grid looking like and the area you want to refine? See you idefix |
4 Attachment(s)
Quote:
Thank you so much for accepting to help me. The mesh is as in the posted picture. I have a long cuboid domain and I want to simulate liquid jet coming from a circular patch from top to bottom through the domain. because I need a high resolution around the liquid through the domain, I want to to refine a specific region along the all domain just a bit bigger than the diameter of the circular patch, so I do not have to increase the mesh all over the domain which runs my case very slow. I tried blockMeshDG but still not that efficient, I want some thing like what snappyHexMesh has... refinementRegions but works on block dict. If you have any syfisticated way to do please help me. I attched my blockMesh file as well.. best wishes, Sandy13, |
Hello,
am I wrong or did you forget to upload the blockMesDict? Do you have any access to ICEM CFD? Did I understand it correct that you want to refine a volume which has the shape of a hollow cylinder? Greetings idefix |
Quote:
I am sorry, it was my fault, I did not upload, so here we go below my blockMesh details. What I want exactly is to refine region in the centre has the same height of my domain(z-axis) but the smaller in the length and width(x and y axis). FoamFile { version 2.0; format ascii; class dictionary; object blockMeshDict; } // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // convertToMeters 1.0; vertices ( (-0.00106 -0.00106 0)//0 // points 0-7 for centerral hex (0.00106 -0.00106 0)//1 (0.00106 0.00106 0)//2 (-0.00106 0.00106 0)//3 (-0.00106 -0.00106 0.2625)//4 (0.00106 -0.00106 0.2625)//5 (0.00106 0.00106 0.2625)//6 (-0.00106 0.00106 0.2625)//7 (0.00106 0.005 0)//8 // thes points relevent for the back hex (-0.00106 0.005 0)//9 (0.00106 0.005 0.2625)//10 (-0.00106 0.005 0.2625)//11 (-0.005 0.005 0)//12 // thes points relevent for back left hex (-0.005 0.00106 0)//13 (-0.005 0.005 0.2625)//14 (-0.005 0.00106 0.2625)//15 (-0.005 -0.00106 0)//16 // thes points relevent for left hex (-0.005 -0.00106 0.2625)//17 (-0.005 -0.005 0)//18 // thes points relevent for front left hex (-0.00106 -0.005 0)//19 (-0.005 -0.005 0.2625)//20 (-0.00106 -0.005 0.2625)//21 (0.00106 -0.005 0)//22 // thes points relevent for front hex (0.00106 -0.005 0.2625)//23 (0.005 -0.005 0)//24 // thes points relevent for front right hex (0.005 -0.00106 0)//25 (0.005 -0.005 0.2625)//26 (0.005 -0.00106 0.2625)//27 (0.005 0.00106 0)//28 // thes points relevent for right hex (0.005 0.00106 0.2625)//29 (0.005 0.005 0)//30 // thes points relevent for back right hex (0.005 0.005 0.2625)//31 ); blocks ( hex (0 1 2 3 4 5 6 7) (8 8 800) simpleGrading (1 1 1) //0 centeral hex hex (3 2 8 9 7 6 10 11) (8 8 800) simpleGrading (1 1 1) //1 back center hex (3 9 12 13 7 11 14 15) (8 8 800) simpleGrading (1 1 1) //2 back left corner hex (0 3 13 16 4 7 15 17) (8 8 800) simpleGrading (1 1 1) //3 left center hex (0 16 18 19 4 17 20 21) (8 8 800) simpleGrading (1 1 1) //4 front left corner hex (1 0 19 22 5 4 21 23) (8 8 800) simpleGrading (1 1 1) //5 front hex (1 22 24 25 5 23 26 27) (8 8 800) simpleGrading (1 1 1) //6 front right corner hex (2 1 25 28 6 5 27 29) (8 8 800) simpleGrading (1 1 1) //7 right hex (2 28 30 8 6 29 31 10) (8 8 800) simpleGrading (1 1 1) //8 back right corner ); edges ( arc 2 3 (0.0 0.0015 0) arc 3 0 (-0.0015 0.0 0) arc 0 1 (0.0 -0.0015 0) arc 1 2 (0.0015 0.0 0) arc 6 7 (0.0 0.0015 0.2625) arc 7 4 (-0.0015 0.0 0.2625) arc 4 5 (0.0 -0.0015 0.2625) arc 5 6 (0.0015 0.0 0.2625) ); boundary ( outlet { type patch; faces ( (0 3 2 1) (2 3 9 8) //lower patches (3 13 12 9) (3 0 16 13) (0 19 18 16) (0 1 22 19) (1 25 24 22) (1 2 28 25) (2 8 30 28) ); } inlet { type patch; faces ( (4 5 6 7) ); } walls { type patch; faces ( (13 15 14 12) //left wall (16 17 15 13) (18 20 17 16) (18 19 21 20) // front (19 22 23 21) (22 24 26 23) (24 25 27 26) //right (25 28 29 27) (28 30 31 29) (12 14 11 9) //back (9 11 10 8) (8 10 31 30) (7 6 10 11) // upper patches (7 11 14 15) (4 7 15 17) (4 17 20 21) (5 4 21 23) (5 23 26 27) (6 5 27 29) (6 29 31 10) ); } ); mergePatchPairs ( ); //.................................................. ................//# thanks again for helping me. Best wishes, Sandy13 |
1 Attachment(s)
Dear Sandy13,
thanks for the information. I assumed that the cylinder in the middle is not hollow. What I did is the following: I created a cylinderInner.stl-file with the geometry of the cylinder. Inside thise cylinder the cells will be refinded. If you do it, you must be careful. I donīt know why but only if the normals of the surfaces point outside the refinement later will work. Put the file cylinderInner.stl in your case-folder (like constant and system). Use the command: insideCells cylinderInner.stl innerSet (the name innerSet is chosen from me) If there is a problem in this step, create a folder "sets": constant/polyMes/sets then try it again now there is a new cell set in constant/polyMesh/sets which is called "innerSet" you can look at it with: foamToVTK -cellSet innerSet or foamToVTK -constant -cellSet innerSet now you need the file refinementMesh in system: FoamFile { version 2.0; format ascii; class dictionary; location "system"; object refineMeshDict; } // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // // Cells to refine; name of 'cellSet' set innerSet; // Type of coordinate system: // - global : coordinate system same for every cell. Usually aligned with // x,y,z axis. Specify in globalCoeffs section below. // - patchLocal : coordinate system different for every cell. Specify in // patchLocalCoeffs section below. coordinateSystem global; // Specifies 2 directions by a name and a vector. The normal direction is // calculated as tan1^tan2 globalCoeffs { //Verfeinerung in x-Richtung tan1 ( 1 0 0 ); tan2 ( 0 1 0 ); // Verfeinerung in y-Richtung // tan1 ( 0 1 0 ); // tan2 ( 1 0 0 ); // Verfeinerung in z-Richtung // tan1 ( 0 0 1 ); // tan2 ( 0 1 0 ); } patchLocalCoeffs { // Normal direction is face normal of zero'th face of patch patch outside; tan1 ( 1 0 0 ); tan2 ( 0 0 1 ); } // Specifies the direction to be refined by the name used above // To refine in the third direction, use the keyword 'normal' directions ( tan1 tan2 normal ); // Whether to use hex topology. This will // - if patchLocal: all cells on selected patch should be hex // - split all hexes in 2x2x2 through the middle of edges. useHexTopology yes; // Cut purely geometric (will cut hexes through vertices) or take // topology into account. Incompatible with 'useHexTopology' geometricCut no; // Write meshes from intermediate steps writeMesh no; here: // Cells to refine; name of 'cellSet' set innerSet; you have to use the same name as the cellSet (created with "insideCells ...") in the next step just use refineMesh –dict a new time step will be created which contains your new grid. The refineMeshDict refines the cells in every direction. If you just want to refine in one direction you have to change it. If you want to refine the cells several time I suggest that you use at a first step a bigger cylinder for the first refinement. For the second refinement use a smaller cylinder. Otherwise the cells donīt look nice any more. I hope it helps, otherwise feel free to ask again. I had to zip the *.stl file because otherwise I couldnīt upload it. See you idefix |
Quote:
Thank you very much for supporting me, I do not know how to thank you, I will try the suggestion you posted to me and let you know If I had success.. best wishes, Sandy13, |
Quote:
I tried to do as you told me exactly. So I saved the the stl file you done and saved it in both constant and systemfolder, then ran the command you sent after blockMesh, but I got this error message Create time Create polyMesh for time = 0 Reading surface from "cylinderInner.stl" --> FOAM FATAL ERROR: Cannnot read "cylinderInner.stl" From function triSurface::read(const fileName&, const word&, const bool) in file triSurface/triSurface.C at line 369. FOAM exiting Then I did sets folder inside poly folder and put the stl file you sent as you said and ran the same command but it did not run and I got the same error message. I am using OF2.1.1 version. As the error message says I need to red this file from triSurface, so inside constant folder I done triSurface and put the stl file, but still I get the same error message when I run the command you sent.. Do you please have any solution? best wishes, Sandy13, |
Quote:
Okay - prolbem solved :) the STL has to be in the "case" diroctory. Not in the triSurface. best wishes, Sandy13, |
Quote:
I tried using the method you suggested, It works very well, but not as I want because this utility refine the all mesh across the all domain not like I want. I want to refine just a cuboid smaller than my domain inside it and keep the rest of mesh as it is. Please help me if you have any Idea... best wishes, Sandy13 |
Hi Sandy,
the magic is in // Cells to refine; name of 'cellSet' set innerSet; when using refineMesh. You can create all kinds of cellSets to select the cells you want to refine, for example only choosing certain cells that contain a certain range of flow velocity or pressure, by using topoSet. once you have created a cellSet with topoSet that contains the cells you want to refine, you can control wether you want to split the cells in x, y or x y and z directions in the refineMeshDict dependent on the presence of tan1, tan2 and normal in directions ( tan1 // x tan2 // y normal // z ); But you have to be aware that you call refineMesh as 'refineMesh -dict system/refinemeMeshDict' in OF 2.3 |
1 Attachment(s)
Hi all,
in the attached picture, I have two blockMeshDict file one for fluid and another for solid as following Code:
/*--------------------------------*- C++ -*----------------------------------*\ Code:
/*--------------------------------*- C++ -*----------------------------------*\ The thickness of the plate (foil) is 0.06, I would like to refine the mesh near the foil. How could do that? Help me please by write all steps in order to do that. Lots of thanks in advanced. Maimouna |
1 Attachment(s)
Hi,
I am using refineMesh to refine the cells locally. But from this refinement, some tetrahedral cells with high skewness are generated. How to get rid of these elements? Can I maintain the size of the original cells which are adjacent to the refined cells? Attached is the mesh after having been refined. You could see the tetrahedral cells at cell faces between the refined cells (right or upper cells) and the cells not being refined (left cells). I would imagine if this can be done, eventually i will have some non-conformal cells or maybe some inner faces. This is what I want to have from my mesh. The local refinement but without any tetrahedral cells. Please anyone who had the same problem share your experience here. Thanks. Best ebb19 |
Hi,
I know this is an old post. Can you tell me how to generate an stl file from the program that idefix attached. I tried saving a file generated by that program in an stl file and I openned the file, but the content of the file is unreadable. How do we then include this stl file into constant folder of OpenFOAM? I am confused about using this stl file. My intention is to specify a region to be refined. I can not use typical cellSources such as cylindertoCell, boxtoCell, etc because nono of them is exactly as I want. Can you please explain to me how you used the stl file to refine a specific region in your domain? |
4 Attachment(s)
Quote:
Hello There You've gone the wrong way. Follow the right method on the following, which differs only in one more topoSet. Present case As an example, I ran refining on cavity case. I created two sets named mediumCellSet and hiCellSet ; images are attached. We want to refine mediumCellSet less and hiCellSet more. Wrong method 1- blockMesh 2- topoSet 3- refineMesh (on mediumCellSet) 4- refineMesh (on hiCellSet) 5- Result:wrongMethod.jpg (attached) Right method - before step 4 mentioned above, execute a topoSet again. - Result:rightMethod.jpg (attached) |
Hi:
I want to konw have you solved this problem? |
All times are GMT -4. The time now is 09:10. |