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

Measuring total pressure with simpleFunctionObjects

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

Reply
 
LinkBack Thread Tools Display Modes
Old   February 18, 2010, 06:40
Question Measuring total pressure with simpleFunctionObjects
  #1
Member
 
Cedric Van Holsbeke
Join Date: Dec 2009
Location: Belgium
Posts: 81
Rep Power: 7
CedricVH is on a distinguished road
I want to monitor the mass flow rate and the total pressure every iteration at the outlet of my geometry. A good way to do this is using the simpleFunctionObjects (http://openfoamwiki.net/index.php/Co...unctionObjects).

Using simpleFoam, I am able to calculate the mass flow rate, but not the total pressure. My code in the controlDict file is given as:

Code:
functions 
(
   massFlow
   {
     type patchMassFlow;
     functionObjectLibs
       (
         "libsimpleFunctionObjects.so"
       );
     verbose true;
     patches
       (
         outlet
       );
   }

   totPress
   {
     type patchAverage;
     functionObjectLibs
       (
         "libsimpleFunctionObjects.so"
       );
     verbose true;
     fields
       (
         ptot
       );
     patches
       (
         outlet
       );
   }
);
The mass flow is reported correctly, but the parameter ptot can not be used, because it has not been calculated by OpenFOAM.

In post-processing, I would first calculate the total pressure with the command "ptot" and then averaging it with the command "patchAverage ptot outlet"

Does anybody know how to implement this using simpleFunctionObjects?

Last edited by CedricVH; February 18, 2010 at 10:38.
CedricVH is offline   Reply With Quote

Old   February 18, 2010, 15:56
Default
  #2
Member
 
Cedric Van Holsbeke
Join Date: Dec 2009
Location: Belgium
Posts: 81
Rep Power: 7
CedricVH is on a distinguished road
Solved: I have modified the simpleFoam solver so that it calculates ptot every iteration.
CedricVH is offline   Reply With Quote

Old   February 19, 2010, 03:11
Default
  #3
Member
 
Michael
Join Date: Mar 2009
Posts: 48
Rep Power: 8
farbfilm is on a distinguished road
Hi Cedric,

could you please explain me how you modified the solver that it calculates ptot every iteration???
farbfilm is offline   Reply With Quote

Old   February 19, 2010, 04:20
Default
  #4
Member
 
Cedric Van Holsbeke
Join Date: Dec 2009
Location: Belgium
Posts: 81
Rep Power: 7
CedricVH is on a distinguished road
I've copied simpleFoam to another directory and renamed all files (mysimpleFoam)

In createFields.H, I changed this:

Code:
    Info << "Reading field U\n" << endl;
    volVectorField U
    (
        IOobject
        (
            "U",
            runTime.timeName(),
            mesh,
            IOobject::MUST_READ,
            IOobject::AUTO_WRITE
        ),
        mesh
    );

// BEGIN ADD CODE
    Info<< "Reading field ptot\n" <<endl;
    volScalarField ptot
    (
        IOobject
        (
            "ptot",
            runTime.timeName(),
            mesh,
            IOobject::NO_READ,
            IOobject::AUTO_WRITE           
       ),
       p + 0.5*magSqr(U)
    );
// END ADD CODE

#   include "createPhi.H"
In mysimpleFoam.C, I've added this:

Code:
        {
            #include "UEqn.H"
            #include "pEqn.H"
        }

        turbulence->correct();
// BEGIN ADD CODE
        ptot = p + 0.5*magSqr(U);
// END ADD CODE

        runTime.write();
Take care! This formula of ptot is ONLY valid for incompressible cases. I don't know is this is a good way as I have never programmed for OpenFoam, but hey, it works!
CedricVH is offline   Reply With Quote

Old   October 12, 2010, 10:07
Default
  #5
Member
 
Join Date: Jun 2010
Posts: 33
Rep Power: 7
RalphS is on a distinguished road
Does anybody know how I can modified the rhoSimpleFoam solver so that it calculates ptot every iteration?
RalphS is offline   Reply With Quote

Old   February 1, 2011, 06:03
Default
  #6
Member
 
Claudio
Join Date: Mar 2010
Posts: 57
Rep Power: 7
claco is on a distinguished road
Quote:
Originally Posted by RalphS View Post
Does anybody know how I can modified the rhoSimpleFoam solver so that it calculates ptot every iteration?
Dear RalphS,

Have You heard any more about total pressure calculation in rhoSimpleFoam solver?

Best regards.

Claudio
claco is offline   Reply With Quote

Old   February 1, 2011, 10:43
Default
  #7
Member
 
Join Date: Jun 2010
Posts: 33
Rep Power: 7
RalphS is on a distinguished road
Quote:
Originally Posted by claco View Post
Dear RalphS,

Have You heard any more about total pressure calculation in rhoSimpleFoam solver?

Best regards.

Claudio

Hello Claudio,


I have written a tool, which is able to calculate total pressure.
But i haven't integrated it into the solver. You can use it for post processing.
Are you interesting in this tool? I can also integrate it (after writing some tools and other stuff, i am able to programming on my own) into the solver, but then I need some time.


Regards

Ralph
RalphS is offline   Reply With Quote

Old   February 1, 2011, 11:37
Default
  #8
Member
 
Claudio
Join Date: Mar 2010
Posts: 57
Rep Power: 7
claco is on a distinguished road
Quote:
Originally Posted by RalphS View Post
Hello Claudio,


I have written a tool, which is able to calculate total pressure.
But i haven't integrated it into the solver. You can use it for post processing.
Are you interesting in this tool? I can also integrate it (after writing some tools and other stuff, i am able to programming on my own) into the solver, but then I need some time.


Regards

Ralph
Dear Ralph,

can I kindly have this tool in order to integrate it into the solver (by myself)?
Thank You in advance.

Best,

Claudio
claco is offline   Reply With Quote

Old   February 1, 2011, 11:59
Default
  #9
Member
 
Join Date: Jun 2010
Posts: 33
Rep Power: 7
RalphS is on a distinguished road
Dear Claudio,

no problem, here is the tool.

my_ptot.C attach

folder Make:

options:

EXE_INC = \
-I$(LIB_SRC)/thermophysicalModels/basic/lnInclude \
-I$(LIB_SRC)/thermophysicalModels/specie/lnInclude \
-I$(LIB_SRC)/turbulenceModels \
-I$(LIB_SRC)/turbulenceModels/compressible/RAS/RASModel \
-I$(LIB_SRC)/finiteVolume/cfdTools \
-I$(LIB_SRC)/finiteVolume/lnInclude

EXE_LIBS = \
-lbasicThermophysicalModels \
-lspecie \
-lcompressibleTurbulenceModel \
-lcompressibleRASModels \
-lfiniteVolume \
-lmeshTools



files:

my_ptot.C

EXE = $(FOAM_USER_APPBIN)/my_ptot
Attached Files
File Type: c my_ptot.C (4.2 KB, 33 views)
RalphS is offline   Reply With Quote

Old   February 1, 2011, 12:45
Default
  #10
Member
 
Claudio
Join Date: Mar 2010
Posts: 57
Rep Power: 7
claco is on a distinguished road
Quote:
Originally Posted by RalphS View Post
Dear Claudio,

no problem, here is the tool.

my_ptot.C attach

folder Make:

options:

EXE_INC = \
-I$(LIB_SRC)/thermophysicalModels/basic/lnInclude \
-I$(LIB_SRC)/thermophysicalModels/specie/lnInclude \
-I$(LIB_SRC)/turbulenceModels \
-I$(LIB_SRC)/turbulenceModels/compressible/RAS/RASModel \
-I$(LIB_SRC)/finiteVolume/cfdTools \
-I$(LIB_SRC)/finiteVolume/lnInclude

EXE_LIBS = \
-lbasicThermophysicalModels \
-lspecie \
-lcompressibleTurbulenceModel \
-lcompressibleRASModels \
-lfiniteVolume \
-lmeshTools



files:

my_ptot.C

EXE = $(FOAM_USER_APPBIN)/my_ptot
Thank You very much Ralph.
Claudio
claco is offline   Reply With Quote

Reply

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
"Pressure Inlet" Boundary Setup Wijaya FLUENT 14 August 26, 2015 06:02
Static Pressure, Total Pressure ufechner FloEFD, FloWorks & FloTHERM 5 March 2, 2015 08:56
Pressure BC for combustion chamber Giuki FLUENT 1 July 19, 2011 11:35
total pressure in CFX Atit Koonsrisuk CFX 0 January 1, 2005 06:46
Total pressure to static pressure ratio roadracer CD-adapco 1 April 17, 2003 05:31


All times are GMT -4. The time now is 23:04.