Advertisement

calc reynolds number having a triangle, velocity vector, fluid data

Started by February 05, 2016 09:25 PM
2 comments, last by _WeirdCat_ 8 years, 7 months ago

found that raynolads num can be computes as following:

Rn = VL / v

where V is Velocity Vector

L Length of the fluid that has to traverse through area (in this case triangle)

v fluid viscosity

how do i determine L knowing triangle normal, points, distance, and velocity vector so i could compute the length on that triangle?

max triangle length in the direction of flow might be a good first approximation.

Norm Barrows

Rockland Software Productions

"Building PC games since 1989"

rocklandsoftware.net

PLAY CAVEMAN NOW!

http://rocklandsoftware.net/beta.php

Advertisement

i think i will be forced to project vector onto that surface then extend it in both directions by square of distance of the farest vertex to tri center, then apply 3x segment-plane intersection to find cut points and somehow test them if they are near or in triangle (due to floatpoint inaccuracy) :x

I have a problem:

my choordlen is calculated wrongly i am not sure what is wrong:

basic idea is that i slice the projected velocity ray with all sides of polygon.










inline float getChoordLength(vec3 velocity, vec3 surf_normal, vec3 pC, vec3 * verts, int vert_count)
{
//Project velocity vector onto surface
vec3 projected = Normalize(ProjectVectorOnPlane(surf_normal, velocity));

//find the biggest side and square it - this will ensure us that ray will always hit two sides
float adst = -999.0;
for (int i=0; i < vert_count; i++)
{
int next = i + 1;
if (next == vert_count) next = 0;
adst = Max(adst, n3ddistance(verts[i],verts[i+1]));
}
adst = adst*adst;

//compute ray
vec3 rA = pC - projected*adst;
vec3 rB = pC + projected*adst;

vec3 cp;

for (int i=0; i < vert_count; i++)
cp = cp + verts[i];

cp = cp / float(vert_count);

vec3 n  = surf_normal*1000.0;

vec3 colp;
//we compute center point to determine whenever a side face is at front or back to the center point (because i don't need to waste time and run math on paper i can just check that and use it for further processing)
int cpside;
for (int i=0; i < vert_count; i++)
{
int next = i + 1;
if (next == vert_count) next = 0;

vec3 normal = Normal(verts[i], verts[next], verts[next] + n, true);
float dst = getplaneD(normal, verts[i]);
//cpside will now determine the
if (i == 0) cpside = classifyapointagainstaplane(cp, normal, dst); // which side faces 'the inside' of polygon  (always either front or bakc never on plane) - solid convex polygon
if (cpside != isBack) //when center point is not behind side plane
{
normal = -normal;
dst = getplaneD(normal, verts[i]);
}


if (SegmentPlaneIntersection(normal, dst, rA, rB, colp))
{
if (dot(Normalize(vectorAB(rA,rB)), normal) < 0) rA = colp;
else rB = colp;
}

}


return n3ddistance(rA, rB);
}

SOmetimes choord len is way bigger than even squared polygon area

BOX: 0 tri: 1 choord len: 5829.15673828125


A: 56.4643363952637 -1.57975578308105 53.5295028686523
B: 51.9471397399902 -1.47248387336731 54.9943962097168
C: 51.9648056030273 -0.764087855815887 54.9969902038574

edited: nvm i pass different surface_normal that is created by these points, due to fact of simplification of a body shape, thus i need to project points onto passed surface normal. well thats what i think the problem is

This topic is closed to new replies.

Advertisement