CFD Online Logo CFD Online URL
www.cfd-online.com
[Sponsors]
Home > Forums > General Forums > Main CFD Forum

Shape function gradients with 3D boudary elements

Register Blogs Members List Search Today's Posts Mark Forums Read

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
Old   January 18, 2016, 15:52
Default Shape function gradients with 3D boudary elements
  #1
New Member
 
Jay
Join Date: Jan 2016
Posts: 7
Rep Power: 10
jfieldstone is on a distinguished road
Hello all,

I am developing a 3D boundary element program where I have only surface elements (4-node quads and 3-node tris), but that are oriented in 3D space. Likewise, I want to compute x,y,z gradients on each of these faces.

I have a nodal solution (phi), and I want to compute dphi/dx, dphi/dy, dphi/dz.

I have successfully done this for quads, but cannot seem to figure it out for triangles.

For the quad-4 with linear shape functions:
N = [1/4*(1+xi)*(1+eta) 1/4(1+xi)*(1-eta) 1/4(1-xi)*(1-eta) 1/4(1-xi)*(1-eta)]
I can compute the differential operators in x,y,z (dNdx, dNdy, and dNdz) by simply computing 2 tangential vectors (dxdxi, dxdeta, dydxi, dydeta, dzdxi, dzdeta):
e1 = dNdxi*[ex,ey,ez]
and
e2 = dNdeta*[ex,ey,ez]

Taking the cross product of these gives me my surface gradient:
e3 = cross(e1,e2)

Then using these 3 vectors as my jacobian:
Jac = [e1; e2; e3];

I can invert my jacobian to compute dxidx,dxidy,dxidz, detadx,detady,detadz, and finally post multiply with dNdxi and dNdeta again to compute dNdx, dNdy, dNdz:

dNdx = Jac(1,1)^-1*dNdxi + Jac(1,2)^-1*dNdeta
dNdy = Jac(2,1)^-1*dNdxi + Jac(2,2)^-1*dNdeta
dNdz = Jac(3,1)^-1*dNdxi + Jac(3,2)^-1*dNdeta

These work well, and I get the correct gradients.

But now for the 3-node triangle, it's not so straight forward. I have formulated the TRI-3 with 3 local coordinates (xi, eta, and zeta), where my shape functions are just:
N = [xi eta zeta],
and so:
dN = I (identity).

How can I compute dNdx, dNdy, and dNdz for the linear 3-node triangle?

Any help is appreciated, and thank you in advance.
jfieldstone is offline   Reply With Quote

Old   January 18, 2016, 16:30
Default
  #2
Senior Member
 
Filippo Maria Denaro
Join Date: Jul 2010
Posts: 6,760
Rep Power: 71
FMDenaro has a spectacular aura aboutFMDenaro has a spectacular aura aboutFMDenaro has a spectacular aura about
I am not sure about my answer, so sorry if I have not understood your question.

Consider a 3D tethraedron (4-nodes) where you define linear shape function Ni(x,y,z) (i=1,..4).

The Grad operator is: i d/dx + j d/dy + k d/dz (in bold the unit vectors in the Cartesian reference system).
Now what is the problem in computing analytically the gradient?
FMDenaro is offline   Reply With Quote

Old   January 23, 2016, 04:34
Default
  #3
Senior Member
 
adrin
Join Date: Mar 2009
Posts: 115
Rep Power: 17
adrin is on a distinguished road
The quad element has curvature; the tri element with linear shape functions does _not_ have curvature! I think this should explain your problem.

adrin
adrin is offline   Reply With Quote

Old   January 27, 2016, 11:26
Default
  #4
New Member
 
Jay
Join Date: Jan 2016
Posts: 7
Rep Power: 10
jfieldstone is on a distinguished road
Quote:
Originally Posted by FMDenaro View Post
I am not sure about my answer, so sorry if I have not understood your question.

Consider a 3D tethraedron (4-nodes) where you define linear shape function Ni(x,y,z) (i=1,..4).

The Grad operator is: i d/dx + j d/dy + k d/dz (in bold the unit vectors in the Cartesian reference system).
Now what is the problem in computing analytically the gradient?
Hi, thanks for the reply.

I am referring to a 3D boundary element, not a 3D volume element. So image that I want to compute a gradient in 3 dimensions, on the face the tetrahedron.

This is what I am trying to do.

Here, you cannot use standard 2D formulations, but since it is a boundary element, standard 3D volume formulations also do not apply.
jfieldstone is offline   Reply With Quote

