CFD Online Discussion Forums

CFD Online Discussion Forums (https://www.cfd-online.com/Forums/)
-   OpenFOAM Meshing & Mesh Conversion (https://www.cfd-online.com/Forums/openfoam-meshing/)
-   -   [mesh manipulation] BlockMesh cellSet refineMesh (https://www.cfd-online.com/Forums/openfoam-meshing/61518-blockmesh-cellset-refinemesh.html)

mattijs November 13, 2008 14:35

BlockMesh cellSet refineMesh
 
refineMesh by default refines the whole mesh. Use

refineMesh -dict

to refine according to the dictionary.

alexm November 16, 2008 21:56

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
);

Hrushi August 26, 2010 01:51

refineMesh tetrahedral
 
Quote:

Originally Posted by mattijs (Post 195725)
refineMesh by default refines the whole mesh. Use

refineMesh -dict

to refine according to the dictionary.

Hi mattijs,

Does refineMesh utility works on tetrahedral mesh? If no, is there any other utility available in OpenFOAM to do that?

Hrushikesh

Maulik September 21, 2010 04:26

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

challenger November 16, 2010 06:53

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

lindstroem November 26, 2010 05:03

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!

challenger November 26, 2010 05:53

Quote:

Originally Posted by lindstroem (Post 284867)
user-1.7.1/run/cases/mesh/constant/polyMesh/sets/c0 at line 0.
cannot be found.

[In 1.6] (should be the same for 1.7)
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!

lindstroem November 26, 2010 06:07

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!

giovanni10 October 31, 2011 11:54

Quote:

Originally Posted by lindstroem (Post 284878)
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!

Hi,
Could you explain me how I can refine a specific region in a cavity? What can I do exactly? Thanks in advance!


emirust January 16, 2013 09:49

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!

nlinder January 16, 2013 09:55

you can run it twice, or as often as you need it...

emirust January 16, 2013 10:22

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)

nlinder January 16, 2013 10:42

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

emirust January 17, 2013 04:24

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!

nlinder January 18, 2013 05:48

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()
{
  while [ $# -ge 1 ]
  do
      echo "creating cell set for primary zone - $1"
      cp system/cellSetDict.$1 system/cellSetDict
      cellSet > log.cellSet.$1 2>&1

      echo "refining primary zone - $1"
      refineMesh -dict -overwrite > log.refineMesh.$1 2>&1
      shift
  done
}

runApplication blockMesh
echo "BlockMesh finish"
refineMeshByCellSet 1 2 3
echo "refineMeshByCellSet finish"

The second last line defines how often it will be refined..

Greetings

idefix July 30, 2013 09:17

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

GerhardHolzinger September 23, 2013 10:45

Quote:

Originally Posted by mattijs (Post 195725)
refineMesh by default refines the whole mesh. Use

refineMesh -dict

to refine according to the dictionary.


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.

90nash February 5, 2014 20:37

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! :)

idefix February 11, 2014 04:13

Hello,

do you want to refine your whole mesh or only a part?

be_inspired April 10, 2014 13:38

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?


All times are GMT -4. The time now is 20:32.