CFD Online Logo CFD Online URL
www.cfd-online.com
[Sponsors]
Home > Forums > Software User Forums > OpenFOAM > OpenFOAM Meshing & Mesh Conversion

[blockMesh] Multiple boundary conditions in one block

Register Blogs Community New Posts Updated Threads Search

Like Tree2Likes
  • 1 Post By Marpole
  • 1 Post By linnemann

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
Old   June 18, 2013, 06:54
Smile Multiple boundary conditions in one block
  #1
EOC
New Member
 
Join Date: Jun 2013
Posts: 4
Rep Power: 13
EOC is on a distinguished road
Hi everyone!

I am new to OpenFOAM and also I just started using this platform. My question is that I want to use just one block with six faces, (a cube). So if I want to put a boundary condition to a face such that the boundary condition applies at certain region of the face and not all over it. For example if I want some Heat flux at the centre of a face in a circular region. Do I need to create blocks and faces whenever I need to put a boundary condition ?

Simply putting , I want to know how can I put multiple boundary conditions at the same face such that certain regions of the face have different boundary conditions and certain regions have other boundary conditions.

I will be very thankful for the help
EOC is offline   Reply With Quote

Old   June 18, 2013, 10:14
Default
  #2
Senior Member
 
Join Date: Aug 2010
Location: Groningen, The Netherlands
Posts: 216
Rep Power: 19
colinB is on a distinguished road
Hi EOC,

the utility you are looking for is named

setFields

With a setFieldsDict stored in the system folder you can specify
the patch/Region which you want to be changed.

The damBreak tutorial gives you an example of the usage
with a region in the domain specified other than its surroundings
by using the parameter alpha1 which is needed for
multiphase flow.

However this should also work with patches according to the manual
and other fields than alpha1.

I hope that helps
regards
colinB is offline   Reply With Quote

Old   June 19, 2013, 15:45
Smile setFields
  #3
EOC
New Member
 
Join Date: Jun 2013
Posts: 4
Rep Power: 13
EOC is on a distinguished road
Thank you so much for the help.
I started learning how to use setFields.
Just one more thing. Which option should I use (from boxtocell to surfacetoface)
The condition is I have a wall and some portion of it is heated. The heated portion can be defined by some co-ordinates and it will be a closed surface.
I would have used boxtocell but it only performs the function for a square shaped heated region in my case.

I shall be very thankful for the help.
EOC is offline   Reply With Quote

Old   June 21, 2013, 07:12
Default
  #4
Senior Member
 
Join Date: Aug 2010
Location: Groningen, The Netherlands
Posts: 216
Rep Power: 19
colinB is on a distinguished road
Hi

I have no idea how it works in particular with
faces, since I only use the boxToCell option
for my cases and just read in the description
that it is also possible to use this tool for faces as well.

But using some common sense I would say
boxToFace is your option. To figure out how it works
you might want to have a look
here:

Code:
/opt/openfoam220/application/utilities/preProcessing/setFields
this is all I know about it

regards
colinB is offline   Reply With Quote

Old   July 10, 2013, 06:22
Default
  #5
Senior Member
 
Artur's Avatar
 
Artur
Join Date: May 2013
Location: Southampton, UK
Posts: 372
Rep Power: 20
Artur will become famous soon enough
Check the wigley hull tutorial in multiphase/LTSInterFoam where the inlet patch has a calculated BC and some of it is set as water (alpha1 field = 1) and some of it as air (alpha1 filed = 0).

I think it should work the same way for you judging from the description you've given.
Artur is offline   Reply With Quote

Old   July 15, 2013, 11:36
Default
  #6
New Member
 
benarab
Join Date: Jul 2013
Posts: 4
Rep Power: 13
didamiamia is on a distinguished road
hi,
can some one tell me where i have do an error in this blockMesh
/*--------------------------------*- C++ -*----------------------------------*\
| ========= | |
| \\ / F ield | OpenFOAM: The Open Source CFD Toolbox |
| \\ / O peration | Version: 2.2.0 |
| \\ / A nd | Web: www.OpenFOAM.org |
| \\/ M anipulation | |
\*---------------------------------------------------------------------------*/
FoamFile
{
version 2.0;
format ascii;
class dictionary;
object blockMeshDict;
}
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //

convertToMeters 1;

vertices
(
(-1 -1 0)
(1 -1 0)
(1 1 0)
(-1 1 0)
(-1 -1 0.1)
(1 -1 0.1)
(1 1 0.1)
(-1 1 0.1)
(0.4 -0.1 0)
(0.6 -0.1 0)
(0.6 0.1 0)
(0.4 0.1 0)
(0.4 -0.1 0.1)
(0.6 -0.1 0.1)
(0.6 0.1 0.1)
(0.4 0.1 0.1)
(-1 -0.1 0)
(1 -0.1 0)
(1 0.1 0)
(-1 0.1 0)
(-1 -0.1 0.1)
(1 -0.1 0.1)
(1 0.1 0.1)
(-1 0.1 0.1)
//add
(0.4 -1 0)
(0.6 -1 0)
(0.6 1 0)
(0.4 1 0)
(0.4 -1 0.1)
(0.6 -1 0.1)
(0.6 1 0.1)
(0.4 1 0.1)
);