Old   January 27, 2016, 11:29
Default
  #5
New Member
 
Jay
Join Date: Jan 2016
Posts: 7
Rep Power: 10
jfieldstone is on a distinguished road
Quote:
Originally Posted by adrin View Post
The quad element has curvature; the tri element with linear shape functions does _not_ have curvature! I think this should explain your problem.

adrin
Hi, thanks for the reply.

I agree that a quad could have a torsional curvature to it, and the triangle cannot represent this, however, this has no bearing on computing the derivatives over the surface. I agree that the normal would vary across the panel, and this could be computed using the formulation in my original post, where xi and eta would be evaluated at various points (say guass points), and the normal would be calculated to be different across the element.

However, leaving this issue out of it (say, for example, that I do not allow any torsion in any quads), I still cannot derive how to compute a discrete exterior gradient over the triangular element.
jfieldstone is offline   Reply With Quote

Old   January 27, 2016, 12:31
Default
  #6
Senior Member
 
Filippo Maria Denaro
Join Date: Jul 2010
Posts: 6,760
Rep Power: 71
FMDenaro has a spectacular aura aboutFMDenaro has a spectacular aura aboutFMDenaro has a spectacular aura about
I am confused in terms of the problem you want to solve...
think a simple example of boundary element method such as the panel method on airfoil. You MUST fix the normal component of the velocity that directly imply a condition on the normal derivative. So I think that what you want to compute is actually a BC dependent issue.

However, it the shape function are linear, any derivative produce a constant value
FMDenaro is offline   Reply With Quote

Old   January 28, 2016, 03:49
Default
  #7
Senior Member
 
adrin
Join Date: Mar 2009
Posts: 115
Rep Power: 17
adrin is on a distinguished road
I'm having a bit of a hard time following your formulations/notations (even for the quad element). N is a 4-element vector, so how does dN/dxi*[ex,ey,ez] lead to e1, which appears to be a 3-element vector?

For the Tri element, zeta is not independent; it should be zeta = 1 - xi - eta. Also, I don't get how you arrived at dN = I (part of it has to do with dN vs dN/d(something) and the other part is with I itself; is it a vector, tensor, ...?)

adrin
adrin is offline   Reply With Quote

Old   February 3, 2016, 12:00
Default
  #8
New Member
 
Jay
Join Date: Jan 2016
Posts: 7
Rep Power: 10
jfieldstone is on a distinguished road
Quote:
Originally Posted by FMDenaro View Post
I am confused in terms of the problem you want to solve...
think a simple example of boundary element method such as the panel method on airfoil. You MUST fix the normal component of the velocity that directly imply a condition on the normal derivative. So I think that what you want to compute is actually a BC dependent issue.

However, it the shape function are linear, any derivative produce a constant value
Just take a triangle arbitrarily oriented in space. Each corner of the triangle has a node, and with that node, x,y,z coordinates, and some value phi. eg. Node (i) has the coordinates x_i,y_i,z_i, and phi value phi_i.

I want to linearly interpolate over the triangular element, so I use the interpolation functions N = [xi eta zeta].

where xi, eta, and zeta are the local coordinates aligned with each corner->side direction.

Taking the derivative of N with respect to xi, eta, and zeta, you get I = [1 0 0; 0 1 0; 0 0 1].

I now want to linearly interpolate the gradient of phi across the triangular element: dphi/dX. where X = [x,y,z]. eg. dphi/dX = [dphi/dx dphi/dy dphi/dz].

This is what I am trying to compute.
jfieldstone is offline   Reply With Quote

Old   February 3, 2016, 12:10
Default
  #9
New Member
 
Jay
Join Date: Jan 2016
Posts: 7
Rep Power: 10
jfieldstone is on a distinguished road
Quote:
Originally Posted by adrin View Post
I'm having a bit of a hard time following your formulations/notations (even for the quad element). N is a 4-element vector, so how does dN/dxi*[ex,ey,ez] lead to e1, which appears to be a 3-element vector?

For the Tri element, zeta is not independent; it should be zeta = 1 - xi - eta. Also, I don't get how you arrived at dN = I (part of it has to do with dN vs dN/d(something) and the other part is with I itself; is it a vector, tensor, ...?)

adrin
Thanks for your interest! Sorry, let me clarify.

For the QUAD4, N is [0.25*(1-xi)*(1+eta) 0.25*(1+xi)*(1+eta) 0.25*(1+xi)*(1-eta) 0.25*(1-xi)*(1-eta)]

