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

How to extract alpha cell data in an area within the domain?

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

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
Old   May 12, 2022, 09:17
Default How to extract alpha cell data in an area within the domain?
  #1
New Member
 
Akshay
Join Date: Jan 2020
Posts: 28
Rep Power: 6
enthusiast is on a distinguished road
Hi, I am using twophaseEulerFoam which is included with multiphaseEulerFoam in OF version 8.

I would like to monitor the phase fraction of gas in water over the time steps, I need to analyze the gas phase fraction at the liquid outlet.

But I don't know how to extract this data for all time steps and average it and save it.

Right now I am only using probe point at a certain point, but this is not reliable as it only considers a single point.

I have attached the cells which I would like to consider.

a.PNG

b.PNG

Thank you
enthusiast is offline   Reply With Quote

Old   May 13, 2022, 15:07
Default
  #2
Senior Member
 
Joachim Herb
Join Date: Sep 2010
Posts: 650
Rep Power: 21
jherb is on a distinguished road
You can use a surfaceFieldValue function object applied to a faceZone. For the ESI version of OpenFOAM see: https://www.openfoam.com/documentati...ieldValue.html
(for the Foundation version, the same is possible)


The faceZone can be produced with topoSet.


See also: Integrate volVectorField over cross section / cutting plane
jherb is offline   Reply With Quote

Old   May 15, 2022, 16:17
Default
  #3
New Member
 
Akshay
Join Date: Jan 2020
Posts: 28
Rep Power: 6
enthusiast is on a distinguished road
Quote:
Originally Posted by jherb View Post
You can use a surfaceFieldValue function object applied to a faceZone. For the ESI version of OpenFOAM see: https://www.openfoam.com/documentati...ieldValue.html
(for the Foundation version, the same is possible)


The faceZone can be produced with topoSet.


See also: Integrate volVectorField over cross section / cutting plane
Thanks for your valuable input, I am able to extract the faceZone from faceSet within the domain but when I try to start the solver with surfaceFieldValue included with controlDict, I am getting an error.

Can you please provide your valuable inputs regarding this issue.

Code:
FoamFile
{
    version     2.0;
    format      ascii;
    class       dictionary;
    location    "system";
    object      topoSetDict;
}
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //

actions
(
    {
        name    internalFaces;
        type    faceSet;
        action  new;
		
        source  boxToFace;
        sourceInfo
        {
            box (0.9823 0.0965 0.457) (1.009 0.1403 0.528);
        }
    } 

	
	{
        name    internalfacepatch;
        type    faceZoneSet;
        action    new;
		
        source    setToFaceZone;
        sourceInfo
        {
            faceSet    internalFaces; 
			cellSet    internalCells;
			flip    false;
        }
    } 


);
// ************************************************************************* //
Code:
surfaceFieldValue1
{
		type            surfaceFieldValue;
        libs            ("libfieldFunctionObjects.so");
		
        log             true;
        writeControl    writeTime;
        writeFields     true;
		
        regionType      faceZone;
        name            internalfacepatch;
		
        operation       areaAverage;
		surfaceFormat   none;
		
        fields
        (
			
			alpha.oxygen 

		);
	
}
The error what I am getting is:

Code:
surfaceFieldValue surfaceFieldValue1 write:


--> FOAM FATAL ERROR:
surfaceFieldValue surfaceFieldValue1: faceZone(internalfacepatch):
    Unable to process internal faces for volume field alpha.oxygen


    From function Foam::tmp<Foam::Field<Type> > Foam::functionObjects::fieldValues::surfaceFieldValue::filterField(const Foam::GeometricField<Type, Foam::fvPatchField, Foam::volMesh>&, bool) const [with Type = double]
    in file fieldValues/surfaceFieldValue/surfaceFieldValueTemplates.C at line 416.

FOAM aborting

Generating stack trace...


