|
[Sponsors] |
May 17, 2012, 10:29 |
fields and factors in simpleFunctionObjects
|
#1 |
New Member
Join Date: Jan 2012
Posts: 22
Rep Power: 14 |
Hi,
I have a specific question regarding simpleFunctionObjects. Here is an extract from my controlDict file: p { type patchAverage; functionObjectLibs ( "libsimpleFunctionObjects.so" ); verbose true; patches ( outlet ); fields (p); } What I would like to know is whether there is a way of multiplying the (p) fields by a factor in order to log a different value and print it to the screen. Is this possible? On a further note, is there a method of taking the values from the 'outlet' patch above and adding/subtracting the value for the inlet patch (which I have as a different item), printing this to screen and the log file? Any information would be greatly appreciated. Thanks |
|
May 21, 2012, 17:18 |
|
#2 | |
Assistant Moderator
Bernhard Gschaider
Join Date: Mar 2009
Posts: 4,225
Rep Power: 51 |
Quote:
Concerning your second question: not with the pure simpleFunctionObjects but with swak4Foam (of which the simpleFunctionObjects are now a part) which has a function object patchExpression (which builds on simpleFunctionObjects) that allows calculation of expressions on patches. An example for a pressure difference would be: Code:
pressureDiff { type patchExpression; patches ( inlet ); variables ( "pOut{patch'outlet}=sum(p*area())/sum(area());" ); accumulations ( average ); expression "p-pOut"; verbose true; } |
||
|
|