Example #1
0
        //you don't need to assign modelSetting.num_longit as it will calculated by axis
        public static void BuildCurveModel(ModelSetting modelSetting, Model model, string path)
        {
            //get the coordinary of each ring
            double length = Math.Abs(modelSetting.axis.AxisPoints.First().Mileage -
                modelSetting.axis.AxisPoints.Last().Mileage);
            modelSetting.num_ring = (int)(length / modelSetting.width);
            List<RingInfo> ringInfos = GetRingInfo(modelSetting);

            //get single ring result
            SingleRingResult ringResult = new SingleRingResult();
            GenerateNodes.GenerateSingleRingNode(modelSetting, ringResult);
            GenerateElements.GenerateSingleRingElement(modelSetting, ringResult);

            //initial 3D result
            List<ShieldTunnel3DResult> results = new List<ShieldTunnel3DResult>();

            for (int i = 0; i < ringInfos.Count - 1; i++)
            //for (int i = 0; i < 10; i++)
            {
                ShieldTunnel3DResult result = new ShieldTunnel3DResult();
                ChangeLocal(ringInfos[i], result);
                GetNodes(i, modelSetting, ringResult, result);
                GetShellElements(i, modelSetting, ringResult, result);
                RotateNode(i, modelSetting, result);
                results.Add(result);
            }

            Output(model, results, path);
        }
Example #2
0
        private static void GenerateGroundSpring(ModelSetting sett, SingleRingResult result)
        {
            double r = sett.outerRadius - sett.thickness / 2; // radius of the model
            double pi = Math.PI;
            int count = result.elements[1].Count;
            int ground_radius_ID = 2;
            int ground_tangential_ID = 3;
            if (!result.elements.ContainsKey(ground_radius_ID))
                result.elements[ground_radius_ID] = new List<Element>();
            if (!result.elements.ContainsKey(ground_tangential_ID))
                result.elements[ground_tangential_ID] = new List<Element>();

            for (int i = 0; i < sett.num_node_ring; i++)
            {
                count++;
                ElementLink spring = new ElementLink(count, ground_radius_ID,
                    i + 1, i + 1 + sett.num_node_ring);
                result.elements[ground_radius_ID].Add(spring);

                count++;
                spring = new ElementLink(count, ground_tangential_ID,
                    i + 1, i + 1 + 2 * sett.num_node_ring);
                result.elements[ground_tangential_ID].Add(spring);
            }
        }
Example #3
0
 public static void Build(ModelSetting modelSetting, Model model, string path)
 {
     if (modelSetting.isCurve == false)
         BuildStraightModel(modelSetting, model);
     else
         BuildCurveModel(modelSetting, model, path);
 }
