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 |
i think you can use User Fortran in CFX, it is easy to realize
|
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. |
Quote:
|
Quote:
|
Quote:
|
Quote:
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. |
And if you do it via Fortran, what can you do?
You also need an initial flowrate, and some kind of coefficient, right? |
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.
|
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. |
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. |
Thanks very much to Rui and longbow's selfless help.
I learned more about CFX. hehe. |
So, share what you've learnt with we all ;)
|
All times are GMT -4. The time now is 23:50. |