SvenHildering
Civil/Environmental
- Jul 15, 2014
- 2
Hee guys,
I just started using Ansys to create a shell structure which I will investigate on numerous subjects for my bachelor thesis. I design the structure with .mac files which I create in notepad.
The following code I made for a simple shell which can be bended in two directions and twisted:
! define variables
kxx = 3/2000 ! 1/mm kromming in de x-richting
kyy = -3/2000 ! 1/mm kromming in de y-richting
kxy = 0 ! 1/mm twist
t = 10 ! mm dikte
lx = 1000 ! mm lengte in de x-richting
ly = 1000 ! mm lengte in de y-richting
E = 2.1e11 ! N/mm2 elasticiteitsmodulus
nu = 0.00 ! - dwarscontractiecoefficient
nx = 10 ! - aantal elementen in de x-richting
ny = 10 ! - aantal elementen in de y-richting
rho = 7000 ! kg/m3 dichtheid
/PREP7
MPTEMP,,,,,,,, ! materiaal: isotroop
MPTEMP,1,0
MPDATA,EX,1,,E
MPDATA,PRXY,1,,nu
MPDATA,DENS,1,,rho ! Definieer dichtheid
ET,1,SHELL281 ! element type: 8 node quadrilateral
R,1,t,t,t,t, , , ! element dikte
*DO,i,0,nx !put nodes,
*DO,j,0,2*ny
x=-lx/2+i*lx/nx
y=-ly/2+j*ly/(2*ny)
z1=0.5*kxx*x*x
z2=kxy*x*y
z3=0.5*kyy*y*y
z=z1+z2+z3
N,,x,y,z,,,
*ENDDO
*ENDDO
*DO,i,0,nx-1 !put nodes, mid nodes op x-as,
*DO,j,0,ny
x=-lx/2+lx/(2*nx)+i*lx/nx
y=-ly/2+j*ly/ny
z1=0.5*kxx*x*x
z2=kxy*x*y
z3=0.5*kyy*y*y
z=z1+z2+z3
N,,x,y,z,,,
*ENDDO
*ENDDO
*DO,j,1,ny ! elements
*DO,i,1,nx
k1=1+(i-1)*2+(j-1)*(3*nx+2)
k2=1+i+(2+(j-1)*3)*nx+(j-1)*2
k3=1+(i-1)*2+j*(3*nx+2)
E,k3,k3+2,k1+2,k1,k3+1,k2+1,k1+1,k2
*ENDDO
*ENDDO
*DO,i,1,2*nx+1 ! hinges
D,i ,,0,,,,UX,UY,UZ,,,
D,(2*nx+1)*ny+(nx+1)*ny+i ,,0,,,,UX,UY,UZ,,,
*ENDDO
*DO,j,1,ny
D,(2+(j-1)*3)*nx+2*(j-1)+2 ,,0,,,,UX,UY,UZ,,,
D,(3+(j-1)*3)*nx+2*(j-1)+2 ,,0,,,,UX,UY,UZ,,,
*ENDDO
*DO,j,2,ny
D,1+(j-1)*(3*nx+2) ,,0,,,,UX,UY,UZ,,,
D,1+(j-1)*(3*nx+2)+2*nx ,,0,,,,UX,UY,UZ,,,
*ENDDO
ACEL,0,0,+1, ! add Self-weight
FINISH
/SOLU ! bereken
SOLVE
FINISH
When I run it, I get a visually perfect node mesh, but I also get an error which states the following:
Quadrilateral element 1 has a zero or negative determinant of the Jacobian matrix at one of its sampling locations. Midside ndoes, if any, may be poorly positioned.
Due to this error, element one can not be constructed, and the script stop running.
Can someone of you please help me fix this problem!
I just started using Ansys to create a shell structure which I will investigate on numerous subjects for my bachelor thesis. I design the structure with .mac files which I create in notepad.
The following code I made for a simple shell which can be bended in two directions and twisted:
! define variables
kxx = 3/2000 ! 1/mm kromming in de x-richting
kyy = -3/2000 ! 1/mm kromming in de y-richting
kxy = 0 ! 1/mm twist
t = 10 ! mm dikte
lx = 1000 ! mm lengte in de x-richting
ly = 1000 ! mm lengte in de y-richting
E = 2.1e11 ! N/mm2 elasticiteitsmodulus
nu = 0.00 ! - dwarscontractiecoefficient
nx = 10 ! - aantal elementen in de x-richting
ny = 10 ! - aantal elementen in de y-richting
rho = 7000 ! kg/m3 dichtheid
/PREP7
MPTEMP,,,,,,,, ! materiaal: isotroop
MPTEMP,1,0
MPDATA,EX,1,,E
MPDATA,PRXY,1,,nu
MPDATA,DENS,1,,rho ! Definieer dichtheid
ET,1,SHELL281 ! element type: 8 node quadrilateral
R,1,t,t,t,t, , , ! element dikte
*DO,i,0,nx !put nodes,
*DO,j,0,2*ny
x=-lx/2+i*lx/nx
y=-ly/2+j*ly/(2*ny)
z1=0.5*kxx*x*x
z2=kxy*x*y
z3=0.5*kyy*y*y
z=z1+z2+z3
N,,x,y,z,,,
*ENDDO
*ENDDO
*DO,i,0,nx-1 !put nodes, mid nodes op x-as,
*DO,j,0,ny
x=-lx/2+lx/(2*nx)+i*lx/nx
y=-ly/2+j*ly/ny
z1=0.5*kxx*x*x
z2=kxy*x*y
z3=0.5*kyy*y*y
z=z1+z2+z3
N,,x,y,z,,,
*ENDDO
*ENDDO
*DO,j,1,ny ! elements
*DO,i,1,nx
k1=1+(i-1)*2+(j-1)*(3*nx+2)
k2=1+i+(2+(j-1)*3)*nx+(j-1)*2
k3=1+(i-1)*2+j*(3*nx+2)
E,k3,k3+2,k1+2,k1,k3+1,k2+1,k1+1,k2
*ENDDO
*ENDDO
*DO,i,1,2*nx+1 ! hinges
D,i ,,0,,,,UX,UY,UZ,,,
D,(2*nx+1)*ny+(nx+1)*ny+i ,,0,,,,UX,UY,UZ,,,
*ENDDO
*DO,j,1,ny
D,(2+(j-1)*3)*nx+2*(j-1)+2 ,,0,,,,UX,UY,UZ,,,
D,(3+(j-1)*3)*nx+2*(j-1)+2 ,,0,,,,UX,UY,UZ,,,
*ENDDO
*DO,j,2,ny
D,1+(j-1)*(3*nx+2) ,,0,,,,UX,UY,UZ,,,
D,1+(j-1)*(3*nx+2)+2*nx ,,0,,,,UX,UY,UZ,,,
*ENDDO
ACEL,0,0,+1, ! add Self-weight
FINISH
/SOLU ! bereken
SOLVE
FINISH
When I run it, I get a visually perfect node mesh, but I also get an error which states the following:
Quadrilateral element 1 has a zero or negative determinant of the Jacobian matrix at one of its sampling locations. Midside ndoes, if any, may be poorly positioned.
Due to this error, element one can not be constructed, and the script stop running.
Can someone of you please help me fix this problem!