/********************************************************* * profile = 1: detailed profile of depth versus length * profile = 2: depth and length of semi-ellipse only * profile = 3: depth and length of rectangle only * flow strength formula = 0: Flow Strength = YieldStrength + 10000 * flow strength formula = 1: Flow Strength = Yieldstrength + FlowConstant * (UltimateStrength - YieldStrength) * yield strength must be between 1 and 147,500 * flaws: if profile > 1 this can be null; otherwise it should be a list of flaw profile data * max length & depth: if profile = 1 then these can be zero; otherwise dimensions of semi-eliptical or rectangular flaw should be provided * 0 < maxlength * 0 < maxdepth < wt * od = Outside Diameter of pipe (must be between 2*wt and 9999.99) * wt = Wall Thickness of pipe (must be between flaw depth and od/2) * yFactor = Hoop Stress Y Factor * * Flow strength can not be > tensile strength * Flaw length can not be < 2 * flaw depth * Flaw length can not be > 3 * circumference * Ratio of yield strength to tensile strength can not be < 0.5 or > 1.0 **/ public static double CrackPredictedCriticalPressure(int profile, int flowStrengthFormula, double yieldStrength, double ultimateStrength, double flowConstant, BindingList <Flaw> flaws, double maxLength, double maxDepth, double od, double wt, double yFactor, string jFract, string location, double mop, double tMod, double eMod, double hExp, double fTough, int alloyGrp) { var ftmax = new EffectiveFlawData(); double qfactor, qfactor1; double xx, xx1; double l2DivDt; double foliasm; double flowstr; if (flowStrengthFormula == 0) { flowstr = yieldStrength + 10000; } else { flowstr = yieldStrength + flowConstant * (ultimateStrength - yieldStrength); } ftmax.JValue = 0.0; //effs = new List<EffectiveFlawData>(); if (profile == 1) { var delarea = new double[flaws.Count - 1]; for (var i = 0; i < delarea.Length; i++) { delarea[i] = 0.5 * (flaws[i + 1].Length - flaws[i].Length) * (flaws[i + 1].Depth + flaws[i].Depth); } for (var nstart = 0; nstart < flaws.Count - 1; nstart++) { var areatot = 0.0; for (var i = nstart; i < flaws.Count - 1; i++) { areatot += delarea[i]; var efd = new EffectiveFlawData(); efd.Area = areatot; efd.Length = flaws[i + 1].Length - flaws[nstart].Length; efd.CrackStart = flaws[nstart].Length; l2DivDt = (efd.Length * efd.Length) / (od * wt); foliasm = FoliasFact(l2DivDt); efd.FlowStrStress = flowstr * (1.0 - efd.Area / (wt * efd.Length)) / (1.0 - efd.Area / (wt * efd.Length * foliasm)); var aspect = AspectRatio(efd.Length, efd.Area, profile); var effDepth = EffectiveDepth(efd.Length, efd.Area, profile); if (aspect >= 1.0) { xx = effDepth / efd.Length; xx1 = (effDepth - 0.001) / efd.Length; } else { xx = 0.5; xx1 = 0.5 * (effDepth - 0.001) / effDepth; } qfactor = Qefactor(xx, profile); qfactor1 = Qefactor(xx1, profile); //CritToughPres(prssop,prsscr,aspect,effdepth,rad,wallthk,flawloc,yfactor,outdia,iallygrp,yslb,emodf,shexpn,qfactor,qfactor1,jmin,safefct,safeprcrk,effval(j,5),effval(j,6),1,failcri,flowstr,tmodf,iprofiletype) efd.JValue = CritToughPres(false, profile, jFract, location, tMod, fTough, hExp, yieldStrength, alloyGrp, mop, eMod, aspect, effDepth, flowstr, qfactor, qfactor1, od, wt, yFactor); if (efd.JValue > ftmax.JValue) { ftmax = efd; } } } } if (profile >= 2) { ftmax.Length = maxLength; // alengthmax; ftmax.Area = EffectiveArea(maxLength, maxDepth, profile); ftmax.CrackStart = 0.0; l2DivDt = (ftmax.Length * ftmax.Length) / (od * wt); foliasm = FoliasFact(l2DivDt); ftmax.FlowStrStress = flowstr * (1.0 - ftmax.Area / (wt * ftmax.Length)) / (1.0 - ftmax.Area / (wt * ftmax.Length * foliasm)); } var taspect = AspectRatio(ftmax.Length, ftmax.Area, profile); var teffDepth = EffectiveDepth(ftmax.Length, ftmax.Area, profile); if (taspect < 1.0) { taspect = 1.0; } xx = 0.5 / taspect; xx1 = (teffDepth - 0.001) / ftmax.Length; qfactor = Qefactor(xx, profile); qfactor1 = Qefactor(xx1, profile); return(CritToughPres(true, profile, jFract, location, tMod, fTough, hExp, yieldStrength, alloyGrp, mop, eMod, taspect, teffDepth, flowstr, qfactor, qfactor1, od, wt, yFactor)); }
public static double FlawFailurePressure(int profile, int flowStrengthFormula, double yieldStrength, double ultimateStrength, double flowConstant, BindingList <Flaw> flaws, double maxLength, double maxDepth, double od, double wt, double yFactor) { double failpr; double flowstr; if (flowStrengthFormula == 0) { flowstr = yieldStrength + 10000; } else { flowstr = yieldStrength + flowConstant * (ultimateStrength - yieldStrength); } double l2DivDt; double foliasm; var fsmax = new EffectiveFlawData(); fsmax.FlowStrStress = 999999.0; if (profile == 1) { double mD = 0; for (var i = 0; i < flaws.Count; i++) { if (flaws[i].Depth > mD) { mD = flaws[i].Depth; } } var delarea = new double[flaws.Count - 1]; for (var i = 0; i < delarea.Length; i++) { delarea[i] = 0.5 * (flaws[i + 1].Length - flaws[i].Length) * (flaws[i + 1].Depth + flaws[i].Depth); } for (var nstart = 0; nstart < flaws.Count - 1; nstart++) { var areatot = 0.0; for (var i = nstart; i < flaws.Count - 1; i++) { areatot += delarea[i]; var efd = new EffectiveFlawData(); efd.Area = areatot; efd.Length = flaws[i + 1].Length - flaws[nstart].Length; efd.CrackStart = flaws[nstart].Length; l2DivDt = (efd.Length * efd.Length) / (od * wt); foliasm = FoliasFact(l2DivDt); efd.FlowStrStress = flowstr * (1.0 - efd.Area / (wt * efd.Length)) / (1.0 - efd.Area / (wt * efd.Length * foliasm)); if (efd.FlowStrStress < fsmax.FlowStrStress) { fsmax = efd; } } } } if (profile >= 2) { fsmax.Length = maxLength; fsmax.Area = EffectiveArea(maxLength, maxDepth, profile); fsmax.CrackStart = 0.0; l2DivDt = (fsmax.Length * fsmax.Length) / (od * wt); foliasm = FoliasFact(l2DivDt); fsmax.FlowStrStress = flowstr * (1.0 - fsmax.Area / (wt * fsmax.Length)) / (1.0 - fsmax.Area / (wt * fsmax.Length * foliasm)); } failpr = fsmax.FlowStrStress / (od / (2.0 * wt) - yFactor); return(failpr); }