|
[Sponsors] |
May 23, 2011, 02:22 |
Naming blocks in blockMesh
|
#1 |
Senior Member
Balkrishna Patankar
Join Date: Mar 2009
Location: Pune
Posts: 123
Rep Power: 17 |
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) ... ) Also how do i output the average of this region at every timestep ? Thanks . |
|
May 23, 2011, 04:09 |
|
#2 |
Senior Member
Martin
Join Date: Oct 2009
Location: Aachen, Germany
Posts: 255
Rep Power: 22 |
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 |
|
May 23, 2011, 04:10 |
|
#3 |
Senior Member
Balkrishna Patankar
Join Date: Mar 2009
Location: Pune
Posts: 123
Rep Power: 17 |
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 04:11. Reason: clarity of expr |
|
May 24, 2011, 08:18 |
|
#4 |
Assistant Moderator
Bernhard Gschaider
Join Date: Mar 2009
Posts: 4,225
Rep Power: 51 |
||
May 24, 2011, 09:02 |
|
#5 |
Senior Member
Bernhard
Join Date: Sep 2009
Location: Delft
Posts: 790
Rep Power: 22 |
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.
|
|
June 28, 2011, 09:50 |
|
#6 |
Senior Member
Balkrishna Patankar
Join Date: Mar 2009
Location: Pune
Posts: 123
Rep Power: 17 |
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 ; } } Can anyone help me out with this ? |
|
June 28, 2011, 09:58 |
|
#7 |
Senior Member
Martin
Join Date: Oct 2009
Location: Aachen, Germany
Posts: 255
Rep Power: 22 |
Hi,
you must use the reduce command for the zoneVol, too: Code:
... zoneVol += V[celli] ; } reduce(zoneVol, sumOp<scalar>()); // <-------- reduce(phaseVolume, sumOp<scalar>()); |
|
June 28, 2011, 10:03 |
|
#8 |
Senior Member
Balkrishna Patankar
Join Date: Mar 2009
Location: Pune
Posts: 123
Rep Power: 17 |
Thanks a lot .....
|
|
|
|
Similar Threads | ||||
Thread | Thread Starter | Forum | Replies | Last Post |
[Commercial meshers] fluent3DMeshToFoam | bego | OpenFOAM Meshing & Mesh Conversion | 31 | August 16, 2023 10:04 |
dsmcInitialise - dsmcFoam | archymedes | OpenFOAM Pre-Processing | 94 | July 15, 2016 17:14 |
[snappyHexMesh] Meshing multiple blocks | Hanno | OpenFOAM Meshing & Mesh Conversion | 3 | February 17, 2011 13:14 |
Merging the blocks in ICEM | saisanthoshm88 | ANSYS Meshing & Geometry | 1 | December 27, 2010 11:14 |
[blockMesh] BlockMesh: Strange interface between blocks | dancfd | OpenFOAM Meshing & Mesh Conversion | 3 | June 8, 2010 17:54 |