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

on the run flow-rate evaluation on a cluster

Register Blogs Community New Posts Updated Threads Search

Like Tree3Likes
  • 3 Post By kmooney

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
Old   August 25, 2014, 05:10
Default on the run flow-rate evaluation on a cluster
  #1
New Member
 
Join Date: Aug 2014
Location: Bremen, Germany
Posts: 5
Rep Power: 12
wstapel is on a distinguished road
Dear Foamers,


I've got a problem with coding a parallel calculation of the flow-rate which is to be evaluated on the run (not by integratePatchField).

My overall purpose is the following: I want the flow-rate to influence the inlet boundary conditions of an internal flow.

So far I've actually managed to evaluate the flow-rate, but it only works if I'm performing parallel calculations on my local machine or on one single node of a cluster. However if I try to run the very same calculation on a cluster distributed over several nodes, it always yields a zero flow-rate.
So obviously the problem must have something to do with parallelisation or with mpi ...

Finally here is the code, I added to the original icoFoam solver:
// Declaration and Initialisation of Variables
word outletPatchName = "OUTLET";
// search for label of the outlet patch by the name within the boundary dictionary

label inletPatchi = mesh.boundaryMesh().findPatchID(outletPatchName);

// Calculate volumetric flow-rate

scalar volFluxOutlet = sum(phi.boundaryField()[outletPatchi]);

// Write flow-rate

Info<< "Volumetric Flowrate: " << volFluxOutlet << " m^3/s" << endl;

/**********************************************/
I'd be glad for any helpful comments.

Waldemar
wstapel is offline   Reply With Quote

Old   August 25, 2014, 23:41
Default
  #2
Senior Member
 
kmooney's Avatar
 
Kyle Mooney
Join Date: Jul 2009
Location: San Francisco, CA USA
Posts: 323
Rep Power: 18
kmooney is on a distinguished road
Hi Waldemar,

Try using

Code:
gSum(...)
instead of

Code:
sum(...)
I believe that gSum has built-in mpi reduction operators while 'sum' does not.

I hope that helps!
Cheers,
Kyle
jhoepken, chrisb2244 and wstapel like this.
kmooney is offline   Reply With Quote

Old   August 26, 2014, 04:04
Default
  #3
New Member
 
Join Date: Aug 2014
Location: Bremen, Germany
Posts: 5
Rep Power: 12
wstapel is on a distinguished road
Hi Kyle,

it works fine. Thank you very much!
wstapel is offline   Reply With Quote

Old   August 26, 2014, 15:55
Default
  #4
Senior Member
 
kmooney's Avatar
 
Kyle Mooney
Join Date: Jul 2009
Location: San Francisco, CA USA
Posts: 323
Rep Power: 18
kmooney is on a distinguished road
Excellent! Good to hear.
kmooney is offline   Reply With Quote

Reply

Tags
clusters, flow-rate, programming


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
Gate valve flow simulations... nikesh FloEFD, FloWorks & FloTHERM 5 January 28, 2014 02:31
How to define a fixed velocity for a given mass flow rate on inlet mqasimali FLUENT 2 April 12, 2013 18:24
Mass flow rate boundary condition for continuity equation for oscillating flow p07ip705 Main CFD Forum 0 February 28, 2013 02:33
target flow rate: varying results Ryan FLUENT 3 January 9, 2008 14:54
fluid flow fundas ram Main CFD Forum 5 June 17, 2000 22:31


All times are GMT -4. The time now is 10:39.