CFD Online Logo CFD Online URL
www.cfd-online.com
[Sponsors]
Home > Forums > Software User Forums > ANSYS > CFX

command editor

Register Blogs Community New Posts Updated Threads Search

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
Old   July 15, 2009, 13:37
Default command editor
  #1
New Member
 
Join Date: Jul 2009
Posts: 6
Rep Power: 17
fkonias is on a distinguished road
Hi all,
I am trying to create some sessions of my own in the command editor, but I do not know the commands and some general stuff…

1) Is there a command like Fortran’s “do”?

2) for example I wrote :

DATA READER:
CASE:Case 50_202pN_001
DOMAIN:Apomastefsi S3
Components to Ignore = Apomastefsi S3
Components to Update =
END
END
END

This works fine. But when I load a different case which means different case name (“Case 50_202pN_001” ), then as expected there are errors! I tried to replace the “Case 50_202pN_001” with “$case” but it didn’t work. Is there a way to bypass this problem? Is there a way to make these lines compatible with ANY case without changing the case name manually?

Thanks a lot
fkonias
fkonias is offline   Reply With Quote

Old   July 15, 2009, 13:52
Default
  #2
LKF
New Member
 
Join Date: Mar 2009
Posts: 16
Rep Power: 17
LKF is on a distinguished road
Hi,

I'm not familiar with 'CASE' but the following should let you loop through a series of commands for a list of different files (I've assumed that 'Case 50_202pN_001' is a res file).

Code:
!foreach $case('Case 50_202pN_001.res', ...)
!{
DATA READER:
CASE:$case
DOMAIN:Apomastefsi S3
Components to Ignore = Apomastefsi S3
Components to Update =
END
END
END
!}
Inthe sample code above, the '!' is required at the start of each code line. Perl variables, functions, commands will work following the !.

To create your own session file, I think the best bet is to record one in POST and then edit it in a command editor. This will allow you to see the commands and then you can just tweak it with your own variables and loops, etc.

I learned a little bit of the coding required to make my own session files through ANSYS training, so I'm not familiar with what content is in the documentation, but I'm sure you'll find some.

Hope this helps a bit.
LKF is offline   Reply With Quote

Old   July 16, 2009, 09:56
Default
  #3
New Member
 
Join Date: Jul 2009
Posts: 6
Rep Power: 17
fkonias is on a distinguished road
Thank you for your replay, but I am not quite sure how to use this!
It looks like it’s a kind of a loop, which is repeated for all ‘things’ in the parenthesis. Am I right? Well this is something else that I might be able to use somewhere else, but it’s not what I was looking for this time. I just want to replace “Case 50_202pN_001” with a “skeleton key”. Like when we write *.* if that is possible.
fkonias is offline   Reply With Quote

Old   July 16, 2009, 20:31
Default
  #4
Super Moderator
 
Glenn Horrocks
Join Date: Mar 2009
Location: Sydney, Australia
Posts: 17,850
Rep Power: 144
ghorrocks is just really niceghorrocks is just really niceghorrocks is just really niceghorrocks is just really nice
Hi,

The for loop in LKF's example is a perl script. CFX supports perl in some of its transcript files. Read the documentation on scripting in CFX or look at the web for references on perl such as http://www.perl.org/

Glenn Horrocks
ghorrocks is offline   Reply With Quote

Old   July 21, 2009, 23:47
Default
  #5
Senior Member
 
Jack
Join Date: Mar 2009
Posts: 106
Rep Power: 16
rogbrito is an unknown quantity at this point
a good book: R. Schwartz and T. Phoenix, Learning Perl, Ed. O'Reilly. At Amazon dot com:

http://www.amazon.com/Learning-Perl-...8230978&sr=8-1
rogbrito 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



All times are GMT -4. The time now is 20:56.