6
$\begingroup$

This is a follow-up question to an earlier question: Make uniform mesh with quad elements

Question: How to solve system of equations with NDsolve on the mesh created in Ansys in order to compare it with the solution obtained from Mathematica?

I managed to import the mesh created in Ansys Workbench into Mathematica, I would like to make a Wiki post and to compare the solution with the one from Mathematica. I tried to solve the system of equations from one of my previous post: Solving a system of PDEs on a piecewise polynomial domain. But the following code reproduce the kernel crash:

Get["ImportMesh`"]
mesh = ImportMesh["C:\\Users\\Documents\\Wolfram \Mathematica\\meshcurvedshape.inp"];
mesh["Wireframe"]

enter image description here

<< NDSolve`FEM`
r0 = .5; Emod = 2*10^6; \[Nu] = 0.3;
System = {Emod/((1 + \[Nu]) (1 - 
  2 \[Nu])) ((1 - \[Nu]) (D[r*U[r, z], r, r])/r - \[Nu]*
D[r*V[r, z], r, z]/r) + (Emod/(2 (1 + \[Nu]))) (D[U[r, z], z, 
z] + D[V[r, z], r, 
z]), (Emod/(2 (1 + \[Nu]))) (D[r*U[r, z], r, z]/r + D[r*V[r, z], r, r]/ r) + (Emod/((1 + [Nu]) (1 - 2 [Nu]))) ((1 - [Nu]) D[ V[r, z], z, z] - [Nu]*D[U[r, z], r, z]), U[r, 4] == 0, V[r, 4] == 0, V[r, 0] == 0.00001};
{uif, vif} = NDSolveValue[System, {U, V}, {r, z} \[Element] mesh];


mesh // InputForm 

