|
[Sponsors] |
April 19, 2019, 06:03 |
cellSet volume across processor.
|
#1 |
New Member
Join Date: Aug 2018
Posts: 18
Rep Power: 8 |
hi!
i use OF 2.3.1, want to get cells total volume in cellSet PPP. i can get it in single-core calculation. but i can't in parallel calculation. >>(code i wrote)---------------------------------------------------------------- double vol_PPP = 0; cellSet ppp(mesh, "PPP"); forAll(mesh.C(),i) { if (ppp[i]){ vol_PPP += mesh.V()[i]; Info << "vol_Mesh : " << mesh.V()[i] << " [m3] " << endl; } } Info << "vol_PPP_total : " << vol_PPP << " [m3] " << endl; ------------------------------------------------------------------------ i found function "reduce()" or "sum()", but don't know how to use it in cellSet ! please tell me the way of getting total volume... regard. |
|
May 7, 2019, 09:40 |
|
#2 |
Senior Member
Mark Olesen
Join Date: Mar 2009
Location: https://olesenm.github.io/
Posts: 1,715
Rep Power: 40 |
You need to specify the reduction operator as well. Eg,
Code:
scalar vol = ...; // your loop over cellSet reduce(vol, sumOp<scalar>()); |
|
May 9, 2019, 04:03 |
|
#3 |
New Member
Join Date: Aug 2018
Posts: 18
Rep Power: 8 |
Dear olesen,
thank you for your reply. I could get cellSet-volume by your way !! Thanks a lot. nago |
|
Tags |
coding style, mesh, openfoam2.3.1 |
|
|
Similar Threads | ||||
Thread | Thread Starter | Forum | Replies | Last Post |
how to set periodic boundary conditions | Ganesh | FLUENT | 15 | November 18, 2020 07:09 |
decomposePar problem: Cell 0contains face labels out of range | vaina74 | OpenFOAM Pre-Processing | 37 | July 20, 2020 06:38 |
[Other] Equal decomposition of cylindrical fluid domain | Sean95 | OpenFOAM Meshing & Mesh Conversion | 3 | February 12, 2019 04:34 |
Problem of simulating of small droplet with radius of 2mm | liguifan | OpenFOAM Running, Solving & CFD | 5 | June 3, 2014 03:53 |
channelFoam for a 3D pipe | AlmostSurelyRob | OpenFOAM | 3 | June 24, 2011 14:06 |