||November 30, 2012 12:35
Mass Flow Rate Over a Sampled Surface
I'm looking to calculate the mass flow rate over a sampled surface. The current function I'm using in controlDict looks like this...
// Output to log&file (true) or to file only
// Output field values as well
// Type of source: patch/faceZone/sampledSurface
// if patch or faceZone: name of patch or faceZone
//// if sampledSurface: dictionary with a sampledSurface
//// Note: will not sample surface fields.
// Sampling on triSurface
source cells; // sample cells or boundaryFaces
// Operation: areaAverage/sum/weightedAverage ...
However, this does not provide any output (or errors). When I change the function to use a patch instead of a sampled surface (example: inlet), it is fine and outputs mass flow correctly. I have internal faces defined by stl files that I would like to sample though, and for some reason it does not provide the same behavior.
When changing the function to use a weighted average based on a sample surface and phi, I can get it to produce the following error.
--> FOAM FATAL ERROR:
 Field phi not found in database
 From function Foam::tmp<Foam::Field<Type> > Foam::fieldValues::faceSource::getFieldValues(const word&, const bool) const
 in file fieldValues/faceSource/faceSourceTemplates.C at line 120.
It almost seems as if phi is inaccessible to the sampled surface or is not being made available by the solver. However, after the first time step, I see a file phi being outputted. Can anyone tell me what I may be doing wrong? Or suggest a better way to do this, perhaps using swak4foam?