Backtrace:
        ZN10StackTraceC1Ev [0x626c1855+0x25]
                 module: C:\PROGRA~1\BLUECF~1\ThirdParty-8\platforms\mingw_w64GccDPInt32\lib\libstack_trace.dll
        ZN4Foam5error10printStackERNS_7OstreamE [0x6c30ae5a+0x23a]
                 module: C:\PROGRA~1\BLUECF~1\OpenFOAM-8\platforms\mingw_w64GccDPInt32Opt\lib\libOpenFOAM.dll
        ZN4Foam5error5abortEv [0x6c0c68b1+0x211]
                 module: C:\PROGRA~1\BLUECF~1\OpenFOAM-8\platforms\mingw_w64GccDPInt32Opt\lib\libOpenFOAM.dll
        ZNK4Foam15functionObjects11fieldValues17surfaceFieldValue11filterFieldIdEENS_3tmpINS_5FieldIT_EEEERKNS_14GeometricFieldIS6_NS_12fvPatchFieldENS_7volMeshEEEb [0x958fb68+0x1d8]
                 module: C:\PROGRA~1\BLUECF~1\OpenFOAM-8\platforms\mingw_w64GccDPInt32Opt\lib\libfieldFunctionObjects.dll
        ZNK4Foam15functionObjects11fieldValues17surfaceFieldValue14getFieldValuesIdEENS_3tmpINS_5FieldIT_EEEERKNS_4wordEbb [0x9591d7f+0x36f]
                 module: C:\PROGRA~1\BLUECF~1\OpenFOAM-8\platforms\mingw_w64GccDPInt32Opt\lib\libfieldFunctionObjects.dll
        ZN4Foam15functionObjects11fieldValues17surfaceFieldValue11writeValuesIdEEbRKNS_4wordERKNS_5FieldIdEEb [0x94b711d+0x9d]
                 module: C:\PROGRA~1\BLUECF~1\OpenFOAM-8\platforms\mingw_w64GccDPInt32Opt\lib\libfieldFunctionObjects.dll
        ZN4Foam15functionObjects11fieldValues17surfaceFieldValue5writeEv [0x939d2cb+0x24b]
                 module: C:\PROGRA~1\BLUECF~1\OpenFOAM-8\platforms\mingw_w64GccDPInt32Opt\lib\libfieldFunctionObjects.dll
        ZN4Foam15functionObjects11timeControl5writeEv [0x6c18a32d+0x2d]
                 module: C:\PROGRA~1\BLUECF~1\OpenFOAM-8\platforms\mingw_w64GccDPInt32Opt\lib\libOpenFOAM.dll
        ZN4Foam18functionObjectList5startEv [0x6c180acf+0x8f]
                 module: C:\PROGRA~1\BLUECF~1\OpenFOAM-8\platforms\mingw_w64GccDPInt32Opt\lib\libOpenFOAM.dll
        ZNK4Foam4Time3runEv [0x6c18ccfd+0x19d]
                 module: C:\PROGRA~1\BLUECF~1\OpenFOAM-8\platforms\mingw_w64GccDPInt32Opt\lib\libOpenFOAM.dll
        (No symbol) [0x472123]
                 module: C:\PROGRA~1\BLUECF~1\OpenFOAM-8\platforms\mingw_w64GccDPInt32Opt\bin\multiphaseEulerFoam.exe
        (No symbol) [0x4013c1]
                 module: C:\PROGRA~1\BLUECF~1\OpenFOAM-8\platforms\mingw_w64GccDPInt32Opt\bin\multiphaseEulerFoam.exe
        (No symbol) [0x4014f6]
                 module: C:\PROGRA~1\BLUECF~1\OpenFOAM-8\platforms\mingw_w64GccDPInt32Opt\bin\multiphaseEulerFoam.exe
        BaseThreadInitThunk [0x7ffbb2517034+0x14]
                 module: C:\Windows\System32\KERNEL32.DLL
        RtlUserThreadStart [0x7ffbb32e2651+0x21]
                 module: C:\Windows\SYSTEM32\ntdll.dll
enthusiast is offline   Reply With Quote

Old   May 16, 2022, 09:22
Default
  #4
New Member
 
Akshay
Join Date: Jan 2020
Posts: 28
Rep Power: 6
enthusiast is on a distinguished road
Quote:
Originally Posted by enthusiast View Post
Thanks for your valuable input, I am able to extract the faceZone from faceSet within the domain but when I try to start the solver with surfaceFieldValue included with controlDict, I am getting an error.

Can you please provide your valuable inputs regarding this issue.

Code:
FoamFile
{
    version     2.0;
    format      ascii;
    class       dictionary;
    location    "system";
    object      topoSetDict;
}
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //

actions
(
    {
        name    internalFaces;
        type    faceSet;
        action  new;
		
        source  boxToFace;
        sourceInfo
        {
            box (0.9823 0.0965 0.457) (1.009 0.1403 0.528);
        }
    } 

	
	{
        name    internalfacepatch;
        type    faceZoneSet;
        action    new;
		
        source    setToFaceZone;
        sourceInfo
        {
            faceSet    internalFaces; 
			cellSet    internalCells;
			flip    false;
        }
    } 


);
// ************************************************************************* //
Code:
surfaceFieldValue1
{
		type            surfaceFieldValue;
        libs            ("libfieldFunctionObjects.so");
		
        log             true;
        writeControl    writeTime;
        writeFields     true;
		
        regionType      faceZone;
        name            internalfacepatch;
		
        operation       areaAverage;
		surfaceFormat   none;
		
        fields
        (
			
			alpha.oxygen 

		);
	
}
The error what I am getting is:

Code:
surfaceFieldValue surfaceFieldValue1 write:


--> FOAM FATAL ERROR:
surfaceFieldValue surfaceFieldValue1: faceZone(internalfacepatch):
    Unable to process internal faces for volume field alpha.oxygen


    From function Foam::tmp<Foam::Field<Type> > Foam::functionObjects::fieldValues::surfaceFieldValue::filterField(const Foam::GeometricField<Type, Foam::fvPatchField, Foam::volMesh>&, bool) const [with Type = double]
    in file fieldValues/surfaceFieldValue/surfaceFieldValueTemplates.C at line 416.

FOAM aborting

Generating stack trace...


