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

"do loop" in cfx expression

Register Blogs Community New Posts Updated Threads Search

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
Old   August 2, 2011, 04:30
Default "do loop" in cfx expression
  #1
Member
 
sajad
Join Date: Nov 2010
Posts: 51
Rep Power: 16
sajad_abasi is on a distinguished road
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???????????
sajad_abasi is offline   Reply With Quote

Old   August 2, 2011, 10:44
Default
  #2
Senior Member
 
Edmund Singer P.E.
Join Date: Aug 2010
Location: Minneapolis, MN
Posts: 511
Rep Power: 21
singer1812 is on a distinguished road
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
singer1812 is offline   Reply With Quote

Old   August 3, 2011, 10:20
Default
  #3
Member
 
sajad
Join Date: Nov 2010
Posts: 51
Rep Power: 16
sajad_abasi is on a distinguished road
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.
sajad_abasi is offline   Reply With Quote

Old   August 3, 2011, 14:29
Default
  #4
Senior Member
 
Edmund Singer P.E.
Join Date: Aug 2010
Location: Minneapolis, MN
Posts: 511
Rep Power: 21
singer1812 is on a distinguished road
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.
singer1812 is offline   Reply With Quote

Old   August 3, 2011, 15:32
Default
  #5
Member
 
sajad
Join Date: Nov 2010
Posts: 51
Rep Power: 16
sajad_abasi is on a distinguished road
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
sajad_abasi is offline   Reply With Quote

Old   August 3, 2011, 19:39
Default
  #6
Member
 
sajad
Join Date: Nov 2010
Posts: 51
Rep Power: 16
sajad_abasi is on a distinguished road
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.
sajad_abasi 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 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


All times are GMT -4. The time now is 10:36.