CFD Online Logo CFD Online URL
www.cfd-online.com
[Sponsors]
Home > Forums > OpenFOAM Native Meshers: blockMesh

multiregion mesh with blockMesh

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

Like Tree9Likes

Reply
 
LinkBack Thread Tools Display Modes
Old   August 16, 2012, 08:57
Default
  #21
Senior Member
 
Martin
Join Date: Oct 2009
Location: Aachen, Germany
Posts: 252
Rep Power: 11
MartinB is on a distinguished road
Hi Paula,

you should check the names of your blockMeshDict file: usually it is written with a lower "b", id est "blockMeshDict" and not "BlockMeshDict".
You must call the blockMesh utility in the shell from within the case directory, in your case from "/home/termico/OpenFOAM/Paula-2.1.0/FOAM_RUN/MultiBlock". To be sure that the correct blockMeshDict file is used you can define it's location explicitly with
Code:
blockMesh -dict /home/termico/OpenFOAM/Paula-2.1.0/FOAM_RUN/MultiBlock/constant/polyMesh/BlockMeshDict
Good luck

Martin
MartinB is offline   Reply With Quote

Old   August 17, 2012, 03:35
Default
  #22
Member
 
Paula
Join Date: Aug 2012
Posts: 30
Rep Power: 4
curiosity is on a distinguished road
Hi Martin,

It seems to work... Thanks for your help!!

Last edited by curiosity; August 17, 2012 at 04:23.
curiosity is offline   Reply With Quote

Old   September 22, 2012, 00:10
Default
  #23
Member
 
Sangeeta
Join Date: Jul 2012
Location: Kingston, Canada
Posts: 70
Rep Power: 4
Sargam05 is on a distinguished road
Hello everybody,

I am also making blockMesh for multi blocks (In my case there are three rectangular solid blocks). As Martin mentioned above I have given different blocks names
// Anode
hex (0 1 9 8 4 5 13 12) Anode (100 80 50) simpleGrading (1.0 1.0 1.0)
// Electrolyte
hex (8 9 10 11 12 13 14 15) Electrolyte (100 50 50) simpleGrading (1.0 1.0 1.0)
// Cathode
hex (11 10 2 3 15 14 6 7) Cathode (100 50 50) simpleGrading (1.0 1.0 1.0)

And run blockMesh first but when I am running splitMeshRegions -cellZones -overwrite, it is showing following error:
Writing region per cell as volScalarField to "/home/sangeeta/elasticThermalSolidFoam/0/cellToRegion"

Region Cells
------ -----
0 400000
1 250000
2 250000

Region Zone Name
------ ---- ----
0 0 Anode
1 1 Electrolyte
2 2 Cathode

Sizes inbetween regions:

Region Region Faces
------ ------ -----
0 1 5000
1 2 5000

Reading volScalarField cellToRegion


Adding patches


Adding patches

Inserting patch Anode_to_Electrolyte to slot 7 out of 7
--> FOAM Warning :
From function gAverage(const UList<Type>&)
in file /home/sangeeta/OpenFOAM/OpenFOAM-1.6-ext/src/OpenFOAM/lnInclude/FieldFunctions.C at line 524
empty field, returning zero.


--> FOAM FATAL ERROR:

request for polyMesh Electrolyte from objectRegistry elasticThermalSolidFoam failed
available objects of type polyMesh are

1
(
region0
)


From function objectRegistry::lookupObject<Type>(const word&) const
in file /home/sangeeta/OpenFOAM/OpenFOAM-1.6-ext/src/OpenFOAM/lnInclude/objectRegistryTemplates.C at line 140.

FOAM aborting

Anyone have any idea why this error is coming? I appreciate if anyone could help to fix this problem.

Kind regards,
Sangeeta
Sargam05 is offline   Reply With Quote

Old   September 23, 2012, 06:23
Default
  #24
Senior Member
 
Bernhard Linseisen
Join Date: May 2010
Location: Magdeburg/Geneva
Posts: 176
Blog Entries: 1
Rep Power: 7
Linse is on a distinguished road
Sorry for not replying for long times in here. But I guess, most of the problems luckily could be solved?

