This figure shows the schematic of the case under consideration: a circular hole of radius
in a square plate, with an uniaxial load of
being applied along the
-axis. The following code, written in C, calculates the elastis stress fields along the
- and
-axes — the axes along and perpendicular to the applied stress direction, respectively.
The stress fields of such a cavity in a square plate is given by the following expressions, where
refers to the angle between the line joining the point
(at which stress is being calcualted) to the centre of the cavity and the direction of applied stress. See p. 109 of Elasticity by J R Barber (2nd Edition, Kluwer Academic Publishers, 2002 (print), 2004(E-book)), Equations 8.74-8.76. The stresses are given in the
coordinate system.



Here is the code, written in C (which, I am distributing under GPL license). Have fun!
/************ This program calculates the elastic stress fields of a circular hole in a square plate under an uniaxial stress. The stress is applied along the x-axis. For the expressions used in calculating the stress fields, see p. 109 of Elasticity by Barber -- Equations 8.74, 8.75, and 8.76. Author: M P Gururajan License: [http://www.gnu.org/copyleft/gpl.html GPL] ************/ #include<stdio.h> #include<stdlib.h> #include<math.h> int main(void){ FILE *fp1, *fp2, *fp3; double S; /* Applied uniaxial stress */ double a; /* Radius of the circular hole */ double r; /* Distance along the x- or y-axis */ int i; double s11, s12, s22; /* The 11, 12 and 22 stress fields, respectively */ /* Let us indicate the applied uniaxial stress and radius of the hole */ S = 1.0; a = 2.5; /* The stress fields in a direction parallel to the applied stress (from the centre of the hole along x-axis)*/ fp1 = fopen("sigma11_x","w"); fp2 = fopen("sigma22_x","w"); fp3 = fopen("sigma12_x","w"); /* Inside the cavity, the stresses are zero; for outside, we use the equations noted above */ for(i=0;i<3000; ++i){ r = 0.01*i; if (r < a){ s11 = s12 = s22 = 0.0; } else{ s11 = 0.5*S*(1. - a*a/(r*r)) + 0.5*S*(3.*a*a*a*a/(r*r*r*r) - 4.*a*a/(r*r) + 1.); s22 = 0.5*S*(1. + a*a/(r*r)) - 0.5*S*(3.*a*a*a*a/(r*r*r*r) + 1.); s12 = 0.0; } fprintf(fp1,"%le %le\n",r,s11); fprintf(fp2,"%le %le\n",r,s22); fprintf(fp3,"%le %le\n",r,s12); } fclose(fp1); fclose(fp2); fclose(fp3); /* The stress fields in a direction perpendicular to the applied stress (from centre of the hole along y-axis) */ fp1 = fopen("sigma11_y","w"); fp2 = fopen("sigma22_y","w"); fp3 = fopen("sigma12_y","w"); for(i=0;i<3000; ++i){ r = 0.01*i; if (r < a){ s11 = s12 = s22 = 0.0; } else{ s22 = 0.5*S*(1. - a*a/(r*r)) - 0.5*S*(3.*a*a*a*a/(r*r*r*r) - 4.*a*a/(r*r) + 1.); s11 = 0.5*S*(1. + a*a/(r*r)) + 0.5*S*(3.*a*a*a*a/(r*r*r*r) + 1.); s12 = 0.0; } fprintf(fp1,"%le %le\n",r,s11); fprintf(fp2,"%le %le\n",r,s22); fprintf(fp3,"%le %le\n",r,s12); } fclose(fp1); fclose(fp2); fclose(fp3); return 0; }







Testing if I can make comments! It works!