CFD Online Discussion Forums

CFD Online Discussion Forums (http://www.cfd-online.com/Forums/)
-   CFX (http://www.cfd-online.com/Forums/cfx/)
-   -   in CFX, how to define a inlet condition of feedback control flow rate ? (http://www.cfd-online.com/Forums/cfx/64485-cfx-how-define-inlet-condition-feedback-control-flow-rate.html)

suihenry May 13, 2009 01:23

in CFX, how to define a inlet condition of feedback control flow rate ?
 
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.

http://www.cfd-online.com/Forums/F:\...NG DN65\33.jpg

liuzhe1213 May 13, 2009 08:08

i think you can use User Fortran in CFX, it is easy to realize

longbow May 13, 2009 08:30

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.

suihenry May 13, 2009 21:50

Quote:

Originally Posted by longbow (Post 215943)
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.

suihenry May 13, 2009 21:51

Quote:

Originally Posted by liuzhe1213 (Post 215939)
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?

Rui May 14, 2009 04:00

Quote:

Originally Posted by suihenry (Post 216015)
... if use the user fortran, maybe the results is more accurate and the convergence can be achieved quickly.

Why? :confused:

suihenry May 14, 2009 04:42

Quote:

Originally Posted by Rui (Post 216035)
Why? :confused:

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.

Rui May 14, 2009 04:49

And if you do it via Fortran, what can you do?
You also need an initial flowrate, and some kind of coefficient, right?

longbow May 14, 2009 08:16

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.

suihenry May 14, 2009 08:26

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.

Rui May 14, 2009 09:54

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.

suihenry May 14, 2009 13:41

Thanks very much to Rui and longbow's selfless help.
I learned more about CFX. hehe.

Rui May 14, 2009 17:59

So, share what you've learnt with we all ;)


All times are GMT -4. The time now is 12:16.