gives:ElementMesh[{{1673.059221, 4000., 0.}, {0., 4000., 0.}, {0., 0., 0.}, {500., 0., 0.}, {179.496731, 237.9367128, 0.}, {192.9984854, 475.7642738, 0.}, {207.6390977, 713.3936658, 0.}, {223.3969593, 950.8125316, 0.}, {240.2566891, 1188.008012, 0.}, {258.3210122, 1424.94122, 0.}, {277.6790182, 1661.571542, 0.}, {298.397494, 1897.859368, 0.}, {320.5443114, 2133.760821, 0.}, {344.1922147, 2369.226209, 0.}, {369.4309118, 2604.195336, 0.}, {396.3444766, 2838.603287, 0.}, {424.9309126, 3072.410261, 0.}, {455.2207023, 3305.562766, 0.}, {487.538854, 3537.878383, 0.}, {522.0147595, 3769.23281, 0.}, {358.9934619, 240.5793079, 0.}, {385.9969707, 480.9403123, 0.}, {415.2781953, 720.9049787, 0.}, {446.7939186, 960.4485927, 0.}, {480.5133782, 1199.545435, 0.}, {516.6420244, 1438.117733, 0.}, {555.3580363, 1676.084261, 0.}, {596.794988, 1913.365796, 0.}, {641.0886228, 2149.874583, 0.}, {688.3844294, 2385.511241, 0.}, {738.8618236, 2620.155379, 0.}, {792.6889532, 2853.677161, 0.}, {849.8618252, 3085.996993, 0.}, {910.4414047, 3317.007885, 0.}, {975.077708, 3546.345001, 0.}, {1044.029519, 3773.759738, 0.}, {538.4901929, 243.221903, 0.}, {578.9954561, 486.1163508, 0.}, {622.917293, 728.4162916, 0.}, {670.1908779, 970.0846537, 0.}, {720.7700673, 1211.082858, 0.}, {774.9630367, 1451.294247, 0.}, {833.0370545, 1690.596979, 0.}, {895.1924819, 1928.872223, 0.}, {961.6329343, 2165.988345, 0.}, {1032.576644, 2401.796274, 0.}, {1108.292735, 2636.115421, 0.}, {1189.03343, 2868.751036, 0.}, {1274.792738, 3099.583725, 0.}, {1365.662107, 3328.453004, 0.}, {1462.616562, 3554.81162, 0.}, {1566.044278, 3778.286666, 0.}, {166.6666667, 0., 0.}, {333.3333333, 0., 0.}, {0., 3764.705882, 0.}, {0., 3529.411765, 0.}, {0., 3294.117647, 0.}, {0., 3058.823529, 0.}, {0., 2823.529412, 0.}, {0., 2588.235294, 0.}, {0., 2352.941176, 0.}, {0., 2117.647059, 0.}, {0., 1882.352941, 0.}, {0., 1647.058824, 0.}, {0., 1411.764706, 0.}, {0., 1176.470588, 0.}, {0., 941.1764706, 0.}, {0., 705.8823529, 0.}, {0., 470.5882353, 0.}, {0., 235.2941176, 0.}, {1115.372814, 4000., 0.}, {557.686407, 4000., 0.}, {1619.326971, 3889.251761, 0.}, {1394.216017, 4000., 0.}, {0., 3882.352941, 0.}, {278.8432035, 4000., 0.}, {83.33333333, 0., 0.}, {0., 117.6470588, 0.}, {519.1189852, 121.6308642, 0.}, {416.6666667, 0., 0.}, {186.2476082, 356.8504933, 0.}, {269.2450964, 239.2580103, 0.}, {173.0816988, 118.9683564, 0.}, {89.74836548, 236.6154152, 0.}, {200.3187915, 594.5789698, 0.}, {289.4977281, 478.352293, 0.}, {96.49924269, 473.1762545, 0.}, {215.5180285, 832.1030987, 0.}, {311.4586465, 717.1493223, 0.}, {103.8195488, 709.6380094, 0.}, {231.8268242, 1069.410272, 0.}, {335.095439, 955.6305622, 0.}, {111.6984797, 945.9945011, 0.}, {249.2888507, 1306.474616, 0.}, {360.3850337, 1193.776723, 0.}, {120.1283446, 1182.2393, 0.}, {268.0000152, 1543.256381, 0.}, {387.4815183, 1431.529476, 0.}, {129.1605061, 1418.352963, 0.}, {288.0382561, 1779.715455, 0.}, {416.5185272, 1668.827901, 0.}, {138.8395091, 1654.315183, 0.}, {309.4709027, 2015.810095, 0.}, {447.596241, 1905.612582, 0.}, {149.198747, 1890.106155, 0.}, {332.3682631, 2251.493515, 0.}, {480.8164671, 2141.817702, 0.}, {160.2721557, 2125.70394, 0.}, {356.8115632, 2486.710773, 0.}, {516.288322, 2377.368725, 0.}, {172.0961073, 2361.083693, 0.}, {382.8876942, 2721.399311, 0.}, {554.1463677, 2612.175358, 0.}, {184.7154559, 2596.215315, 0.}, {410.6376946, 2955.506774, 0.}, {594.5167149, 2846.140224, 0.}, {198.1722383, 2831.066349, 0.}, {440.0758075, 3188.986514, 0.}, {637.3963689, 3079.203627, 0.}, {212.4654563, 3065.616895, 0.}, {471.3797782, 3421.720575, 0.}, {682.8310535, 3311.285325, 0.}, {227.6103512, 3299.840207, 0.}, {504.7768068, 3653.555597, 0.}, {731.308281, 3542.111692, 0.}, {243.769427, 3533.645074, 0.}, {783.0221392, 3771.496274, 0.}, {261.0073797, 3766.969346, 0.}, {539.8505832, 3884.616405, 0.}, {372.4952163, 360.7598101, 0.}, {448.7418274, 241.9006055, 0.}, {346.1633976, 120.289654, 0.}, {400.637583, 600.9226455, 0.}, {482.4962134, 483.5283315, 0.}, {431.036057, 840.6767857, 0.}, {519.0977441, 724.6606352, 0.}, {463.6536484, 1079.997014, 0.}, {558.4923983, 965.2666232, 0.}, {498.5777013, 1318.831584, 0.}, {600.6417228, 1205.314147, 0.}, {536.0000304, 1557.100997, 0.}, {645.8025306, 1444.70599, 0.}, {576.0765121, 1794.725028, 0.}, {694.1975454, 1683.34062, 0.}, {618.9418054, 2031.62019, 0.}, {745.9937349, 1921.119009, 0.}, {664.7365261, 2267.692912, 0.}, {801.3607786, 2157.931464, 0.}, {713.6231265, 2502.83331, 0.}, {860.4805367, 2393.653758, 0.}, {765.7753884, 2736.91627, 0.}, {923.5772795, 2628.1354, 0.}, {821.2753892, 2969.837077, 0.}, {990.8611915, 2861.214099, 0.}, {880.151615, 3201.502439, 0.}, {1062.327282, 3092.790359, 0.}, {942.7595564, 3431.676443, 0.}, {1138.051756, 3322.730444, 0.}, {1009.553614, 3660.05237, 0.}, {1218.847135, 3550.57831, 0.}, {1305.036899, 3776.023202, 0.}, {1079.701166, 3886.879869, 0.}, {558.3661133, 364.7320064, 0.}, {600.5202067, 607.3449975, 0.}, {646.1509201, 849.3295657, 0.}, {695.0496732, 1090.674186, 0.}, {747.3949029, 1331.294993, 0.}, {803.5020636, 1571.065959, 0.}, {863.5922042, 1809.870877, 0.}, {927.8641045, 2047.584498, 0.}, {996.5264247, 2284.065364, 0.}, {1069.8197, 2519.15539, 0.}, {1148.029192, 2752.652272, 0.}, {1231.292329, 2984.399179, 0.}, {1319.543493, 3214.289618, 0.}, {1413.302961, 3441.990935, 0.}, {1513.649871, 3666.86387, 0.}, {250., 0., 0.}, {0., 3647.058824, 0.}, {0., 3411.764706, 0.}, {0., 3176.470588, 0.}, {0., 2941.176471, 0.}, {0., 2705.882353, 0.}, {0., 2470.588235, 0.}, {0., 2235.294118, 0.}, {0., 2000., 0.}, {0., 1764.705882, 0.}, {0., 1529.411765, 0.}, {0., 1294.117647, 0.}, {0., 1058.823529, 0.}, {0., 823.5294118, 0.}, {0., 588.2352941, 0.}, {0., 352.9411765, 0.}, {836.5296105, 4000., 0.}}, Automatic, {QuadElement[{{53, 5, 70, 3, 83, 84, 78, 77}, {54, 21, 5, 53, 132, 82, 83, 178}, {4, 37, 21, 54, 79, 131, 132, 80}, {5, 6, 69, 70, 81, 87, 193, 84}, {21, 22, 6, 5, 130, 86, 81, 82}, {37, 38, 22, 21, 163, 134, 130, 131}, {6, 7, 68, 69, 85, 90, 192, 87}, {22, 23, 7, 6, 133, 89, 85, 86}, {38, 39, 23, 22, 164, 136, 133, 134}, {7, 8, 67, 68, 88, 93, 191, 90}, {23, 24, 8, 7, 135, 92, 88, 89}, {39, 40, 24, 23, 165, 138, 135, 136}, {8, 9, 66, 67, 91, 96, 190, 93}, {24, 25, 9, 8, 137, 95, 91, 92}, {40, 41, 25, 24, 166, 140, 137, 138}, {9, 10, 65, 66, 94, 99, 189, 96}, {25, 26, 10, 9, 139, 98, 94, 95}, {41, 42, 26, 25, 167, 142, 139, 140}, {10, 11, 64, 65, 97, 102, 188, 99}, {26, 27, 11, 10, 141, 101, 97, 98}, {42, 43, 27, 26, 168, 144, 141, 142}, {11, 12, 63, 64, 100, 105, 187, 102}, {27, 28, 12, 11, 143, 104, 100, 101}, {43, 44, 28, 27, 169, 146, 143, 144}, {12, 13, 62, 63, 103, 108, 186, 105}, {28, 29, 13, 12, 145, 107, 103, 104}, {44, 45, 29, 28, 170, 148, 145, 146}, {13, 14, 61, 62, 106, 111, 185, 108}, {29, 30, 14, 13, 147, 110, 106, 107}, {45, 46, 30, 29, 171, 150, 147, 148}, {14, 15, 60, 61, 109, 114, 184, 111}, {30, 31, 15, 14, 149, 113, 109, 110}, {46, 47, 31, 30, 172, 152, 149, 150}, {15, 16, 59, 60, 112, 117, 183, 114}, {31, 32, 16, 15, 151, 116, 112, 113}, {47, 48, 32, 31, 173, 154, 151, 152}, {16, 17, 58, 59, 115, 120, 182, 117}, {32, 33, 17, 16, 153, 119, 115, 116}, {48, 49, 33, 32, 174, 156, 153, 154}, {17, 18, 57, 58, 118, 123, 181, 120}, {33, 34, 18, 17, 155, 122, 118, 119}, {49, 50, 34, 33, 175, 158, 155, 156}, {18, 19, 56, 57, 121, 126, 180, 123}, {34, 35, 19, 18, 157, 125, 121, 122}, {50, 51, 35, 34, 176, 160, 157, 158}, {19, 20, 55, 56, 124, 128, 179, 126}, {35, 36, 20, 19, 159, 127, 124, 125}, {51, 52, 36, 35, 177, 161, 159, 160}, {20, 72, 2, 55, 129, 76, 75, 128}, {36, 71, 72, 20, 162, 194, 129, 127}, {52, 1, 71, 36, 73, 74, 162, 161}}, {0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0}]}, {PointElement[{{1}, {2}, {3}, {4}, {5}, {6}, {7}, {8}, {9}, {10}, {11}, {12}, {13}, {14}, {15}, {16}, {17}, {18}, {19}, {20}, {21}, {22}, {23}, {24}, {25}, {26}, {27}, {28}, {29}, {30}, {31}, {32}, {33}, {34}, {35}, {36}, {37}, {38}, {39}, {40}, {41}, {42}, {43}, {44}, {45}, {46}, {47}, {48}, {49}, {50}, {51}, {52}, {53}, {54}, {55}, {56}, {57}, {58}, {59}, {60}, {61}, {62}, {63}, {64}, {65}, {66}, {67}, {68}, {69}, {70}, {71}, {72}, {73}, {74}, {75}, {76}, {77}, {78}, {79}, {80}, {81}, {82}, {83}, {84}, {85}, {86}, {87}, {88}, {89}, {90}, {91}, {92}, {93}, {94}, {95}, {96}, {97}, {98}, {99}, {100}, {101}, {102}, {103}, {104}, {105}, {106}, {107}, {108}, {109}, {110}, {111}, {112}, {113}, {114}, {115}, {116}, {117}, {118}, {119}, {120}, {121}, {122}, {123}, {124}, {125}, {126}, {127}, {128}, {129}, {130}, {131}, {132}, {133}, {134}, {135}, {136}, {137}, {138}, {139}, {140}, {141}, {142}, {143}, {144}, {145}, {146}, {147}, {148}, {149}, {150}, {151}, {152}, {153}, {154}, {155}, {156}, {157}, {158}, {159}, {160}, {161}, {162}, {163}, {164}, {165}, {166}, {167}, {168}, {169}, {170}, {171}, {172}, {173}, {174}, {175}, {176}, {177}, {178}, {179}, {180}, {181}, {182}, {183}, {184}, {185}, {186}, {187}, {188}, {189}, {190}, {191}, {192}, {193}, {194}}]}]