Example #4
0
        private static void GenerateSingleRingShell(ModelSetting sett, SingleRingResult result)
        {
            double r = sett.outerRadius - sett.thickness / 2; // radius of the model
            int count = 0;
            int shellID = 1;
            if (!result.elements.ContainsKey(shellID))
                result.elements[shellID] = new List<Element>();

            //generate the shell elements of a ring
            for (int i = 0; i < sett.num_longit; i++)
            {
                // element from 0 degree to pos_joint.first degree
                for(int j = 0; j < sett.num_segment_element[0]; j++)
                {
                    count++;
                    ElementShell shell = new ElementShell(count, shellID, j + 1 + i * sett.num_node_face,
                        j + 2 + i * sett.num_node_face, j + 2 + sett.num_node_face * (i + 1),
                        j + 1 + sett.num_node_face * (i + 1));
                    result.elements[shellID].Add(shell);
                }

                //element from pos_joint.first degree to pos_joint.last degree
                for(int j = 0; j < sett.pos_joint.Count - 1; j++)
                {
                    count++;
                    ElementShell shell = new ElementShell(count, shellID, sett.num_circum + j + 1 + i * sett.num_node_face,
                        sett.num_segment_element[j] + 2 + i * sett.num_node_face, sett.num_segment_element[j] + 2 + (i + 1) * sett.num_node_face,
                        sett.num_circum + j + 1 + (i + 1) * sett.num_node_face);
                    result.elements[shellID].Add(shell);
                    for (int k = sett.num_segment_element[j] + 2; k <= sett.num_segment_element[j + 1]; k++)
                    {
                        count++;
                        ElementShell shell_tmp = new ElementShell(count, shellID, k + i * sett.num_node_face,
                            k + 1 + i * sett.num_node_face, k + 1 + (i + 1) * sett.num_node_face,
                            k + (i + 1) * sett.num_node_face);
                        result.elements[shellID].Add(shell_tmp);
                    }
                }

                //element from pos_joint.last degree to 360 degree
                count++;
                ElementShell shell1 = new ElementShell(count, shellID, sett.num_circum + sett.pos_joint.Count + i * sett.num_node_face,
                    sett.num_segment_element.Last() + 2 + i * sett.num_node_face, sett.num_segment_element.Last() + 2 + (i + 1) * sett.num_node_face,
                    sett.num_circum + sett.pos_joint.Count + (i + 1) * sett.num_node_face);
                result.elements[shellID].Add(shell1);
                for (int j = sett.num_segment_element.Last() + 2; j < sett.num_circum; j++)
                {
                    count++;
                    ElementShell shell2 = new ElementShell(count, shellID, j + i * sett.num_node_face,
                        j + 1 + i * sett.num_node_face, j + 1 + (i + 1) * sett.num_node_face,
                        j + (i + 1) * sett.num_node_face);
                    result.elements[shellID].Add(shell2);
                }
                count++;
                ElementShell shell3 = new ElementShell(count, shellID, sett.num_circum + i * sett.num_node_face,
                    1 + i * sett.num_node_face, 1 + (i + 1) * sett.num_node_face, sett.num_circum + (i + 1) * sett.num_node_face);
                result.elements[shellID].Add(shell3);
            }
        }
Example #5
0
        private void SettingInitial()
        {
            //Model Setting
            modelSetting = new ModelSetting();
            modelSetting.outerRadius = 3.1;
            modelSetting.thickness = 0.35;
            modelSetting.width = 1.2;
            modelSetting.num_ring = 2;
            modelSetting.num_longit = 1;
            modelSetting.num_circum = 90;
            modelSetting.pos_joint.Add(8);
            modelSetting.pos_joint.Add(73);
            modelSetting.pos_joint.Add(138);
            modelSetting.pos_joint.Add(222);
            modelSetting.pos_joint.Add(287);
            modelSetting.pos_joint.Add(352);
            modelSetting.axialForce = 15000;
            modelSetting.circumferential_joint_length = 0.4;
            modelSetting.circumferential_joint_diameter = 0.03;
            modelSetting.circumferential_joint_Es = 200000000;
            modelSetting.circumferential_joint_Ec = 35000000;
            modelSetting.circumferential_ring_friction_factor = 0.6;

            modelSetting.isCurve = true;
            modelSetting.axis = TunnelTools.GetTunnelFootprintAxis(121800);

            modelSetting.Initial();

            //Mat Setting
            matSetting = new MatSetting();
            matSetting.shell_coe = 35000000;
            matSetting.shell_pr = 0.25;
            matSetting.shell_dens = 2.5;
            matSetting.shell_thickness = modelSetting.thickness;

            matSetting.radial_spring_coe = 5000;
            matSetting.radial_spring_pr = 0.25;
            matSetting.radial_spring_area = 2 * PI * modelSetting.modelRadius
                / modelSetting.num_circum * modelSetting.width / modelSetting.num_longit;

            matSetting.tangential_spring_coe = 100;
            matSetting.tangential_spring_pr = 0.25;
            matSetting.tangential_spring_area = matSetting.radial_spring_area / 3;

            matSetting.circumferential_joint_tensile = modelSetting.circumferential_joint_Es
                * modelSetting.circumferential_joint_area / modelSetting.circumferential_joint_length;
            matSetting.circumferential_joint_compression = matSetting.circumferential_joint_tensile * 1000;

            matSetting.longitudinal_joint_rotation_k_1 = 200000 / modelSetting.num_longit;
            matSetting.longitudinal_joint_rotation_strain_1 = 0.0015;
            matSetting.longitudinal_joint_rotation_k_2 = 20000 / modelSetting.num_longit;
            matSetting.longitudinal_joint_rotation_strain_2 = 0.002;

            matSetting.longitudinal_joint_shear_force = modelSetting.axialForce * modelSetting.circumferential_ring_friction_factor / modelSetting.num_circum;
        }
