|
[Sponsors] |
How to repeat to read the same case without saving case and data file? |
|
LinkBack | Thread Tools | Search this Thread | Display Modes |
November 22, 2012, 01:54 |
How to repeat to read the same case without saving case and data file?
|
#1 |
New Member
Chenguang Li
Join Date: Sep 2011
Posts: 15
Rep Power: 15 |
Hi, everyone.
I'm trying to do a loop. The velocity of dynamic mesh is adjusted every time step. If the result is not good enough then I need to read the case and data of last good result again to let the mesh back to the beginning of this time step. If the result is good enough then the date and case will be saved.I write a scheme file as following. But the problem is it doesn't read the case again when it has been read. It only calculate 5 step (as I set x max value is 5) after a case file is read in, which means the mesh has kept moving during the 5 steps. It is not I want. Can you help me to find the problem? Thank you very much. yours, Chenguang (rp-var-define 'mlcg 1.0 'real #f) (rp-var-define 'klcg 0.0 'real #f) (rp-var-define 'nlcg 0.0 'real #f) (rp-var-define 'setao 1.57 'real #f) (rp-var-define 'omegao 0.0 'real #f) (rp-var-define 'domegao 0.0 'real #f) (rp-var-define 'mo 0.0 'real #f) (define x 1) (define y 0) (format #f "heartvalve~03d~03d" y x) (do ((x 1 (+ x 1)) ) ((> x 5)) (format #f "heartvalve~03d~03d" y x) (ti-menu-load-string (format #f "file/read-case-data heartvalve~03d" y)) (ti-menu-load-string "solve/set/time-step 0.00245") (ti-menu-load-string "solve/dual-time-iterate 1") (ti-menu-load-string "file/write-case-data heartvalveo") (if (> (rpgetvar 'mlcg) 0) (begin (set! y (+ y 1)) (ti-menu-load-string (format #f "file/write-case-data heartvalve~03d" y))))) |
|
November 22, 2012, 02:30 |
RP variables are initialed everytime
|
#2 |
New Member
Chenguang Li
Join Date: Sep 2011
Posts: 15
Rep Power: 15 |
Hi, everyone. I add a save command at the end of every time step. Then it can read the case again every time.
But I found these RP variables are initialed every time? Why? I didn't put the define and initial command in the loop. Please help me. yours, Chenguang |
|
November 22, 2012, 03:13 |
RP variables are defined in case file
|
#3 |
New Member
Chenguang Li
Join Date: Sep 2011
Posts: 15
Rep Power: 15 |
Now I understand RP variables are defined and saved in case file. Its value are different depending on different cases like pressure, velocity. Is that right?
So my problem is more difficult. Which kind of variables can exist along the FLUENT and keep the stored value until its value is changed. If there is not such kind of variables ,than I can write them to a data file and read them at the beginning of next step. Is there any better way? I hope somebody can help me. your, Chenguang |
|
November 22, 2012, 03:34 |
How to transfer the value from a Rp variable to a global variable?
|
#4 |
New Member
Chenguang Li
Join Date: Sep 2011
Posts: 15
Rep Power: 15 |
How to transfer the value from a Rp variable to a global variable?
And from a global variable to a Rp variable? Anyone can give me an answer? Thank you very much. |
|
November 22, 2012, 11:45 |
|
#5 |
New Member
Chenguang Li
Join Date: Sep 2011
Posts: 15
Rep Power: 15 |
Hi, now I add these transfers between rp variables and global variables as following. But there is an error:
Error: %prf-set-var: invalid flonum Error Object: #[compound-procedure] what's the problem? (rp-var-define 'mlcg 0 'real #f) (rp-var-define 'klcg 0 'real #f) (rp-var-define 'nlcg 0 'real #f) (rp-var-define 'setao 0 'real #f) (rp-var-define 'omegao 0 'real #f) (rp-var-define 'domegao 0 'real #f) (rp-var-define 'mo 0 'real #f) (define x 1) (define y 0) (define mg 0) (define kg 0) (define ng 0) (define setag 1.57) (define omegag 0) (define domegag 0) (define mog 0) (do ((x 1 (+ x 1)) ) ((> x 5)) (ti-menu-load-string (format #f "file/read-case-data heartvalve~05d" y)) (rpsetvar'mlcg mg) (rpsetvar 'klcg kg) (rpsetvar 'nlcg ng) (rpsetvar 'setao setag) (rpsetvar 'omegao omegag) (rpsetvar 'domegao domegag) (rpsetvar 'mo mog) (ti-menu-load-string "solve/set/time-step 0.00245") (ti-menu-load-string "solve/dual-time-iterate 1") (set! mg rpgetvar('mlcg)) (set! kg rpgetvar('klcg)) (set! ng rpgetvar('nlcg)) (set! setag rpgetvar('setao)) (set! omegag rpgetvar('omegao)) (set! domegag rpgetvar('domegao)) (set! mog rpgetvar('mo)) (ti-menu-load-string (format #f "file/write-case-data heartvalve~07d" x)) (if (> (rpgetvar 'mlcg) 0) (begin (set! y (+ y 1)) (ti-menu-load-string (format #f "file/write-case-data heartvalve~05d" y))))) |
|
|
|
Similar Threads | ||||
Thread | Thread Starter | Forum | Replies | Last Post |
Error while saving the case and data file | Sri | FLUENT | 6 | September 2, 2015 10:55 |
read saved case and data error | NAD | FLUENT | 0 | November 20, 2012 06:45 |
FLUENT can not read data file | jing113cn | FLUENT | 0 | December 6, 2010 10:06 |
Changing the grid on the same set-up | Katya | FLUENT | 7 | October 8, 2009 17:31 |
Saving particle (DPM) data to file? | Philip | FLUENT | 2 | June 12, 2006 02:41 |