$\endgroup$
  • $\begingroup$ After you import the mesh, can you do mesh//InputForm and out the result into your question? $\endgroup$ – user21 Sep 16 at 12:11
  • $\begingroup$ @user21 i did it $\endgroup$ – LejlaS Sep 16 at 12:16
  • $\begingroup$ @user21 works perfectly now. thank you, ill inform the creator of the package about the mesh. $\endgroup$ – LejlaS Sep 16 at 12:53
1
$\begingroup$

We fix one error. It was necessary to bring the mesh to the same scale, and then compare.

<< NDSolve`FEM`
\[Rho] = 7850; g = 9.8066; u = 0.1; F = 100000; k = \[Rho]*g*.5^2*
  Pi/2/F;
r0 = .5; Emod = 2*10^6; \[Nu] = 0.3;
mesh = ElementMesh[{{1673.059221, 4000., 0.}, {0., 4000., 0.}, {0., 
     0., 0.}, {500., 0., 0.}, {179.496731, 237.9367128, 
     0.}, {192.9984854, 475.7642738, 0.}, {207.6390977, 713.3936658, 
     0.}, {223.3969593, 950.8125316, 0.}, {240.2566891, 1188.008012, 
     0.}, {258.3210122, 1424.94122, 0.}, {277.6790182, 1661.571542, 
     0.}, {298.397494, 1897.859368, 0.}, {320.5443114, 2133.760821, 
     0.}, {344.1922147, 2369.226209, 0.}, {369.4309118, 2604.195336, 
     0.}, {396.3444766, 2838.603287, 0.}, {424.9309126, 3072.410261, 
     0.}, {455.2207023, 3305.562766, 0.}, {487.538854, 3537.878383, 
     0.}, {522.0147595, 3769.23281, 0.}, {358.9934619, 240.5793079, 
     0.}, {385.9969707, 480.9403123, 0.}, {415.2781953, 720.9049787, 
     0.}, {446.7939186, 960.4485927, 0.}, {480.5133782, 1199.545435, 
     0.}, {516.6420244, 1438.117733, 0.}, {555.3580363, 1676.084261, 
     0.}, {596.794988, 1913.365796, 0.}, {641.0886228, 2149.874583, 
     0.}, {688.3844294, 2385.511241, 0.}, {738.8618236, 2620.155379, 
     0.}, {792.6889532, 2853.677161, 0.}, {849.8618252, 3085.996993, 
     0.}, {910.4414047, 3317.007885, 0.}, {975.077708, 3546.345001, 
     0.}, {1044.029519, 3773.759738, 0.}, {538.4901929, 243.221903, 
     0.}, {578.9954561, 486.1163508, 0.}, {622.917293, 728.4162916, 
     0.}, {670.1908779, 970.0846537, 0.}, {720.7700673, 1211.082858, 
     0.}, {774.9630367, 1451.294247, 0.}, {833.0370545, 1690.596979, 
     0.}, {895.1924819, 1928.872223, 0.}, {961.6329343, 2165.988345, 
     0.}, {1032.576644, 2401.796274, 0.}, {1108.292735, 2636.115421, 
     0.}, {1189.03343, 2868.751036, 0.}, {1274.792738, 3099.583725, 
     0.}, {1365.662107, 3328.453004, 0.}, {1462.616562, 3554.81162, 
     0.}, {1566.044278, 3778.286666, 0.}, {166.6666667, 0., 
     0.}, {333.3333333, 0., 0.}, {0., 3764.705882, 0.}, {0., 
     3529.411765, 0.}, {0., 3294.117647, 0.}, {0., 3058.823529, 
     0.}, {0., 2823.529412, 0.}, {0., 2588.235294, 0.}, {0., 
     2352.941176, 0.}, {0., 2117.647059, 0.}, {0., 1882.352941, 
     0.}, {0., 1647.058824, 0.}, {0., 1411.764706, 0.}, {0., 
     1176.470588, 0.}, {0., 941.1764706, 0.}, {0., 705.8823529, 
     0.}, {0., 470.5882353, 0.}, {0., 235.2941176, 0.}, {1115.372814, 
     4000., 0.}, {557.686407, 4000., 0.}, {1619.326971, 3889.251761, 
     0.}, {1394.216017, 4000., 0.}, {0., 3882.352941, 
     0.}, {278.8432035, 4000., 0.}, {83.33333333, 0., 0.}, {0., 
     117.6470588, 0.}, {519.1189852, 121.6308642, 0.}, {416.6666667, 
     0., 0.}, {186.2476082, 356.8504933, 0.}, {269.2450964, 
     239.2580103, 0.}, {173.0816988, 118.9683564, 0.}, {89.74836548, 
     236.6154152, 0.}, {200.3187915, 594.5789698, 0.}, {289.4977281, 
     478.352293, 0.}, {96.49924269, 473.1762545, 0.}, {215.5180285, 
     832.1030987, 0.}, {311.4586465, 717.1493223, 0.}, {103.8195488, 
     709.6380094, 0.}, {231.8268242, 1069.410272, 0.}, {335.095439, 
     955.6305622, 0.}, {111.6984797, 945.9945011, 0.}, {249.2888507, 
     1306.474616, 0.}, {360.3850337, 1193.776723, 0.}, {120.1283446, 
     1182.2393, 0.}, {268.0000152, 1543.256381, 0.}, {387.4815183, 
     1431.529476, 0.}, {129.1605061, 1418.352963, 0.}, {288.0382561, 
     1779.715455, 0.}, {416.5185272, 1668.827901, 0.}, {138.8395091, 
     1654.315183, 0.}, {309.4709027, 2015.810095, 0.}, {447.596241, 
     1905.612582, 0.}, {149.198747, 1890.106155, 0.}, {332.3682631, 
     2251.493515, 0.}, {480.8164671, 2141.817702, 0.}, {160.2721557, 
     2125.70394, 0.}, {356.8115632, 2486.710773, 0.}, {516.288322, 
     2377.368725, 0.}, {172.0961073, 2361.083693, 0.}, {382.8876942, 
     2721.399311, 0.}, {554.1463677, 2612.175358, 0.}, {184.7154559, 
     2596.215315, 0.}, {410.6376946, 2955.506774, 0.}, {594.5167149, 
     2846.140224, 0.}, {198.1722383, 2831.066349, 0.}, {440.0758075, 
     3188.986514, 0.}, {637.3963689, 3079.203627, 0.}, {212.4654563, 
     3065.616895, 0.}, {471.3797782, 3421.720575, 0.}, {682.8310535, 
     3311.285325, 0.}, {227.6103512, 3299.840207, 0.}, {504.7768068, 
     3653.555597, 0.}, {731.308281, 3542.111692, 0.}, {243.769427, 
     3533.645074, 0.}, {783.0221392, 3771.496274, 0.}, {261.0073797, 
     3766.969346, 0.}, {539.8505832, 3884.616405, 0.}, {372.4952163, 
     360.7598101, 0.}, {448.7418274, 241.9006055, 0.}, {346.1633976, 
     120.289654, 0.}, {400.637583, 600.9226455, 0.}, {482.4962134, 
     483.5283315, 0.}, {431.036057, 840.6767857, 0.}, {519.0977441, 
     724.6606352, 0.}, {463.6536484, 1079.997014, 0.}, {558.4923983, 
     965.2666232, 0.}, {498.5777013, 1318.831584, 0.}, {600.6417228, 
     1205.314147, 0.}, {536.0000304, 1557.100997, 0.}, {645.8025306, 
     1444.70599, 0.}, {576.0765121, 1794.725028, 0.}, {694.1975454, 
     1683.34062, 0.}, {618.9418054, 2031.62019, 0.}, {745.9937349, 
     1921.119009, 0.}, {664.7365261, 2267.692912, 0.}, {801.3607786, 
     2157.931464, 0.}, {713.6231265, 2502.83331, 0.}, {860.4805367, 
     2393.653758, 0.}, {765.7753884, 2736.91627, 0.}, {923.5772795, 
     2628.1354, 0.}, {821.2753892, 2969.837077, 0.}, {990.8611915, 
     2861.214099, 0.}, {880.151615, 3201.502439, 0.}, {1062.327282, 
     3092.790359, 0.}, {942.7595564, 3431.676443, 0.}, {1138.051756, 
     3322.730444, 0.}, {1009.553614, 3660.05237, 0.}, {1218.847135, 
     3550.57831, 0.}, {1305.036899, 3776.023202, 0.}, {1079.701166, 
     3886.879869, 0.}, {558.3661133, 364.7320064, 0.}, {600.5202067, 
     607.3449975, 0.}, {646.1509201, 849.3295657, 0.}, {695.0496732, 
     1090.674186, 0.}, {747.3949029, 1331.294993, 0.}, {803.5020636, 
     1571.065959, 0.}, {863.5922042, 1809.870877, 0.}, {927.8641045, 
     2047.584498, 0.}, {996.5264247, 2284.065364, 0.}, {1069.8197, 
     2519.15539, 0.}, {1148.029192, 2752.652272, 0.}, {1231.292329, 
     2984.399179, 0.}, {1319.543493, 3214.289618, 0.}, {1413.302961, 
     3441.990935, 0.}, {1513.649871, 3666.86387, 0.}, {250., 0., 
     0.}, {0., 3647.058824, 0.}, {0., 3411.764706, 0.}, {0., 
     3176.470588, 0.}, {0., 2941.176471, 0.}, {0., 2705.882353, 
     0.}, {0., 2470.588235, 0.}, {0., 2235.294118, 0.}, {0., 2000., 
     0.}, {0., 1764.705882, 0.}, {0., 1529.411765, 0.}, {0., 
     1294.117647, 0.}, {0., 1058.823529, 0.}, {0., 823.5294118, 
     0.}, {0., 588.2352941, 0.}, {0., 352.9411765, 0.}, {836.5296105, 
     4000., 0.}}/1000, 
  Automatic, {QuadElement[{{53, 5, 70, 3, 83, 84, 78, 77}, {54, 21, 5,
       53, 132, 82, 83, 178}, {4, 37, 21, 54, 79, 131, 132, 80}, {5, 
      6, 69, 70, 81, 87, 193, 84}, {21, 22, 6, 5, 130, 86, 81, 
      82}, {37, 38, 22, 21, 163, 134, 130, 131}, {6, 7, 68, 69, 85, 
      90, 192, 87}, {22, 23, 7, 6, 133, 89, 85, 86}, {38, 39, 23, 22, 
      164, 136, 133, 134}, {7, 8, 67, 68, 88, 93, 191, 90}, {23, 24, 
      8, 7, 135, 92, 88, 89}, {39, 40, 24, 23, 165, 138, 135, 
      136}, {8, 9, 66, 67, 91, 96, 190, 93}, {24, 25, 9, 8, 137, 95, 
      91, 92}, {40, 41, 25, 24, 166, 140, 137, 138}, {9, 10, 65, 66, 
      94, 99, 189, 96}, {25, 26, 10, 9, 139, 98, 94, 95}, {41, 42, 26,
       25, 167, 142, 139, 140}, {10, 11, 64, 65, 97, 102, 188, 
      99}, {26, 27, 11, 10, 141, 101, 97, 98}, {42, 43, 27, 26, 168, 
      144, 141, 142}, {11, 12, 63, 64, 100, 105, 187, 102}, {27, 28, 
      12, 11, 143, 104, 100, 101}, {43, 44, 28, 27, 169, 146, 143, 
      144}, {12, 13, 62, 63, 103, 108, 186, 105}, {28, 29, 13, 12, 
      145, 107, 103, 104}, {44, 45, 29, 28, 170, 148, 145, 146}, {13, 
      14, 61, 62, 106, 111, 185, 108}, {29, 30, 14, 13, 147, 110, 106,
       107}, {45, 46, 30, 29, 171, 150, 147, 148}, {14, 15, 60, 61, 
      109, 114, 184, 111}, {30, 31, 15, 14, 149, 113, 109, 110}, {46, 
      47, 31, 30, 172, 152, 149, 150}, {15, 16, 59, 60, 112, 117, 183,
       114}, {31, 32, 16, 15, 151, 116, 112, 113}, {47, 48, 32, 31, 
      173, 154, 151, 152}, {16, 17, 58, 59, 115, 120, 182, 117}, {32, 
      33, 17, 16, 153, 119, 115, 116}, {48, 49, 33, 32, 174, 156, 153,
       154}, {17, 18, 57, 58, 118, 123, 181, 120}, {33, 34, 18, 17, 
      155, 122, 118, 119}, {49, 50, 34, 33, 175, 158, 155, 156}, {18, 
      19, 56, 57, 121, 126, 180, 123}, {34, 35, 19, 18, 157, 125, 121,
       122}, {50, 51, 35, 34, 176, 160, 157, 158}, {19, 20, 55, 56, 
      124, 128, 179, 126}, {35, 36, 20, 19, 159, 127, 124, 125}, {51, 
      52, 36, 35, 177, 161, 159, 160}, {20, 72, 2, 55, 129, 76, 75, 
      128}, {36, 71, 72, 20, 162, 194, 129, 127}, {52, 1, 71, 36, 73, 
      74, 162, 161}}, {0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
      0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 
     0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 
     0}]}, {PointElement[{{1}, {2}, {3}, {4}, {5}, {6}, {7}, {8}, \
{9}, {10}, {11}, {12}, {13}, {14}, {15}, {16}, {17}, {18}, {19}, \
{20}, {21}, {22}, {23}, {24}, {25}, {26}, {27}, {28}, {29}, {30}, \
{31}, {32}, {33}, {34}, {35}, {36}, {37}, {38}, {39}, {40}, {41}, \
{42}, {43}, {44}, {45}, {46}, {47}, {48}, {49}, {50}, {51}, {52}, \
{53}, {54}, {55}, {56}, {57}, {58}, {59}, {60}, {61}, {62}, {63}, \
{64}, {65}, {66}, {67}, {68}, {69}, {70}, {71}, {72}, {73}, {74}, \
{75}, {76}, {77}, {78}, {79}, {80}, {81}, {82}, {83}, {84}, {85}, \
{86}, {87}, {88}, {89}, {90}, {91}, {92}, {93}, {94}, {95}, {96}, \
{97}, {98}, {99}, {100}, {101}, {102}, {103}, {104}, {105}, {106}, \
{107}, {108}, {109}, {110}, {111}, {112}, {113}, {114}, {115}, {116}, \
{117}, {118}, {119}, {120}, {121}, {122}, {123}, {124}, {125}, {126}, \
{127}, {128}, {129}, {130}, {131}, {132}, {133}, {134}, {135}, {136}, \
{137}, {138}, {139}, {140}, {141}, {142}, {143}, {144}, {145}, {146}, \
{147}, {148}, {149}, {150}, {151}, {152}, {153}, {154}, {155}, {156}, \
{157}, {158}, {159}, {160}, {161}, {162}, {163}, {164}, {165}, {166}, \
{167}, {168}, {169}, {170}, {171}, {172}, {173}, {174}, {175}, {176}, \
{177}, {178}, {179}, {180}, {181}, {182}, {183}, {184}, {185}, {186}, \
{187}, {188}, {189}, {190}, {191}, {192}, {193}, {194}}]}]; mesh2 = 
 ElementMesh[mesh["Coordinates"][[All, 1 ;; 2]], 
  mesh["BoundaryElements"]];
