BriefFiniteElementNet / BriefFiniteElement.Net

BriefFiniteElementDotNET (BFE.NET) is a library for linear-static Finite Element Method (FEM) analysis of solids and structures in .NET
GNU Lesser General Public License v3.0
148 stars 57 forks source link

BarElement ConcentratedLoad returns incorrect results for moments #101

Closed SerGlushko closed 3 years ago

SerGlushko commented 3 years ago

Describe the bug Greetings! I've tried to apply moment as a ConcentratedLoad to a BarElement and I was getting varying incorrect support reactions depending on the IsoPoint. When the moment is applied to IsoPoint -1.0 or 1.0, however, the results are correct.

To Reproduce This is the code We've used and caused wrong result/ runtime error

var m1 = new Model();
m1.Nodes.Add(new Node(0, 0, 0) { Label = "n1" });
m1.Nodes.Add(new Node(0, 0, 6) { Label = "n2" });
m1.Nodes["n1"].Constraints = new Constraint(dx: DofConstraint.Fixed, dy: DofConstraint.Fixed, dz: DofConstraint.Fixed, rx: DofConstraint.Fixed, ry: DofConstraint.Fixed, rz: DofConstraint.Fixed);
m1.Elements.Add(new BarElement(m1.Nodes["n1"], m1.Nodes["n2"]) { Label = "r1" });
(m1.Elements["r1"] as BarElement).Behavior = BarElementBehaviours.FullFrame;
(m1.Elements["r1"] as BarElement).Section = new BriefFiniteElementNet.Sections.UniformParametric1DSection(16.43 / 10000, 541.22 / 100000000, 44.92 / 100000000, 541.22 / 100000000 + 44.92 / 100000000);
(m1.Elements["r1"] as BarElement).Material = BriefFiniteElementNet.Materials.UniformIsotropicMaterial.CreateFromYoungPoisson(210 * Math.Pow(10, 9), 0.3);
m1.Elements["r1"].Loads.Add(new BriefFiniteElementNet.Loads.ConcentratedLoad(new Force(0, 0, 0, 0, -2000, 0), new IsoPoint(0.0), CoordinationSystem.Global)); //The moment is applied to the center point of the element
m1.Solve();
var r11 = m1.Nodes[0].GetSupportReaction();
var r12 = m1.Nodes[1].GetSupportReaction();
Console.WriteLine("n0 reaction: {0}", r11);
Console.WriteLine("n1 reaction: {0}", r12);
Console.ReadKey();

Expected behavior Although near-zero Fx result for n1 is exected, My must be equal to -2000

Additional context The illustration:

image

Current results are as follows:

image

epsi1on commented 3 years ago

If user applies moment about Z instead of Y, then result is right.

probably there is problem with EulerBernoulliBeamHelper.GetLocalEquivalentNodalLoads() (pre-process phase) or EulerBernoulliBeamHelper.GetLocalInternalForceAt() (post-process phase)

Each one should be tested separately, unit tests for these two methods also should be revised for any probable calculation errors :D

SerGlushko commented 3 years ago

I've got a question about legacy components. Since FrameElement2Node is now legacy, are there any plans and maybe a time frame on ConcentratedLoad support for this type of element too? Thanks in advance.

epsi1on commented 3 years ago

This issue is in progress. Currently no plan to develop legacy code. Thanks

epsi1on commented 3 years ago

Problem fixed, it should work fine now,

However I'm afraid to say fixing this bug may create another bug, Could you please also test the correctness of internal force of this beam? (I mean BarElement.GetExactInternalForce() method)?

image

Thanks

SerGlushko commented 3 years ago

It seems the results are correct for both support reactions and internal forces in this example.

image

Trying to read exactly at the point where the moment is applied throws an exception, but I guess there's no way around it. Thanks!

epsi1on commented 3 years ago

Trying to read exactly at the point where the moment is applied throws an exception, but I guess there's no way around it.

Yes because the moment is not a single value at the point that moment is applied. Take a look at this example image:

image

you can calculate exact internal force a little before (like 1e-9) and a little after this location and draw or do the rest of calculation.

Take a look at file BarElement.cs method

public Force GetExactInternalForceAt(double xi, LoadCase loadCase)

to see how these points are calculated.

keyword: InvalidInternalForceLocationException