Skip to content

Commit

Permalink
Minor nonbreaking update to handle tangentially oriented elements in …
Browse files Browse the repository at this point in the history
…the automatic mesh orientation calculation
  • Loading branch information
kevmoor committed Sep 3, 2024
1 parent ce255b8 commit ff1fc4b
Showing 1 changed file with 8 additions and 2 deletions.
10 changes: 8 additions & 2 deletions src/meshing_utilities.jl
Original file line number Diff line number Diff line change
Expand Up @@ -1133,13 +1133,19 @@ function calculateElementOrientation(mesh)
elpos = (p1.+p2)./2

Psi_d[i] = -atand(elpos[1],elpos[2]).-90.0 #global yaw position, this calculation is agnostic to vertical elements, keep in mind that top dead center is 0 degrees yaw


if mesh.type[i] == 4 # treat tangentially aligned mesh components different than radially aligned
Psi_d[i] -= 90.0
twist_d[i] += 90.0
end

# Now with the global yaw position know, get the node points in a consistent frame of reference to calculate the delta, or the slope of the element
p1[1],p1[2],p1[3] = rigidBodyRotation(p1[1],p1[2],p1[3],[-Psi_d[i]],[3])
p2[1],p2[2],p2[3] = rigidBodyRotation(p2[1],p2[2],p2[3],[-Psi_d[i]],[3])

v=p2-p1

v[abs.(v).<1e-7] .= 0.0 #zero out close to zero differences

Theta_d[i] = atand(v[1],v[3]).-90.0

lenv[i] = LinearAlgebra.norm(v) #calculate element length
Expand Down

0 comments on commit ff1fc4b

Please sign in to comment.