mesh11 = ToElementMesh[Rectangle[{0, 0}, {r0, 4}], 
   "MaxBoundaryCellMeasure" -> .24];
f = {r, z} \[Function] {r Exp[k z], z};
mesh1 = ToElementMesh["Coordinates" -> f @@@ mesh11["Coordinates"], 
   "MeshElements" -> mesh11["MeshElements"]];
Show[mesh1["Wireframe"["MeshElementStyle" -> EdgeForm[Red]]], 
 mesh2["Wireframe"["MeshElementStyle" -> EdgeForm[Blue]]]]

Mesh on one scale

Figure 1

Now compare the two solutions

System = {Emod/((1 + \[Nu]) (1 - 
           2 \[Nu])) ((1 - \[Nu]) (D[r*U[r, z], r, r])/r - \[Nu]*
         D[r*V[r, z], r, z]/r) + (Emod/(2 (1 + \[Nu]))) (D[U[r, z], z,
          z] + D[V[r, z], r, z]) == 
    0, (Emod/(2 (1 + \[Nu]))) (D[r*U[r, z], r, z]/r + 
        D[r*V[r, z], r, r]/
         r) + (Emod/((1 + \[Nu]) (1 - 2 \[Nu]))) ((1 - \[Nu]) D[
          V[r, z], z, z] - \[Nu]*D[U[r, z], r, z]) == 0, 
   DirichletCondition[{U[r, z] == 0, V[r, z] == 0}, z == 4], 
   DirichletCondition[V[r, z] == 0.00001, z == 0]};
{uif1, vif1} = NDSolveValue[System, {U, V}, {r, z} \[Element] mesh1];

