|
[Sponsors] |
pressureTools postProcessing function objects in 2.2.0 |
|
LinkBack | Thread Tools | Search this Thread | Display Modes |
May 23, 2013, 17:16 |
pressureTools postProcessing function objects in 2.2.0
|
#1 |
Senior Member
Ehsan
Join Date: Oct 2012
Location: Iran
Posts: 2,208
Rep Power: 26 |
here:
http://www.openfoam.org/version2.2.0...processing.php its mentioned about pressureTools.how can use these function objects? is there a tutorial or more guidance through? new pressureTools - enables the calculation of pressure (from kinematic pressure), total pressure, pressure coefficient and total pressure coefficient.
__________________
Injustice Anywhere is a Threat for Justice Everywhere.Martin Luther King. To Be or Not To Be,Thats the Question! The Only Stupid Question Is the One that Goes Unasked. |
|
May 23, 2013, 17:58 |
|
#2 |
Retired Super Moderator
Bruno Santos
Join Date: Mar 2009
Location: Lisbon, Portugal
Posts: 10,975
Blog Entries: 45
Rep Power: 128 |
Hi Ehsan,
Quick answer:
Bruno
__________________
|
|
May 24, 2013, 06:27 |
|
#3 |
Senior Member
Ehsan
Join Date: Oct 2012
Location: Iran
Posts: 2,208
Rep Power: 26 |
thank you Bruno
can use a Code:
operation areaAverage; totally can use other features of function objects like the one below with it? and is there a totalTemperature too or isn't? Code:
Average_left { type faceSource; functionObjectLibs ("libfieldFunctionObjects.so"); enabled on; log yes; valueOutput false; surfaceFormat vtk; source patch; sourceName left; operation areaAverage; fields ( p //phi // surface fields not supported for sampledSurface U T rho h e ); outputControl timeStep;//outputTime;// outputInterval 1; // 5000; }
__________________
Injustice Anywhere is a Threat for Justice Everywhere.Martin Luther King. To Be or Not To Be,Thats the Question! The Only Stupid Question Is the One that Goes Unasked. |
|
May 25, 2013, 16:33 |
|
#4 |
Retired Super Moderator
Bruno Santos
Join Date: Mar 2009
Location: Lisbon, Portugal
Posts: 10,975
Blog Entries: 45
Rep Power: 128 |
Hi Ehsan,
A bit of a confusion of ideas going on here... OK, so to sort out by items:
Bruno
__________________
|
|
May 25, 2013, 16:43 |
|
#5 |
Senior Member
Ehsan
Join Date: Oct 2012
Location: Iran
Posts: 2,208
Rep Power: 26 |
you mean I can simply add total(p) to the function as below?without adding anything other?
Code:
Average_left { type faceSource; functionObjectLibs ("libfieldFunctionObjects.so"); enabled on; log yes; valueOutput false; surfaceFormat vtk; source patch; sourceName left; operation areaAverage; fields ( p total(p) U T rho h e ); outputControl timeStep;//outputTime;// outputInterval 1; // 5000; }
__________________
Injustice Anywhere is a Threat for Justice Everywhere.Martin Luther King. To Be or Not To Be,Thats the Question! The Only Stupid Question Is the One that Goes Unasked. |
|
May 25, 2013, 16:51 |
|
#6 |
Retired Super Moderator
Bruno Santos
Join Date: Mar 2009
Location: Lisbon, Portugal
Posts: 10,975
Blog Entries: 45
Rep Power: 128 |
Where's the "pressureTools" entry?
I have not tested this, this is just copy-paste-adapt from the pages I posted links for: Code:
myFunctionObject // user-defined name of function object entry { type pressureTools; libs ("libutilityFunctionObjects.so"); //region defaultRegion; enabled yes; //timeStart 0; //timeEnd 10; outputControl timeStep;//outputTime;// outputInterval 1; // 5000; calcTotal yes; calcCoeff no; } Average_left { type faceSource; functionObjectLibs ("libfieldFunctionObjects.so"); enabled on; log yes; valueOutput false; surfaceFormat vtk; source patch; sourceName left; operation areaAverage; fields ( p total(p) U T rho h e ); outputControl timeStep;//outputTime;// outputInterval 1; // 5000; }
__________________
Last edited by wyldckat; May 25, 2013 at 16:52. Reason: changed "outputControl" |
|
May 25, 2013, 17:43 |
|
#7 |
Senior Member
Ehsan
Join Date: Oct 2012
Location: Iran
Posts: 2,208
Rep Power: 26 |
Ok.thanks.is it true now?
Code:
totalP // user-defined name of function object entry { type pressureTools; libs ("libutilityFunctionObjects.so"); //region defaultRegion; enabled yes; //timeStart 0; //timeEnd 10; outputControl timeStep;//outputTime;// outputInterval 1; // 5000; calcTotal yes; calcCoeff no; } //patch-left------------------------------------------------------------------ flowInlet { type swakExpression; valueType patch; patchName left; expression "phi"; accumulations ( sum ); verbose true; } Average_left { type faceSource; functionObjectLibs ("libfieldFunctionObjects.so"); enabled on; log yes; valueOutput false; surfaceFormat vtk; source patch; sourceName left; operation areaAverage; fields ( p //phi // surface fields not supported for sampledSurface U T rho h e ); outputControl timeStep;//outputTime;// outputInterval 1; // 5000; } totalPressure_left { $Average_left; operation weightedAverage; weighted rho; fields ( total(p) ); outputControl timeStep;//outputTime;// outputInterval 1; // 5000; } Code:
operation weightedAverage; weighted rho;
__________________
Injustice Anywhere is a Threat for Justice Everywhere.Martin Luther King. To Be or Not To Be,Thats the Question! The Only Stupid Question Is the One that Goes Unasked. |
|
May 25, 2013, 18:47 |
|
#8 |
Retired Super Moderator
Bruno Santos
Join Date: Mar 2009
Location: Lisbon, Portugal
Posts: 10,975
Blog Entries: 45
Rep Power: 128 |
I think it's all OK. I can't see nothing wrong with it.
__________________
|
|
May 25, 2013, 19:04 |
|
#9 |
Senior Member
Ehsan
Join Date: Oct 2012
Location: Iran
Posts: 2,208
Rep Power: 26 |
hi Bruno
Really?i thought maybe those lines for weightedAverarage had another keywords as the case you sent to me before but i can't find now.please have a look into it again tomorrow. Thanks. Have a good night.
__________________
Injustice Anywhere is a Threat for Justice Everywhere.Martin Luther King. To Be or Not To Be,Thats the Question! The Only Stupid Question Is the One that Goes Unasked. |
|
May 25, 2013, 19:12 |
|
#10 |
Retired Super Moderator
Bruno Santos
Join Date: Mar 2009
Location: Lisbon, Portugal
Posts: 10,975
Blog Entries: 45
Rep Power: 128 |
Hi Ehsan,
Sorry, I don't understand the question. The function objects code seems to be OK. I don't see any problem with it. The reference page on how to use "faceSource" is this one: http://foam.sourceforge.net/docs/cpp...5.html#details Wait... now I see the problem! It should be: Code:
operation weightedAverage; weightField rho; Bruno
__________________
|
|
May 26, 2013, 04:30 |
|
#11 |
Senior Member
Ehsan
Join Date: Oct 2012
Location: Iran
Posts: 2,208
Rep Power: 26 |
Hi
if I want to use function object on a face,how should change these terms? Code:
source patch; sourceName left; Code:
source sampledSurface; //sourceName baffleFaces; sampledSurfaceDict { type cuttingPlane; planeType pointAndNormal; pointAndNormalDict { basePoint (0.0345 0.002 0); normalVector (1 0 0); } interpolate true; }
__________________
Injustice Anywhere is a Threat for Justice Everywhere.Martin Luther King. To Be or Not To Be,Thats the Question! The Only Stupid Question Is the One that Goes Unasked. |
|
June 11, 2013, 17:40 |
|
#12 |
Senior Member
Ehsan
Join Date: Oct 2012
Location: Iran
Posts: 2,208
Rep Power: 26 |
in compressible case I should use pRef 0;
correct?
__________________
Injustice Anywhere is a Threat for Justice Everywhere.Martin Luther King. To Be or Not To Be,Thats the Question! The Only Stupid Question Is the One that Goes Unasked. |
|
June 12, 2013, 10:29 |
|
#13 |
Senior Member
Ehsan
Join Date: Oct 2012
Location: Iran
Posts: 2,208
Rep Power: 26 |
it writes total(p) values in all time steps in the solution folder but not in the patch I have set:
Code:
# Source : patch left # Faces : 60 # Time sum(magSf) weightedAverage(total(p)) 1.123595506e-08 1.2e-05 2.375195563e-08 1.2e-05 3.694449677e-08 1.2e-05 5.013703791e-08 1.2e-05 6.332957905e-08 1.2e-05 7.652212019e-08 1.2e-05 8.971466133e-08 1.2e-05 1.029072025e-07 1.2e-05 1.160997436e-07 1.2e-05 1.292922847e-07 1.2e-05 1.424848259e-07 1.2e-05 1.55677367e-07 1.2e-05 1.688699082e-07 1.2e-05 1.820624493e-07 1.2e-05 1.952549904e-07 1.2e-05 2.084475316e-07 1.2e-05 2.216400727e-07 1.2e-05 2.348326139e-07 1.2e-05 2.48025155e-07 1.2e-05 2.612176961e-07 1.2e-05 2.744102373e-07 1.2e-05 2.876027784e-07 1.2e-05 3.007953196e-07 1.2e-05 3.110777413e-07 1.2e-05 3.210621219e-07 1.2e-05 3.304918147e-07 1.2e-05 3.395392226e-07 1.2e-05 3.482294959e-07 1.2e-05 3.565855281e-07 1.2e-05 3.64730015e-07 1.2e-05 Code:
totalP // user-defined name of function object entry { type pressureTools; libs ("libutilityFunctionObjects.so"); //region defaultRegion; enabled yes; //timeStart 0; //timeEnd 10; outputControl timeStep;//outputTime;// outputInterval 1; // 5000; calcTotal yes; calcCoeff no; pRef 0; } Code:
totalPressure_left { $Average_left; operation weightedAverage; weightField rho; fields ( total(p) ); } Code:
Average_left { type faceSource; functionObjectLibs ("libfieldFunctionObjects.so"); enabled on; log yes; valueOutput false; surfaceFormat vtk; source patch; sourceName left; operation areaAverage; fields ( p //phi // surface fields not supported for sampledSurface T rho h U ); outputControl timeStep;//outputTime;// outputInterval 1; // 5000; }
__________________
Injustice Anywhere is a Threat for Justice Everywhere.Martin Luther King. To Be or Not To Be,Thats the Question! The Only Stupid Question Is the One that Goes Unasked. |
|
June 15, 2013, 15:54 |
|
#14 |
Retired Super Moderator
Bruno Santos
Join Date: Mar 2009
Location: Lisbon, Portugal
Posts: 10,975
Blog Entries: 45
Rep Power: 128 |
Hi Ehsan,
Took me a while to get to here, but here goes:
__________________ As for the original issue on the previous post, I'll quote what I've already sent you through emails - The following function objects worked well together: Code:
functions { writeMissingFields { type writeRegisteredObject; functionObjectLibs ( "libIOFunctionObjects.so" ); objectNames ("phi"); outputControl outputTime; } //................................................................................ totalP // user-defined name of function object entry { type pressureTools; libs ("libutilityFunctionObjects.so"); //region defaultRegion; enabled yes; //timeStart 0; //timeEnd 10; outputControl timeStep;//outputTime;// outputInterval 1; // 5000; calcTotal yes; calcCoeff no; pRef 0; } Average_left { type faceSource; functionObjectLibs ("libfieldFunctionObjects.so"); enabled on; log yes; valueOutput false; surfaceFormat vtk; source patch; sourceName left; operation areaAverage; fields ( p //phi // surface fields not supported for sampledSurface T rho h U ); outputControl timeStep;//outputTime;// outputInterval 1; // 5000; } reloadTotalP { type readFields; functionObjectLibs ("libfieldFunctionObjects.so"); //region defaultRegion; enabled yes; //timeStart 0; //timeEnd 10; outputControl timeStep;//outputTime;// outputInterval 1; // 5000; fields ( "total(p)" ); } totalPressure_left { $Average_left; operation weightedAverage; weightField rho; fields ( total(p) ); } }
Bruno
__________________
Last edited by wyldckat; June 15, 2013 at 16:36. Reason: see "edit:" |
|
June 16, 2013, 10:36 |
|
#15 |
Senior Member
Ehsan
Join Date: Oct 2012
Location: Iran
Posts: 2,208
Rep Power: 26 |
dear Bruno
it wouldn't make any trouble to use it?because I'm in middle of the run and Bernhard has told maybe it will cause some inconsistency with before versions if I have understood correctly?
__________________
Injustice Anywhere is a Threat for Justice Everywhere.Martin Luther King. To Be or Not To Be,Thats the Question! The Only Stupid Question Is the One that Goes Unasked. |
|
June 16, 2013, 11:09 |
|
#16 | ||
Retired Super Moderator
Bruno Santos
Join Date: Mar 2009
Location: Lisbon, Portugal
Posts: 10,975
Blog Entries: 45
Rep Power: 128 |
Quote:
Quote:
The second detail is likely related to groovyBC!?
__________________
|
|||
June 16, 2013, 11:22 |
|
#17 |
Senior Member
Ehsan
Join Date: Oct 2012
Location: Iran
Posts: 2,208
Rep Power: 26 |
thanks.I'm compiling i now.it will replaced to before version automatically?
and I have to move old folders to postProcessing folder manually and no other issue will take place?
__________________
Injustice Anywhere is a Threat for Justice Everywhere.Martin Luther King. To Be or Not To Be,Thats the Question! The Only Stupid Question Is the One that Goes Unasked. |
|
June 16, 2013, 11:39 |
|
#18 | |
Retired Super Moderator
Bruno Santos
Join Date: Mar 2009
Location: Lisbon, Portugal
Posts: 10,975
Blog Entries: 45
Rep Power: 128 |
Quote:
Yes, move the ones in the case folder named "swak*". I haven't tested this yet myself, so I'm not 100% sure of this. But from what I briefly saw yesterday from the source code, I think it's all that is necessary.
__________________
|
||
July 31, 2014, 03:25 |
|
#19 |
New Member
Join Date: Mar 2014
Posts: 17
Rep Power: 12 |
Hi Ehsan and Bruno,
I found your post very interesting, since I'm trying to use the pressureTools to compute the static pressure from an incompressible case that uses kinematic pressure. I would have used the utility as follows: { type pressureTools; libs ("libutilityFunctionObjects.so"); enabled yes; outputControl timeStep;//outputTime;// calcTotal no; calcCoeff no; } It does yield a static(p) field, but the values are very low (1e-16). Have I done something wrong ? Best regards BenJ |
|
August 15, 2014, 14:49 |
|
#20 | |
Member
Brock Lee
Join Date: Sep 2012
Location: Midwest
Posts: 40
Rep Power: 13 |
Quote:
I just figured this out not too long ago. You have to specify a rho value for pressure tools to use to convert from kinematic to static pressure. Add these two lines to your pressure tools functionObject... rhoName rhoInf; rhoInf 1.225; // density value ______________________________________ Gentlemen, I have an additional question related to this pressure tools function object. Is there a way to calculate static pressure for every time step and not have it write out the iteration folder every time step? I want to be able to monitor a mass-weighted static pressure at an outlet every time-step (for an in-compressible solver). I can't find a way to do this though without forcing pressure tools to write an iteration folder every time step. Here is my current pressure-tools setup... Code:
p_tools { type pressureTools; functionObjectLibs ("libutilityFunctionObjects.so"); enabled yes; outputControl timeStep; outputInterval 1; rhoName rhoInf; rhoInf 831.1; calcTotal no; calcCoeff no; } Brock |
||
|
|
Similar Threads | ||||
Thread | Thread Starter | Forum | Replies | Last Post |
compressible flow in turbocharger | riesotto | OpenFOAM | 50 | May 26, 2014 01:47 |
channelFoam for a 3D pipe | AlmostSurelyRob | OpenFOAM | 3 | June 24, 2011 13:06 |
ParaView for OF-1.6-ext | Chrisi1984 | OpenFOAM Installation | 0 | December 31, 2010 06:42 |
Droplet Evaporation | Christian | Main CFD Forum | 2 | February 27, 2007 06:27 |
REAL GAS UDF | brian | FLUENT | 6 | September 11, 2006 08:23 |