CFD Online Logo CFD Online URL
www.cfd-online.com
[Sponsors]
Home > Forums > Software User Forums > ANSYS > FLUENT > Fluent UDF and Scheme Programming

"cx-interrupt" not Interrupting

Register Blogs Members List Search Today's Posts Mark Forums Read

Like Tree2Likes
  • 1 Post By pakk
  • 1 Post By pakk

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
Old   February 11, 2017, 15:53
Default "cx-interrupt" not Interrupting
  #1
Member
 
Join Date: Jun 2016
Posts: 64
Rep Power: 7
Baden is on a distinguished road
Hello all.

I have defined a SCHEME variable using the following TUI command:
Code:
(rp-var-define 'interrupt/flag 0 'interger #f)
Initially, the variable "interrupt/flag" has a value of 0, but this value is changed to 1 via UDF based on a certain condition. I want the simulation to stop once the variable is changed to 1, so I implemented the following in Solve - Execute Command panels:



However, when the value of ""interrupt/flag" is changed to 1, the following text appears in the console but the simulation continues without stopping.



Does anyone have any idea why the simulation is not properly being interrupted? There is remarkably little documentation on the SCHEME language and even less on cx-interrupt.

Last edited by Baden; February 15, 2017 at 23:12.
Baden is offline   Reply With Quote

Old   February 13, 2017, 05:28
Default
  #2
Senior Member
 
Join Date: Nov 2013
Posts: 1,946
Rep Power: 24
pakk will become famous soon enough
I think you made a typo in your scheme command, it should be integer and not interger.

On the question you asked: I have no idea, but I am interested in this way of working, it looks useful if it works. Do you get the same behavior when you manually press control-C?
I see the command (cx-interrupt-client) also exists, maybe this could be what you need?
Baden likes this.
pakk is offline   Reply With Quote

Old   February 13, 2017, 21:38
Default
  #3
Member
 
Join Date: Jun 2016
Posts: 64
Rep Power: 7
Baden is on a distinguished road
Quote:
Originally Posted by pakk View Post
I think you made a typo in your scheme command, it should be integer and not interger.

On the question you asked: I have no idea, but I am interested in this way of working, it looks useful if it works. Do you get the same behavior when you manually press control-C?
I see the command (cx-interrupt-client) also exists, maybe this could be what you need?
The typo was not present when in the SCHEME command I used, but thank you for pointing that out.

Pressing control-C results in the same problem: the simulation says "Interrupting" but does not stop. However, pressing control-C twice properly stops the simulation. I also tried the "cx-interrupt-client" command, but it appeared to have no effect (the "Interrupting" text did not appear in the command window).
Baden is offline   Reply With Quote

Old   February 14, 2017, 03:45
Default
  #4
Senior Member
 
Join Date: Nov 2013
Posts: 1,946
Rep Power: 24
pakk will become famous soon enough
If control-C twice works, did you try to put (cx-interrupt) twice?
Code:
(if (> (rpgetvar 'interrupt/flag) 0) (begin (cx-interrupt) (cx-interrupt)))
Baden likes this.
pakk is offline   Reply With Quote

Old   February 15, 2017, 23:25
Default
  #5
Member
 
Join Date: Jun 2016
Posts: 64
Rep Power: 7
Baden is on a distinguished road
Quote:
Originally Posted by pakk View Post
If control-C twice works, did you try to put (cx-interrupt) twice?
Code:
(if (> (rpgetvar 'interrupt/flag) 0) (begin (cx-interrupt) (cx-interrupt)))
I tried both of the following neither worked.
Code:
(if (> (rpgetvar 'interrupt/flag) 0) (begin (cx-interrupt) (cx-interrupt)))
Code:
(if (> (rpgetvar 'interrupt/flag) 0) (begin (cx-interrupt) (cx-interrupt-client)))
Pressing control-C twice gives the following message which I was unable to replicate with the latter of the two codes posted above.

Baden is offline   Reply With Quote

Old   February 16, 2017, 04:42
Default
  #6
Senior Member
 
Kevin
Join Date: Dec 2016
Posts: 138
Rep Power: 6
KevinZ09 is on a distinguished road
I've got little to no experience using the SCHEME language, but to me it almost seems like you need to interrupt twice because the first time it interrupts the iteration loop within the current time step and the second time it interrupts the time step loop. So perhaps there are different commands for that.

Did you consult the following website to get more information:

http://www.scheme.com/tspl4/
KevinZ09 is offline   Reply With Quote

Old   February 16, 2017, 12:18
Default
  #7
Senior Member
 
Join Date: Nov 2013
Posts: 1,946
Rep Power: 24
pakk will become famous soon enough
Quote:
Originally Posted by Baden View Post
Pressing control-C twice gives the following message which I was unable to replicate with the latter of the two codes posted above.

It looks like it should be some combination of (cx-interrupt) and (cx-interrupt-client). I tried a little bit, and with (cx-interrupt) I get the same response, but with (cx-interrupt-client) I get "()" instead of "Interrupting client...". I tried to add parameters, as in (cx-interrupt-client 0), (cx-interrupt-client 'test), but the response was the same every time.

My conclusion: I don't know how to do this, and don't know how to find out.
pakk is offline   Reply With Quote

Old   February 16, 2017, 16:06
Default
  #8
Member
 
Join Date: Jun 2016
Posts: 64
Rep Power: 7
Baden is on a distinguished road
Quote:
Originally Posted by pakk View Post
It looks like it should be some combination of (cx-interrupt) and (cx-interrupt-client). I tried a little bit, and with (cx-interrupt) I get the same response, but with (cx-interrupt-client) I get "()" instead of "Interrupting client...". I tried to add parameters, as in (cx-interrupt-client 0), (cx-interrupt-client 'test), but the response was the same every time.

My conclusion: I don't know how to do this, and don't know how to find out.
I have encountered the same issue. Unless anyone on the forums knows any better, I believe this is a dead end.
Baden is offline   Reply With Quote

Old   February 17, 2017, 04:53
Default
  #9
Senior Member
 
Join Date: Nov 2013
Posts: 1,946
Rep Power: 24
pakk will become famous soon enough
If you can go to Fluent support, it might not be a dead end.
pakk is offline   Reply With Quote

Old   February 27, 2017, 22:27
Default
  #10
Member
 
Join Date: Jun 2016
Posts: 64
Rep Power: 7
Baden is on a distinguished road
Quote:
Originally Posted by pakk View Post
If you can go to Fluent support, it might not be a dead end.
Unfortunately, this avenue is not available to me as a student user.
Baden is offline   Reply With Quote

Reply

Tags
cx-interrupt, scheme

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are Off
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
Interrupting calculation at value aalansari FLUENT 0 August 22, 2014 09:03
Interrupting a run in progress austin.m SU2 4 October 4, 2013 10:55
Interrupting a Journal File svp FLUENT 2 February 16, 2011 09:00
Interrupting Gambit w/o leaving CPU busy? Chris Bailey FLUENT 0 January 26, 2005 17:29


All times are GMT -4. The time now is 14:03.