{uif, vif} = NDSolveValue[System, {U, V}, {r, z} \[Element] mesh2];

mesh1 = uif1["ElementMesh"];

{Show[{mesh1["Wireframe"["MeshElement" -> "BoundaryElements"]], 
   ElementMeshDeformation[mesh1, {uif, vif}][
    "Wireframe"[
     "ElementMeshDirective" -> 
      Directive[EdgeForm[Red], FaceForm[]]]]}], 
 ContourPlot[uif1[r, z], {r, z} \[Element] mesh1, PlotRange -> All, 
  AspectRatio -> Automatic, ColorFunction -> Hue, 
  FrameLabel -> {"r", "z"}, PlotLabel -> "ur", Contours -> 20, 
  PlotLegends -> Automatic], 
 ContourPlot[vif1[r, z], {r, z} \[Element] mesh1, PlotRange -> All, 
  AspectRatio -> Automatic, ColorFunction -> Hue, 
  FrameLabel -> {"r", "z"}, PlotLabel -> "uz", Contours -> 20, 
  PlotLegends -> Automatic]}
mesh2 = uif["ElementMesh"];

{Show[{mesh2["Wireframe"["MeshElement" -> "BoundaryElements"]], 
   ElementMeshDeformation[mesh2, {uif, vif}][
    "Wireframe"[
     "ElementMeshDirective" -> 
      Directive[EdgeForm[Blue], FaceForm[]]]]}], 
 ContourPlot[uif[r, z], {r, z} \[Element] mesh2, PlotRange -> All, 
  AspectRatio -> Automatic, ColorFunction -> Hue, 
  FrameLabel -> {"r", "z"}, PlotLabel -> "ur", Contours -> 20, 
  PlotLegends -> Automatic], 
 ContourPlot[vif[r, z], {r, z} \[Element] mesh2, PlotRange -> All, 
  AspectRatio -> Automatic, ColorFunction -> Hue, 
  FrameLabel -> {"r", "z"}, PlotLabel -> "uz", Contours -> 20, 
  PlotLegends -> Automatic]}
{Plot[{uif[0, z] - uif1[0, z]}, {z, 0, 4}, 
  AxesLabel -> {"z", "\[Delta]u"}, PlotLegends -> Automatic], 
 Plot[{vif[0, z] - vif1[0, z]}, {z, 0, 4}, 
  AxesLabel -> {"z", "\[Delta]v"}, PlotLegends -> Automatic]}

