|
[Sponsors] | |||||
|
|
|
#1 |
|
Banned
ehsan
Join Date: Oct 2012
Location: Iran
Posts: 1,106
Rep Power: 0 ![]() |
I've found this function in an thesis.is it correct?
because it has defined an average of total pressure on the patch at each time step and in accumulations it uses average again.what does average do in this case?is it a correct method to get average on a patch? Code:
Total-pressuresec9outlet
{
functionObjectLibs("libsimpleSwakFunctionObjects.so”);
type swak Expression ;
outputControl outputTime ;
valueType faceZone ;
zoneName sec9 outlet ;
expression ”sum((0.5∗rho*pow(mag(U),2)+p)∗(area()∗rho))/(sum(area()∗rho))”;
accumulations
(
average
);
verbose true ;
autoInterpolate true ;
warnAutoInterpolate false ;
}
Last edited by immortality; May 2, 2013 at 15:32. |
|
|
|
|
|
|
|
|
#2 |
|
Super Moderator
Bruno Santos
Join Date: Mar 2009
Location: Lisbon, Portugal
Posts: 4,228
Blog Entries: 31
Rep Power: 45 ![]() ![]() |
Hi Ehsan,
Mmm... after thinking a bit about this, I think I can explain what happened:
Bruno |
|
|
|
|
|
|
|
|
#3 |
|
Banned
ehsan
Join Date: Oct 2012
Location: Iran
Posts: 1,106
Rep Power: 0 ![]() |
I think its because the flow has been compressible.correct?this way the average will be more accurate(because of variation of density I think),is it true? if the mesh is uniform then I think there is no need to sum on area manually,am i correct?! |
|
|
|
|
|
|
|
|
#4 | ||
|
Super Moderator
Bruno Santos
Join Date: Mar 2009
Location: Lisbon, Portugal
Posts: 4,228
Blog Entries: 31
Rep Power: 45 ![]() ![]() |
Quote:
Although I was thinking more along the lines of "mass weighted average" - an even better description on this topic can be found on this thread: Area weighted or mass weighted average - specially on post #20! Quote:
It's better to use the area no matter what, to avoid any unpleasant surprises, in case you change the mesh and forget to update this calculation.
__________________
|
|||
|
|
|
|||
|
|
|
#5 |
|
Banned
ehsan
Join Date: Oct 2012
Location: Iran
Posts: 1,106
Rep Power: 0 ![]() |
ok.but I think its more satisfying to have min and max as well as true average of a variable field on a plane.
how can I change the function below to have min,max an true average(if I change mesh that I'm going to!)in a single function(so that no more complexity be added to poor controlDict! )is it possible in your opinion? ![]() Code:
sP_h2_velocity
{
type swakExpression;
valueType surface;
surfaceName horizontal_Plane_2;
verbose true;
surface {
type plane;
basePoint (0.0345 0.002 0);
normalVector (0 1 0);
interpolate true;
}
expression "mag(U)";
accumulations (
min
max
average
);
}
|
|
|
|
|
|
![]() |
| Thread Tools | |
| Display Modes | |
|
|
Similar Threads
|
||||
| Thread | Thread Starter | Forum | Replies | Last Post |
| non-orthogonal faces and incorrect orientation? | nennbs | OpenFOAM Native Meshers: blockMesh | 7 | April 17, 2013 05:42 |
| is internalField(U) equivalent to zeroGradient? | immortality | OpenFOAM Running, Solving & CFD | 7 | March 29, 2013 02:27 |
| whats the cause of error? | immortality | OpenFOAM Running, Solving & CFD | 8 | March 6, 2013 11:41 |
| channelFoam for a 3D pipe | AlmostSurelyRob | OpenFOAM | 3 | June 24, 2011 13:06 |
| Problem with compile the setParabolicInlet | ivanyao | OpenFOAM Running, Solving & CFD | 6 | September 5, 2008 20:50 |