sik_98
Student
- Jul 13, 2022
- 2
Hello,
I am trying to do the post-processing of the results of the dynamic analysis of a column, using Python scripting. A time-dependent acceleration in the X-direction is used as a boundary condition at the column base (so the base of the column oscillates around its initial position to simulate an earthquake).
I would like to obtain a contour plot of the envelope over all the frames during the ‘Seismic analysis step’ of the absolute value of the displacements of the structure, in the X-direction (U1), relative to the displacement of the column base (U1base).
To do so, I created a new coordinate system, attached to a node corresponding to the base of the structure, as follows:
myOdb.rootAssembly.DatumCsysBy6dofNode(name='CSYS_Support', coordSysType=CARTESIAN, origin=NodeSupport)
datumCoordSys = myOdb.rootAssembly.datumCsyses['CSYS_LeftSupport']
Then, I apply the coordinates transformation to my structure:
myViewport.odbDisplay.basicOptions.setValues(transformationType=USER_SPECIFIED, datumCsys=datumCoordSys)
myViewport.odbDisplay.basicOptions.setValues(rigidTransformPrimary=True, rigidTransformDeformed=True)
I checked, and I indeed obtain the U1 displacement relative to the base of the column, as expected.
Then, to obtain the envelope of the absolute value of U1 relative to the base of the column, over all the frames, I do as follows:
DisplU1 = [abs(frames.fieldOutputs['U'].getScalarField(componentLabel='U1’)) for i in range(numFrames)]
(Field_MaxAbsU1, Index_MaxAbsU1) = maxEnvelope(DisplU1)
However, by doing so, I only get a contour of the envelope of the absolute value of U1 in the initial fixed coordinate system… And not relative to the base of the column!
Maybe because the ‘abs()’ operator considers the displacement value in the initial fixed coordinate system?…
One solution that I thought of would be to use ‘getTransformedField’ as follows:
DisplU1 = [abs(frames.fieldOutputs['U'].getTransformedField(datumCsys=datumCoordSys, deformationField=frames.fieldOutputs['U'], rotationField=0*frames.fieldOutputs['U']).getScalarField(componentLabel='U1')) for i in range(numFramesInitial)]
And then use maxEnvelope as before.
However, I am not completely sure of the signification of ‘deformationField’ and ‘rotationField’: do they correspond to the displacement/rotation output fields of the whole structure for the considered frame? or just those of the node at the base (to which the 'moving' coordinate system is attached)
Also, in my case, I conduct a 2D analysis using a homogeneous solid section, so I can’t get any rotation field output (so I just used the displacement field output, and multiplied it by 0 as you can see above)…
Sorry, I have a lot of questions! Hope you can help me
Thanks in advance!
I am trying to do the post-processing of the results of the dynamic analysis of a column, using Python scripting. A time-dependent acceleration in the X-direction is used as a boundary condition at the column base (so the base of the column oscillates around its initial position to simulate an earthquake).
I would like to obtain a contour plot of the envelope over all the frames during the ‘Seismic analysis step’ of the absolute value of the displacements of the structure, in the X-direction (U1), relative to the displacement of the column base (U1base).
To do so, I created a new coordinate system, attached to a node corresponding to the base of the structure, as follows:
myOdb.rootAssembly.DatumCsysBy6dofNode(name='CSYS_Support', coordSysType=CARTESIAN, origin=NodeSupport)
datumCoordSys = myOdb.rootAssembly.datumCsyses['CSYS_LeftSupport']
Then, I apply the coordinates transformation to my structure:
myViewport.odbDisplay.basicOptions.setValues(transformationType=USER_SPECIFIED, datumCsys=datumCoordSys)
myViewport.odbDisplay.basicOptions.setValues(rigidTransformPrimary=True, rigidTransformDeformed=True)
I checked, and I indeed obtain the U1 displacement relative to the base of the column, as expected.
Then, to obtain the envelope of the absolute value of U1 relative to the base of the column, over all the frames, I do as follows:
DisplU1 = [abs(frames.fieldOutputs['U'].getScalarField(componentLabel='U1’)) for i in range(numFrames)]
(Field_MaxAbsU1, Index_MaxAbsU1) = maxEnvelope(DisplU1)
However, by doing so, I only get a contour of the envelope of the absolute value of U1 in the initial fixed coordinate system… And not relative to the base of the column!
Maybe because the ‘abs()’ operator considers the displacement value in the initial fixed coordinate system?…
One solution that I thought of would be to use ‘getTransformedField’ as follows:
DisplU1 = [abs(frames.fieldOutputs['U'].getTransformedField(datumCsys=datumCoordSys, deformationField=frames.fieldOutputs['U'], rotationField=0*frames.fieldOutputs['U']).getScalarField(componentLabel='U1')) for i in range(numFramesInitial)]
And then use maxEnvelope as before.
However, I am not completely sure of the signification of ‘deformationField’ and ‘rotationField’: do they correspond to the displacement/rotation output fields of the whole structure for the considered frame? or just those of the node at the base (to which the 'moving' coordinate system is attached)
Also, in my case, I conduct a 2D analysis using a homogeneous solid section, so I can’t get any rotation field output (so I just used the displacement field output, and multiplied it by 0 as you can see above)…
Sorry, I have a lot of questions! Hope you can help me
Thanks in advance!