Example #6
0
 public static void GenerateSingleRingElement(ModelSetting sett, SingleRingResult result)
 {
     GenerateSingleRingShell(sett, result);
     GenerateGroundSpring(sett,result);
 }
Example #7
0
        public static void GenerateSingleRingNode(ModelSetting sett, SingleRingResult result)
        {
            double r = sett.outerRadius - sett.thickness / 2; // radius of the model

            double pi = Math.PI;

            //generate the nodes of front border
            //first segment
            for (int i = 0; i < sett.num_segment_element[0]; i++ )
            {
                double detal = sett.pos_joint[0] * 1.0 / sett.num_segment_element[0];
                double angle = pi / 180 * i * detal;
                Node node = new Node(i + 1, 0, Math.Sin(angle) * r, Math.Cos(angle) * r);
                result.nodes.Add(node);
            }
            //middle segment
            for (int i = 1; i < sett.pos_joint.Count; i++ )
            {
                for (int j = 0; j < (sett.num_segment_element[i] - sett.num_segment_element[i - 1]); j++)
                {
                    double detal = (sett.pos_joint[i] - sett.pos_joint[i - 1]) * 1.0 / (sett.num_segment_element[i] - sett.num_segment_element[i - 1]);
                    double angle = (sett.pos_joint[i - 1] + j * detal) * pi / 180;
                    Node node = new Node(sett.num_segment_element[i - 1] + j + 1, 0, Math.Sin(angle) * r, Math.Cos(angle) * r);
                    result.nodes.Add(node);
                }
            }
            //last segment
            for (int i = 0; i < sett.num_segment_element[0]; i++)
            {
                double detal = sett.pos_joint[0] * 1.0 / sett.num_segment_element[0];
                double angle = (sett.pos_joint.Last() + i * detal) * pi / 180;
                Node node = new Node(sett.num_segment_element.Last() + i + 1, 0, Math.Sin(angle) * r, Math.Cos(angle) * r);
                result.nodes.Add(node);
            }

            //joint node
            for(int i = 0; i < sett.pos_joint.Count; i++)
            {
                double angle = pi / 180 * sett.pos_joint[i];
                Node node = new Node(sett.num_circum + i + 1, 0, Math.Sin(angle) * r, Math.Cos(angle) * r);
                result.nodes.Add(node);
            }

            //generate the nodes of lining in longitudinal direction
            double width = sett.width * 0.97;
            double delta = width / sett.num_longit;

            for(int j = 0; j < sett.num_longit; j++)
            {
                for (int i = 0; i < sett.num_node_face; i++)
                {
                    Node tmp = result.nodes[i];
                    Node node = new Node(tmp.nid + (j + 1) * sett.num_node_face, delta * (j + 1), tmp.y, tmp.z);
                    result.nodes.Add(node);
                }
            }

            //generate the radial ground node
            for(int i = 0; i < sett.num_node_ring; i++)
            {
                Node slNode = result.nodes[i];
                Node node = new Node(slNode.nid + sett.num_node_ring, slNode.x, slNode.y * (1 + 1 / r),
                    slNode.z * (1 + 1 / r));
                result.nodes.Add(node);
            }

            //gegerate the tangential ground node
            for (int i = 0; i < sett.num_node_ring; i++)
            {
                Node slNode = result.nodes[i];
                Node node = new Node(slNode.nid + sett.num_node_ring * 2, slNode.x, slNode.y + slNode.z / r,
                    slNode.z - slNode.y / r);
                result.nodes.Add(node);
            }
        }
