CFD Online Discussion Forums

CFD Online Discussion Forums (https://www.cfd-online.com/Forums/)
-   FLUENT (https://www.cfd-online.com/Forums/fluent/)
-   -   Stop calculation bym measn of UDF (https://www.cfd-online.com/Forums/fluent/151275-stop-calculation-bym-measn-udf.html)

jacek April 8, 2015 02:32

Stop calculation bym measn of UDF
 
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?

`e` April 8, 2015 02:56

"How to stop iteration process from UDF".

jacek April 8, 2015 03:16

@ `e`
 
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.

`e` April 8, 2015 03:31

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.

jacek April 8, 2015 05:09

`e`
 
"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.

`e` April 8, 2015 06:20

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).


All times are GMT -4. The time now is 21:00.