Concerning your question, Sargam: I had the same error myself recently. I am not completely sure, but could you check if you have all the zones (particularly "Electrolyte") within constant/regionProperties ?
I think I was missing a zone in there which was asked for...
If it was not that thing, I am sure it was a rather simple solution anyway - else I would remember it for sure! ;-)

Please tell us if that was the point!
Linse is offline   Reply With Quote

Old   September 23, 2012, 11:07
Default
  #25
Member
 
Sangeeta
Join Date: Jul 2012
Location: Kingston, Canada
Posts: 70
Rep Power: 4
Sargam05 is on a distinguished road
Hi Bernhard,

thank you for the reply. Yes, I have all the zones (particularly "Electrolyte") within constant/regionProperties. Following is constant/regionProperties:

FoamFile
{
version 2.0;
format ascii;
class dictionary;
object regionProperties;
}
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //

solidRegionNames
(
Anode
Electrolyte
Cathode
);

pRef 100000;

My blockMesh file is:
convertToMeters 1;

vertices
(
(0.00025 0 0)
(0.0005 0 0)
(0.0005 0.000027 0)
(0.00025 0.000027 0)
(0.00025 0 0.0005)
(0.0005 0 0.0005)
(0.0005 0.000027 0.0005)
(0.00025 0.000027 0.0005)

(0.00025 0.000025 0)
(0.0005 0.000025 0)
(0.0005 0.000026 0)
(0.00025 0.000026 0)
(0.00025 0.000025 0.0005)
(0.0005 0.000025 0.0005)
(0.0005 0.000026 0.0005)
(0.00025 0.000026 0.0005)

);

blocks
(
// Anode
hex (0 1 9 8 4 5 13 12) Anode (100 80 50) simpleGrading (1.0 1.0 1.0)
// Electrolyte
hex (8 9 10 11 12 13 14 15) Electrolyte (100 50 50) simpleGrading (1.0 1.0 1.0)
// Cathode
hex (11 10 2 3 15 14 6 7) Cathode (100 50 50) simpleGrading (1.0 1.0 1.0)
);

edges
(
);

patches
(
// From Bottom to Top

patch
Anode_Bottom
(
(0 4 5 1)
)

/* patch
Anode_To_Electrolyte
(
(3 7 6 2)
)

patch
Electrolyte_To_Cathod
(
(9 11 10 8)
)*/

patch
Cathod_TOP
(
(3 7 6 2)
)

symmetryPlane left
(
(0 4 12 8)
(7 15 11 3)
(8 12 15 11)
)

patch Anode_right
(
(1 5 13 9)
)
patch Cathode_right
(
(6 14 10 2)
)

patch Electrolyte_right
(
(9 13 14 10)
)

patch frontAndBack
(
(4 5 13 12)
(13 14 15 12)
(15 14 6 7)
(0 1 9 8)
(9 10 11 8)
(11 10 2 3)
)
);

mergePatchPairs
(
);

In my blockMesh I am not able to define Anode_to_Electrolyte and Electrolyte_to_Cathode patches. When I define these patches it shows some error to run blockMesh. I am wondering how can I define these two patches?

How can I fix this problem?

Thanks in advance.

Best regards,
Sangeeta
Sargam05 is offline   Reply With Quote

Old   September 23, 2012, 12:49
Default
  #26
Senior Member
 
Bernhard Linseisen
Join Date: May 2010
Location: Magdeburg/Geneva
Posts: 176
Blog Entries: 1
Rep Power: 7
Linse is on a distinguished road
Okay, concerning the BCs to be defined in the blockMeshDict I don't know, because I do not know in which step they usually are created. But if I understand correctly, they are created automagically when running either blockMesh or splitMeshRegions. (I would guess for the latter one). So try to leave them out at first.

For the splitMeshRegions.... I would try to put in "fluidRegionNames ( );" into your regionProperties as well. I think that was the case with my problem one or two weeks ago.
Linse is offline   Reply With Quote

Old   September 23, 2012, 15:10
Default
  #27
Member
 
