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
154 stars 57 forks source link

BarElement InternalForce #23

Closed epsi1on closed 4 years ago

epsi1on commented 4 years ago

Describe the bug BarElement’s internal forces are inverted relative to the middle of the element.

Expected behavior and Current Behavior

Incorrect (with BarElement): image

Correct (with FrameElement2Node): image

Additional context Reported by S.G.

epsi1on commented 4 years ago

It seems working right:

image

image is output of this code with some graphic edits class: BriefFiniteElementNet.Validation.GithubIssues.Issue23

        var model = new Model();

        var l = 5.0;

        var n1 = new Node() { Constraints = Constraints.Fixed };
        var n2 = new Node(l,0,0) { Constraints = Constraints.Fixed };

        var elm = new BarElement();

        elm.Material = Materials.UniformIsotropicMaterial.CreateFromYoungPoisson(210e9, 0.25);
        elm.Section = new Sections.UniformGeometric1DSection(SectionGenerator.GetRectangularSection(0.05, 0.05));

        elm.Nodes[0] = n1;
        elm.Nodes[1] = n2;

        elm.EndReleaseCondition = Constraints.RotationFixed;

        var load = new Loads.UniformLoad(LoadCase.DefaultLoadCase, Vector.K, -100, CoordinationSystem.Global);
        elm.Loads.Add(load);

        model.Elements.Add(elm);
        model.Nodes.Add(n1, n2);

        model.Solve_MPC();

        var fnc = new Func<double, double>(x =>
        {
            try
            {
                var xi = elm.LocalCoordsToIsoCoords(x);
                var frc = elm.GetExactInternalForceAt(xi[0]);
                return frc.My;
            }
            catch
            {

                return 0;
            }

        });

        Controls.FunctionVisualizer.VisualizeInNewWindow(fnc, 1E-6, l-1E-6, 50);