CFD Online Discussion Forums

CFD Online Discussion Forums (https://www.cfd-online.com/Forums/)
-   OpenFOAM Post-Processing (https://www.cfd-online.com/Forums/openfoam-post-processing/)
-   -   openfoam - monitor flow value on internal surface (https://www.cfd-online.com/Forums/openfoam-post-processing/219747-openfoam-monitor-flow-value-internal-surface.html)

ufocfd August 7, 2019 10:36

openfoam - monitor flow value on internal surface
 
Im posting this because it took me a while to set up correctly, so maybe it will be useful to others. It monitors the flow and logs the results.

I needed to monitor the average velocity at a plane within the mesh (not a patch or boundary condition), so I was able to use an STL file to specify the plane location (just a flat plate), using sampledTriSurfaceMesh.

I used the code below which is added to the controlDict file - you can change the operation to average, areaAverage,min,max etc. Note the STL file need to be completely within the mesh domain, or you will get warning messages.

surfaceFieldValue1
{
name midradsurf;
type surfaceFieldValue;
libs ("libfieldFunctionObjects.so");

writeControl timeStep;
writeInterval 1;
writeFields false;
log true;

operation average; //areaAverage, average, max, min
fields (U);
regionType sampledSurface;
surfaceFormat stl;

sampledSurfaceDict
{
type sampledTriSurfaceMesh;
surface midradsurf.stl; // <<<<<<< stl file
source cells;
interpolate true;
}

}

gian93 November 19, 2020 11:15

it seems not to work with field phi .. it generates a warning like this :
HTML Code:

surfaceFieldValue massFlowatTurbinlet write:
--> FOAM Warning :
    From function Foam::label Foam::functionObjects::fieldValues::surfaceFieldValue::writeAll(const vectorField&, const Foam::Field<Type>&, const Foam::meshedSurf&) [with WeightType = double; Foam::label = int; Foam::vectorField = Foam::Field<Foam::Vector<double> >]
    in file fieldValues/surfaceFieldValue/surfaceFieldValueTemplates.C at line 358
    Requested field phi not found in database and not processed

why?

>> solution: sampledSurface not available for surface fields

Didu October 10, 2022 14:54

monitor flow value on internal surface
 
Dear foamers,
I came across this thread and it's exactly what I'm looking for, my case is a simple pipe with a constant cross-section and I need to analyze the mass flow in the middle, I tried some solutions presented in this topic, however, none resulted in success, does anyone know why? I have noticed that the command change in version 2112...
Mainly, I have to analyze the flow behaviour (mass flow rate) in the middle of the total pipe length, my initial idea was to generate a plane, create a patch and run the following command "postProcess -func" flowRatePatch(name=middle)" however, this resulted in a big challenge.

LongGe October 11, 2022 22:34

Hi ALL,


There is a very good example in OpenFOAM tutorials as "OpenFOAM/OpenFOAM-v2012/tutorials/compressible/rhoSimpleFoam/squareBend". This tutorial describes how to sample various cross sections. Of course, examples of flow rate sampling are also provided.


All times are GMT -4. The time now is 12:20.