Figure 2

And we see here the difference is only 10^-7 Figure 3

$\endgroup$
9
$\begingroup$

There are a couple of issues:

1) The mesh imported by ImportMesh is not correct. It imports this mesh as a 3D surface mesh - which is not what you want. Update: it turned out that you exported a 3D surface element but you want a 2D area element.

To fix this for now you can convert this into a 2D mesh by using:

mesh2 = ElementMesh[mesh["Coordinates"][[All, 1 ;; 2]], mesh["BoundaryElements"]]

2) Your system of PDEs are not equations. You need an == in each of the equations. I set them to 0.

<< NDSolve`FEM`
r0 = .5; Emod = 2*10^6; \[Nu] = 0.3;
System = {Emod/((1 + \[Nu]) (1 - 
           2 \[Nu])) ((1 - \[Nu]) (D[r*U[r, z], r, r])/r - \[Nu]*
         D[r*V[r, z], r, z]/r) + (Emod/(2 (1 + \[Nu]))) (D[U[r, z], z,
          z] + D[V[r, z], r, z]) == 
    0, (Emod/(2 (1 + \[Nu]))) (D[r*U[r, z], r, z]/r + 
        D[r*V[r, z], r, r]/
         r) + (Emod/((1 + \[Nu]) (1 - 2 \[Nu]))) ((1 - \[Nu]) D[
          V[r, z], z, z] - \[Nu]*D[U[r, z], r, z]) == 0, U[r, 4] == 0,
    V[r, 4] == 0, V[r, 0] == 0.00001};

