CFD Online Discussion Forums

CFD Online Discussion Forums (
-   OpenFOAM Pre-Processing (
-   -   OpenFoam and complex numbers (

panara July 12, 2005 05:38

Can OpenFoam handle fields of
Can OpenFoam handle fields of a complex scalar and relative complex algebra operations?

I would like to create an initialization field that consist of the real part of a complex function of the y coordinate of the field..

something like


where i=sqrt(-1)

Any idea on how to do that?

niklas July 12, 2005 05:48

from beta... z = x + iy Re(
from beta...
z = x + iy
Re( cosh(z) ) = cosh(x)cos(y)


henry July 12, 2005 05:52

Yes OpenFOAM supports complex
Yes OpenFOAM supports complex numbers and fields of complex numbers but I don't think all the functions you might need are currently supported and GeometricComplexFields are not instantiated. dnsFoam uses complex numbers as part of the forcing-field creation which uses a random-UO process and FFTs. Take a look in


for uses of complexFields to create the random-UO process and the use of it in dnsFoam.

If you find that the functions you need are not implemented and you would like GeometricFields of complex numbers it won't be a great deal of work for you to add them.

All times are GMT -4. The time now is 04:10.