|
[Sponsors] |
October 7, 2011, 09:23 |
atan(s) function. openFoam
|
#1 |
Member
luca
Join Date: Feb 2011
Posts: 34
Rep Power: 15 |
Hi
I can see that the function atan(s) in openFoam can only give results in the 1st and 4th quadrant. (angles between -pi and +pi) My angle can variate between 0 and 2pi. Is there any function in openFoam which can give the right result? I know in Matlab is called atan2(s) but openFoam does not recognise that. Any idea??? Thanks |
|
October 7, 2011, 09:41 |
|
#2 |
Retired Super Moderator
Bruno Santos
Join Date: Mar 2009
Location: Lisbon, Portugal
Posts: 10,981
Blog Entries: 45
Rep Power: 128 |
Hi Luca,
When in doubt about some detail like this, check the code documentation: http://www.openfoam.com/docs/cpp/ Here's the proof that atan2 does exist in OpenFOAM: http://foam.sourceforge.net/docs/cpp...ce.html#l00085 - AFAIK it's the standard C/C++ libraries that don't have atan2. To use it, you might need to call it by the full path name: Code:
value = Foam::atan2(x,y); Code:
value = atan2(x,y); Best regards, Bruno
__________________
|
|
October 7, 2011, 09:59 |
|
#3 |
Member
luca
Join Date: Feb 2011
Posts: 34
Rep Power: 15 |
Thanks a lot.
I was trying atan2(s) but of course it needs 2 variables atan2(x,y). |
|
August 11, 2016, 09:35 |
|
#4 |
Member
Join Date: Nov 2012
Posts: 83
Rep Power: 14 |
in doubleScalar it is
atan (y,x) |
|
Tags |
atan, function, openfoam |
|
|
Similar Threads | ||||
Thread | Thread Starter | Forum | Replies | Last Post |
bug in "average" function of OpenFOAM | jms | OpenFOAM | 0 | March 22, 2011 05:04 |
Cross-compiling OpenFOAM 1.7.0 on Linux for Windows 32 and 64bits with Mingw-w64 | wyldckat | OpenFOAM Announcements from Other Sources | 3 | September 8, 2010 07:25 |
Modified OpenFOAM Forum Structure and New Mailing-List | pete | Site News & Announcements | 0 | June 29, 2009 06:56 |
Could you please help me about the VTKFoam | liugx212 | OpenFOAM Pre-Processing | 5 | February 13, 2008 12:31 |
OpenFoam 14 installation problem | gfcoppola | OpenFOAM Installation | 20 | November 2, 2007 14:38 |