|
[Sponsors] |
execute command, how to refer to report definitions |
|
LinkBack | Thread Tools | Search this Thread | Display Modes |
May 7, 2020, 12:18 |
execute command, how to refer to report definitions
|
#1 |
Member
Francesco
Join Date: Apr 2020
Posts: 56
Rep Power: 6 |
Hi everybody,
I'm writing an execute command which has to do a specific task each time-step. It has to interrupt the calculation after a parameter reach a determined value. So i tried something of this type: Code:
(if (<VALUE (pick-a-real "/rep/vol...PROBLEM..."))(set! mstop? #t)) thank you in advance. |
|
May 7, 2020, 13:26 |
Report Definition
|
#2 |
Senior Member
|
Report Definitions are used only for defining a report and not for computing it. Though in GUI there is an option by doing a right-click on Report-Definitions and selecting Compute, in TUI, you need to define an output-parameter which is equal to report-definition. Then you can access the value using
def para out p-t-c "name of output parameter"
__________________
Regards, Vinerm PM to be used if and only if you do not want something to be shared publicly. PM is considered to be of the least priority. |
|
May 8, 2020, 04:39 |
|
#3 |
Member
Francesco
Join Date: Apr 2020
Posts: 56
Rep Power: 6 |
Thank you Vinerm,
Code:
(if(=170 (def para out p-t-c "energia-totale-op" ))(set! mstop? #t)) Error: eval: unbound variable Error Object: =170 What does it mean? Thank you in advance |
|
May 8, 2020, 04:51 |
Space
|
#4 |
Senior Member
|
A space is required between operand and operator. Write it as = 170.
And you have to use pick to pick-up numerical value. The output of direct command is just like report.
__________________
Regards, Vinerm PM to be used if and only if you do not want something to be shared publicly. PM is considered to be of the least priority. |
|
May 8, 2020, 05:16 |
|
#5 |
Member
Francesco
Join Date: Apr 2020
Posts: 56
Rep Power: 6 |
Thank you again,
The problem of "unbound variable" isn't occurring anymore, in fact a space was missing as you said. But how do i use "pick" in my code? Really sorry for the question, it should be easy but i have no background in scheme programming. Thank you in advance |
|
May 8, 2020, 06:06 |
Pick
|
#6 |
Senior Member
|
Just the way you did it before with report. (pick-a-real "TUI command" indices), where TUI command is full define param command all the way up to the selection of the output parameter and indices are used to identify the value you want to pick-up. You can try with just one index, say, 3 or 4 and see which one returns the value you are expecting.
__________________
Regards, Vinerm PM to be used if and only if you do not want something to be shared publicly. PM is considered to be of the least priority. |
|
May 8, 2020, 07:18 |
|
#7 |
Member
Francesco
Join Date: Apr 2020
Posts: 56
Rep Power: 6 |
In TUI you mean this way: ( pick-a-real "/define/parameters/output-parameters, stop-op" )
or not? But then i do not understand the meaning of the "indices". I tried to write in it 1,2,3,4,.. but no values are returned. Code:
def para out p-t-c "stop-op" (if(< 0 ( pick-a-real "/define/parameters/output-parameters, stop-op" INDICES )) (set! mstop? #t)) |
|
May 8, 2020, 07:39 |
Command
|
#8 |
Senior Member
|
pick-a-real command is actually a combination of two commands, pick and string->number. It picks up a string from the output of the journal command and then converts it into number because returned value is always string. So, if you type
define parameters output-parameters print-to-console report-def-0-op it will return number but other strings as well. You need to pick up only the value of the number. That's what pick-a-real does. Since the whole output is a list of strings (that's what Scheme language is, a subset of List Processing Language), user needs to specify which member of the list he or she requires. Index starts from bottom. So, usually, for dimensional return values, 3 is the index to be used and for non-dimensional ones, 2 is to be used. The command to compare it and then execute a stop has to be outside pick command. So, the command (if (> threshold_value (pick-a-real "define parameters output-parameters print-to-console report-def-0-op" 3)) (cx-interrupt)) will stop Fluent if value of output parameter report-def-0-op is smaller than threshold_value.
__________________
Regards, Vinerm PM to be used if and only if you do not want something to be shared publicly. PM is considered to be of the least priority. |
|
January 16, 2021, 08:56 |
Stop transient simulation when a parameter reaches threshold value
|
#9 |
New Member
Sagar
Join Date: Apr 2016
Posts: 23
Rep Power: 10 |
Hello everyone,
I am trying to stop a transient simulation when the volume averaged temperature of a cell zone reaches a particular value using the following scheme script: Code:
(if (< 295 (pick-a-real "/rep/vol/volume-avg 32 , temperature n")) (set! mstop? #t)) The problem is as soon as the simulation starts with the above scheme command, the simulation stops while the volume average temperature of the cell zone is still around 320 K. If anybody could explain what is the problem with the above scheme command or the execution part, your help would be appreciated. Thanks |
|
January 18, 2021, 01:32 |
|
#10 |
Senior Member
Alexander
Join Date: Apr 2013
Posts: 2,363
Rep Power: 34 |
Code:
(set! mstop? #t) Actually, you code seems to be correct. you can execute it through execute commands window, don't see any problem here, frankly speaking you may try to print the value of avg temperature at the moment, when simulation stops, just to check
__________________
best regards ****************************** press LIKE if this message was helpful |
|
|
|
Similar Threads | ||||
Thread | Thread Starter | Forum | Replies | Last Post |
Writing report files and creating report definitions. | cfd_worker99 | FLUENT | 3 | June 12, 2020 13:55 |
Report Forces vs Report Definitions | iakov1703 | ANSYS | 0 | April 4, 2020 20:55 |
Problem with Report Definitions in Solver | rupak504 | FLUENT | 2 | February 11, 2020 10:27 |
Post-Processing Report Definitions After Re-Opening CAS file | m_ridzon | FLUENT | 3 | November 12, 2018 19:59 |
Report > Discrete Phase > Report > How to commands | Francesco Micchetti | FLUENT | 1 | January 23, 2008 07:10 |