|
[Sponsors] |
May 12, 2004, 13:54 |
Angle two vectors.
|
#1 |
Guest
Posts: n/a
|
Good morning,
I am looking to calculate the angle between two 3D vectors in my CFD results. I can do this mathematically, but I don't know how to implement it in code for a general coordinate system. Has anyone any ideas were I can learn how to use standard CFD code to calculate such quantities?? |
|
May 13, 2004, 02:28 |
Re: Angle two vectors.
|
#2 |
Guest
Posts: n/a
|
<html xmlns="urn:schemas-microsoft-comfficeffice" xmlns:w="urn:schemas-microsoft-comffice:word" xmlns="http://www.w3.org/TR/REC-html40">
<head> <meta http-equiv=Content-Type content="text/html; charset=windows-1255"> <meta name=ProgId content=Word.Document> <meta name=Generator content="Microsoft Word 10"> <meta name=Originator content="Microsoft Word 10"> <link rel=File-List href="dot_files/filelist.xml"> <title>This actually is just basic vector analysis</title> <!--[if gte mso 9]><xml> <w:WordDocument> <w:SpellingState>Clean</w:SpellingState> <w:GrammarState>Clean</w:GrammarState> <w:Compatibility> <w:BreakWrappedTables/> <w:SnapToGridInCell/> <w:WrapTextWithPunct/> <w:UseAsianBreakRules/> </w:Compatibility> <w:BrowserLevel>MicrosoftInternetExplorer4</w:BrowserLevel> </w:WordDocument> </xml><![endif]--> <style> </style> <!--[if gte mso 10]> <style> /* Style Definitions */ table.MsoNormalTable {mso-style-name:"Table Normal"; mso-tstyle-rowband-size:0; mso-tstyle-colband-size:0; mso-style-noshow:yes; mso-style-parent:""; mso-padding-alt:0in 5.4pt 0in 5.4pt; mso-para-margin:0in; mso-para-margin-bottom:.0001pt; mso-pagination:widow-orphan; font-size:10.0pt; font-family:"Times New Roman";} </style> <![endif]--> </head> <body lang=EN-US style='tab-interval:.5in'> <div class=Section1> <p class=MsoNormal>This actually is just basic vector analysis. The scalar product of two vectors, a and b <span class=GramE>is<span style='mso-spacerun:yes'>* </span>a</span> · b = |a| |b| <span class=SpellE>cos<span style='font-family:Symbol'>f , </span>from</span> which <span style='font-family:Symbol'>f</span> – the angle between a and b – may be solved. <p class=MsoNormal><o>*</o> <p class=MsoNormal><o>*</o> </div> </body> </html> |
|
May 13, 2004, 09:33 |
Re: Angle two vectors.
|
#3 |
Guest
Posts: n/a
|
I know that, but how do I implement it numerically. How do I implement it numerically? How do I calculate that angle using code?
|
|
May 13, 2004, 10:15 |
Re: Angle two vectors.
|
#4 |
Guest
Posts: n/a
|
Fortran implementation:
real a(3), b(3) AdotA = a(1)*a(1) + a(2)*a(2) + a(3)*a(3) BdotB = b(1)*b(1) + b(2)*b(2) + b(3)*b(3) den = AdotA*BdotB if(den .gt. 0.) then AdotB = a(1)*b(1) + a(2)*b(2) + a(3)*b(3) cosphi = AdotB / sqrt(den) phi = acos(cosphi) endif |
|
May 16, 2004, 07:48 |
Re: Angle two vectors.
|
#5 |
Guest
Posts: n/a
|
Thank you.
If I have two grid lines, which are not orthogonal, how can I find the angle between them? What term do I use to describe their direction? Also, how is this done in a general curvilinear coordinate system? How can I find the angle between a grid line and a velocity field for example. |
|
May 19, 2004, 13:58 |
Re: Angle two vectors.
|
#6 |
Guest
Posts: n/a
|
give me ur email i will drop u an email how to calculate what u need. (i understood that u want to use that in calculation for CFD, say for angle between the faces etc.)
|
|
May 20, 2004, 05:06 |
Re: Angle two vectors.
|
#7 |
Guest
Posts: n/a
|
Hi zxaar,
This is my email account address as requested: cfd_user_uk@yahoo.co.uk I would appreciate any help you can give me for this problem. Thank you. "give me ur email i will drop u an email how to calculate what u need. (i understood that u want to use that in calculation for CFD, say for angle between the faces etc.) " |
|
|
|
Similar Threads | ||||
Thread | Thread Starter | Forum | Replies | Last Post |
InterFoam contact angle | JoaoMiranda | OpenFOAM Running, Solving & CFD | 7 | October 20, 2016 06:27 |
[Netgen] Import netgen mesh to OpenFOAM | hsieh | OpenFOAM Meshing & Mesh Conversion | 32 | September 13, 2011 05:50 |
What does velocity angle mean? | wateraction | FLUENT | 0 | May 19, 2011 03:01 |
Normal vector, slope and aspect angle | g_niro | Main CFD Forum | 0 | February 2, 2011 17:24 |
Integration Points and normal area vectors | Bloshchitsyn Vladimir | CFX | 0 | November 26, 2007 07:35 |