BriefFiniteElementNet / BriefFiniteElement.Net

BriefFiniteElementDotNET (BFE.NET) is a library for linear-static Finite Element Method (FEM) analysis of solids and structures in .NET

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Fixed bar has no displacements

SerGlushko opened this issue · comments

Describe the bug
Greetings! I've been using an older version of BFE.NET since late 2020 and I have recently discovered an issue that is present in the latest build as well.
A simple bar has two fixed supports and a distributed load. Its internal displacements are empty unless intermediary nodes are introduced. Two example apps are provided below

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

var model = new Model();

Node n1, n2;

model.Nodes.Add(n1 = new Node(x: 0, y: 0, z: 0) { Constraints = Constraints.Fixed });
model.Nodes.Add(n2 = new Node(x: 10, y: 0, z: 0) { Constraints = Constraints.Fixed });

var elm = new BarElement(n1, n2);

model.Elements.Add(elm);

elm.Section = new BriefFiniteElementNet.Sections.UniformParametric1DSection(a: 0.01, iy: 8.3e-6, iz: 8.3e-6, j: 16.6e-6);
elm.Material = BriefFiniteElementNet.Materials.UniformIsotropicMaterial.CreateFromYoungPoisson(210e9, 0.3);

elm.Loads.Add(new BriefFiniteElementNet.Loads.UniformLoad(LoadCase.DefaultLoadCase, new Vector(0, 0, 1), 50000, CoordinationSystem.Local));

model.Solve_MPC();

List<Displacement> dpms = new List<Displacement>();

var iso = new[] { -1.0 };
dpms.Add(elm.GetInternalDisplacementAt(iso[0], LoadCase.DefaultLoadCase));
for (int i = 1; i < 10; i++)
{
    iso = elm.LocalCoordsToIsoCoords(i);
    dpms.Add(elm.GetInternalDisplacementAt(iso[0], LoadCase.DefaultLoadCase));
}
iso[0] = 1;
dpms.Add(elm.GetInternalDisplacementAt(iso[0], LoadCase.DefaultLoadCase));
Console.WriteLine("Press any key to continue");
Console.ReadKey();
            

image

Expected behavior

 var model = new Model();

Node n1, n2, n3;

model.Nodes.Add(n1 = new Node(x: 0, y: 0, z: 0) { Constraints = Constraints.Fixed });
model.Nodes.Add(n2 = new Node(x: 5, y: 0, z: 0) { Constraints = Constraints.Released });
model.Nodes.Add(n3 = new Node(x: 10, y: 0, z: 0) { Constraints = Constraints.Fixed });

var elm1 = new BarElement(n1, n2);
var elm2 = new BarElement(n2, n3);

model.Elements.Add(elm1);
model.Elements.Add(elm2);

elm1.Section = new BriefFiniteElementNet.Sections.UniformParametric1DSection(a: 0.01, iy: 8.3e-6, iz: 8.3e-6, j: 16.6e-6);
elm2.Section = new BriefFiniteElementNet.Sections.UniformParametric1DSection(a: 0.01, iy: 8.3e-6, iz: 8.3e-6, j: 16.6e-6);
elm1.Material = BriefFiniteElementNet.Materials.UniformIsotropicMaterial.CreateFromYoungPoisson(210e9, 0.3);
elm2.Material = BriefFiniteElementNet.Materials.UniformIsotropicMaterial.CreateFromYoungPoisson(210e9, 0.3);

elm1.Loads.Add(new BriefFiniteElementNet.Loads.UniformLoad(LoadCase.DefaultLoadCase, new Vector(0, 0, 1), 50000, CoordinationSystem.Local));
elm2.Loads.Add(new BriefFiniteElementNet.Loads.UniformLoad(LoadCase.DefaultLoadCase, new Vector(0, 0, 1), 50000, CoordinationSystem.Local));

model.Solve_MPC();

List<Displacement> dpms = new List<Displacement>();

var iso = new[] { -1.0 };
dpms.Add(elm1.GetInternalDisplacementAt(iso[0], LoadCase.DefaultLoadCase));
for (int i = 1; i < 5; i++)
{
    iso = elm1.LocalCoordsToIsoCoords(i / 2);
    dpms.Add(elm1.GetInternalDisplacementAt(iso[0], LoadCase.DefaultLoadCase));
}
iso[0] = 1;
dpms.Add(elm1.GetInternalDisplacementAt(iso[0], LoadCase.DefaultLoadCase));
            for (int i = 1; i < 5; i++)
{
    iso = elm2.LocalCoordsToIsoCoords(i / 2);
    dpms.Add(elm2.GetInternalDisplacementAt(iso[0], LoadCase.DefaultLoadCase));
}
iso[0] = 1;
dpms.Add(elm2.GetInternalDisplacementAt(iso[0], LoadCase.DefaultLoadCase));
Console.WriteLine("Press any key to continue");
Console.ReadKey();

image

Additional context
Original model:
image
image
Same model with an extra node in the middle:
image
image

Yes you are right. As you maybe noticed, there are two methods for getting internal force of BarElement:
BarElement.GetInternalForce and BarElement.GetExactInternalForce. (read more here)

There should be same sequence for the internal displacement:
BarElement.GetInternalDisplacement and BarElement.GetExactInternalDisplacement.
But the BarElement.GetExactInternalDisplacement is not implemented (yet), so i think the only method to get nonzero internal displacement, is to add a middle node at somewhere near center of BarElement...

Thank you for your response!
I find it a little confusing considering that the displacements of statically determinate bar with pin and roller supports are calculated correctly while the support nodes have a displacement of zero
image
image

Thank you for your response! I find it a little confusing considering that the displacements of statically determinate bar with pin and roller supports are calculated correctly while the support nodes have a displacement of zero image image

support nodes have linear displacement of zero, BUT rotational displacement is nonzero (each node have 6 DoF, 3 linear and three rotational).
But if you fix both ends, then both rotational and linear displacements go zero.

Thank you for the clarification!