Taking the derivative with respect to xi and eta, dN/dxi = [-0.25*(1+eta) 0.25*(1+eta) 0.25*(1-eta) -0.25*(1-eta)] and dN/deta = [0.25*(1-xi) 0.25*(1+xi) -0.25*(1+xi) -0.25*(1-xi)]

letting dN = [dN/dxi ; dN/deta], dN will be a 2 x 4 matrix.

e1 = dN/dxi*[ex ey ez] is a 1x3 row vector because ex, ey, and ez are 4 component column vectors, and dNdxi is a 1x4 row vector.

Likewise, e2 = dN/deta*[ex ey ez], is a 1x3 row vector.

e3 = e1 x e2, is a 1x3 row vector.

J = [e1;e2;e3], is the 3x3 Jacobian matrix.
Then by inverting the Jacobian, the gradients of the shape functions are calculated:

dNdx = J^-1(1,1:2)*dN
dNdy = J^-1(2,1:2)*dN
dNdz = J^-1(3,1:2)*dN


For the 3 node triangle, see my above response to @FMDenaro how I got dN = I.I am now looking into using 2 independent local coordinates instead of 3 to see if I can analogously compute the gradient like with the quad.
jfieldstone is offline   Reply With Quote

Old   February 3, 2016, 12:28
Default
  #10
Senior Member
 
Filippo Maria Denaro
Join Date: Jul 2010
Posts: 6,760
Rep Power: 71
FMDenaro has a spectacular aura aboutFMDenaro has a spectacular aura aboutFMDenaro has a spectacular aura about
Quote:
Originally Posted by jfieldstone View Post
Just take a triangle arbitrarily oriented in space. Each corner of the triangle has a node, and with that node, x,y,z coordinates, and some value phi. eg. Node (i) has the coordinates x_i,y_i,z_i, and phi value phi_i.

I want to linearly interpolate over the triangular element, so I use the interpolation functions N = [xi eta zeta].

where xi, eta, and zeta are the local coordinates aligned with each corner->side direction.

Taking the derivative of N with respect to xi, eta, and zeta, you get I = [1 0 0; 0 1 0; 0 0 1].

I now want to linearly interpolate the gradient of phi across the triangular element: dphi/dX. where X = [x,y,z]. eg. dphi/dX = [dphi/dx dphi/dy dphi/dz].

This is what I am trying to compute.

I am not sure about my proposal, however check it.
in the (x,y,z) the Grad phi = i dphi/dx + j dphi/dy + k dphi/dz that can be equate to the expression of the gradient in the local (orthogonal) reference system on the triangle. That means for example that from the equality of the expression you can compute dphi/dx by scalar product with i and so on for the other derivatives. In conclusion you need only the angles of orientation
FMDenaro is offline   Reply With Quote

Old   February 3, 2016, 13:16
Default
  #11
New Member
 
Jay
Join Date: Jan 2016
Posts: 7
Rep Power: 10
jfieldstone is on a distinguished road
Note, formulating the triangle element as 2 local coordinates, rather than three, you can just use the same theory as the quad above.

Set zeta = 1-xi-eta and proceed.
jfieldstone is offline   Reply With Quote

Old   February 3, 2016, 13:28
Default
  #12
Senior Member
 
Filippo Maria Denaro
Join Date: Jul 2010
Posts: 6,760
Rep Power: 71
FMDenaro has a spectacular aura aboutFMDenaro has a spectacular aura aboutFMDenaro has a spectacular aura about
Quote:
Originally Posted by jfieldstone View Post
Note, formulating the triangle element as 2 local coordinates, rather than three, you can just use the same theory as the quad above.

Set zeta = 1-xi-eta and proceed.

using normalized areal coordinates that is correct
FMDenaro is offline   Reply With Quote

Reply

Tags
boundary element, differential operators

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are Off
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
Shape function gradients with 3D boudary elements jfieldstone Structural Mechanics 0 January 18, 2016 15:33
Ansys SIG$ILL error loth ANSYS 3 December 24, 2015 06:31
Hexahedral element shape function and interpolating function Lateef CFD Freelancers 0 December 10, 2015 18:41
Mesh elements shape on faces Mohsin FLUENT 3 August 17, 2011 03:37
CFX4.3 -build analysis form Chie Min CFX 5 July 13, 2001 00:19


All times are GMT -4. The time now is 07:37.