CFD Online Discussion Forums

CFD Online Discussion Forums (https://www.cfd-online.com/Forums/)
-   OpenFOAM Pre-Processing (https://www.cfd-online.com/Forums/openfoam-pre-processing/)
-   -   OpenFoam and complex numbers (https://www.cfd-online.com/Forums/openfoam-pre-processing/62271-openfoam-complex-numbers.html)

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

U=cosh(y*sqrt(i*omega/nu))

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)

N

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

OpenFOAM-1.1/src/randomProcesses

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 16:27.