|
[Sponsors] |
November 20, 2009, 11:16 |
How can I use complex numbers in OpenFOAM.
|
#1 |
New Member
Join Date: Nov 2009
Posts: 2
Rep Power: 0 |
Hi Foamers
How can I use complex numbers in OpenFOAM. I want to introduce a formula such: a/(c+ i d). Thanks |
|
November 21, 2009, 14:54 |
|
#2 |
Senior Member
Kevin Smith
Join Date: Mar 2009
Posts: 104
Rep Power: 17 |
The source code for complex numbers is in
src/OpenFOAM/primitives/complex under your root openfoam directory. All the operators are there so the code should be pretty simple, something like the following should get you started. #include "complex.H" #include "IOstreams.H" using namespace Foam; int main() { complex a(1, 3); complex b(1, 2); complex c = a / b; Info << a << " / " << b << " = " << c << endl; return 0; } |
|
|
|
Similar Threads | ||||
Thread | Thread Starter | Forum | Replies | Last Post |
OpenFoam and complex numbers | panara | OpenFOAM Pre-Processing | 3 | June 13, 2017 06:25 |
Superlinear speedup in OpenFOAM 13 | msrinath80 | OpenFOAM Running, Solving & CFD | 18 | March 3, 2015 06:36 |
How can I use complex numbers in OpenFOAM. | zola | OpenFOAM Programming & Development | 0 | November 19, 2009 15:49 |
IcoFoam parallel woes | msrinath80 | OpenFOAM Running, Solving & CFD | 9 | July 22, 2007 03:58 |
Could anybody help me see this error and give help | liugx212 | OpenFOAM Running, Solving & CFD | 3 | January 4, 2006 19:07 |