|
[Sponsors] |
March 4, 2014, 03:54 |
cyclic boundary condition
|
#1 |
Member
Kan
Join Date: Feb 2014
Location: Australia
Posts: 54
Rep Power: 12 |
Dear OpenFoamer,
I've tried to write this cyclic or periodic boundary condition code by myself. For the velocity between two connected surface, I use the transformation matrix to change the direction of velocity. In order to calculate this matrix, the normal and tangent vectors of surface should be inputted. For instance, nA = [-sin(theta_A), cos(theta_A), 0.0] t1A = [cos(theta_A), sin(theta_A), 0.0] however, there is certain error between real value of nA and calculated one. if theta_A = 30 degree. cos(theta_A) should be equal to sqrt(3)/2, but for the double type value in C++, the calculated result of cos(theta_A) is slightly different from real value, and then make the mass flux through two connected surfaces different. So how can I fix this bug? Thanks in advance |
|
March 4, 2014, 07:39 |
|
#2 |
Senior Member
Joachim Herb
Join Date: Sep 2010
Posts: 650
Rep Power: 22 |
The C++ functions use radians angle values: http://www.cplusplus.com/reference/cmath/cos/
|
|
March 4, 2014, 20:59 |
|
#3 | |
Member
Kan
Join Date: Feb 2014
Location: Australia
Posts: 54
Rep Power: 12 |
Quote:
I did use radian angle in my calculation. Thanks |
||
March 9, 2014, 06:59 |
|
#4 |
New Member
Tenglubao
Join Date: Feb 2013
Posts: 5
Rep Power: 13 |
Maybe,you can try" Foam::sin(theta_A)"
|
|
|
|
Similar Threads | ||||
Thread | Thread Starter | Forum | Replies | Last Post |
Understanding the cyclic boundary condition | leroyv | OpenFOAM Running, Solving & CFD | 10 | May 31, 2020 10:05 |
mixed inflow/outflow downstream boundary condition question | peob | OpenFOAM Running, Solving & CFD | 3 | February 3, 2017 11:54 |
cyclic boundary condition | flotran | OpenFOAM | 3 | December 19, 2011 21:13 |
can I use cyclic boundary condition to modeling axisymmetric flow ? | mechy | OpenFOAM | 0 | July 8, 2011 15:16 |
cyclic boundary condition doesn't work in a tube ?? | Cyp | OpenFOAM | 6 | April 16, 2010 16:21 |