CFD Online Discussion Forums (http://www.cfd-online.com/Forums/)
-   Main CFD Forum (http://www.cfd-online.com/Forums/main/)
-   -   Programming a CFD code using complex variables (http://www.cfd-online.com/Forums/main/15362-programming-cfd-code-using-complex-variables.html)

 New coding June 30, 2008 18:02

Programming a CFD code using complex variables

Hi,

In Math you can use Integer(E), Real(R) or Complex(Z) numbers. In multiphase flow (VOF or bubbles, evaporation, boiling) the results locus and validations can be plotted on Nyquist-type diagrams (plotting the variation of the Amplitude and the Argument Z=Aexp(i.theta).

http://ralyx.inria.fr/2007/Raweb/apics/3.png

http://www.cemtool.com/img/pro_img_01_03.gif

http://www.engr.udayton.edu/faculty/...s/image002.gif

We would like to program a new CFD code using complex variables (Z = U1 + iU2 = Aexp(i.theta) )

Which language would you suggest to handle complex variables: derivation, convertion to amplitude and argument, etc...

Thanks,

 triple_r July 3, 2008 21:32

Re: Programming a CFD code using complex variables

Well, it's easy in MATLAB, but I wouldn't recommend that for much of anything in CFD. Fortran has a complex variable data type, and you can work with complex numbers in C also. In C++ you could even overload the operators which could make the math very easy to write, although you always need to be careful when you do this. So to answer your question, I don't think handling of complex variables should dictate which language you write in. Use what you're comfortable with.

 All times are GMT -4. The time now is 19:52.