Sangeeta
Join Date: Jul 2012
Location: Kingston, Canada
Posts: 70
Rep Power: 4
Sargam05 is on a distinguished road
Hi Bernhard,

Thanks a lot for the reply. I have put "fluidRegionNames ( );" in regionProperties file but still following error is coming:
/*---------------------------------------------------------------------------*\
| ========= | |
| \\ / F ield | OpenFOAM Extend Project: Open source CFD |
| \\ / O peration | Version: 1.6-ext |
| \\ / A nd | Web: www.extend-project.de |
| \\/ M anipulation | |
\*---------------------------------------------------------------------------*/
Build : 1.6-ext-2467099e383a
Exec : splitMeshRegions -cellZones -overwrite
Date : Sep 23 2012
Time : 15:05:26
Host : sangeeta-laptop
PID : 6371
Case : /home/sangeeta/elasticThermalSolidFoam
nProcs : 1
SigFpe : Enabling floating point exception trapping (FOAM_SIGFPE).

// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
Create time

Create mesh for time = 0

Trying to match regions to existing cell zones.


Number of regions:3

Writing region per cell file (for manual decomposition) to "/home/sangeeta/elasticThermalSolidFoam/constant/cellToRegion"

Writing region per cell as volScalarField to "/home/sangeeta/elasticThermalSolidFoam/0/cellToRegion"

Region Cells
------ -----
0 400000
1 250000
2 250000

Region Zone Name
------ ---- ----
0 0 Anode
1 1 Electrolyte
2 2 Cathode

Sizes inbetween regions:

Region Region Faces
------ ------ -----
0 1 5000
1 2 5000

Reading volScalarField cellToRegion


Adding patches


Adding patches

Inserting patch Anode_to_Electrolyte to slot 7 out of 7
--> FOAM Warning :
From function gAverage(const UList<Type>&)
in file /home/sangeeta/OpenFOAM/OpenFOAM-1.6-ext/src/OpenFOAM/lnInclude/FieldFunctions.C at line 524
empty field, returning zero.


--> FOAM FATAL ERROR:

request for polyMesh Electrolyte from objectRegistry elasticThermalSolidFoam failed
available objects of type polyMesh are

1
(
region0
)


From function objectRegistry::lookupObject<Type>(const word&) const
in file /home/sangeeta/OpenFOAM/OpenFOAM-1.6-ext/src/OpenFOAM/lnInclude/objectRegistryTemplates.C at line 140.

FOAM aborting

Aborted

Why this error is coming? Please let me know if you have any idea to fix this problem.

Best regards,
Sangeeta
Sargam05 is offline   Reply With Quote

Old   September 23, 2012, 17:52
Default
  #28
Senior Member
 
Bernhard Linseisen
Join Date: May 2010
Location: Magdeburg/Geneva
Posts: 176
Blog Entries: 1
Rep Power: 7
Linse is on a distinguished road
Okay, from this point onwards it is only guesswork from my side! I do not know a definite solution!

But what you could try:
Remove the polyMesh-folders within the different part-regions. The only one remaining should be the one within case/constant/polyMesh. Then try again. Maybe the previous polyMesh-folders are blocking something.
Afterwards do a new blockMesh and then the splitMeshRegions again.
If it works post it in here and be happy. ;-)

Another step for finding out if there is a problem with the procedure: Try to put in one of the regions into the fluidRegionNames-group. I do not know for sure if leaving a field blank does work with the 1.6-ext-release already.
In any case then you will see if it is an error due to the splitMesh or if the problem is in the blockMesh already.


But as I said: This is guessing from my side, so I wish you good luck in solving that problem!
Linse is offline   Reply With Quote

Old   September 26, 2012, 16:57
Default
  #29
Member
 
Sangeeta
Join Date: Jul 2012
Location: Kingston, Canada
Posts: 70
Rep Power: 4
Sargam05 is on a distinguished road
Hi Berhard,

Thank you for the reply. Sorry for the late reply. I do have only one polyMesh folder in constant directory. I think I am missing something in procedure. Now I am again doing it.

Thanks,
Sangeeta
Sargam05 is offline   Reply With Quote

