|
[Sponsors] |
August 28, 2011, 17:13 |
Access a probed value
|
#1 |
New Member
Anders
Join Date: Nov 2010
Posts: 10
Rep Power: 16 |
Hello!
I probe the pressure in a point (x,y,z) and it is written to a file and I can post-process it later, so far so good. In OpenFoam 2 there is the new codedFixedValue boundary condition, and in the code I would like to implement there, I want to use the pressure from my probe; so the question is, how do I access it? Can someone help me with that part of the code? Thanks! / Anders |
|
August 28, 2011, 19:57 |
|
#2 | |
Assistant Moderator
Bernhard Gschaider
Join Date: Mar 2009
Posts: 4,225
Rep Power: 51 |
Quote:
(Disclaimer: the next part will be seen as a shameless self-advertisment by some people ) If you just need the value of the probe and the BC you want to set depending on it is an expression (nothing that involves multiple iterations) you should be able to do it with the groovyBC that come with swak4Foam (see the fillingTheDam-example. Just use a sampledSet of type cloud) |
||
June 29, 2012, 12:28 |
|
#3 |
Member
Join Date: Oct 2010
Location: Germany
Posts: 39
Rep Power: 16 |
Hi Bernhard,
do you need swak4Foam for using sampledSet? Thanks Ivan |
|
June 30, 2012, 08:34 |
|
#4 |
Assistant Moderator
Bernhard Gschaider
Join Date: Mar 2009
Posts: 4,225
Rep Power: 51 |
No. The sampling-functionality is part of OpenFOAM. Only if you want to use it in the way anlj needs it (in a boundary condition) AND you do not want to program the BC yourself in C++ do you need swak4Fam
Last edited by gschaider; June 30, 2012 at 08:34. Reason: Corrected name |
|
July 1, 2012, 08:37 |
|
#5 | |
Member
Join Date: Oct 2010
Location: Germany
Posts: 39
Rep Power: 16 |
Hi Bernhard,
thanks for your reply. I have tried to use sampledSet in my controlDict, but I become this error message: Quote:
Thanks you very much Ivan |
||
July 1, 2012, 11:23 |
|
#6 | |
Assistant Moderator
Bernhard Gschaider
Join Date: Mar 2009
Posts: 4,225
Rep Power: 51 |
Quote:
|
||
July 2, 2012, 12:57 |
|
#7 |
Member
Join Date: Oct 2010
Location: Germany
Posts: 39
Rep Power: 16 |
||
March 13, 2014, 06:34 |
|
#8 |
Senior Member
Aurelien Thinat
Join Date: Jul 2010
Posts: 165
Rep Power: 16 |
Hi everyone,
I'm willing to use a probe monitoring to control a boundary condition. The problem : - multiregion (1 fluid, 1 solid), - 1 probe in temperature in the fluid domain, - the energy flux at the outside of the solid region is a function of the probed temperature. I'm aiming to use swak4Foam (OF.2.x) for this purpose. I'm looking at fillingTheDam example which use function type addGlobalVariable. But I don't find any exemple of probe reading in swak4Foam. 1) Does anyone have any idea how to link my function "probes" to the function "globalVariable" ? 2) How can I link a globalVariable to the flux boundary condition ? I guess I have to use a BC of type "groovyBC" ? This is done by using "0" in fractionExpression right ? Thank you. |
|
March 13, 2014, 11:52 |
|
#9 |
Senior Member
Aurelien Thinat
Join Date: Jul 2010
Posts: 165
Rep Power: 16 |
Well I didn't find out how to link the probe value to the boundary condition. Here is what I wrote for now. It seems that global variables are linked to 1 domain zone and are not shared with the others.
NB : The probe is perfectly working this way. ControlDict file : Code:
createProbe {type createSampledSet; outputControl timeStep; outputInterval 1; setName probePoint; region fluide; //The problem is coming from here set {} Probe {type cloud; axis x; points ( ( 0.03 0.0005 0.05) );}type swakExpression; valueType set; verbose true; globalScopes ("scopeBC"); globalName probe; outputControl timeStep; outputInterval 1; region fluide; setName probeSwak; set { type swakRegistryProxy; axis x; setName probePoint; } variables ( "probeTemp = T"; ); expression "probeTemp"; accumulations (sum); interpolate true; interpolationType cell;} Code:
solidExternalWall {type groovyBC; globalScopes (scopeBC); valueExpression "flux"; fractionExpression "0"; value uniform 0; variables ( "TempProbe{set 'probePoint} = sum(T);" "TempObj = 400;" "flux=100000(TempObj - TempProbe)/100";; );} |
|
March 13, 2014, 12:25 |
|
#10 | |
Assistant Moderator
Bernhard Gschaider
Join Date: Mar 2009
Posts: 4,225
Rep Power: 51 |
Quote:
I think I showed a case with such probes at the 6th Workshop (see http://openfoamwiki.net/index.php/Co...er_information) and there is also the (rather elaborate) CleaningTank-example in Examples/FromPresentation For accessing the other mesh use "/other" as described in http://openfoamwiki.net/index.php/Co...al_expressions
__________________
Note: I don't use "Friend"-feature on this forum out of principle. Ah. And by the way: I'm not on Facebook either. So don't be offended if I don't accept your invitation/friend request |
||
March 13, 2014, 12:33 |
|
#11 | |
Assistant Moderator
Bernhard Gschaider
Join Date: Mar 2009
Posts: 4,225
Rep Power: 51 |
Quote:
This application seems to be quite popular. Would be nice if someone added it at http://openfoamwiki.net/index.php/Co...Usage_examples
__________________
Note: I don't use "Friend"-feature on this forum out of principle. Ah. And by the way: I'm not on Facebook either. So don't be offended if I don't accept your invitation/friend request |
||
March 13, 2014, 15:13 |
|
#12 |
Senior Member
Aurelien Thinat
Join Date: Jul 2010
Posts: 165
Rep Power: 16 |
Thank you for the answer.
Yes it's a very usefull tool when a PID controler is in the loop. Thanks to your answer (I was pretty sure to saw this earlier but I read "another patch" instead of another mesh...), I'm now able to impose a fixedValue (dirichlet condition) : Twall = f(Tprobe, time). I'm now looking to swtich to a Neumann's one. I'll try it tomorow morning and if everything is fine, I'll write something up for the wiki. Though I might ask you how to upload it. |
|
March 14, 2014, 07:40 |
|
#13 | |
Assistant Moderator
Bernhard Gschaider
Join Date: Mar 2009
Posts: 4,225
Rep Power: 51 |
Quote:
__________________
Note: I don't use "Friend"-feature on this forum out of principle. Ah. And by the way: I'm not on Facebook either. So don't be offended if I don't accept your invitation/friend request |
||
Tags |
codedfixedvalue, probe |
|
|
Similar Threads | ||||
Thread | Thread Starter | Forum | Replies | Last Post |
Online libraries - with access to Journals | momentum_waves | Main CFD Forum | 2 | December 12, 2007 11:08 |
UDF Data Access Macro | Woo Meng Wai | FLUENT | 0 | November 6, 2007 21:23 |
Error: access: unbound variable,HELP | sudhakar | FLUENT | 0 | January 16, 2007 00:21 |
Access Density | Allan Walsh | FLUENT | 3 | October 4, 2005 08:55 |
access to variables at interface of porous media? | Mazyar | FLUENT | 0 | October 10, 2003 15:59 |