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

Finding Volume of Air

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

Like Tree2Likes
  • 1 Post By Taataa
  • 1 Post By Taataa

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
Old   March 25, 2018, 01:55
Default Finding Volume of Air
  #1
Member
 
Ysmn
Join Date: Mar 2018
Location: Auburn,AL
Posts: 34
Rep Power: 8
elyasmin is on a distinguished road
Hello,

Is anyone know how can I find the total volume of air in the the domain for an exact time after simulation finished? I mean when simulation finished, I would like to see, for example, how much air stays in the domain at the time 15 sec. Accually how air volume changes in time. I am using OpenFOAM 4.1 and water and air are the fluids in the domain.

Thank you,
Yasemin
elyasmin is offline   Reply With Quote

Old   March 26, 2018, 23:51
Default
  #2
Senior Member
 
Taher Chegini
Join Date: Nov 2014
Location: Houston, Texas
Posts: 125
Rep Power: 12
Taataa is on a distinguished road
Just add this block to controlDict:

Code:
functions
{  
    waterVolume
    {
        type            volFieldValue;
        libs            ("libfieldFunctionObjects.so");
        log             true;
        writeControl    writeTime;
        writeFields     true;
        regionType      all;
        operation       volIntegrate;
        fields
        (
            alpha.water
        );
    }
}
which should give you water volume at each time step in a file. So when you want to plot it you can subtract it from total volume to get air volume.

I didn't test it myself but it should work. You can find more info here.
joshmccraney likes this.
Taataa is offline   Reply With Quote

Old   March 28, 2018, 14:09
Default
  #3
Member
 
Ysmn
Join Date: Mar 2018
Location: Auburn,AL
Posts: 34
Rep Power: 8
elyasmin is on a distinguished road
Hi Taataa,
Thank you so much for your reply.

I have added it to the controlDict but it gives error as is seen below. Do you have any idea about it?


Quote:
--> FOAM FATAL ERROR:
[0] Unknown function type volFieldValue

Valid functions are :

6
(
patchProbes
probes
psiReactionThermoMoleFractions
rhoReactionThermoMoleFractions
sets
surfaces
)

[0]
[0]
[0] From function static Foam::autoPtr<Foam::functionObject> Foam::functionObject::New(const Foam::word&, const Foam::Time&, const Foam::dictionary&)
[0] in file db/functionObjects/functionObject/functionObject.C at line 85.
[0]
FOAM parallel run exiting
[0]
[node234:07122] 97 more processes have sent help message help-mpi-api.txt / mpi-abort
[node234:07122] Set MCA parameter "orte_base_help_aggregate" to 0 to see all help / error messages


--> FOAM FATAL ERROR:
No times selected

From function int main(int, char**)
in file reconstructPar.C at line 215.

FOAM exiting
Here is my controlDict:

Quote:
/*--------------------------------*- C++ -*----------------------------------*\
| ========= | |
| \\ / F ield | OpenFOAM: The Open Source CFD Toolbox |
| \\ / O peration | Version: 2.1.0 |
| \\ / A nd | Web: www.OpenFOAM.org |
| \\/ M anipulation | |
\*---------------------------------------------------------------------------*/
FoamFile
{
version 2.0;
format ascii;
class dictionary;
location "system";
object controlDict;
}
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //

application compressibleInterFoam;

startFrom latestTime;

startTime 0;

stopAt endTime;

endTime 14.4;

deltaT 0.000001;

writeControl adjustableRunTime;

writeInterval 0.1;

purgeWrite 0;

writeFormat ascii;

writePrecision 9;

writeCompression compressed;

timeFormat general;

timePrecision 9;

runTimeModifiable yes;

adjustTimeStep on;

maxCo 0.2;
maxAlphaCo 0.2;

maxDeltaT 1;

functions
{
waterVolume
{
type volFieldValue;
libs ("libfieldFunctionObjects.so");
log true;
writeControl writeTime;
writeFields true;
regionType all;
operation volIntegrate;
fields
(
alpha.water
);
}
}
/*functions
{
probes
{
// Where to load it from
functionObjectLibs ( "libsampling.so" );

type probes;

// Name of the directory for probe data
name probes;

// Write at same frequency as fields
outputControl outputTime;
outputInterval 1;

// Fields to be probed
fields
(
p U
);

probeLocations
(
(40.49 0.45 -0.001)
(40.49 0.5 -0.001)
(40.49 0.55 -0.001)
(40.49 0.6 -0.001)
(40.49 0.65 -0.001)
(40.49 0.7 -0.001)
(40.49 0.75 -0.001)
(40.49 0.8 -0.001)
(40.49 0.85 -0.001)
(40.49 0.9 -0.001)
(40.49 0.95 -0.001)
(40.49 0.075 -0.001)
(50.63 0.5 -0.00001)
(50.63 0.51 -0.0001)
(50.63 0.52 -0.00001)
(50.63 0.53 -0.0001)
(50.63 0.54 -0.00001)
(50.63 0.55 -0.0001)
);
}
}*/
// ************************************************** *********************** //

// ******************************************

Please ignore the last part.

Thank you for any help in advance!


Yasemin
elyasmin is offline   Reply With Quote

Old   March 28, 2018, 18:40
Default
  #4
Senior Member
 
Taher Chegini
Join Date: Nov 2014
Location: Houston, Texas
Posts: 125
Rep Power: 12
Taataa is on a distinguished road
Try changing regionType to cellZone and name to all.

Code:
functions
{  
    waterVolume
    {
        type            volFieldValue;
        libs            ("libfieldFunctionObjects.so");
        log             true;
        writeControl    writeTime;
        writeFields     true;
        regionType          cellZone;
        name                all;
        operation       volIntegrate;
        fields
        (
            alpha.water
        );
    }
}
If it didn't work, you should use topoSet to create a cellZone named "all" then it will work for sure. You can take a look at this tutorial for creating cellZone if you don't know how.
elyasmin likes this.
Taataa is offline   Reply With Quote

Reply

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
[blockMesh] blockMesh error - Negative Volume Block adoledin OpenFOAM Meshing & Mesh Conversion 2 June 22, 2016 10:44
Rotating Disc in a Volume of Air alcesalces FLOW-3D 5 August 28, 2009 17:04
Rotating Disc in a Volume of Air alcesalces Siemens 0 August 24, 2009 13:59
*extract volume of air in VOF model Adriano FLUENT 0 April 13, 2007 03:57
How to apply negtive pressure to outlet bioman66 CFX 5 June 3, 2006 01:40


All times are GMT -4. The time now is 06:45.