# in CFX, how to define a inlet condition of feedback control flow rate ?

 Register Blogs Members List Search Today's Posts Mark Forums Read

 May 13, 2009, 02:23 in CFX, how to define a inlet condition of feedback control flow rate ? #1 New Member   henry wang Join Date: May 2009 Posts: 13 Rep Power: 15 Hi, guys. i have a big problem in my simulation to analysis the fluid flow passing a check valve. i want to define a feedback control inlet condition of mass flow. At the end of each tStep, if the force caused by fluid flow is bigger than the spring force, the mass rate should be reduced; if the force caused by fluid flow is lower than the spring force, the mass rate should be increased. But how to do it? should i use the function of program like VB or C language? if so, are there some cases to study? Please help me. Thank you. Last edited by suihenry; May 13, 2009 at 02:33. Reason: i want the problem to be described more clearly

 May 13, 2009, 09:08 #2 New Member   liuzhe Join Date: May 2009 Posts: 3 Rep Power: 15 i think you can use User Fortran in CFX, it is easy to realize

 May 13, 2009, 09:30 #3 New Member   Join Date: Apr 2009 Posts: 14 Rep Power: 15 This can be easily done with CCL. First define an expression like this: inletMass=massFlow@(inlet)+coef*(spring force - force_z@(check valve)) Then, use it to define your inlet boundary condition. Here I assume check valve force is along z-axis. You probably want to try several "coef" values to make above expression working. Please make sure "coef" have correct unit.

May 13, 2009, 22:50
#4
New Member

henry wang
Join Date: May 2009
Posts: 13
Rep Power: 15
Quote:
 Originally Posted by longbow This can be easily done with CCL. First define an expression like this: inletMass=massFlow@(inlet)+coef*(spring force - force_z@(check valve)) Then, use it to define your inlet boundary condition. Here I assume check valve force is along z-axis. You probably want to try several "coef" values to make above expression working. Please make sure "coef" have correct unit.
Thank you! it's a good idea. But if use the user fortran, maybe the results is more accurate and the convergence can be achieved quickly.

May 13, 2009, 22:51
#5
New Member

henry wang
Join Date: May 2009
Posts: 13
Rep Power: 15
Quote:
 Originally Posted by liuzhe1213 i think you can use User Fortran in CFX, it is easy to realize
Do you have some cases to study the user fortran in CFX?

May 14, 2009, 05:00
#6
Member

Rui Igreja
Join Date: Mar 2009
Location: Aveiro
Posts: 68
Blog Entries: 1
Rep Power: 16
Quote:
 Originally Posted by suihenry ... if use the user fortran, maybe the results is more accurate and the convergence can be achieved quickly.
Why?
__________________
Rui

May 14, 2009, 05:42
#7
New Member

henry wang
Join Date: May 2009
Posts: 13
Rep Power: 15
Quote:
 Originally Posted by Rui Why?
To make the total force of disc zero (balance of force caused by fluid flow and spring force), using CEL expression need to give a initial flow rate, and we don't know this initial flowrate, we just try to value it but may very inaccurate, and the coefficient in the CEL expression is difficult to determine. we need to try man\ybe many times to get the right coefficient, this cost a lot of times.
But if use the user fortran, the above problems can be greatly improved. At each timestep, the inlet flow rate can be calculated by the computer, and it's more accurate and quickly approach the banlance value.

 May 14, 2009, 05:49 #8 Member     Rui Igreja Join Date: Mar 2009 Location: Aveiro Posts: 68 Blog Entries: 1 Rep Power: 16 And if you do it via Fortran, what can you do? You also need an initial flowrate, and some kind of coefficient, right? __________________ Rui

 May 14, 2009, 09:16 #9 New Member   Join Date: Apr 2009 Posts: 14 Rep Power: 15 massFlow@(Inlet) calculates flow rate at each timestep too. As Rui pointed out, you also need to define an initial flow rate. I don't know why you think using user fortran is better than CEL. As a matter of fact, CFX actually wants customer to stay away from user fortran. They are enhancing CEL's capability to accomplish what previously has to be done by user fortran. The stuff you want to do can be done by CEL easily without sacrificing accuracy.

 May 14, 2009, 09:26 #10 New Member   henry wang Join Date: May 2009 Posts: 13 Rep Power: 15 You two mean that using user fortran also need a initial flowrate and a coefficient? i have no idea about user fortran since i never use it, i just heared that it's more convenient than CEL. And one had told me that in my case, i can use user fortran to replace the CEL. this method can reduce the times of trying to determine a suitable coefficient and a initial flowrate when using CEL. I can use CEL well, but i should try many times to determine the suitable coefficient and initial flowrate. So i want to use a better method.

 May 14, 2009, 10:54 #11 Member     Rui Igreja Join Date: Mar 2009 Location: Aveiro Posts: 68 Blog Entries: 1 Rep Power: 16 Myself never used User Fortran in CFX. And I asked "why?", because I was curious about what you had said. But I know User Fortran isn't any miraculous tool. I'm pretty sure you can do many more things than you can do just with CEL, but if you want to calculate the inlet flowrate as function (whatever it may be) of the force caused by the flow, as this force caused by the flow will only be possible to obtain if you have an inlet flow rate, it seems obvious that you'll an initial estimative. In the expression indicated by longbow inletMass=massFlow@(inlet)+coef*(spring force - force_z@(check valve)), what happens when the simulation has converged? The spring force will be equal to the force_z@(check valve), and the equation becomes simply inletMass=massFlow@(inlet). So the value you use for coef doesn't really matter, at least theoretically. A high value will speed up the convergence of this equation, but it may also lead to instability. __________________ Rui

 May 14, 2009, 14:41 #12 New Member   henry wang Join Date: May 2009 Posts: 13 Rep Power: 15 Thanks very much to Rui and longbow's selfless help. I learned more about CFX. hehe.

 May 14, 2009, 18:59 #13 Member     Rui Igreja Join Date: Mar 2009 Location: Aveiro Posts: 68 Blog Entries: 1 Rep Power: 16 So, share what you've learnt with we all __________________ Rui