CFD Online Discussion Forums

CFD Online Discussion Forums (https://www.cfd-online.com/Forums/)
-   CFX (https://www.cfd-online.com/Forums/cfx/)
-   -   CFX expression language (https://www.cfd-online.com/Forums/cfx/142720-cfx-expression-language.html)

mahdimazloom October 8, 2014 04:50

CFX expression language
 
How can I solve an ordinary differential equation using CFX expression language?

ghorrocks October 8, 2014 06:23

You can't.

mahdimazloom October 8, 2014 12:48

1 Attachment(s)
Attachment 34271

Menter, Florian, et al. "Overview of Fluid-structure coupling in ANSYS-CFX." 25th International Conference on Offshore Mechanics and Arctic Engineering. American Society of Mechanical Engineers, 2006.

singer1812 October 8, 2014 16:00

The motion of the cylindar is prescribed by the forces on it.
Weight is one = m_cylinder*g
Spring is one = k*dy_cylinder
damper is one = c*v_cylinder
Fluid force = F_fluid

All of those values are variables in CFX. You can sum those up to F_sum

Your cylinder wall motion will be dicretization of F_sum=ma. The resulting displacement (this is relative to previous mesh) is used for mesh motion of (assuming motion in one direction only):

(F_sum*tstep/m+v_cylinder)*tstep

That equation can be used in CEL to move the wall.

I leave it to you to derive that.

mahdimazloom October 8, 2014 17:49

Thanks Edmund. I think that's the answer

ghorrocks October 8, 2014 17:51

Nice work Edmund!

But in general you cannot solve an arbitrary ODE in CEL. It works in this specific case because it is using force as the variable and CFX has a lot of functions to calculate forces on bodies.

mahdimazloom October 8, 2014 18:09

I'v gotten my answer but is it possible to get access to the data from one or more steps before through CEL commands so one can solve the arbitrary ODE using finite difference method?

ghorrocks October 8, 2014 18:15

I thought my previous post was quite clear......

There is a messy way of accessing previous values. Do a search of the forum for "TRANS_LOOP".


All times are GMT -4. The time now is 21:39.