fiber section stress-strain output through recorder command

Forum for asking and answering questions related to use of the OpenSeesPy module

Moderators: silvia, selimgunay, Moderators

Post Reply
mcetink
Posts: 2
Joined: Mon Jun 05, 2017 3:09 pm
Location: Nc State University

fiber section stress-strain output through recorder command

Post by mcetink » Sat May 09, 2020 2:20 am

Hello, I am a new learner of OpenSees and have started learning it through its Python version. My question is about generating stress-strain outputs for a specific fiber or for a specific location in a given section. I am currently working through the example of 14.2.8, which is available in https://openseespydoc.readthedocs.io/en ... anti2.html . I have added 2 lines of element recorder command to the original code generating stress-strain outputs. I obtained different results at different combination of these two lines of commands. Below I give the commands I tried in generating stress-strain outputs with my own interpretations and the questions I kindly ask you to help me understand. Any help is appreciated.

1) op.recorder('Element', '-file', 'Data-2c/FiberSec1SS.out','-time','-closeOnWrite', '-ele', 1, 'section', '1', 'fiber', '5','stressStrain')

Does this command generate stress-strain values at fiber 5 in section 1? When I take the 5 out of quotes, i.e. (...‘fiber’, 5, stressStrain), it produces different results. What does the command generate when I write it by putting 5 in quotes and with non-quotes? Also, I am wondering what is the ordering of fiber numbers in a patched section? Is it possible to obtain the fiber number that corresponds to a given coordinate pairs in local axis?

2) op.recorder('Element', '-file', 'Data-2c/FiberSec1SS.out','-time','-closeOnWrite', '-ele', 1, 'section', '1', 'fiber', '5','15','stressStrain')

Here I am trying to get stress-strain values for a specific location (5 units in y and 15 units in z). Again, when I remove the quotes from these two coordinate entries, I get different results. I am wondering functioning difference between coding as … 'fiber', '5','15','stressStrain' and as….'fiber', 5,15,'stressStrain'.

pavanchigullapally
Posts: 2
Joined: Sat Sep 16, 2017 4:23 pm
Location: university of auckland

Re: fiber section stress-strain output through recorder command

Post by pavanchigullapally » Sat May 09, 2020 12:49 pm

Hello,

I am not sure about the recorder command (I do not use recorders anymore) but if you are using OpenSeesPy then I would recommend using eleResponse command and not recorders. As recorders take a lot of time to run your analysis(open file -> save data->close file each time it saves data in a loop, it can consume a lot of time if your analysis or structure is big).

The below line of code and approach can give you the stress-strain of a section within an element for a given y and z coordinates within the fiber section (this is the way I plot my stress-strains). If you are not sure which Z and Y (out of 4 quadrants) you max or min fiber is in then write 4 command lines (with (+z,+y), (+z, -y), etc.) and take max or min among them (depending on tension or compression). You can do the same for stresses and strains (4 lines for stresses and 4 lines for strain in that case) for the required length of column i.e. you can try to run a loop where you can run these eleResponse command lines for a given range of length, save the data in a list or dictionary at each section and then use it for plotting stress-strain curves at each section or choose the maximum value of the range if you want to find the maximum strain or stress location, you can do it for every timestep or displacement increment (depending on your analysis).

section_strain = eleResponse(Elementtag, "-section", "based on number of integration points", "-fiber", "y cordinate in section", "z cordinate in section", "material tag", "stressStrain")

I hope this helps you to plot your stress-strain curves now.

Pavan Chigullapally.

mcetink
Posts: 2
Joined: Mon Jun 05, 2017 3:09 pm
Location: Nc State University

Re: fiber section stress-strain output through recorder command

Post by mcetink » Sun May 10, 2020 5:59 am

Thank you Pavan, your answer has been very helpful.

mhscott
Posts: 444
Joined: Tue Jul 06, 2004 3:38 pm
Location: Corvallis, Oregon USA
Contact:

Re: fiber section stress-strain output through recorder command

Post by mhscott » Tue May 19, 2020 8:31 am

The quotes are a bit of a problem with recorders because they were designed for Tcl where everything is a string and the internal implementation of setResponse reflects this. With the conversion of commands to Python there's a problem if you don't pass everything in as strings, i.e., surrounded by ' '.

So, when you pass in 5, the recorder is not finding any fibers and is using the first fiber in the list. When you pass in '5', the recorder is finding the fiber you want. That's why you're getting different results.

This is something we need to fix, but there's not an easy solution.
Was my answer helpful to you? https://www.buymeacoffee.com/mhscott
Do you need extra help with OpenSees? https://courses.silviasbrainery.com/

Michael H. Scott, Ph.D.
OpenSees blog: www.portwooddigital.com

cslotboom
Posts: 6
Joined: Sun Sep 09, 2018 8:09 pm
Location: UBC

Re: fiber section stress-strain output through recorder command

Post by cslotboom » Thu Jun 11, 2020 9:02 pm

Micheal, that is incredibly useful to know about the fibre sections!
I spent my entire masters degree thinking it was not possible to recorder individual fibers in OpenSees.
I'm wondering what the scope is for string arguments?
For example, it seems like for the node recorder, using ints in python works okay. Is it just element commands that are getting tripped up?

For anyone:
My assumption always was that the overhead from recorders in OpenSeesPy was less than the overhead from using Python output commands.
Pavan, it seems like your experience was opposite to this.
I'm curious, has anyone stress tested a model using both methods?

mhscott
Posts: 444
Joined: Tue Jul 06, 2004 3:38 pm
Location: Corvallis, Oregon USA
Contact:

Re: fiber section stress-strain output through recorder command

Post by mhscott » Tue Jun 23, 2020 7:32 am

I think the recorders have less overhead than the output commands, but I haven't quantified it.
Was my answer helpful to you? https://www.buymeacoffee.com/mhscott
Do you need extra help with OpenSees? https://courses.silviasbrainery.com/

Michael H. Scott, Ph.D.
OpenSees blog: www.portwooddigital.com

mhscott
Posts: 444
Joined: Tue Jul 06, 2004 3:38 pm
Location: Corvallis, Oregon USA
Contact:

Re: fiber section stress-strain output through recorder command

Post by mhscott » Fri Aug 14, 2020 2:58 pm

A better workaround is to cast the numeric values as strings in Python. It is only a problem for numeric values that come after 'section', 'material',or 'fiber'. Not a problem with node recorders as you pointed out.

ops.recorder('Element','-ele',1,'section',str(5),...)
Was my answer helpful to you? https://www.buymeacoffee.com/mhscott
Do you need extra help with OpenSees? https://courses.silviasbrainery.com/

Michael H. Scott, Ph.D.
OpenSees blog: www.portwooddigital.com

Post Reply