|
[Sponsors] |
August 2, 2011, 04:30 |
"do loop" in cfx expression
|
#1 |
Member
sajad
Join Date: Nov 2010
Posts: 51
Rep Power: 15 |
hi dear friends.
is it possible to write do loop by CEL in cfx? the project is a tube with a porous domain at the end of that. then the inlet pressure decreased suddenly and so the flowrate decreased. i want to change the resistance of the porous domain to obtain the initial flowrate and i need to have sumation of flowrate in all passed time. i dont know if it is possible or not??????????? |
|
August 2, 2011, 10:44 |
|
#2 |
Senior Member
Edmund Singer P.E.
Join Date: Aug 2010
Location: Minneapolis, MN
Posts: 511
Rep Power: 21 |
Do-Loop isnt what you need. Follow this thread. It shows a method to do what you want within CEL. If you dont like this, you can use user fortran.
http://www.cfd-online.com/Forums/cfx...pressions.html |
|
August 3, 2011, 10:20 |
|
#3 |
Member
sajad
Join Date: Nov 2010
Posts: 51
Rep Power: 15 |
hi singer 1812 and thanks for your help.
but im still confused.i do what you wrote me but i dont know how should i use the "res file" as an initial condition? can you guide me? another question for me is that after i add an additional variable and run one itration then should i add an expression?????? thanks again. |
|
August 3, 2011, 14:29 |
|
#4 |
Senior Member
Edmund Singer P.E.
Join Date: Aug 2010
Location: Minneapolis, MN
Posts: 511
Rep Power: 21 |
You need to run an intial run, a "dummy" run if you will, needs only be one iteration, to initialize the variable that you want to addup. If you try adding up that variable, (ie. a=a+1), CFX will complain because a doesnt exist upon start.
If you make a dummy run, only needs to be 1 iteration, with a=0. Then use that run as an initialization for your real run (with a=a+1 or whatever you are using), then CFX will not complain. |
|
August 3, 2011, 15:32 |
|
#5 |
Member
sajad
Join Date: Nov 2010
Posts: 51
Rep Power: 15 |
hi singer 1812
should i write "a=a+1" as a ""CEL expression"" or another "additional variable"? i want to have sum of flowrate in all of the passed times. i realy need that so if it is possible for you guide me in detail. best regards |
|
August 3, 2011, 19:39 |
|
#6 |
Member
sajad
Join Date: Nov 2010
Posts: 51
Rep Power: 15 |
hello
i see you posted a topic about "Update Loop = TRANS_LOOP" . i want to sum the flow rate at all the time step passed but i dont know how... i defined a AV by name of debi and add "Update Loop = TRANS_LOOP" to it in the "edit in command" part then i run for one iteration to have a given initial value for debi=0 then i defined a expression by name of "totdebi=debi+flowrate@inlet" when i run it gives me error im really confused. if it is possible for you give me help in detail thanks. |
|
|
|
Similar Threads | ||||
Thread | Thread Starter | Forum | Replies | Last Post |
How to install CGNS under windows xp? | lzgwhy | Main CFD Forum | 1 | January 11, 2011 19:44 |
CGNS lib and Fortran compiler | manaliac | Main CFD Forum | 2 | November 29, 2010 07:25 |
Expression in cfx | selim | CFX | 13 | September 5, 2007 14:09 |
CFX Expression Statement | Ivan | CFX | 3 | June 5, 2006 12:42 |
Lift, Drag Vs time chart,calculations | Jamesd69climber | CFX | 8 | February 17, 2005 18:23 |