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

Internal faces for monitoring

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

Reply
 
LinkBack Thread Tools Display Modes
Old   April 23, 2010, 16:40
Default Internal faces for monitoring
  #1
New Member
 
Jason Ryon
Join Date: Oct 2009
Posts: 17
Rep Power: 11
jason.ryon is on a distinguished road
I would like to know how to monitor at an internal face (faceZone or faceSet). I want to know p, U, etc... for every point in the faceZone, as well as the mass flow through the entire face.

This is what I have tried so far, but can't seem to get things to work:
1. Import mesh (with "interior" surfaces) from Fluent using:
>fluentMeshToFoam mesh.msh -writeSets -writeZones
2. I see the name (interior_001) in faceZones of the faceZone that I want to monitor
3. Now, I have tried using the "surfaces" functionObject which works for slice planes or patches, but is it possible to use this to output a faceZone or faceSet?
4. I also tried even using the libfieldFunctionObjects.so but this seems to only work on a faceZone that is a patch and not an internal one.
5. Also, I have used libsimplefunctionobjects to work very well for mass flow at patches (i.e. pressure_inlet) but I don't know if this works for internal faceZones too.
http://openfoamwiki.net/index.php/Co...unctionObjects

I am sorry if this has been posted before, I searched through the Forum but keep hitting dead-ends.

Thanks,
Jason
jason.ryon is offline   Reply With Quote

Old   April 24, 2010, 07:48
Default
  #2
Member
 
Johan Spĺng
Join Date: Mar 2009
Location: Stockholm, Sweden
Posts: 35
Rep Power: 11
josp is on a distinguished road
(Assuming OpenFOAM-1.6.x) insert this into your controlDict and update according to your case:

