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

Area(or mass)-weighted average vs. time at an outlet

Register Blogs Community New Posts Updated Threads Search

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
Old   May 22, 2012, 18:22
Default Area(or mass)-weighted average vs. time at an outlet
  #1
Member
 
Jeong Kim
Join Date: Feb 2010
Posts: 42
Rep Power: 16
enoch is on a distinguished road
Dear foamers,

I am sorry for a redundant question about plotting aveaged quantity vs. time at an outlet, but I could not find a helpful posting to me. I'd like to plot area(or mass)-weighted average with time at the outlet. I need it to check if the solution is steady-state and for post-processing work. Thanks in advance for your help.
enoch is offline   Reply With Quote

Old   May 22, 2012, 19:32
Default
  #2
Assistant Moderator
 
Bernhard Gschaider
Join Date: Mar 2009
Posts: 4,225
Rep Power: 51
gschaider will become famous soon enoughgschaider will become famous soon enough
Quote:
Originally Posted by enoch View Post
Dear foamers,

I am sorry for a redundant question about plotting aveaged quantity vs. time at an outlet, but I could not find a helpful posting to me. I'd like to plot area(or mass)-weighted average with time at the outlet. I need it to check if the solution is steady-state and for post-processing work. Thanks in advance for your help.
http://openfoamwiki.net/index.php/Co...unctionObjects
gschaider is offline   Reply With Quote

Old   May 23, 2012, 18:03
Default swak4Faom and pyFoamTimelinePlot.py
  #3
Member
 
Jeong Kim
Join Date: Feb 2010
Posts: 42
Rep Power: 16
enoch is on a distinguished road
Quote:
Originally Posted by gschaider View Post
Thanks for the link.
I've found that swak4Foam include that library. I tried to run one example available in the examples directory of swak4Foam. I could not see a plot using pyFoamTimelinePlot.py. I've already installed pyFoam. Why can't I see the plot? Below is log information that I capture.

===
jeong@pulsedPitzDaily:$ pyFoamTimelinePlot.py . --dir=patchMassFlows_massFlowSimple --basic-mode=lines
set term png nocrop enhanced
set xrange [1e-05:0.02929]
set output "patchMassFlows_massFlowSimple_writeTime_0_Value_m assFlow.png"
set title "Directory: patchMassFlows_massFlowSimple WriteTime: 0 Value: massFlow"
plot "./patchMassFlows_massFlowSimple/0/massFlow" using 1:2 title "inlet" with lines , "./patchMassFlows_massFlowSimple/0/massFlow" using 1:3 title "outlet" with lines
jeong@pulsedPitzDaily:$
enoch is offline   Reply With Quote

Old   May 24, 2012, 09:10
Default
  #4
Assistant Moderator
 
Bernhard Gschaider
Join Date: Mar 2009
Posts: 4,225
Rep Power: 51
gschaider will become famous soon enoughgschaider will become famous soon enough
Quote:
Originally Posted by enoch View Post
Thanks for the link.
I've found that swak4Foam include that library. I tried to run one example available in the examples directory of swak4Foam. I could not see a plot using pyFoamTimelinePlot.py. I've already installed pyFoam. Why can't I see the plot? Below is log information that I capture.

===
jeong@pulsedPitzDaily:$ pyFoamTimelinePlot.py . --dir=patchMassFlows_massFlowSimple --basic-mode=lines
set term png nocrop enhanced
set xrange [1e-05:0.02929]
set output "patchMassFlows_massFlowSimple_writeTime_0_Value_m assFlow.png"
set title "Directory: patchMassFlows_massFlowSimple WriteTime: 0 Value: massFlow"
plot "./patchMassFlows_massFlowSimple/0/massFlow" using 1:2 title "inlet" with lines , "./patchMassFlows_massFlowSimple/0/massFlow" using 1:3 title "outlet" with lines
jeong@pulsedPitzDaily:$
That's all the utility does: generate the commands that make Gnuplot generate the plot. Send them into a pipe to gnuplot and you get a PNG:
Code:
pyFoamTimelinePlot.py . --dir=patchMassFlows_massFlowSimple --basic-mode=lines | gnuplot
(or copy them to the Gnuplot command-line)

The advantage of this is that you have all the flexibility of the Gnuplot-command line if you want it: redirect the output to a file. Change the options (scale logarithmic, set tics, etc). THEN plot
gschaider is offline   Reply With Quote

Old   May 24, 2012, 11:37
Default calcualte flow rate
  #5
Member
 
Jeong Kim
Join Date: Feb 2010
Posts: 42
Rep Power: 16
enoch is on a distinguished road
Quote:
Originally Posted by gschaider View Post
That's all the utility does: generate the commands that make Gnuplot generate the plot. Send them into a pipe to gnuplot and you get a PNG:
Code:
pyFoamTimelinePlot.py . --dir=patchMassFlows_massFlowSimple --basic-mode=lines | gnuplot
(or copy them to the Gnuplot command-line)

The advantage of this is that you have all the flexibility of the Gnuplot-command line if you want it: redirect the output to a file. Change the options (scale logarithmic, set tics, etc). THEN plot

Thank you for your further tip. I wanted to plot flow rate in time at the inlet and outlet (alpha*phia and beta*phiab) in two phase flows. How can I calculate the quantity in the two phase problems. Below is the script for a single phase flow. Thanks in advance for your help.

massFlowSwak
{
type patchExpression;
verbose true;
accumulations (
sum
);
patches (
inlet
outlet
);
expression "phi";
}
enoch is offline   Reply With Quote

Old   May 24, 2012, 12:15
Default
  #6
Assistant Moderator
 
Bernhard Gschaider
Join Date: Mar 2009
Posts: 4,225
Rep Power: 51
gschaider will become famous soon enoughgschaider will become famous soon enough
Quote:
Originally Posted by enoch View Post
Thank you for your further tip. I wanted to plot flow rate in time at the inlet and outlet (alpha*phia and beta*phiab) in two phase flows. How can I calculate the quantity in the two phase problems. Below is the script for a single phase flow. Thanks in advance for your help.

massFlowSwak
{
type patchExpression;
verbose true;
accumulations (
sum
);
patches (
inlet
outlet
);
expression "phi";
}
The answer is in your question
Code:
expression "alpha*phia+beta*phib";
should do the trick. Although I'm not too familiar with that solver so it could be
Code:
expression "phia+phib";
(depends how phiX is defined)

You can use ANY field in the expression. It only has to be there under that name. That is the only limitation. Whether it makes phyiscal sense is another thing
gschaider is offline   Reply With Quote

Reply


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
transsonic nozzle with rhoSimpleFoam Unseen OpenFOAM Running, Solving & CFD 8 July 1, 2022 06:54
Multiple floating objects CKH OpenFOAM Running, Solving & CFD 14 February 20, 2019 09:08
Moving mesh Niklas Wikstrom (Wikstrom) OpenFOAM Running, Solving & CFD 122 June 15, 2014 06:20
Time Average Vs Ensemble Average Mohsin FLUENT 1 December 4, 2013 03:48
AMG versus ICCG msrinath80 OpenFOAM Running, Solving & CFD 2 November 7, 2006 15:15


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