CFD Online Discussion Forums

CFD Online Discussion Forums (https://www.cfd-online.com/Forums/)
-   OpenFOAM Community Contributions (https://www.cfd-online.com/Forums/openfoam-community-contributions/)
-   -   [swak4Foam] complex numbers in swak4foam (https://www.cfd-online.com/Forums/openfoam-community-contributions/98153-complex-numbers-swak4foam.html)

juanjo March 4, 2012 13:51

complex numbers in swak4foam
 
Hi all,

I wish to implement the Womersley equation at patches of my model. Can utilize complex numbers in groovyBC type?.

Regards.

gschaider March 4, 2012 18:28

Quote:

Originally Posted by juanjo (Post 347578)
Hi all,

I wish to implement the Womersley equation at patches of my model. Can utilize complex numbers in groovyBC type?.

No. I don't see the point. You're the boundary condition is defined on a real (as opposed to complex) field. So you can always calculate the real part of your complex expression and put that into the BC (I think this has been discussed a few months ago)

lastjedivol September 20, 2019 11:38

Quote:

Originally Posted by gschaider (Post 347608)
No. I don't see the point. You're the boundary condition is defined on a real (as opposed to complex) field. So you can always calculate the real part of your complex expression and put that into the BC (I think this has been discussed a few months ago)




Dear Bernhard, i am sorry to pick up such an old thread but i have a question regarding complex numbers and complex field operations in combination with swak4Foam and this is the only relevant post that i have found.



My question is : how can i declare complex numbers or even operations with complex numbers, inside an expressionField in controlDict? Is there any special way that i can write the imaginary part ( i ) ?


Thank you very much in advance.

gschaider September 22, 2019 12:52

Quote:

Originally Posted by lastjedivol (Post 745119)
Dear Bernhard, i am sorry to pick up such an old thread but i have a question regarding complex numbers and complex field operations in combination with swak4Foam and this is the only relevant post that i have found.



My question is : how can i declare complex numbers or even operations with complex numbers, inside an expressionField in controlDict? Is there any special way that i can write the imaginary part ( i ) ?


Thank you very much in advance.


Sorry. There currently is no built-in support for complex numbers in swak4Foam. Complex numbers are not really "first class citizens" in OpenFOAM (there is no volComplexField for instance) and I never had a need for them. So you'll have to keep complex and real part of your complex variable in two separate scalar fields and do the calculations for them by hand

lastjedivol September 23, 2019 04:26

Quote:

Originally Posted by gschaider (Post 745209)
Sorry. There currently is no built-in support for complex numbers in swak4Foam. Complex numbers are not really "first class citizens" in OpenFOAM (there is no volComplexField for instance) and I never had a need for them. So you'll have to keep complex and real part of your complex variable in two separate scalar fields and do the calculations for them by hand


Ok i see. Thank you very much for your reply and your advice.


All times are GMT -4. The time now is 14:48.