CFD Online Logo CFD Online URL
www.cfd-online.com
[Sponsors]
Home > Forums > OpenFOAM Mesh Utilities

BlockMesh cellSet refineMesh

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

Like Tree4Likes

Reply
 
LinkBack Thread Tools Display Modes
Old   November 13, 2008, 14:35
Default refineMesh by default refines
  #1
Super Moderator
 
Mattijs Janssens
Join Date: Mar 2009
Posts: 1,416
Rep Power: 16
mattijs is on a distinguished road
refineMesh by default refines the whole mesh. Use

refineMesh -dict

to refine according to the dictionary.
GerhardHolzinger likes this.
mattijs is offline   Reply With Quote

Old   November 16, 2008, 21:56
Default Thank you very much for your h
  #2
New Member
 
Axel Mohr
Join Date: Mar 2009
Location: Kiel, Schleswig-Holstein, Germany
Posts: 24
Rep Power: 8
alexm is on a distinguished road
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
);
alexm is offline   Reply With Quote

Old   August 26, 2010, 00:51
Default refineMesh tetrahedral
  #3
Member
 
Hrushikesh Khadamkar
Join Date: Jul 2010
Location: Mumbai
Posts: 59
Rep Power: 6
Hrushi is on a distinguished road
Quote:
Originally Posted by mattijs View Post
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
Hrushi is offline   Reply With Quote

Old   September 21, 2010, 03:26
Default
  #4
New Member
 
Join Date: Sep 2010
Posts: 1
Rep Power: 0
Maulik is on a distinguished road
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
Maulik is offline   Reply With Quote

Old   November 16, 2010, 06:53
Default Solution for a faster refinement
  #5
New Member
 
Frank Whittle
Join Date: Aug 2010
Posts: 12
Rep Power: 6
challenger is on a distinguished road
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
challenger is offline   Reply With Quote

Old   November 26, 2010, 05:03
Default
  #6
Senior Member
 
Join Date: Nov 2010
Posts: 113
Rep Power: 6
lindstroem is on a distinguished road
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!
lindstroem is offline   Reply With Quote

Old   November 26, 2010, 05:53
Default
  #7
New Member
 
Frank Whittle
Join Date: Aug 2010
Posts: 12
Rep Power: 6
challenger is on a distinguished road
Quote:
Originally Posted by lindstroem View Post
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!
challenger is offline   Reply With Quote

Old   November 26, 2010, 06:07
Default
  #8
Senior Member
 
Join Date: Nov 2010
Posts: 113
Rep Power: 6
lindstroem is on a distinguished road
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!

Last edited by lindstroem; November 26, 2010 at 06:33.
lindstroem is offline   Reply With Quote

Old   October 31, 2011, 11:54
Default
  #9
New Member
 
giovanni silva
Join Date: Jul 2010
Posts: 14
Rep Power: 6
giovanni10 is on a distinguished road
Quote:
Originally Posted by lindstroem View Post
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!

giovanni10 is offline   Reply With Quote

Old   January 16, 2013, 09:49
Default
  #10
Member
 
Join Date: Sep 2012
Posts: 30
Rep Power: 4
emirust is on a distinguished road
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!
emirust is offline   Reply With Quote

Old   January 16, 2013, 09:55
Default
  #11
Member
 
Nicklas Linder
Join Date: Jul 2012
Location: Germany
Posts: 33
Rep Power: 4
nlinder is on a distinguished road
you can run it twice, or as often as you need it...
nlinder is offline   Reply With Quote

Old   January 16, 2013, 10:22
Default
  #12
Member
 
Join Date: Sep 2012
Posts: 30
Rep Power: 4
emirust is on a distinguished road
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)
Attached Images
File Type: jpg refined3times.jpg (97.1 KB, 238 views)
emirust is offline   Reply With Quote

Old   January 16, 2013, 10:42
Default
  #13
Member
 
Nicklas Linder
Join Date: Jul 2012
Location: Germany
Posts: 33
Rep Power: 4
nlinder is on a distinguished road
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...

cfd.jpg
nlinder is offline   Reply With Quote

Old   January 17, 2013, 04:24
Default
  #14
Member
 
Join Date: Sep 2012
Posts: 30
Rep Power: 4
emirust is on a distinguished road
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!
emirust is offline   Reply With Quote

Old   January 18, 2013, 05:48
Default
  #15
Member
 
Nicklas Linder
Join Date: Jul 2012
Location: Germany
Posts: 33
Rep Power: 4
nlinder is on a distinguished road
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

Last edited by nlinder; January 18, 2013 at 08:02.
nlinder is offline   Reply With Quote

Old   July 30, 2013, 08:17
Default
  #16
Member
 
Join Date: Aug 2011
Posts: 74
Rep Power: 5
idefix is on a distinguished road
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:rintStack(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
idefix is offline   Reply With Quote

Old   September 23, 2013, 09:45
Default
  #17
Senior Member
 
Gerhard Holzinger
Join Date: Feb 2012
Location: Austria
Posts: 165
Rep Power: 14
GerhardHolzinger will become famous soon enoughGerhardHolzinger will become famous soon enough
Quote:
Originally Posted by mattijs View Post
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.
GerhardHolzinger is offline   Reply With Quote

Old   February 5, 2014, 20:37
Default Problems in refineMesh
  #18
Member
 
Nadish Saini
Join Date: Feb 2014
Location: Raleigh, North Carolina
Posts: 33
Rep Power: 3
90nash is on a distinguished road
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!
90nash is offline   Reply With Quote

Old   February 11, 2014, 04:13
Default
  #19
Member
 
Join Date: Aug 2011
Posts: 74
Rep Power: 5
idefix is on a distinguished road
Hello,

do you want to refine your whole mesh or only a part?
idefix is offline   Reply With Quote

Old   April 10, 2014, 12:38
Default
  #20
Member
 
M. Montero
Join Date: Mar 2009
Location: Madrid
Posts: 99
Rep Power: 8
be_inspired is on a distinguished road
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?
be_inspired 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
Create a cellSet out of the gamma directory cricke OpenFOAM Running, Solving & CFD 11 July 12, 2009 03:52
CellSet question bobbicknell OpenFOAM Post-Processing 0 February 24, 2009 17:50
RefineMesh warning mgz1985 OpenFOAM Native Meshers: blockMesh 1 August 29, 2008 08:45
Using refineMesh matteo_gautero OpenFOAM Mesh Utilities 0 February 11, 2008 10:07
Center coordinates of all the cells in a cellset lizhihua CD-adapco 0 August 21, 2006 03:59


All times are GMT -4. The time now is 15:33.