3) When you now evaluate this you will see that your boundary conditions are not on the boundary of the mesh:

{uif, vif} = NDSolveValue[System, {U, V}, {r, z} \[Element] mesh2];

You'd need to fix that.

When I set them at 4000 then I get:

<< NDSolve`FEM`
r0 = .5; Emod = 2*10^6; \[Nu] = 0.3;
System = {Emod/((1 + \[Nu]) (1 - 
           2 \[Nu])) ((1 - \[Nu]) (D[r*U[r, z], r, r])/r - \[Nu]*
         D[r*V[r, z], r, z]/r) + (Emod/(2 (1 + \[Nu]))) (D[U[r, z], z,
          z] + D[V[r, z], r, z]) == 
    0, (Emod/(2 (1 + \[Nu]))) (D[r*U[r, z], r, z]/r + 
        D[r*V[r, z], r, r]/
         r) + (Emod/((1 + \[Nu]) (1 - 2 \[Nu]))) ((1 - \[Nu]) D[
          V[r, z], z, z] - \[Nu]*D[U[r, z], r, z]) == 0, 
   U[r, 4000] == 0, V[r, 4000] == 0, V[r, 0] == 0.00001};
{uif, vif} = NDSolveValue[System, {U, V}, {r, z} \[Element] mesh2];
Show[{
  mesh2["Wireframe"[ "MeshElement" -> "BoundaryElements"]],
  ElementMeshDeformation[mesh2, {uif, vif}, 
    "ScalingFactor" -> 1000000][
   "Wireframe"[
    "ElementMeshDirective" -> Directive[EdgeForm[Red], FaceForm[]]]]}]