blocks
(
// hex (0 1 2 3 4 5 6 7) (100 100 1) simpleGrading (1 1 1)
hex (0 24 8 16 4 28 12 20) (50 50 1) simpleGrading (1 1 1)
hex (24 25 9 8 28 29 13 12) (20 30 1) simpleGrading (1 1 1)
hex (25 1 17 9 29 5 21 13) (15 30 1) simpleGrading (1 1 1)
hex (16 8 11 19 20 12 15 23) (70 20 1) simpleGrading (1 1 1)
hex (9 17 18 10 13 21 22 14) (20 20 1) simpleGrading (1 1 1)
hex (19 11 27 3 23 15 31 7) (50 50 1) simpleGrading (1 1 1)
hex (11 10 26 27 15 14 30 31) (20 30 1) simpleGrading (1 1 1)
hex (10 18 2 26 14 22 6 30) (15 30 1) simpleGrading (1 1 1)


);

edges
(

);

boundary
(
innerwall
{
type wall;
faces
(
(11 15 12 8)
(10 14 13 9)
//(11 10 14 15)
(11 15 14 10)

(8 12 13 9)

);
}
outerwall
{
type wall;
faces
(
(3 7 23 19)
(19 23 20 16)
(16 20 4 0)
(2 6 22 18)
(18 22 21 17)
(17 21 5 1)
(0 4 28 24)
(24 28 29 25)
(25 29 5 1)
(3 7 31 27)
(27 31 30 26)
(26 30 6 2)
);
}

frontAndBack
{
type empty;
faces
(
(0 24 8 16)
(24 25 9 8)
(25 1 17 9)
(16 8 11 19)
(9 17 18 10)
(19 11 27 3)
(11 10 26 27)
(10 18 2 26)
(4 28 12 20)
(28 29 13 12)
(29 5 21 13)
(20 12 15 23)
(13 21 22 14)
(23 15 31 7)
(15 14 30 31)
(14 22 6 30)
//(0 3 2 1)
//(4 5 6 7)
);
}
);

mergePatchPairs
(
);

// ************************************************** ********


i have this error :

Create time

Creating block mesh from
"/home/linda/Simulations/caseFI/partie_11/Noconforming_Mesh/P11_move_SRFP/constant/polyMesh/blockMeshDict"
Creating curved edges
Creating topology blocks
Creating topology patches

Creating block mesh topology

Check topology

Basic statistics
Number of internal faces : 8
Number of boundary faces : 32
Number of defined boundary faces : 32
Number of undefined boundary faces : 0
Checking patch -> block consistency

Creating block offsets
Creating merge list

--> FOAM FATAL ERROR:
Inconsistent number of faces between block pair 0 and 1

From function blockMesh::calcMergeInfo()
in file blockMesh/blockMeshMerge.C at line 221.


thank you for answers
didamiamia is offline   Reply With Quote

Old   July 20, 2013, 06:42
Default
  #7
Member
 
Yosmcer Mocktai
Join Date: Apr 2013
Location: Behind a computer
Posts: 50
Rep Power: 17
Yosmcer will become famous soon enough
Hello,

I think you should have posted a new thread. I do not see the ling between your error and the usage of setFields.

Your error says there is a problem between your two first blocks:

Code:
hex (0 24 8 16 4 28 12 20) (50 50 1) simpleGrading (1 1 1)
 hex (24 25 9 8 28 29 13 12) (20 30 1) simpleGrading (1 1 1)
You defined 50 meshing blocks in y direction for the first block, and 30 for the second one.
This mean that blockMesh cannot connect perfectly theses blocks.
Yosmcer is offline   Reply With Quote

Old   July 22, 2013, 13:18
Default
  #8
New Member
 
benarab
Join Date: Jul 2013
Posts: 4
Rep Power: 13
didamiamia is on a distinguished road
Quote:
Originally Posted by Yosmcer View Post
Hello,

I think you should have posted a new thread. I do not see the ling between your error and the usage of setFields.

Your error says there is a problem between your two first blocks:

Code:
hex (0 24 8 16 4 28 12 20) (50 50 1) simpleGrading (1 1 1)
 hex (24 25 9 8 28 29 13 12) (20 30 1) simpleGrading (1 1 1)
You defined 50 meshing blocks in y direction for the first block, and 30 for the second one.
This mean that blockMesh cannot connect perfectly theses blocks.
you're right I'll post again a new thread for a new topic
thank you for your answer.
didamiamia is offline   Reply With Quote

Old   October 30, 2020, 09:23
Question
  #9
New Member
 