Old   September 27, 2012, 07:50
Default
  #30
New Member
 
Unnikrishnan Mohankumar
Join Date: Apr 2011
Posts: 29
Rep Power: 6
unnikrsn is on a distinguished road
Dear Faomers,

I have the sample problem, I am using blockmesh to create my Multi Regions mesh and I am trying to create a Cylinder(solid) inside a Box(Air).

hex (0 1 2 3 4 5 6 7) solid (20 20 30) simpleGrading (1 1 1) // Create Cylinder for solid
hex (8 9 10 11 12 13 14 15) air (30 30 32) (1 1 1) // Creating a block for air

I checked the constant/regionProperties. I have also set the region names correctly.

I am not using setSet -batch batch.setSet and subsetMesh.
As the edges of the Cylinder depend on the mesh and the Cells are not Split.

The Mesh in the Box(air) and Cylinder(solid) are intersection. But 2 independent mesh.

I wanted to know. if there is a option to Split the cells in Mesh in the Box(air) with the Cylinder(solid) which are create by same blockMesh file.

Regards
Unni

attached Pictures of the box(air) & Cylinder(solid)


blockMeshDict file

FoamFile
{
version 2.0;
format ascii;
class dictionary;
location "constant/polyMesh";
object blockMeshDict;
}
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //

convertToMeters 1;


vertices
(
//Creating a cylinder which can be called as 'solid'
(-1 0 0)//0
(0 -1 0)//1
(1 0 0)//2
(0 1 0)//3
(-1 0 3)//4
(0 -1 3)//5
(1 0 3)//6
(0 1 3)//7
// Creating a box outside the Cylinder and calling it 'air'
(-1.5 -1.5 -0.2) // 8
(1.5 -1.5 -0.2) // 9
(1.5 1.5 -0.2) // 10
(-1.5 1.5 -0.2) // 11
(-1.5 -1.5 3.2) // 12
(1.5 -1.5 3.2) // 13
(1.5 1.5 3.2) // 14
(-1.5 1.5 3.2) // 15
);

blocks
(
hex (0 1 2 3 4 5 6 7) solid (20 20 30) simpleGrading (1 1 1) // Creating a Cylinder for solid

hex (8 9 10 11 12 13 14 15) air (30 30 32) (1 1 1) // Creating a block with air
);

edges
(
//Creating edges for Cylinder
//If edges are not created the a cube would be formed instead of a cylinder.
arc 0 1 (-0.707106781 -0.707106781 0)
arc 1 2 (0.707106781 -0.707106781 0)
arc 2 3 (0.707106781 0.707106781 0)
arc 3 0 (-0.707106781 0.707106781 0)
arc 4 5 (-0.707106781 -0.707106781 3)
arc 5 6 (0.707106781 -0.707106781 3)
arc 6 7 (0.707106781 0.707106781 3)
arc 7 4 (-0.707106781 0.707106781 3)
);

patches
(
patch inner
(
(0 1 2 3)
(0 1 5 4)
(1 2 6 5)
(2 3 7 6)
(3 0 4 7)
(4 5 6 7)
)
patch outer
(
(8 9 10 11)
(12 13 14 15)
(8 12 15 11)
(9 13 14 10)
(8 12 13 9)
(11 15 14 10)
)
)
;

mergePatchPairs
(
);
Attached Images
File Type: jpg With_Cylinder.jpg (97.7 KB, 56 views)
File Type: jpg Slice_Without_Cylinder.jpg (98.0 KB, 38 views)
unnikrsn is offline   Reply With Quote

Old   September 28, 2012, 06:59
Default
  #31
New Member
 
Unnikrishnan Mohankumar
Join Date: Apr 2011
Posts: 29
Rep Power: 6
unnikrsn is on a distinguished road
@Sangeetha..

Did you solve your problem..

i think you have a file inside 0 folder with the name cellToRegion... i think this one consists only one set of region. That must be a reason. yours dint work.

Do check. & also if you have any idea about my problem. Kindly check and reply.

Regards
Unni

