|
[Sponsors] |
April 8, 2015, 03:32 |
Stop calculation bym measn of UDF
|
#1 |
New Member
Join Date: Oct 2009
Posts: 25
Rep Power: 16 |
I take up an old problem that was previously once published on CFD.
How to stop Fluent calculation from inside UDF if some some criteria are fulfilled? |
|
April 8, 2015, 03:56 |
|
#2 |
Senior Member
Join Date: Mar 2015
Posts: 892
Rep Power: 18 |
||
April 8, 2015, 04:16 |
@ `e`
|
#3 |
New Member
Join Date: Oct 2009
Posts: 25
Rep Power: 16 |
I know this site but it is too laconic for me.
It seems that the core of the method is RP_Set_Boolean("stop",1). But this macro is non even described in the UDF manual or Fluent manual. To make things worse even RP_Get..... macors are hardly mentioned in the UDF manual. |
|
April 8, 2015, 04:31 |
|
#4 |
Senior Member
Join Date: Mar 2015
Posts: 892
Rep Power: 18 |
They've provided an introduction, code and comments. Bear in mind this website is an unofficial source of help from volunteers (similar to these forums); respectfully, what were you expecting? I believe their method of stopping the solver with an RP-variable acting as a flag (and an if statement with Scheme) is the quickest solution.
Fluent has no official documentation for Scheme, and in fact the developers were intending to replace Scheme with Python as the official scripting language back in 2004... have a read of this unofficial Fluent Scheme Programming Reference which I believe is the only Scheme-Fluent documentation available. I'm wondering if this method could work (which doesn't use Scheme files): create a User-Defined Scalar and alternate the values between, say, 0 and 1 but set a small convergence criteria on this UDS. When your other convergence criteria is met then set the UDS at a constant value, say 0, and the convergence of this artificial scalar should stop your solver. |
|
April 8, 2015, 06:09 |
`e`
|
#5 |
New Member
Join Date: Oct 2009
Posts: 25
Rep Power: 16 |
"what were you expecting?"
I expected as much as I could understand this RP_Set... macro and use it according to my will. With such limitations I can only re-write it in my UDF and use it only the restricted way produced on http://www.eureka.im/996.html. I hoped in a timid way that some leakages from Ansys are possible, for instance ex-empoyees or better informed users from the native market. Initially I can say it works - it stops calculations and that's the goal. However, it yields some corrupting good mood announcements - something about Error, ect. Never mind. If it comes to UDS I'm not familiar with this type of macros at the moment. Scheme is the same problem for me. Taking this into account, thank you. |
|
April 8, 2015, 07:20 |
|
#6 |
Senior Member
Join Date: Mar 2015
Posts: 892
Rep Power: 18 |
If you're unfamiliar with Scheme, RP-Variables etc I suggest you have a read of that unofficial document I linked to above. You'd be lucky finding an active expert in this field kicking around the forums because there's been no documentation on Scheme with Fluent since that file in 2004 (that I've come across). This approach with the RP-variable is a little messy, but there's no clean/straightforward method to my knowledge for accomplishing this task.
I've not used UDS myself, but it seems like a UDS could accomplish your goal in a more elegant fashion. I'm also not very familiar with Scheme (it's hardly used elsewhere) but have used it for running TUI commands mid-simulation (there's no other way of achieving this task). |
|
Thread Tools | Search this Thread |
Display Modes | |
|
|
Similar Threads | ||||
Thread | Thread Starter | Forum | Replies | Last Post |
How can I stop the calculation in UDF | Seyoung Oh | Fluent UDF and Scheme Programming | 1 | September 24, 2013 08:44 |
Source Term UDF VS Porous Media Model | pchoopanya | Fluent UDF and Scheme Programming | 1 | August 28, 2013 07:12 |
command TUI / Scheme for stop and continue calculate | rayolau | FLUENT | 1 | May 13, 2013 11:20 |
DEFINE_GEOM UDF Problems | Pat | FLUENT | 0 | August 14, 2003 14:16 |
UDF...UDF...UDF...UDF | Luc SEMINEL | FLUENT | 0 | November 25, 2002 05:03 |