Rosivaldo
Join Date: Nov 2019
Location: Brazil
Posts: 6
Rep Power: 7
chymalaia is on a distinguished road
Quote:
Originally Posted by EOC View Post
Just one more thing. Which option should I use (from boxtocell to surfacetoface)
The condition is I have a wall and some portion of it is heated. The heated portion can be defined by some co-ordinates and it will be a closed surface.
I would have used boxtocell but it only performs the function for a square shaped heated region in my case.
Has anyone found a solution for this? I have a similar problem, where only a portion of one of my patches should be introducing water into the flow, whereas the surface above introduces another liquid (I'm using interFoam).

Thanks in advance!
chymalaia is offline   Reply With Quote

Old   November 1, 2020, 10:25
Default
  #10
RGS
Member
 
Rohit George Sebastian
Join Date: May 2017
Posts: 42
Rep Power: 9
RGS is on a distinguished road
Quote:
Originally Posted by chymalaia View Post
Has anyone found a solution for this? I have a similar problem, where only a portion of one of my patches should be introducing water into the flow, whereas the surface above introduces another liquid (I'm using interFoam).

Thanks in advance!

Are you trying to simulate 3 phases? Two liquids and air? interFoam (as far as I am aware) only supports two phases. The parts of the geometry that are not filled with one phase is assumed to be filled with the other phase. Of course, a cell can have both phases, and alpha shows what proportion of the cell is filled with each phase.
RGS is offline   Reply With Quote

Old   November 2, 2020, 00:22
Default set boundary condition on partial area of a face
  #11
Senior Member
 
Charles
Join Date: Aug 2016
Location: Vancouver, Canada
Posts: 151
Rep Power: 10
Marpole is on a distinguished road
OpenFOAM sets one boundary condition for one patch. On one patch, one can not specify two boundary conditions.
In the case of the cube example, the face needs to be split to 2 in order to accept two boundary conditions. This can be done with a combination of topoSet and createPatch.
In the first step, one need to use topoSet to create faceZone. In topoSetDict, shape of the patch, i.e. circular or rectangular, needs to be defined. Likely one need to create a cellZone first, and then faceZone.
In the second step, using command createPatch to create patches from the faceZone.
With the patches created, to set boundary condition is the same as one did for openFOAM in 0 folder.
setFields can work for some cases. Though it can not change boundary type but only with boundary value. For example, it cannot work if part of the cube face is wall and the rest is inlet. But a combination of topoSet and createPatch can make it.
chymalaia likes this.
__________________
Charles L.
Marpole is offline   Reply With Quote

Old   November 2, 2020, 19:54
Thumbs up
  #12
New Member
 
Rosivaldo
Join Date: Nov 2019
Location: Brazil
Posts: 6
Rep Power: 7
chymalaia is on a distinguished road
Quote:
Originally Posted by Marpole View Post
OpenFOAM sets one boundary condition for one patch. On one patch, one can not specify two boundary conditions.
In the case of the cube example, the face needs to be split to 2 in order to accept two boundary conditions. This can be done with a combination of topoSet and createPatch.
In the first step, one need to use topoSet to create faceZone. In topoSetDict, shape of the patch, i.e. circular or rectangular, needs to be defined. Likely one need to create a cellZone first, and then faceZone.
In the second step, using command createPatch to create patches from the faceZone.
With the patches created, to set boundary condition is the same as one did for openFOAM in 0 folder.
setFields can work for some cases. Though it can not change boundary type but only with boundary value. For example, it cannot work if part of the cube face is wall and the rest is inlet. But a combination of topoSet and createPatch can make it.
Thanks for your answer! Very well explained.


Rosivaldo
chymalaia is offline   Reply With Quote

Old   November 2, 2020, 19:58
Default
  #13
New Member
 
Rosivaldo
Join Date: Nov 2019
Location: Brazil
Posts: 6
Rep Power: 7
chymalaia is on a distinguished road
Quote:
Originally Posted by RGS View Post
Are you trying to simulate 3 phases? Two liquids and air? interFoam (as far as I am aware) only supports two phases. The parts of the geometry that are not filled with one phase is assumed to be filled with the other phase. Of course, a cell can have both phases, and alpha shows what proportion of the cell is filled with each phase.
No, only 2 phases (2 liquids). The problem was that one of the geometry boundaries had 2 different conditions, and i did not know how to divide the path. But our friend Marpole explained a good way out.
chymalaia is offline   Reply With Quote

Old   November 3, 2020, 02:26
Default
  #14
Senior Member
 
linnemann's Avatar
 
Niels Nielsen
Join Date: Mar 2009
Location: NJ - Denmark
Posts: 556
Rep Power: 27
linnemann will become famous soon enough
This method also works.

Splitting the Boundaries
chymalaia likes this.
__________________
Linnemann

PS. I do not do personal support, so please post in the forums.
linnemann is offline   Reply With Quote

Reply


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 Off
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
CFD analaysis of Pelton turbine amodpanthee CFX 31 April 19, 2018 19:02
Error - Solar absorber - Solar Thermal Radiation MichaelK CFX 12 September 1, 2016 06:15
Velocity vector in impeller passage ngoc_tran_bao CFX 24 May 3, 2016 22:16
Difficulty In Setting Boundary Conditions Moinul Haque CFX 4 November 25, 2014 18:30
Overflow Error in Multiphase Modelling with Two Continuous Fluids ashtonJ CFX 6 August 11, 2014 15:32


All times are GMT -4. The time now is 07:50.