-
Notifications
You must be signed in to change notification settings - Fork 65
Expand file tree
/
Copy pathSimpleCantilever.cs
More file actions
71 lines (51 loc) · 1.98 KB
/
SimpleCantilever.cs
File metadata and controls
71 lines (51 loc) · 1.98 KB
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
using BriefFiniteElementNet.Elements;
using BriefFiniteElementNet.Materials;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Net.Configuration;
using System.Text;
using System.Threading.Tasks;
namespace BriefFiniteElementNet.CodeProjectExamples
{
public class SimpleCantilever
{
public static void Run()
{
var model = new Model();
var l = 5;
var n1 = new Node(0, 0, 0);
var n2 = new Node(0, 0, l);
var axialLoad = 1000;
var horizontalLoad = 1000;
var f = new Force(horizontalLoad, 0, axialLoad, 0, 0, 0);
/**/
var h = 0.1;
var w = 0.05;
var a = h * w;
var iy = h * h * h * w / 12;
var iz = w * w * w * h / 12;
var j = iy + iz;
var e = 210e9;
var nu = 0.3;
var g = e / (2 * 1 + nu);
/**/
var sec = new Sections.UniformParametric1DSection(a, iy, iz, j);
var mat = UniformIsotropicMaterial.CreateFromYoungShear(e, g);
var belm = new BarElement(n1, n2) { Material = mat, Section = sec, Behavior = BarElementBehaviours.FullFrame };
model.Elements.Add(belm);
model.Nodes.Add(n1,n2);
n1.Constraints = Constraints.Fixed;
n2.Loads.Add(new NodalLoad(f));
model.Solve_MPC();
var d = model.Nodes[1].GetNodalDisplacement();
var expectedDx = (horizontalLoad*l*l*l)/(3*e*iy);
var expectedRy = (horizontalLoad * l * l) / (2 * e * iy);
var expectedDz = axialLoad * l / (e * a);
var epsilon = 0.0;
if (Math.Abs(d.DX - expectedDx) > epsilon) throw new NotImplementedException();
if (Math.Abs(d.RY - expectedRy) > epsilon) throw new NotImplementedException();
if (Math.Abs(d.DZ - expectedDz) > epsilon) throw new NotImplementedException();
}
}
}