Thursday, 3 August 2017

ODB post processing using python scripts.

Dear All,
Today I will show you how python script can be used to do post processing of ABAQUS output files ODB. ODB is a binary file so unlike other files like input file, message file it cannot be opened directly to look at the results. Python scripts can be used to read the data in the odb files. Lets do it step by step.

You need any odb file and it would be better if you are working with  linux system.  Now follow following steps.

1. Create a python file with . py extension, in my case mark.py and write

import sys
import os
from odbAccess import *
from numpy import savetxt,loadtxt,sort,asarray,zeros
from abaqusConstants import *
import sys
################################################
from odbMaterial import *
from odbSection import *
################################################

# reading the odb file. 
odb=openOdb(path='/home/kishan/Job-1.odb') 
print odb


Some of these are mandatory modules which need to imported to read the abaqus file.
Then open a terminal in the folder where python file is created which in my case is  '/home/kishan'.  Type "abaqus python mark.py". The result will look like something like this

({'analysisTitle': '', 'closed': False, 'customData': python object wrapper, 'description': 'DDB object', 'diagnosticData': 'OdbDiagnosticData object', 'isReadOnly': False, 'jobData': 'JobData object', 'materials': 'Repository object', 'name': '/home/kishan/Desktop/simulation/ICAMS/Ramber_Hydrogen/Ramberg_PBC/Job-1.odb', 'parts': 'Repository object', 'path': '/home/kishan/Job-1.odb', 'profiles': 'Repository object', 'readInternalSets': False, 'rootAssembly': 'OdbAssembly object', 'sectionCategories': 'Repository object', 'sections': 'Repository object', 'sectorDefinition': None, 'steps': 'Repository object', 'userData': 'UserData object'})

The important point to note here is the bracket used which is '})' which means that we can go inside the odb file using 'dot' for example we can write "print odb.steps" to look results related to step.  If you are familiar with object oriented programming then you know what I am talking about.

2. Then let's do "print odb.steps"  so see what happens.  The ouput on screen is 
 {'Step-1': 'OdbStep object'} Which means there is only one step used with name Step-1. please keep in mind that s is capital like in superman.  You will also find that now there is only curly bracket which means we have to put name not instead  of dot. So we will write now "print odb.steps['Step-1']" and the result is
  ({'acousticMass': -1.0, 'acousticMassCenter': (), 'description': '', 'domain': TIME, 'eliminatedNodalDofs': 'NodalDofsArray object', 'frames': 'OdbFrameArray object', 'historyRegions': 'Repository object', 'inertiaAboutCenter': (), 'inertiaAboutOrigin': (), 'loadCases': 'Repository object', 'mass': -1.0, 'massCenter': (), 'name': 'Step-1', 'nlgeom': True, 'number': 1, 'previousStepName': 'Initial', 'procedure': '*COUPLED TEMPERATURE-DISPLACEMENT, STEADY STATE', 'retainedEigenModes': (), 'retainedNodalDofs': 'NodalDofsArray object', 'timePeriod': 2.0, 'totalTime': 0.0})


 3. Now there is same bracket as in step 1 so we will again use dot and lets go in frames "print odb.steps['Step-1'].frames". The result will look something like this 
['OdbFrame object', 'OdbFrame object', 'OdbFrame object', 'OdbFrame object', 'OdbFrame object', 'OdbFrame object', 'OdbFrame object', 'OdbFrame object', 'OdbFrame object']  . There is only square bracket which is new. Now we have to use numbers. Abaqus divides the whole analysis in many increments. If we write 
"print odb.steps['Step-1'].frames[0]" , this means that we are looking at step-1 at the start of step or say at first increment which will corresponds to t=0 time of this step. 

That's it. You all have to do is learn a simple python like reading a file, writing data in file, all loops and look carefully at the brackets. 
  • ({---------------------- use . 
  • {----------------------- use names 
  • []----------------------- use numbers 0 for starting and -1 for end.
I hope that it was useful for you. If you still have some doubts do comment and I will try to answer them as soon as possible   

Saturday, 8 July 2017

Element deletion in abaqus 14.

Hello everyone,
Abaqus has released new version which among other things allows user to delete element even when using abaqus standard. This feature was not present in earlier versions.
This post will help you in understanding how you may use this feature in abaqus now.
It is important to note that this feature requires following things.
  • Defining a control for the element deletion part which enables the element deletion feature, for example  " *SECTION CONTROLS,ELEMENT DELETION=YES,MAX DEGRADATION=0.75,NAME=CONT
  •  You must use UMAT to define the constitutive behavior of the material.In doing so you will also have to define the damage criteria using damage varible D
      where D is 0 when no damage and it becomes 1 then material is fully damaged. 
    • In input file you will also need to define the state variable which will correspond to the damage variable of the element.
      "*Depvar, delete =10
            20, "
      tells that there are total of 20 state variables and if the value of SDV(10) is 1 for integration points of an element then that element is active and if all have value 0 then those element will be removed. 
    • We also need to define output variable "Status" in the input file. 

    Wednesday, 24 May 2017

    Questions ???

    Hello everyone. If you have any question, you may use this post and write your questions in the comments. I will try to answer them as soon as possible.

    Thank you.

    Abaqus and intel fortran installation in UBUNTU.

    You may find this youtube video of  abaqus installation in ubuntu very useful which shows how to install the abaqus if you have the license already installed somewhere. you can then just use the ip address of that license server to access the abaqus licenses.
    If you are a university student then just copying the installed abaqus folder into your home directory will also work provided you have access to the license server.

    If you still find any difficulty, you may contact the IT staff of your college or you may also contact me. I would be happy to assist you.I would recommed to get familiar with ubuntu operating system which you will find quite useful for user defined material modelling.

    We need to link intel fortran  to abaqus to run the user based subroutines. Intel allows students to install a non comercial version of fortran for a limited period.
    University students can register here and install intel fortran without any cost for personal use.

    Please post your questions in the comments.

    Material Simulation in Abaqus

    This blog is to learn user defined material simulation in Abaqus where we use subroutines like UMAT, UEL, VUMAT, UMATHT, UDMGINI etc. Such kind of subroutines can be used to define any kind of material which is not inbuilt in abaqus.

    I hope that this blog would help you in learning abaqus better. Wish you a great time. 

    If you need any kind of help with abaqus, you are most welcome to contact me at krishangovind@iitrpr.ac.in or kishan.govind@rub.de.

    Please share this blog so that others can also learn.