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

Naming blocks in blockMesh

Register Blogs Community New Posts Updated Threads Search

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
Old   May 23, 2011, 01:22
Default Naming blocks in blockMesh
  #1
Senior Member
 
Balkrishna Patankar
Join Date: Mar 2009
Location: Pune
Posts: 123
Rep Power: 17
balkrishna is on a distinguished road
Hi ,

How do i name blocks in a blockMeshDict file ? For example ,
a line of my blockMesh reads as follows :
Code:
blocks
(
hex (0 1 2 3 12 13 14 15) (20 1 20) simpleGrading (1 1 1)
...
)
How do i give it a name ? Something like "Region 1" ?
Also how do i output the average of this region at every timestep ?

Thanks .
balkrishna is offline   Reply With Quote

Old   May 23, 2011, 03:09
Default
  #2
Senior Member
 
Martin
Join Date: Oct 2009
Location: Aachen, Germany
Posts: 255
Rep Power: 21
MartinB will become famous soon enough
For the first question: you can do it like this:

hex (0 1 2 3 12 13 14 15) Region_1 (20 1 20) simpleGrading (1 1 1)

Martin
MartinB is offline   Reply With Quote

Old   May 23, 2011, 03:10
Default
  #3
Senior Member
 
Balkrishna Patankar
Join Date: Mar 2009
Location: Pune
Posts: 123
Rep Power: 17
balkrishna is on a distinguished road
Thanks ... How do i output the average of some value , say: gas holdup ,in this region at every timestep ?

Last edited by balkrishna; May 23, 2011 at 03:11. Reason: clarity of expr
balkrishna is offline   Reply With Quote

Old   May 24, 2011, 07:18
Default
  #4
Assistant Moderator
 
Bernhard Gschaider
Join Date: Mar 2009
Posts: 4,225
Rep Power: 51
gschaider will become famous soon enoughgschaider will become famous soon enough
Quote:
Originally Posted by balkrishna View Post
Thanks ... How do i output the average of some value , say: gas holdup ,in this region at every timestep ?
I'm not aware of a way to do this with "standard"-OpenFOAM. I like to do that kind of calculation with swak4Foam (but I'm a bit biased in that respect)
gschaider is offline   Reply With Quote

Old   May 24, 2011, 08:02
Default
  #5
Senior Member
 
Bernhard
Join Date: Sep 2009
Location: Delft
Posts: 790
Rep Power: 21
Bernhard is on a distinguished road
Quote:
Originally Posted by balkrishna View Post
Thanks ... How do i output the average of some value , say: gas holdup ,in this region at every timestep ?
I think there is a volume average that you can use in the functions subdictionary using the sampling library, or, if you want to calculate it afterwards, you can probably just use the sample utility.
Bernhard is offline   Reply With Quote

Old   June 28, 2011, 08:50
Default
  #6
Senior Member
 
Balkrishna Patankar
Join Date: Mar 2009
Location: Pune
Posts: 123
Rep Power: 17
balkrishna is on a distinguished road
I figured out a way to do the same . The code for the same is as follows :
Code:
{
    const scalarField& V = mesh.V();

    forAll(mesh.cellZones(), czi)
    {
        const labelList& cellLabels = mesh.cellZones()[czi];
        //      const volScalarField& alpha = phasea.alpha() ; 
        
        scalar phaseVolume = 0;
        scalar zoneVol = 0;
        forAll(cellLabels, cli)
          {
            label celli = cellLabels[cli];
            phaseVolume += alpha[celli]*V[celli];
            zoneVol += V[celli] ;
          }
        
        reduce(phaseVolume, sumOp<scalar>());

        Info<< " phase volume in zone " << mesh.cellZones()[czi].name() << " of volume  " << zoneVol << " " <<phaseVolume << endl ;
            
        
    }
}
This works perfectly fine in serial runs , however in parallel runs it gives absurd answers . For eg : in parallel runs it outputs the value of the zoneVol (the volume of the zone ) as 0 while in the serial runs it outputs the correct volume values .

Can anyone help me out with this ?
balkrishna is offline   Reply With Quote

Old   June 28, 2011, 08:58
Default
  #7
Senior Member
 
Martin
Join Date: Oct 2009
Location: Aachen, Germany
Posts: 255
Rep Power: 21
MartinB will become famous soon enough
Hi,

you must use the reduce command for the zoneVol, too:
Code:
               ...
               zoneVol += V[celli] ;
          }
        reduce(zoneVol, sumOp<scalar>()); // <--------
        reduce(phaseVolume, sumOp<scalar>());
Martin
MartinB is offline   Reply With Quote

Old   June 28, 2011, 09:03
Default
  #8
Senior Member
 
Balkrishna Patankar
Join Date: Mar 2009
Location: Pune
Posts: 123
Rep Power: 17
balkrishna is on a distinguished road
Thanks a lot .....
balkrishna 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
[Commercial meshers] fluent3DMeshToFoam bego OpenFOAM Meshing & Mesh Conversion 31 August 16, 2023 09:04
dsmcInitialise - dsmcFoam archymedes OpenFOAM Pre-Processing 94 July 15, 2016 16:14
[snappyHexMesh] Meshing multiple blocks Hanno OpenFOAM Meshing & Mesh Conversion 3 February 17, 2011 12:14
Merging the blocks in ICEM saisanthoshm88 ANSYS Meshing & Geometry 1 December 27, 2010 10:14
[blockMesh] BlockMesh: Strange interface between blocks dancfd OpenFOAM Meshing & Mesh Conversion 3 June 8, 2010 16:54


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