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

Scheme macros inside journal files

Register Blogs Community New Posts Updated Threads Search

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
Old   March 2, 2018, 13:35
Default Scheme macros inside journal files
  #1
Member
 
Michal
Join Date: May 2017
Posts: 35
Rep Power: 8
michal.s is on a distinguished road
Hello everybody!

I have got a problem with scheme commands and unfortunatelly I haven't found any solution here.

I need to set a few scheme variables for my UDF.
I have already solved my problems with UDF and defining a variables with couple commands:
(rp-var-define 'NAME1 0.0 'real #f)
(rp-var-define 'NAME2 0.0 'real #f)

When I type them in TUI everything is OK, but when I put those lines in my journal (with another "common" commands) I've got an error:

Error: A journal or macro has already been started.
Error Object: #f

It appers while fluent executes first journal command after defining all scheme variables using: (rp-var...).

Anyone knows a solution?

Best regards,
Michal.s
michal.s is offline   Reply With Quote

Old   March 4, 2018, 23:23
Default
  #2
Senior Member
 
Alexander
Join Date: Apr 2013
Posts: 2,363
Rep Power: 34
AlexanderZ will become famous soon enoughAlexanderZ will become famous soon enough
what is your next line?

best regards
AlexanderZ is offline   Reply With Quote

Old   March 5, 2018, 03:00
Default
  #3
Member
 
Michal
Join Date: May 2017
Posts: 35
Rep Power: 8
michal.s is on a distinguished road
My next line:
Code:
/define/boundary-conditions/wall wall-sphere 0 no 0 no yes temperature no 20 no no no no 0.0025 no 0.5 no 1
michal.s is offline   Reply With Quote

Old   March 5, 2018, 06:27
Default
  #4
Senior Member
 
Join Date: Sep 2017
Posts: 246
Rep Power: 11
obscureed is on a distinguished road
Hi Michal.s

I do not think that these lines are the (only) cause of that error message.
(And I think this is where AlexanderZ's question was leading as well.)

You cannot read a journal while you are writing a journal. You cannot necessarily run a read-journal command inside a journal -- this may have changed in recent versions, but it certainly used to be forbidden.

By the way, it is generally discouraged to rp-var-define the same RP-variable twice. I'm not sure how serious the consequences are. The UDF manual used to contain a nice little Scheme function to guard against this -- see for example https://www.sharcnet.ca/Software/Flu...df/node107.htm. I'm not sure why this disappeared from the documentation.

Good luck,
Ed
obscureed is offline   Reply With Quote

Old   March 5, 2018, 23:47
Default
  #5
Senior Member
 
Alexander
Join Date: Apr 2013
Posts: 2,363
Rep Power: 34
AlexanderZ will become famous soon enoughAlexanderZ will become famous soon enough
Quote:
Originally Posted by michal.s View Post
My next line:
Code:
/define/boundary-conditions/wall wall-sphere 0 no 0 no yes temperature no 20 no no no no 0.0025 no 0.5 no 1
if previous comment doesn't help, may may try to use other approach.
Change format of your file from journal(mixed with scheme) to scheme.
And run scheme file not journal.

to make new format you should change the way, how your execute TUI commands

Was
Code:
/define/boundary-conditions/wall wall-sphere 0 no 0 no yes temperature no 20 no no no no 0.0025 no 0.5 no 1
New
Code:
(ti-menu-load-string (format #f "define boundary-conditions wall wall-sphere 0 no 0 no yes temperature no 20 no no no no 0.0025 no 0.5 no 1 \n" ))
It means, you can access all TUI functions using ti-menu-load-string scheme command.

Best regards
AlexanderZ is offline   Reply With Quote

Old   March 6, 2018, 05:41
Default
  #6
Member
 
Michal
Join Date: May 2017
Posts: 35
Rep Power: 8
michal.s is on a distinguished road
Hello Again,

I tried to simply rewrite my journal.
I don't know what could be the the problem, but currently everything is OK.
Hope that nothing will crash.

Thank you for all suggestions. I will try them if the problem will appear again.

Best regards,
Michal
michal.s is offline   Reply With Quote

Reply


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
How to run a series of Fluent journal files in order? jyoung79 FLUENT 2 September 22, 2014 08:52
How to define macros in Dictionary files? keepfit OpenFOAM 3 December 16, 2013 15:13
Two conditions in Fluent journal files bobmalaria FLUENT 5 November 10, 2011 05:31
error reading journal files Wenbin FLUENT 2 February 22, 2005 04:43
Experimental Repository for UDFs, Journal Files and Scheme Scripts Jonas Larsson FLUENT 0 March 5, 2000 15:36


All times are GMT -4. The time now is 05:42.