|
[Sponsors] |
September 13, 2010, 12:42 |
Split Mesh
|
#1 |
Member
Join Date: Mar 2010
Posts: 42
Rep Power: 16 |
Hi,
I need to get the weighted average value of a variable in two different zones. How can i split the mesh like zone1 (upper part) and zone2 (lower part) to get these results? The actual code that im using is: scalar averageT = T.weightedAverage(mesh.V()).value(); but as you can see it gets the whole mesh values. Is it possible to specify like mesh.V(zone1) and mesh.V(zone2) ? If its possible how can i divide the mesh? im using blockMesh with several blocks. Any other suggestion on how to collect these results? Thanks, Guilherme |
|
September 13, 2010, 14:31 |
|
#2 |
Senior Member
Laurence R. McGlashan
Join Date: Mar 2009
Posts: 370
Rep Power: 23 |
You could look at using cellSet and something like boxToCell. I had to do something similar recently to calculate the weighted average of a variable within a certain area of the mesh.
I've attached the files if you're interested.
__________________
Laurence R. McGlashan :: Website |
|
September 14, 2010, 06:58 |
|
#3 |
Member
Join Date: Mar 2010
Posts: 42
Rep Power: 16 |
Hi Laurence!
Thank you for the fast answer and the calculator! I compiled it and it seems to be working, but my output is like this: Code:
Create time Create mesh for time = 0 Time = 0 Reading holdupCalculationDict Time = 500 Reading holdupCalculationDict Time = 1000 Reading holdupCalculationDict ExecutionTime = 9.08 s ClockTime = 10 s End Thanks, Guilherme |
|
September 14, 2010, 07:18 |
|
#4 |
Senior Member
Laurence R. McGlashan
Join Date: Mar 2009
Posts: 370
Rep Power: 23 |
I've quickly made it more general to average any variable (see attached).
You'll have to change the name of the variable in holdupCalculation and the dimensions of the box you're averaging the variable in. The variable must be in the time folders for anything to be output. If you want a shape other than a box you'll have to alter the code slightly.
__________________
Laurence R. McGlashan :: Website |
|
September 14, 2010, 08:40 |
|
#5 |
Member
Join Date: Mar 2010
Posts: 42
Rep Power: 16 |
Now it worked perfectly! You did a great job with this code.
Thank you a lot Laurence. Guilherme |
|
Tags |
blockmesh split average |
|
|
Similar Threads | ||||
Thread | Thread Starter | Forum | Replies | Last Post |
[Gmsh] 2D Mesh Generation Tutorial for GMSH | aeroslacker | OpenFOAM Meshing & Mesh Conversion | 12 | January 19, 2012 04:52 |
[ICEM] Split wall hexa mesh | Anorky | ANSYS Meshing & Geometry | 2 | March 21, 2010 11:33 |
2d irregular grid | Remy | Main CFD Forum | 1 | December 22, 2008 05:49 |
fluent add additional zones for the mesh file | SSL | FLUENT | 2 | January 26, 2008 12:55 |
basic of mesh refinement | arya | CFX | 4 | June 19, 2007 13:21 |