CFD Online Discussion Forums

CFD Online Discussion Forums (http://www.cfd-online.com/Forums/)
-   FLUENT (http://www.cfd-online.com/Forums/fluent/)
-   -   Looping in Journals error (http://www.cfd-online.com/Forums/fluent/49377-looping-journals-error.html)

Kai Wohlfahrt September 29, 2008 05:03

Looping in Journals error
 
I am doing some 2d simulation of wings, and I am trying to write a journal file that will allow me to automate solving for a set of angles.

However, in the following section of code I get the error

Error: eval: unbound variable

Error Object: /define/boundary-conditions/velocity-inlet

The relevant code is here, if it is not too much trouble to check it...

(define ang 0)

(define angmin -5)

(define angmax 5)

(define angstep 5)

(define window 1)

(define save "ggsf_naca4102_at")

(define degtorad 0.0174532925)

------------{here is a long section that sets up the solver and runs one simulation and saves the data, I don't think there are errors here}-----------

(set! ang angmin)

(let tiltup ((ang angmin))

(if (> ang angmax) (display "DDDOOONNNEEE")

(begin

(define angstr "-5")

(define angrad (* ang degtorad))

(define savefile (string-append save "at" angstr "deg" "030" "ms"))

(define savefiledat (string-append savefile ".dat"))

(define ycomp (sin angrad))

(define xcomp (cos angrad))

/define/boundary-conditions/velocity-inlet 6 yes yes no 30 no xcomp no ycomp yes no 0.001

/solve/monitors/force/clear-all-monitors-data yes yes yes

/solve/monitors/force/lift-coefficient yes 4 () yes no yes 2 no ycomp xcomp

/solve/monitors/force/drag-coefficient yes 4 () yes no yes 1 no xcomp ycomp

/solve/initialize/compute-defaults/velocity-inlet 6

/solve/initialize/initialize-flow

/solve/iterate 200 10 1

(cx-gui-do cx-activate-item "MenuBar*WriteSubMenu*Data...")

(cx-gui-do cx-set-text-entry "Select File*Text" savefiledat)

(cx-gui-do cx-activate-item "Select File*OK")

(tiltup (+ ang angstep)))))

;end angle loop

Thanks for any help!

(Sorry about the empty lines, but I can't figure out how to add line breaks)

Kai Wohlfahrt September 30, 2008 08:06

Re: Looping in Journals error
 
Nevermind the problem, I found out that I have to use (ti-menu-load-string "blabla")

Now I am getting the error:

Error: CAR: invalid argument [1]: wrong type [not a pair] Error Object: ()

Somewhere in the following lines of code:

(ti-menu-load-string (format #f "/define/boundary-conditions/velocity-inlet 6 yes yes no 30 no ~a no ~a yes no 0.001" xcomp ycomp)) (newline) (ti-menu-load-string (format #f "/solve/monitors/force/clear-all-monitors-data yes yes yes")) (newline)

I have a suspicion that it might be due to a different syntax in fluent 6.3, as that line was from an older tutorial.

Kai Wohlfahrt September 30, 2008 09:03

Re: Looping in Journals error
 
Correction: the error is in this line (atleast it turns up when this one is added):

(ti-menu-load-string (format #f "/solve/monitors/force/lift-coefficient yes 4 () yes no yes 2 no ~a ~a ") ycomp xcomp)(newline)

Many thanks, Kai

Kai Wohlfahrt October 2, 2008 08:23

Fixed. Now how to return a default value?
 
I found my error, miscounted prompts somewhere :P.

How do I script the default value to be returned for a prompt?

Kai


All times are GMT -4. The time now is 17:21.