Code:
functions
(
//=========================================================//
Meas-outlet  // Name also used to identify output folder
    {
        type            faceSource;
        functionObjectLibs ("libfieldFunctionObjects.so");
        enabled         true;
        outputControl   timeStep;
        outputInterval  1;
        log             true;
        valueOutput     false;
        source          faceZone;  // Type of face source: faceZone, patch
        sourceName      meas-outlet;
        operation       sum;
        fields
        (
            phi
        );
    }
This should integrate massflow (or volume flow for incompressible flow). I'm unsure about the other scalars as they are not defined at the faces so they have to be interpolated..

OpenFOAM-1.6.x/src/postProcessing/functionObjects/field/fieldValues/faceSource/faceSource.H:

- if the field is a volField the faceZone can only consist of boundary faces.

You could write something yourself like:
Code:
surfaceScalarField test = fvc::interpolate(field);
label q = mesh.faceZones().findZoneID(surfaceName);
const labelList& faces = mesh.faceZones()[q];

forAll(faces, j)
{
label facei = faces[j];
result+= test[facei]
...
}
Or check if surfaceInterpolateFieldsFunctionObjects can help you.

Last edited by josp; April 24, 2010 at 09:05.
josp is offline   Reply With Quote

Old   April 26, 2010, 16:56
Default
  #3
New Member
 
Jason Ryon
Join Date: Oct 2009
Posts: 17
Rep Power: 11
jason.ryon is on a distinguished road
josp,

Thanks for your response. I think this sum(phi) is close to what I am looking for, but not quite right. I am wondering though if this is "mass flow" or "mass flow rate"? I am looking for "mass flow rate".

I tried the sum(phi) at an inlet patch, and it is giving me results that are not the same as "mass flow rate" from Fluent or from the libsimpleFunctionObjects mass-flux calculations (both of which match up reasonably well to each other):

Thanks again for your help,
Jason
jason.ryon is offline   Reply With Quote

Old   April 27, 2010, 05:31
Default
  #4
Member
 
Cedric Van Holsbeke
Join Date: Dec 2009
Location: Belgium
Posts: 81
Rep Power: 10
CedricVH is on a distinguished road
sum(phi) is the mass flow rate trough the patch. However, in incompressible solvers, phi has the dimension m^3/s and not kg/s. You will have to multiply this value with rho to have the same results as Fluent.
CedricVH is offline   Reply With Quote

Old   June 20, 2010, 15:21
Default surfaceScalarField
  #5
New Member
 
Nadeem
Join Date: Mar 2009
Location: MĂĽnchen, Bavarian, Deutschland
Posts: 24
Rep Power: 11
ubaid is on a distinguished road
Hello everybody,

I am new to openfoam but have a similar question. I am wondering what I will get as an output if i have the following case.

surfaceScalarField abc

Info<<"Whats this"<<abc[100];

will it give me output of abc at the face number 100?

If I have faceSets, and get the facenumbers out of these facesets, could i get the value of abc at the putting the face number inside the brackets as following
Info<<"value at the required facenumber"<<abs[facenumber];

Thanks in advance.
ubaid is offline   Reply With Quote

Old   May 10, 2012, 08:35
Default
  #6
New Member
 
Michal
Join Date: Apr 2012
Location: Czech Republic
Posts: 27
Rep Power: 8
majkl is on a distinguished road
Quote:
Originally Posted by josp View Post
surfaceScalarField test = fvc::interpolate(field);
label q = mesh.faceZones().findZoneID(surfaceName);
const labelList& faces = mesh.faceZones()[q];

forAll(faces, j)
{
label facei = faces[j];
result+= test[facei]
...
}
[/CODE]Or check if surfaceInterpolateFieldsFunctionObjects can help you.
Well, it must be implemented in faceSource.H file? Thank you for your response. Majkl
majkl is offline   Reply With Quote

Old   October 11, 2018, 07:52
Default
  #7
New Member
 
Josef Dobeš
Join Date: Mar 2012
Location: Czech republic
Posts: 7
Rep Power: 8
Iose is on a distinguished road
Hi guys,
could you provide me some more information if you had/have succesfully implemented monitoring pressure on faceZones. I used OpenFOAM v6 and I am able to online monitoring phi as flux on the internal faces - faceZones, but if I want to monitoring pressure it doesn't work. Any help would be appreciated.

Thanks.
Iose is offline   Reply With Quote

Old   October 13, 2018, 06:13
Default
  #8
Super Moderator
 
Bruno Santos
Join Date: Mar 2009
Location: Lisbon, Portugal
Posts: 10,381
Blog Entries: 41
Rep Power: 114
wyldckat is a glorious beacon of lightwyldckat is a glorious beacon of lightwyldckat is a glorious beacon of lightwyldckat is a glorious beacon of lightwyldckat is a glorious beacon of lightwyldckat is a glorious beacon of light
Quick answer: You will have to create a baffle from that faceZone and apply cyclic boundary conditions to it. Search for "createBafflesDict" in the "tutorials" folder... I don't remember which tutorial has it...
__________________
wyldckat is offline   Reply With Quote

Old   October 15, 2018, 03:14
Default
  #9
New Member
 
Josef Dobeš
Join Date: Mar 2012
Location: Czech republic
Posts: 7
Rep Power: 8
Iose is on a distinguished road
Hi wyldckat,
you have a briliant idea. It works. My createBaffleDict looks:
Code:
/*--------------------------------*- C++ -*----------------------------------*\
  =========                 |
  \\      /  F ield         | OpenFOAM: The Open Source CFD Toolbox
   \\    /   O peration     | Website:  https://openfoam.org
    \\  /    A nd           | Version:  dev
     \\/     M anipulation  |
\*---------------------------------------------------------------------------*/
FoamFile
{
    version     2.0;
    format      ascii;
    class       dictionary;
    object      createBafflesDict;
}
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //

// Whether to convert internal faces only (so leave boundary faces intact).
// This is only relevant if your face selection type can pick up boundary
// faces.
internalFacesOnly true;

fields true;

// Baffles to create.
baffles
{
    I0_B
    {
        //- Use predefined faceZone to select faces and orientation.
        type        faceZone;
        zoneName    I0;

        patchPairs
        {
            type            cyclic;
        }
    }
    
    I3_B
    {
        //- Use predefined faceZone to select faces and orientation.
        type        faceZone;
        zoneName    I3;

        patchPairs
        {
            type            cyclic;     
        }
    }
}


// ************************************************************************* //
And my output looks like this:
Code:
/*---------------------------------------------------------------------------*\
  =========                 |
  \\      /  F ield         | OpenFOAM: The Open Source CFD Toolbox
   \\    /   O peration     | Website:  https://openfoam.org
    \\  /    A nd           | Version:  dev
     \\/     M anipulation  |
\*---------------------------------------------------------------------------*/
Build  : dev-8f3f2f7365c1
Exec   : createBaffles -overwrite
Date   : Oct 15 2018
Time   : 08:37:25
Host   : "dobesj-Precision-T5600"
PID    : 26264
I/O    : uncollated
Case   : /media/dobesj/Data_disc/Re_CS_OF
nProcs : 1
sigFpe : Enabling floating point exception trapping (FOAM_SIGFPE).
fileModificationChecking : Monitoring run-time modified files using timeStampMaster (fileModificationSkew 10)
allowSystemOperations : Allowing user-supplied system call operations

// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
Create time

Create mesh for time = 0

Reading baffle criteria from createBafflesDict

Not converting faces on non-coupled patches.

Reading geometric fields

Reading volScalarField p
Reading volScalarField nut
Reading volScalarField k
Reading volScalarField epsilon
Reading volScalarField omega
Reading volVectorField U
Created zone I0_B at index 24 with 610 faces
Created zone I3_B at index 25 with 610 faces
Converted 1220 faces into boundary faces in patches 
4
(
I0_B_master
I0_B_slave
I3_B_master
I3_B_slave
)


--> FOAM Warning : 
    From function int main(int, char**)
    in file createBaffles.C at line 854
    Setting field on boundary faces to zero.
You might have to edit these fields.
Writing mesh to 0
End
Maybe one little question about FOAM Warning - the error tells me that I don't setup boundary condition for cyclic, am I right?

Thanks.
Iose is offline   Reply With Quote

Old   October 15, 2018, 03:18
Default
  #10
New Member
 
Josef Dobeš
Join Date: Mar 2012
Location: Czech republic
Posts: 7
Rep Power: 8
Iose is on a distinguished road
Hi wyldckat,
thank you for your briliant idea, it works. In my log file, during create baffles I received that warning:

Code:
--> FOAM Warning : 
    From function int main(int, char**)
    in file createBaffles.C at line 854
    Setting field on boundary faces to zero.
You might have to edit these fields.
This is only about information that I don't setup boundary condition for cyclic face zones, am I right?
Iose is offline   Reply With Quote

Reply

Tags
internal monitoring

Thread Tools
Display Modes

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


Similar Threads
Thread Thread Starter Forum Replies Last Post
DecomposePar unequal number of shared faces maka OpenFOAM Pre-Processing 6 August 12, 2010 09:01
external flow with snappyHexMesh chelvistero OpenFOAM 11 January 15, 2010 19:43
How to store the variable on internal faces to calculate UDS_FLUX? bigfans FLUENT 0 October 28, 2009 14:22
Problem in IMPORT of ICEM input file in FLUENT csvirume FLUENT 2 September 9, 2009 01:08
Unaligned accesses on IA64 andre OpenFOAM 5 June 23, 2008 10:37


All times are GMT -4. The time now is 18:48.