Example #8
0
        //you don't need to assign modelSetting.axis as it won't be used
        public static void BuildStraightModel(ModelSetting modelSetting, Model model)
        {
            SingleRingResult ringResult = new SingleRingResult();
            GenerateNodes.GenerateSingleRingNode(modelSetting, ringResult);
            GenerateElements.GenerateSingleRingElement(modelSetting, ringResult);

            //generate all nodes
            for(int i = 0; i < modelSetting.num_ring; i++)
            {
                for(int j = 0; j < modelSetting.num_node_all; j++)
                {
                    Node node = ringResult.nodes[j];
                    Node newNode = new Node(node.nid + i * modelSetting.num_node_all,
                        node.x, node.y, node.z + modelSetting.width * i);
                    model.AddNode(newNode);
                }
            }

            int elemenCount = 0;

            //generate all shells
            for (int i = 0; i < modelSetting.num_ring; i++)
            {
                foreach (Element element in ringResult.elements[1])
                {
                    elemenCount++;
                    ElementShell shell = element as ElementShell;
                    ElementShell newShell = new ElementShell(elemenCount,
                        shell.pid, shell.n1 + modelSetting.num_node_all * i, shell.n2 + modelSetting.num_node_all * i,
                        shell.n3 + modelSetting.num_node_all * i, shell.n4 + modelSetting.num_node_all * i);
                    model.AddElement(newShell);
                }
            }

            //generate radial ground spring
            for (int i = 0; i < modelSetting.num_ring; i++)
            {
                foreach (Element element in ringResult.elements[2])
                {
                    elemenCount++;
                    ElementLink link = element as ElementLink;
                    ElementLink newLink = new ElementLink(elemenCount,
                        link.pid, link.n1 + modelSetting.num_node_all * i, link.n2 + modelSetting.num_node_all * i);
                    model.AddElement(newLink);
                }
            }

            //generate tangential ground spring
            for (int i = 0; i < modelSetting.num_ring; i++)
            {
                foreach (Element element in ringResult.elements[3])
                {
                    elemenCount++;
                    ElementLink link = element as ElementLink;
                    ElementLink newLink = new ElementLink(elemenCount,
                        link.pid, link.n1 + modelSetting.num_node_all * i, link.n2 + modelSetting.num_node_all * i);
                    model.AddElement(newLink);
                }
            }

            //generate the longitudinal joint spring
            for (int i = 0; i < modelSetting.num_ring; i++)
            {
                for (int j = 0; j <= modelSetting.num_longit; j++)
                {
                    for (int k = 0; k < modelSetting.pos_joint.Count; k++)
                    {
                        elemenCount++;
                        ElementCombin combinZ = new ElementCombin(elemenCount, 5,
                            modelSetting.pos_joint[k] + 1 + j * modelSetting.num_node_face + i * modelSetting.num_node_all,
                            k + 1 + modelSetting.num_circum + j * modelSetting.num_node_face + i * modelSetting.num_node_all);
                        model.AddElement(combinZ);
                    }
                }
            }

            //generate circumferential joint spring
            for (int i = 1; i < modelSetting.num_ring; i++)
            {
                for (int j = 0; j < modelSetting.num_node_face; j++ )
                {
                    elemenCount++;
                    ElementCombin combinCircumZ = new ElementCombin(elemenCount, 4,
                         j + 1 + (i - 1) * modelSetting.num_node_all + modelSetting.num_node_face * modelSetting.num_longit,
                         j + 1 + i * modelSetting.num_node_all);
                    elemenCount++;
                    ElementCombin combinCircumX = new ElementCombin(elemenCount, 6,
                         j + 1 + (i - 1) * modelSetting.num_node_all + modelSetting.num_node_face * modelSetting.num_longit,
                         j + 1 + i * modelSetting.num_node_all);
                    elemenCount++;
                    ElementCombin combinCircumY = new ElementCombin(elemenCount, 7,
                        j + 1 + (i - 1) * modelSetting.num_node_all + modelSetting.num_node_face * modelSetting.num_longit,
                         j + 1 + i * modelSetting.num_node_all);
                    model.AddElement(combinCircumZ);
                    model.AddElement(combinCircumX);
                    model.AddElement(combinCircumY);
                }

            }

            //add longitudinal joint nodes couple-constrain
            for (int i = 0; i < modelSetting.num_ring; i++)
            {
                for (int j = 0; j <= modelSetting.num_longit; j++)
                {
                    for (int k = 0; k < modelSetting.pos_joint.Count; k++)
                    {
                        ConstrainedNodes constrain = new ConstrainedNodes();
                        constrain.nodes.Add(model.nodes[modelSetting.pos_joint[k] + 1 + j * modelSetting.num_node_face + i * modelSetting.num_node_all]);
                        constrain.nodes.Add(model.nodes[k + 1 + modelSetting.num_circum + j * modelSetting.num_node_face + i * modelSetting.num_node_all]);
                        constrain.ux = 1;
                        constrain.uy = 1;
                        model.AddConstrained(constrain);
                    }
                }
            }

            //add boundary
            for (int i = 0; i < modelSetting.num_node_face; i++)
            {
                BoundaryNode boundary = new BoundaryNode();
                boundary.node = model.nodes[i + 1];
                boundary.ux = 1;
                boundary.uy = 1;
                boundary.uz = 1;
                boundary.rx = 1;
                boundary.ry = 1;
                boundary.rz = 1;
                model.AddBoundary(boundary);
            }
            for (int i = 0; i < modelSetting.num_node_face; i++)
            {
                BoundaryNode boundary = new BoundaryNode();
                boundary.node = model.nodes[i + 1 + modelSetting.num_node_all * (modelSetting.num_ring - 1)
                    + modelSetting.num_longit * modelSetting.num_node_face];
                boundary.ux = 1;
                boundary.uy = 1;
                boundary.uz = 1;
                boundary.rx = 1;
                boundary.ry = 1;
                boundary.rz = 1;
                model.AddBoundary(boundary);
            }

            //apply load
        }