Last edited by unnikrsn; September 28, 2012 at 07:00. Reason: Spelling mistake.. hehehe
unnikrsn is offline   Reply With Quote

Old   September 28, 2012, 07:51
Default
  #32
Senior Member
 
Bernhard Linseisen
Join Date: May 2010
Location: Magdeburg/Geneva
Posts: 176
Blog Entries: 1
Rep Power: 7
Linse is on a distinguished road
Well, it is paramount for the chtMultiRegionFoam-solvers to find the subdirectories with the different regions.
So in case you do have no region-folders within constant, system and 0, it is already in the preparation that something has gone wrong.

Did you define each of the blocks in the blockMeshDict to belong to one of the different regions? If not, try to do so!
You will definitely need the setSet-step during preparation. As well I guess the splitMeshRegions-step is inavoidable during case preparation...

If you really have one region only, you could try creating the different folders with these names and copying the complete polyMesh from constant to constant/fluidRegionName/polyMesh and do the same with the other files.
Linse is offline   Reply With Quote

Old   September 28, 2012, 08:27
Default
  #33
New Member
 
Unnikrishnan Mohankumar
Join Date: Apr 2011
Posts: 29
Rep Power: 6
unnikrsn is on a distinguished road
Dear Linse

No... I dint understand what you are saying. But i think you were givign a reply to Sangeetha Question ??

Could you please check my question and give me a reply.

I am not planning to use Cellset.setSet at this stage as i have more than 100 Cylinder in a single Case file... Most of the Edges doesnt form a Cylinder because of the refinement in the blockMesh... so that is the only reason. i am planning to create my 100 Cylinders in blockMesh.

Later use batch.setSet to define the region and split them using SplitMeshRegions.

The Question asked is just for reference. with one Cylinder and one Box.

Regards
Unni
unnikrsn is offline   Reply With Quote

Old   October 1, 2012, 08:14
Default
  #34
Senior Member
 
Bernhard Linseisen
Join Date: May 2010
Location: Magdeburg/Geneva
Posts: 176
Blog Entries: 1
Rep Power: 7
Linse is on a distinguished road
Sorry, I think, some thoughts got mixed up in my last post. ;-)

@unnikrsn: I would suggest to try using the setSet without the -batch option. I GUESS then it tries to take the values from the blockMeshDict. I would not expect blockMesh to write the different mesh regions. I only would HOPE for setSet and splitMeshRegions to use the regions as they are defined within the blockMeshDict.
But as I said: This is guessing from my side, I do not have definite solutions.

@Sargam: Did you succeed already?
Linse is offline   Reply With Quote

Old   October 2, 2012, 08:39
Default
  #35
New Member
 
Unnikrishnan Mohankumar
Join Date: Apr 2011
Posts: 29
Rep Power: 6
unnikrsn is on a distinguished road
Dear Bernhard Linseisen

Thanks for you reply.

I am working on it. when i get some success with it. I will post the pictures.

Thanks & regards
Unnikrishnan
unnikrsn is offline   Reply With Quote

Old   November 1, 2012, 18:49
Default
  #36
Member
 
ak
Join Date: May 2011
Posts: 71
Rep Power: 6
newOFuser is on a distinguished road
Sangeeta/Unni,

Were you able to resolve the problem?

I am also getting:
request for polyMesh heater from objectRegistry heatercase failed

Kindly provide the solution if you were able to solve the issue, for the benefit of OF users.
Thanks,
ak
newOFuser is offline   Reply With Quote

Old   November 2, 2012, 04:11
Default
  #37
New Member
 
Unnikrishnan Mohankumar
Join Date: Apr 2011
Posts: 29
Rep Power: 6
unnikrsn is on a distinguished road
Hi Ak,

I checked the method, I am able to create 2 meshes with blockMesh.

But i am still not able to split 2 meshes using Cellset.Setset and splitMesh.

hex (0 1 2 3 4 5 6 7) solid (20 20 30) simpleGrading (1 1 1) // Create Cylinder for solid
hex (8 9 10 11 12 13 14 15) air (30 30 32) (1 1 1) // Creating a block for air

