xcfem / xc

finite element analysis package for civil engineering structures.
http://www.xcengineering.xyz/html_files/software.html
GNU General Public License v3.0
262 stars 54 forks source link

Question: Linear Element Loads #69

Closed MaximilianFranz closed 3 years ago

MaximilianFranz commented 3 years ago

Upon searching the repository for a while, I haven't been able to locate a test or source code that hints at a way to define linear line loads along a beam element. I found these types: https://github.com/xcfem/xc/blob/master/src/domain/load/elem_load.cc

Is it possible as of now to define a linear element line load?

If not, what is required to add it, as I believe opensees should be able to solve for that, right? Where should I look to start implementing it?

lcpt commented 3 years ago

Do you mean uniform loads over beam elements?

You can use beam2d_uniform_load and beam3d_uniform_load, you have some examples here

At present the loads are constant along the element (no trapezoidal loads yet).

MaximilianFranz commented 3 years ago

I mean trapezoidal loads. Any hint where to look in order to build it using the xc wrapper of opensees?

lcpt commented 3 years ago

Hi.

OK, now I understand.

There is no linear (or trapezoidal loads) in OpenSees or XC. To avoid this problem we normally use an element size that makes the error negligible.

Anyway, if you want to implement such a load in XC I'll be happy to help (sorry, I'm too busy to do it myself). I think the path to do this is as follows:

  1. Create a preliminary version of the new class for the load, probably as a child of Beam2dUniformLoad and/or Beam3dUniformLoad. The methods which actually add the load to the element are addReactionsInBasicSystem and addFixedEndForcesInBasicSystem, you can see those methods in the existing classes to see how they work.
  2. Object serialization: add the new LOAD_TAG_Beam2dLinearLoad values to the classTags.h file. Add the header files to the all_includes.h header.
  3. Insert the new files in CMakeLists.txt files.
  4. Python interface: expose the new class to Python; see the python interface for loads on beams.
  5. Add the corresponding command (for example beam2d_linear_load or beam3d_linear_load) to the function process_element_load.
  6. Compile the code.
  7. Write a verification test as simple as possible to check that things are working as expected.

I think that's all. Feel free to ask, this way we can also enhance the documentation of the code :)

lcpt commented 3 years ago

Hi, @MaximilianFranz.

I was reading this post and I have remembered this issue. Even if the post is not directly related to linear varying loads over the elements it discusses integration algorithms for beam elements, and maybe you can use this to compute equivalent nodal loads.

MaximilianFranz commented 3 years ago

Hey @lcpt, thanks for remembering! Though, we've chosen a simpler tool for our purposes (anastruct), which is 2D, but enough for us. We're adding the trapezoidal line loads based on the direct stiffness method there, but are not going through with the changes proposed above.

Thanks anyways :)

lcpt commented 3 years ago

You're welcome! I understand, there is no need to overcomplicate things. I'll close this issue then.

ebrahimraeyat commented 3 years ago

Hi @lcpt. Can I write the code in python? Or can I write a routine for this that takes the inputs from the user and split the element and then assign the constant load in each piece? I need it for snow load in my industrial model:

DLtotaluZ

my model in ETABS:

image

Thanks.

lcpt commented 3 years ago

Hi @ebrahimraeyat

No, if we want to add this type of load we need to modify the existing C++ code.

Nevertheless, I think the best approach is to use a finer discretization and take the average load on each element. There are a bunch of reasons to use multiple elements along each member (buckling analysis,...).

ebrahimraeyat commented 3 years ago

Yes, But I want to know if I want to create an automatically routine for it, for example a function like this:

def assign_linear_load(
    [min_load, max_load]: minimum and maximum load value,
    [min_rel_loc, max_rel_loc]: relative location on beam, 0, 1 for complete load
    element,
     ...
     ) -> list:
    CODE
    return elements

what would be the needed function's arguments? thanks

lcpt commented 3 years ago

Hi.

If the elements are generated by a line (xc.Line object) you can iterate through its elements as follows:

for e in l.elements:
    print(e.tag) # or whatever...

You can obtain the position of the element centroid using the getPosCentroid() method. After that you can use the getLambda() method of the line to compute the parameter of the element centroid in the line (the distance from the line origin to the element centroid) and then divide that by the line length to compute the relative location of the element centroid on the line.

ebrahimraeyat commented 3 years ago

Thanks @lcpt . I think this way I don't need to define additional lines. After creating elements of the line, I can assign appropriate load on it. I will try that.

lcpt commented 3 years ago

Apparently, you can define trapezoidal beam loads in OpenSees, so we can port this feature into XC quite easily.