Example #9
0
        private static void RotateNode(int ringNo, ModelSetting modelSetting, ShieldTunnel3DResult result)
        {
            //rotate the nodes of back border of the last ring
            if (ringNo != 0) //not the first ring
                for (int j = 0; j < modelSetting.num_node_face; j++)
                {
                    result.rotateNodeID.Add(j + 1 + (ringNo - 1) * modelSetting.num_node_all + modelSetting.num_node_face * modelSetting.num_longit);
                }

            //rotate all the nodes of this ring
            for (int j = 0; j < modelSetting.num_node_ring; j++)
            {
                result.rotateNodeID.Add(j + 1 + ringNo * modelSetting.num_node_all);
            }
        }
Example #10
0
 private static void GetShellElements(int ringNo, ModelSetting modelSetting, SingleRingResult ringResult, ShieldTunnel3DResult result)
 {
     if (!result.PreElements.ContainsKey(1))
         result.PreElements[1] = new List<Element>();
     foreach (Element element in ringResult.elements[1])
     {
         ElementShell shell = element as ElementShell;
         ElementShell newShell = new ElementShell(1,
             shell.pid, shell.n1 + modelSetting.num_node_all * ringNo, shell.n2 + modelSetting.num_node_all * ringNo,
             shell.n3 + modelSetting.num_node_all * ringNo, shell.n4 + modelSetting.num_node_all * ringNo);
         result.PreElements[1].Add(newShell);
     }
 }
Example #11
0
 /// <summary>
 /// Get the coordinary and direction of each ring
 /// </summary>
 /// <param name="modelSetting"></param>
 /// <returns></returns>
 private static List<RingInfo> GetRingInfo(ModelSetting modelSetting)
 {
     List<RingInfo> ringInfos = new List<RingInfo>();
     for (int i = 0; i < modelSetting.num_ring; i++ )
     {
         double mStart = modelSetting.axis.AxisPoints[0].Mileage + modelSetting.width * i;
         double mEnd = mStart + modelSetting.width;
         TunnelAxisPoint axisP1 = TunnelMappingUtility.MileageToAxisPoint(mStart, modelSetting.axis);
         TunnelAxisPoint axisP2 = TunnelMappingUtility.MileageToAxisPoint(mEnd, modelSetting.axis);
         RingInfo info = new RingInfo();
         info.x = axisP1.X;
         info.y = axisP1.Y;
         info.z = axisP1.Z;
         info.vecX = axisP2.X - axisP1.X;
         info.vecY = axisP2.Y - axisP1.Y;
         info.vecZ = axisP2.Z - axisP1.Z;
         ringInfos.Add(info);
     }
     return ringInfos;
 }