I dont think it is possible to seperate 2 intersecting blockMesh create using single blockMeshDict file. I also tried using stitchMesh, i get a mesh, with the intersecting area added twice to the new mesh.

Kindly try the blockMeshDict file in this thread.
multiregion mesh with blockMesh

Thanks & regards
Unnikrishnan
unnikrsn is offline   Reply With Quote

Old   November 2, 2012, 12:32
Default
  #38
Member
 
ak
Join Date: May 2011
Posts: 71
Rep Power: 6
newOFuser is on a distinguished road
EDIT: I just realized that I had modified the solver previously - and checked now that the regionProperties files had not been compiled! It is working now (so far).

------------------------------------------------------
Thanks a lot for your reply. I'll try that approach as well.

I've enclosed the case file (with the Allrun script). If you get a chance, could you please try and take a look/run the case?
All commands run okay and appropriate region files are also generated, till I get to the solver chtMultiRegionFoam command.

I use OF 1.7.1

Thanks!
ak
Attached Files
File Type: zip heatercase.zip (17.6 KB, 19 views)
unnikrsn likes this.

Last edited by newOFuser; November 2, 2012 at 12:48.
newOFuser is offline   Reply With Quote

Old   May 20, 2013, 07:13
Default blockMesh
  #39
Member
 
sandy
Join Date: Mar 2013
Location: Cardiff, UK
Posts: 71
Rep Power: 4
sandy13 is on a distinguished road
Quote:
Originally Posted by MartinB View Post
Hi Per,

just give the blocks the same name:
hex (0 1 3 2 6 7 9 8) name_of_region_1 (200 100 1) simpleGrading (1.0 1.0 1.0)
hex (2 3 5 4 8 9 11 10) name_of_region_1 (200 100 1) simpleGrading (1.0 1.0 1.0)

Now the two blocks form one region. You can add more blocks, of course.

Martin
Dear MartinB,
Please I want to take your advice, could you please help me about doing blockMesh for my geometry as in the attached sketch. I am using OF 2.1.1, I have injector inside the combustion chamber, I have fuel inlet and air inlet and between these two inlets walls. Between air inlet and combustion chamber is wall. I constructed the geometry using blockMesh but I had problem in defining the internal walls for the injector then I found your post about naming blocks but I do not if it good for my case, please any thoughts,ideas would be very much helpful..
Sandy,
Attached Images
File Type: jpg img007.jpg (67.6 KB, 31 views)
sandy13 is offline   Reply With Quote

Old   May 20, 2013, 10:23
Default
  #40
Member
 
Yosmcer Mocktai
Join Date: Apr 2013
Location: Behind a computer
Posts: 41
Rep Power: 8
Yosmcer will become famous soon enough
Quote:
Originally Posted by sandy13 View Post
Dear MartinB,
Please I want to take your advice, could you please help me about doing blockMesh for my geometry as in the attached sketch. I am using OF 2.1.1, I have injector inside the combustion chamber, I have fuel inlet and air inlet and between these two inlets walls. Between air inlet and combustion chamber is wall. I constructed the geometry using blockMesh but I had problem in defining the internal walls for the injector then I found your post about naming blocks but I do not if it good for my case, please any thoughts,ideas would be very much helpful..
Sandy,
Hello Sandy,

So downer face is the outlet patch.

Maybe giving your blockMeshDict file may help to advice you.

It seems that other people already tried to have internal walls, hope this post can help:
Internal walls of zero thickness

Good luck with your design.
Yosmcer 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
SnappyHexMesh for internal Flow vishwa OpenFOAM Native Meshers: snappyHexMesh and Others 23 August 6, 2014 03:50
[ICEM] surface mesh merging problem everest ANSYS Meshing & Geometry 39 June 5, 2013 19:02
[ICEM] Problem making structural mesh on a surface froztbear ANSYS Meshing & Geometry 1 November 10, 2011 09:52
basic of mesh refinement arya CFX 4 June 19, 2007 12:21
Does blockMesh create mesh vertices in any particular order brooksmoses OpenFOAM Native Meshers: blockMesh 3 December 12, 2005 21:26


All times are GMT -4. The time now is 21:03.