using System; using System.Collections.Generic; using System.ComponentModel; using System.Data; using System.Drawing; using System.Linq; using System.Text; using System.Windows.Forms; namespace vcsCPT { public partial class Form1 : Form { public Form1() { InitializeComponent(); } //---------------------------------------------------------------------------- private void toolStripButton1_Click(object sender, EventArgs e) { main_part(); } //---------------------------------------------------------------------------- private void main_part() { // 多重円環理論による円形圧力トンネルの応力計算 System.IO.StreamReader sr; System.IO.StreamWriter sw; string fnameR = ""; string fnameW=""; string dat; string[] sbuf; char delim = ','; int i,iii,jjj; string strcom;//コメント文 int nd;//計算組数 int STRES;//0;平面歪み,1:平面応力 //作業用変数 double PP,ar,br; double Ecc,ncc; double Ess,taa,tbb; double Egg,ngg; double ssa=0.0,ssb=0.0; double src=0.0,stc=0.0; double uaa=0.0,ubb=0.0; //入出力ファイル指定 openFileDialog1.InitialDirectory=System.IO.Directory.GetCurrentDirectory(); if(openFileDialog1.ShowDialog()==DialogResult.OK){fnameR=openFileDialog1.FileName;} if(saveFileDialog1.ShowDialog()==DialogResult.OK){fnameW=saveFileDialog1.FileName;} //データ入力 sr=new System.IO.StreamReader(fnameR,System.Text.Encoding.Default); dat=sr.ReadLine();strcom=dat; dat=sr.ReadLine();sbuf=dat.Split(delim);nd=int.Parse(sbuf[0])-1;STRES=int.Parse(sbuf[1]); double[] P=new double[nd+1]; // 内圧 double[] a=new double[nd+1]; // 水路内半径 double[] b=new double[nd+1]; // 掘削半径 double[] Ec=new double[nd+1]; // コンクリート弾性係数 double[] nc=new double[nd+1]; // コンクリートポアソン比 double[] Es=new double[nd+1]; // 鉄筋弾性係数 double[] ta=new double[nd+1]; // 内側鉄筋等価板厚 double[] tb=new double[nd+1]; // 外側鉄筋等価板厚 double[] Eg=new double[nd+1]; // 岩盤弾性係数 double[] ng=new double[nd+1]; // 岩盤ポアソン比 double[,] sigsa=new double[nd+1,4]; // 内側鉄筋応力 double[,] sigsb=new double[nd+1,4]; // 外側鉄筋応力 double[,] sigrc=new double[nd+1,4]; // コンクリート半径方向応力 double[,] sigtc=new double[nd+1,4]; // コンクリート円周方向応力 double[,] ua=new double[nd+1,4]; // 内壁半径方向変位 double[,] ub=new double[nd+1,4]; // 外壁半径方向変位 i=0; while(!sr.EndOfStream){ dat=sr.ReadLine(); sbuf=dat.Split(delim); P[i] =double.Parse(sbuf[0]); a[i] =double.Parse(sbuf[1]); b[i] =double.Parse(sbuf[2]); Ec[i]=double.Parse(sbuf[3]); nc[i]=double.Parse(sbuf[4]); Es[i]=double.Parse(sbuf[5]); ta[i]=double.Parse(sbuf[6]); tb[i]=double.Parse(sbuf[7]); Eg[i]=double.Parse(sbuf[8]); ng[i]=double.Parse(sbuf[9]); i=i+1; } sr.Close(); nd=i-1; for(iii=0;iii<=nd;iii++){ PP=P[iii];ar=a[iii];br=b[iii]; Ecc=Ec[iii];ncc=nc[iii]; Ess=Es[iii];taa=ta[iii];tbb=tb[iii]; Egg=Eg[iii];ngg=ng[iii]; for(jjj=0;jjj<=3;jjj++){ switch(jjj){ case 0: // ひび割れのない無筋コンクリート CALC0(STRES,PP,ar,br,Ecc,ncc,Ess,taa,tbb,Egg,ngg,out ssa,out ssb,out src,out stc,out uaa,out ubb);break; case 1: // ひび割れの無い単鉄筋コンクリート CALC1(STRES,PP,ar,br,Ecc,ncc,Ess,taa,tbb,Egg,ngg,out ssa,out ssb,out src,out stc,out uaa,out ubb);break; case 2: // ひび割れのある単鉄筋コンクリート CALC2(STRES,PP,ar,br,Ecc,ncc,Ess,taa,tbb,Egg,ngg,out ssa,out ssb,out src,out stc,out uaa,out ubb);break; case 3: // ひび割れのある複鉄筋コンクリート CALC3(STRES,PP,ar,br,Ecc,ncc,Ess,taa,tbb,Egg,ngg,out ssa,out ssb,out src,out stc,out uaa,out ubb);break; } sigsa[iii,jjj]=ssa; // 内側鉄筋応力 sigsb[iii,jjj]=ssb; // 外側鉄筋応力 sigrc[iii,jjj]=src; // コンクリート半径方向応力 sigtc[iii,jjj]=stc; // コンクリート円周方向応力 ua[iii,jjj]=uaa; // 内壁半径方向変位 ub[iii,jjj]=ubb; // 外壁半径方向変位 } } //データ書き込み sw=new System.IO.StreamWriter(fnameW,false, System.Text.Encoding.Default); dat=strcom;sw.WriteLine(dat); dat="nd=,"+(nd+1).ToString()+",STRES=,"+STRES.ToString();sw.WriteLine(dat); dat="入力データ";sw.WriteLine(dat); dat="i,P,a,b,Ec,nc,Es,ta,tb,Eg,ng";sw.WriteLine(dat); for(iii=0;iii<=nd;iii++){ dat=(iii+1).ToString("0"); dat=dat+"," +P[iii].ToString("E"); dat=dat+"," +a[iii].ToString("E"); dat=dat+"," +b[iii].ToString("E"); dat=dat+","+Ec[iii].ToString("E"); dat=dat+","+nc[iii].ToString("E"); dat=dat+","+Es[iii].ToString("E"); dat=dat+","+ta[iii].ToString("E"); dat=dat+","+tb[iii].ToString("E"); dat=dat+","+Eg[iii].ToString("E"); dat=dat+","+ng[iii].ToString("E"); sw.WriteLine(dat); } for(jjj=0;jjj<=3;jjj++){ switch(jjj){ case 0:dat="ひび割れのない無筋コンクリート" ;break; case 1:dat="ひび割れのない単鉄筋コンクリート" ;break; case 2:dat="ひび割れのある単鉄筋コンクリート";break; case 3:dat="ひび割れのある複鉄筋コンクリート";break; } sw.WriteLine(dat); dat="i,σsa,σsb,σrc,σtc,u(r=a),u(r=b)";sw.WriteLine(dat); for(iii=0;iii<=nd;iii++){ dat=(iii+1).ToString("0"); dat=dat+","+sigsa[iii,jjj].ToString("E"); dat=dat+","+sigsb[iii,jjj].ToString("E"); dat=dat+","+sigrc[iii,jjj].ToString("E"); dat=dat+","+sigtc[iii,jjj].ToString("E"); dat=dat+"," +ua[iii,jjj].ToString("E"); dat=dat+"," +ub[iii,jjj].ToString("E"); sw.WriteLine(dat); } } sw.Close(); } //---------------------------------------------------------------------------- private void STIF(int STRES,double EE,double po,out double AA,out double BB) { AA = 0.0; BB = 0.0; switch (STRES) { case 0: // 平面ひずみ AA = EE * (1.0 - po) / (1.0 + po) / (1.0 - 2.0 * po); BB = EE * po / (1.0 + po) / (1.0 - 2.0 * po); break; case 1: // 平面応力 AA = EE / (1.0 - po * po); BB = EE * po / (1.0 - po * po); break; } } //---------------------------------------------------------------------------- private void CALC0(int STRES,double PP,double ar,double br, double Ecc,double ncc,double Ess,double taa,double tbb,double Egg,double ngg, out double ssa,out double ssb,out double src,out double stc,out double uaa,out double ubb) { // ひび割れのない無筋コンクリート int mm = 2; double[,] sm = new double[mm + 1, mm + 2]; double Ac, Bc, C1, C2, Cg; int i, j; STIF(STRES, Ecc, ncc, out Ac, out Bc); for (i = 0; i <= mm; i++) { for (j = 0; j <= mm + 1; j++) { sm[i, j] = 0.0; } } sm[0, 0] = Ac + Bc; sm[0, 1] = -(Ac - Bc) / ar / ar; sm[1, 0] = br; sm[1, 1] = 1.0 / br; sm[1, 2] = -1.0 / br; sm[2, 0] = Ac + Bc; sm[2, 1] = -(Ac - Bc) / br / br; sm[2, 2] = Egg / (1.0 + ngg) / br / br; sm[0, 3] = -PP; MATGJ(mm, sm); C1 = sm[0, 3]; C2 = sm[1, 3]; Cg = sm[2, 3]; ssa = 0.0; ssb = 0.0; src = (Ac + Bc) * C1 - (Ac - Bc) * C2 / ar / ar; stc = (Ac + Bc) * C1 + (Ac - Bc) * C2 / ar / ar; uaa = C1 * ar + C2 / ar; ubb = C1 * br + C2 / br; } //---------------------------------------------------------------------------- private void CALC1(int STRES,double PP,double ar,double br, double Ecc,double ncc,double Ess,double taa,double tbb,double Egg,double ngg, out double ssa,out double ssb,out double src,out double stc,out double uaa,out double ubb) { //ひび割れのない単鉄筋コンクリート int mm = 3; double[,] sm = new double[mm + 1, mm + 2]; double Ac, Bc, C1, C2, Cg, Psa; int i, j; STIF(STRES, Ecc, ncc, out Ac, out Bc); for (i = 0; i <= mm; i++) { for (j = 0; j <= mm + 1; j++) { sm[i, j] = 0.0; } } sm[0, 0] = ar; sm[0, 1] = 1.0 / ar; sm[0, 2] = -ar * ar / Ess / taa; sm[1, 0] = Ac + Bc; sm[1, 1] = -(Ac - Bc) / ar / ar; sm[1, 2] = -1.0; sm[2, 0] = br; sm[2, 1] = 1.0 / br; sm[2, 3] = -1.0 / br; sm[3, 0] = Ac + Bc; sm[3, 1] = -(Ac - Bc) / br / br; sm[3, 3] = Egg / (1.0 + ngg) / br / br; sm[1, 4] = -PP; MATGJ(mm, sm); C1 = sm[0, 4]; C2 = sm[1, 4]; Psa = sm[2, 4]; Cg = sm[3, 4]; ssa = Psa * ar / taa; ssb = 0.0; src = (Ac + Bc) * C1 - (Ac - Bc) * C2 / ar / ar; stc = (Ac + Bc) * C1 + (Ac - Bc) * C2 / ar / ar; uaa = Psa * ar * ar / Ess / taa; ubb = C1 * br + C2 / br; } //---------------------------------------------------------------------------- private void CALC2(int STRES, double PP, double ar, double br, double Ecc, double ncc, double Ess, double taa, double tbb, double Egg, double ngg, out double ssa, out double ssb, out double src, out double stc, out double uaa, out double ubb) { //ひび割れのある単鉄筋コンクリート int mm = 3; double[,] sm = new double[mm + 1, mm + 2]; double C3, C4, Cg, Psa; int i, j; for (i = 0; i <= mm; i++) { for (j = 0; j <= mm + 1; j++) { sm[i, j] = 0.0; } } sm[0, 0] = Math.Log(ar) / Ecc; sm[0, 1] = 1.0; sm[0, 2] = -ar * ar / Ess / taa; sm[1, 0] = 1.0 / ar; sm[1, 2] = -1.0; sm[2, 0] = Math.Log(br) / Ecc; sm[2, 1] = 1.0; sm[2, 3] = -1.0 / br; sm[3, 0] = 1.0 / br; sm[3, 3] = Egg / (1.0 + ngg) / br / br; sm[1, 4] = -PP; MATGJ(mm, sm); C3 = sm[0, 4]; C4 = sm[1, 4]; Psa = sm[2, 4]; Cg = sm[3, 4]; ssa = Psa * ar / taa; ssb = 0.0; src = C3 / ar; stc = 0.0; uaa = Psa * ar * ar / Ess / taa; ubb = C3 / Ecc * Math.Log(br) + C4; } //---------------------------------------------------------------------------- private void CALC3(int STRES, double PP, double ar, double br, double Ecc, double ncc, double Ess, double taa, double tbb, double Egg, double ngg, out double ssa, out double ssb, out double src, out double stc, out double uaa, out double ubb) { //ひび割れのある複鉄筋コンクリート int mm = 4; double[,] sm = new double[mm + 1, mm + 2]; double C3, C4, Cg, Psa, Psb; int i, j; if (0.0 < tbb) { for (i = 0; i <= mm; i++) { for (j = 0; j <= mm + 1; j++) { sm[i, j] = 0.0; } } sm[0, 0] = Math.Log(ar) / Ecc; sm[0, 1] = 1.0; sm[0, 2] = -ar * ar / Ess / taa; sm[1, 0] = 1.0 / ar; sm[1, 2] = -1.0; sm[2, 0] = Math.Log(br) / Ecc; sm[2, 1] = 1.0; sm[2, 3] = -br * br / Ess / tbb; sm[3, 3] = br * br / Ess / tbb; sm[3, 4] = -1.0 / br; sm[4, 0] = 1.0 / br; sm[4, 3] = 1.0; sm[4, 4] = Egg / (1.0 + ngg) / br / br; sm[1, 5] = -PP; MATGJ(mm, sm); C3 = sm[0, 5]; C4 = sm[1, 5]; Psa = sm[2, 5]; Psb = sm[3, 5]; Cg = sm[4, 5]; ssa = Psa * ar / taa; ssb = Psb * br / tbb; src = C3 / ar; stc = 0.0; uaa = Psa * ar * ar / Ess / taa; ubb = C3 / Ecc * Math.Log(br) + C4; } else { ssa = 0.0; ssb = 0.0; src = 0.0; stc = 0.0; uaa = 0.0; ubb = 0.0; } } //---------------------------------------------------------------------------- private void MATGJ(int n, double[,] a) { // Gauss-Jordan法による連立一次方程式の解法 int i, j, k, s; double p, d, max, dumy; for (k = 0; k <= n; k++) { max = 0.0; s = k; for (j = k; j <= n; j++) { if (Math.Abs(a[j, k]) > max) { max = Math.Abs(a[j, k]); s = j; } } for (j = 0; j <= n + 1; j++) { dumy = a[k, j]; a[k, j] = a[s, j]; a[s, j] = dumy; } p = a[k, k]; for (j = k; j <= n + 1; j++) { a[k, j] = a[k, j] / p; } for (i = 0; i <= n; i++) { if (i != k) { d = a[i, k]; for (j = k; j <= n + 1; j++) { a[i, j] = a[i, j] - d * a[k, j]; } } } } } //------------------------------------------------------------------- } }