Example #12
0
 private static void GetNodes(int ringNo, ModelSetting modelSetting, SingleRingResult ringResult, ShieldTunnel3DResult result)
 {
     for (int j = 0; j < modelSetting.num_node_all; j++)
     {
         Node node = ringResult.nodes[j];
         Node newNode = new Node(node.nid + ringNo * modelSetting.num_node_all,
             node.x, node.y, node.z);
         result.nodes.Add(newNode);
     }
 }
Example #13
0
 private static void GetLongitudinalJoint(int ringNo, ModelSetting modelSetting, ShieldTunnel3DResult result)
 {
     if (!result.PostElements.ContainsKey(5))
         result.PostElements[5] = new List<Element>();
     for (int j = 0; j <= modelSetting.num_longit; j++)
     {
         for (int k = 0; k < modelSetting.pos_joint.Count; k++)
         {
             ElementCombin combinZ = new ElementCombin(1, 5,
                 modelSetting.num_segment_element[k] + 1 + j * modelSetting.num_node_face + ringNo * modelSetting.num_node_all,
                 k + 1 + modelSetting.num_circum + j * modelSetting.num_node_face + ringNo * modelSetting.num_node_all);
             result.PostElements[5].Add(combinZ);
         }
     }
 }
Example #14
0
        private static void GetGroundElements(int ringNo, ModelSetting modelSetting, SingleRingResult ringResult, ShieldTunnel3DResult result)
        {
            if (!result.PreElements.ContainsKey(2))
                result.PreElements[2] = new List<Element>();
            //generate radial ground spring
            foreach (Element element in ringResult.elements[2])
            {
                ElementLink link = element as ElementLink;
                ElementLink newLink = new ElementLink(1,
                    link.pid, link.n1 + modelSetting.num_node_all * ringNo, link.n2 + modelSetting.num_node_all * ringNo);
                result.PreElements[2].Add(newLink);
            }

            if (!result.PreElements.ContainsKey(3))
                result.PreElements[3] = new List<Element>();
            //generate tangential ground spring
            foreach (Element element in ringResult.elements[3])
            {
                ElementLink link = element as ElementLink;
                ElementLink newLink = new ElementLink(1,
                    link.pid, link.n1 + modelSetting.num_node_all * ringNo, link.n2 + modelSetting.num_node_all * ringNo);
                result.PreElements[3].Add(newLink);
            }
        }
Example #15
0
        private static void GetCircumferentialJoint(int ringNo, ModelSetting modelSetting, ShieldTunnel3DResult result)
        {
            if (!result.PostElements.ContainsKey(4))
                result.PostElements[4] = new List<Element>();
            if (!result.PostElements.ContainsKey(6))
                result.PostElements[6] = new List<Element>();
            if (!result.PostElements.ContainsKey(7))
                result.PostElements[7] = new List<Element>();

            if(ringNo != 0)
                for (int j = 0; j < modelSetting.num_node_face; j++)
                {
                    ElementCombin combinCircumZ = new ElementCombin(1, 4,
                         j + 1 + (ringNo - 1) * modelSetting.num_node_all + modelSetting.num_node_face * modelSetting.num_longit,
                         j + 1 + ringNo * modelSetting.num_node_all);
                    result.PostElements[4].Add(combinCircumZ);

                    ElementCombin combinCircumX = new ElementCombin(1, 6,
                         j + 1 + (ringNo - 1) * modelSetting.num_node_all + modelSetting.num_node_face * modelSetting.num_longit,
                         j + 1 + ringNo * modelSetting.num_node_all);
                    result.PostElements[6].Add(combinCircumX);

                    ElementCombin combinCircumY = new ElementCombin(1, 7,
                        j + 1 + (ringNo - 1) * modelSetting.num_node_all + modelSetting.num_node_face * modelSetting.num_longit,
                         j + 1 + ringNo * modelSetting.num_node_all);
                    result.PostElements[7].Add(combinCircumY);
                }
        }
Example #16
0
 private static void ApplyLoad(ModelSetting modelSetting, Model model, SoilInitalStress.IResult load, int ringNo)
 {
 }