Reading RP Var from the GUI
Hello,
I modeled a fuel cell using UDF, but I want read, every time I initialize my model, couple of RP variables.The following line shows one of the variables I defined in the scheme (318.15 is just a initial value). (make-new-rpvar 'fuel-cell/operating-temp 318.15 'real) ;; K My problem is that I want to do something like (these 2 lines that follows goes within the DEFINE_INIT) Message("\n Define the operating temperature: 313.15 - 400 [K]"); XXXXXXXXXXXXX (in this line I need to read a value and set it to the rpvar operating-temp, but I do not know how) Then, within the code, I could use it as T0 = RP_Get_Real("fuel-cell/operating-temp"); Does anyone know how to write this line? Fluent documentation regarding the User Define Scheme is very poor, and there is not much information regarding this. Thanks in advanced. |
Read from what? From the solution? From a file? Or do you really mean that you want the user to type the value?
If it is the latter... I see two possible options. 1. Add a dialog box, as explained in the Fluent manual->Customization Manual->II Creating Custom User Interfaces in Fluent->5. Comprehensive examples->5.1 Dialog Box Example, together with 5.3. UDF Example. It is not like you describe, and maybe not what you want, but it might be similar enough. This is in the Help in this location since Fluent 16, but it probably was already working before. 2. Try to use standard c code for reading lines. Such as 'scanf' or 'fgets'. I don't know if they work... |
1 Attachment(s)
Quote:
Nevertheless, I took one of your suggestions and created my own (simple but efficient) dialog box. At a first try I thought about using a droplist, but did not work since I need real values instead of strings. As a second option, I changed it to a typing input and produced my code as it follows: Code:
(define (make-new-rpvar name default type) |
Wow. Looks impressive!
|
All times are GMT -4. The time now is 10:35. |