# Averaging due to parallel running - cuttingPlane

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

 December 8, 2010, 08:42 Averaging due to parallel running - cuttingPlane #1 Member   Tobias Holzinger Join Date: Mar 2009 Location: Munich, Germany Posts: 46 Rep Power: 9 Dear All, I am actually implementing a boundary condition that accesses some Field values like p, U, rho from cutting planes inside the mesh. As only the average of the cut Field is of interest, I have to create some kind of weighting factor for each processor part. So far the Code looks like this: Code: ``` // Create the cutting Planes point planeLocation = planeLocations[planeI]; plane extPlane(planeLocation,orientPatch); cuttingPlane cuttedPlane(extPlane,this->dimensionedInternalField().mesh()); vector averageUPRho(0.0,0.0,0.0); scalar weigthPatch; // Compute the the cut of each processor if (cuttedPlane.cut()== 1) { averageUPRho.component(0)= (average(cuttedPlane.sample(Ufield)) & orientPatch); // The mean Velocity in normal Direction averageUPRho.component(1)= average(cuttedPlane.sample(pfield));// The mean Pressure averageUPRho.component(2)=average(cuttedPlane.sample(rhofield));// The mean Density weigthPatch= cuttedPlane.size(); // The weighting factor } else { weigthPatch=0; }``` Now I forward the averageUPRho and the weigthPatch to the Master and do the averaging with rhoMean=sum(averageUPRho*weigthPatch)/sum(weigthPatch); unfortunately I weight by the number of faces and not by their Area (magSf for patches works ... not for planes?). How can I acces them?? Any hints? solefire likes this.

 December 8, 2010, 11:35 #2 Senior Member   Laurence R. McGlashan Join Date: Mar 2009 Posts: 370 Rep Power: 15 I notice that sampledPlane inherits from sampledSurface and cuttingPlane. sampledSurface has an area() function. Would that help you? Could you create a sampledPlane from your plane? __________________ Laurence R. McGlashan :: Website

 December 8, 2010, 11:54 #3 Member   Tobias Holzinger Join Date: Mar 2009 Location: Munich, Germany Posts: 46 Rep Power: 9 It worked... just adding / editing 2 lines... Code: ```... cuttingPlane cuttedPlane(extPlane,this->dimensionedInternalField().mesh()); sampledPlane smpPl("smpPl",this->dimensionedInternalField().mesh(),extPlane); .... averageUPRho.component(2)=average(cuttedPlane.sample(rhofield)); weigthPlane= sum(smpPl.magSf()); } ...``` mm.abdollahzadeh and Pagoda like this. Last edited by woody; December 8, 2010 at 12:19.

 December 8, 2010, 12:58 #4 Senior Member   Laurence R. McGlashan Join Date: Mar 2009 Posts: 370 Rep Power: 15 You can replace weightPlane with smpPI.area() Also because samplePlane inherits from cuttingPlane, you probably don't need cuttedPlane and can just use smpPI? __________________ Laurence R. McGlashan :: Website

December 9, 2010, 04:33
#5
Member

Tobias Holzinger
Join Date: Mar 2009
Location: Munich, Germany
Posts: 46
Rep Power: 9
Hi Laurence,

Quote:
 Originally Posted by l_r_mcglashan You can replace weightPlane with smpPI.area()
area() unfortunately passes the total plane magnitude, not only the part a processor contains ....

Quote:
 Originally Posted by l_r_mcglashan Also because samplePlane inherits from cuttingPlane, you probably don't need cuttedPlane and can just use smpPI?
...this works fine...

Thanks so far...

 Tags area, averaging, cuttingplane, parallel processing

 Thread Tools Display Modes Linear Mode

 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 OffTrackbacks are On Pingbacks are On Refbacks are On Forum Rules

 Similar Threads Thread Thread Starter Forum Replies Last Post francesco OpenFOAM Bugs 3 June 10, 2011 09:30 daveatstyacht OpenFOAM 7 August 31, 2010 17:16 Ravi Duggirala FLUENT 4 August 3, 2010 10:01 carcass OpenFOAM Running, Solving & CFD 2 July 22, 2009 10:56 Pat Fox Main CFD Forum 1 January 21, 1999 15:01

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