enter image description here

$\endgroup$
7
$\begingroup$

By following the previous instructions from @user21 i was able to solve the given system first on imported mesh for uif and vif and to visualize the solution.

mesh2 = uif["ElementMesh"];
{Show[{mesh2["Wireframe"["MeshElement" -> "BoundaryElements"]],  ElementMeshDeformation[mesh2, {uif, vif}, 
 "ScalingFactor" -> 1000000][
"Wireframe"[
 "ElementMeshDirective" -> 
  Directive[EdgeForm[Red], FaceForm[]]]]}],  ContourPlot[uif[r, z], {r, z} \[Element] mesh2, PlotRange -> All, AspectRatio -> Automatic, ColorFunction -> Hue, FrameLabel -> {"r", "z"}, PlotLabel -> "ur", Contours -> 20, PlotLegends -> Automatic], ContourPlot[vif[r, z], {r, z} [Element] mesh2, PlotRange -> All, AspectRatio -> Automatic, ColorFunction -> Hue, FrameLabel -> {"r", "z"}, PlotLabel -> "uz", Contours -> 20, PlotLegends -> Automatic]}

enter image description here Now solve the same system with the mesh created within Mathematica:

\[Rho] = 7850; g = 9.8066; u = 0.1; F = 100000; k = \[Rho]*g*.5^2*Pi/2/F;
mesh11 = ToElementMesh[Rectangle[{0, 0}, {r0, 4}], "MaxBoundaryCellMeasure" -> .24];
f = {r, z} \[Function] {r Exp[k z], z};
mesh1 = ToElementMesh["Coordinates" -> f @@@ mesh11["Coordinates"], "MeshElements" -> mesh11["MeshElements"]]; mesh1["Wireframe"]
System1 = {Emod/((1 + \[Nu]) (1 - 
       2 \[Nu])) ((1 - \[Nu]) (D[r*U[r, z], r, r])/r - \[Nu]*
     D[r*V[r, z], r, z]/r) + (Emod/(2 (1 + \[Nu]))) (D[U[r, z], z,
      z] + D[V[r, z], r, z]) == 
0, (Emod/(2 (1 + \[Nu]))) (D[r*U[r, z], r, z]/r + 
    D[r*V[r, z], r, r]/
     r) + (Emod/((1 + \[Nu]) (1 - 2 \[Nu]))) ((1 - \[Nu]) D[
      V[r, z], z, z] - \[Nu]*D[U[r, z], r, z]) == 0, U[r, 4] == 0,
V[r, 4] == 0, V[r, 0] == 0.00001};
{uif1, vif1} = NDSolveValue[System1, {U, V}, {r, z} \[Element] mesh1];
mesh1 = uif1["ElementMesh"];
{Show[{mesh1["Wireframe"["MeshElement" -> "BoundaryElements"]], ElementMeshDeformation[mesh1, {uif, vif}][
"Wireframe"[
 "ElementMeshDirective" -> 
  Directive[EdgeForm[Red], FaceForm[]]]]}], 
ContourPlot[uif1[r, z], {r, z} \[Element] mesh1, PlotRange -> All,AspectRatio -> Automatic, ColorFunction -> Hue, FrameLabel -> {"r", "z"}, PlotLabel -> "ur", Contours -> 20, PlotLegends -> Automatic],
ContourPlot[vif1[r, z], {r, z} \[Element] mesh1, PlotRange -> All,AspectRatio -> Automatic, ColorFunction -> Hue, FrameLabel -> {"r", "z"}, PlotLabel -> "uz", Contours -> 20, PlotLegends -> Automatic]}

enter image description here

Then we can determine the difference of the two solutions when r = 0 as follows:

{Row[{"nint = ", nint}], Plot[{uif[0, z] - uif1[0, z]}, {z, 0, 4}, 
AxesLabel -> {"z", "\[Delta]u"}, PlotLegends -> Automatic], 
Plot[{vif[0, z] - vif1[0, z]}, {z, 0, 4},  AxesLabel -> {"z", "\[Delta]v"}, PlotLegends -> Automatic]}

enter image description here

$\endgroup$
  • $\begingroup$ +1. Thanks for sharing this. $\endgroup$ – user21 Sep 17 at 5:43
  • $\begingroup$ What would be interesting too, is the comparison to the result from Abaqus. $\endgroup$ – user21 Sep 17 at 5:57
  • 1
    $\begingroup$ @LejlaS It was necessary to bring the mesh to the same scale, and then compare. Then the difference will be 10^-7 $\endgroup$ – Alex Trounev Sep 17 at 6:55
  • $\begingroup$ @AlexTrounev thank you very much, i forgot about that. $\endgroup$ – LejlaS Sep 17 at 8:27
  • $\begingroup$ @LejlaS I see you have great success in mastering FEM. $\endgroup$ – Alex Trounev Sep 17 at 9:12

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.