Backtrace:
        ZN10StackTraceC1Ev [0x626c1855+0x25]
                 module: C:\PROGRA~1\BLUECF~1\ThirdParty-8\platforms\mingw_w64GccDPInt32\lib\libstack_trace.dll
        ZN4Foam5error10printStackERNS_7OstreamE [0x6c30ae5a+0x23a]
                 module: C:\PROGRA~1\BLUECF~1\OpenFOAM-8\platforms\mingw_w64GccDPInt32Opt\lib\libOpenFOAM.dll
        ZN4Foam5error5abortEv [0x6c0c68b1+0x211]
                 module: C:\PROGRA~1\BLUECF~1\OpenFOAM-8\platforms\mingw_w64GccDPInt32Opt\lib\libOpenFOAM.dll
        ZNK4Foam15functionObjects11fieldValues17surfaceFieldValue11filterFieldIdEENS_3tmpINS_5FieldIT_EEEERKNS_14GeometricFieldIS6_NS_12fvPatchFieldENS_7volMeshEEEb [0x958fb68+0x1d8]
                 module: C:\PROGRA~1\BLUECF~1\OpenFOAM-8\platforms\mingw_w64GccDPInt32Opt\lib\libfieldFunctionObjects.dll
        ZNK4Foam15functionObjects11fieldValues17surfaceFieldValue14getFieldValuesIdEENS_3tmpINS_5FieldIT_EEEERKNS_4wordEbb [0x9591d7f+0x36f]
                 module: C:\PROGRA~1\BLUECF~1\OpenFOAM-8\platforms\mingw_w64GccDPInt32Opt\lib\libfieldFunctionObjects.dll
        ZN4Foam15functionObjects11fieldValues17surfaceFieldValue11writeValuesIdEEbRKNS_4wordERKNS_5FieldIdEEb [0x94b711d+0x9d]
                 module: C:\PROGRA~1\BLUECF~1\OpenFOAM-8\platforms\mingw_w64GccDPInt32Opt\lib\libfieldFunctionObjects.dll
        ZN4Foam15functionObjects11fieldValues17surfaceFieldValue5writeEv [0x939d2cb+0x24b]
                 module: C:\PROGRA~1\BLUECF~1\OpenFOAM-8\platforms\mingw_w64GccDPInt32Opt\lib\libfieldFunctionObjects.dll
        ZN4Foam15functionObjects11timeControl5writeEv [0x6c18a32d+0x2d]
                 module: C:\PROGRA~1\BLUECF~1\OpenFOAM-8\platforms\mingw_w64GccDPInt32Opt\lib\libOpenFOAM.dll
        ZN4Foam18functionObjectList5startEv [0x6c180acf+0x8f]
                 module: C:\PROGRA~1\BLUECF~1\OpenFOAM-8\platforms\mingw_w64GccDPInt32Opt\lib\libOpenFOAM.dll
        ZNK4Foam4Time3runEv [0x6c18ccfd+0x19d]
                 module: C:\PROGRA~1\BLUECF~1\OpenFOAM-8\platforms\mingw_w64GccDPInt32Opt\lib\libOpenFOAM.dll
        (No symbol) [0x472123]
                 module: C:\PROGRA~1\BLUECF~1\OpenFOAM-8\platforms\mingw_w64GccDPInt32Opt\bin\multiphaseEulerFoam.exe
        (No symbol) [0x4013c1]
                 module: C:\PROGRA~1\BLUECF~1\OpenFOAM-8\platforms\mingw_w64GccDPInt32Opt\bin\multiphaseEulerFoam.exe
        (No symbol) [0x4014f6]
                 module: C:\PROGRA~1\BLUECF~1\OpenFOAM-8\platforms\mingw_w64GccDPInt32Opt\bin\multiphaseEulerFoam.exe
        BaseThreadInitThunk [0x7ffbb2517034+0x14]
                 module: C:\Windows\System32\KERNEL32.DLL
        RtlUserThreadStart [0x7ffbb32e2651+0x21]
                 module: C:\Windows\SYSTEM32\ntdll.dll
Found the solution for my error, if someone has the same problem. This can help.

HTML Code:
https://www.cfd-online.com/Forums/openfoam-post-processing/238974-facezoneaverage-function-object-does-not-work-field-u-p-etc.html
Volume fields needs to be interpolated to surface fields, I implemented it in controlDict, now the solver is running.
enthusiast is offline   Reply With Quote

Reply

Tags
post procesing, twophaseeuelrfoam

Thread Tools Search this Thread
Search this Thread:

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


Similar Threads
Thread Thread Starter Forum Replies Last Post
Fluent UDF wrong number of cells in parallel - correct in serial dralexpe Fluent UDF and Scheme Programming 7 May 17, 2018 08:26
Reduce on alpha data vishwesh OpenFOAM Programming & Development 0 September 21, 2017 00:37
Out File does not show Imbalance in % Mmaragann CFX 5 January 20, 2017 10:20
injection problem Mark New FLUENT 0 August 4, 2013 01:30
CFX Solver Memory Error mike CFX 1 March 19, 2008 07:22


All times are GMT -4. The time now is 21:01.