TMM4175 Polymer Composites

Home About Python Links Table of Contents

CASE STUDY: Linear displacement field

A linear displacement field can be expressed by

\begin{equation} u(x,y,z) = a_1 x + a_2 y + a_3 z, \quad v(x,y,z) = b_1 x + b_2 y + b_3 z, \quad w(x,y,z) = c_1 x + x_2 y + c_3 z \end{equation}

where $u,v,w$ are displacments in the directions $x,y,z$

Consider the set of boundary conditions

\begin{equation} u(0,0,0) = 0, \quad v(0,0,0) = 0, \quad w(0,0,0) = 0,\quad u(0,y,0) = 0, \quad w(x,0,0) = 0, \quad w(0,y,0) = 0 \end{equation}

The displacement field can now be expressed by the engineering strains as:

\begin{equation} u(x,y,z) = \varepsilon_x x + \gamma_{xz} z, \quad v(x,y,z) = \gamma_{xy} x + \varepsilon_y y + \gamma_{yz} z, \quad w(x,y,z) = \varepsilon_z z \end{equation}

Figure-1 illustrates the nodal displacements imposed on a single 8-nodes linear hex elemement for three non-zero strain components.

Figure-1: Nodal displacements of a single 8-nodes linear hex element

Abaqus implementation

The element has dimensions 1x1x1. The imposed non-zero strain components for the following example are $\varepsilon_x = 0.01$ and $\gamma_{xy}=0.02$

Figure-2: Deformation, scaled x20

An Abaqus python script for the model is listed below:

In [ ]:
from abaqus import *
from abaqusConstants import *
import mesh
import regionToolset

modelName='model-01'

# imposed strains:
ex =  0.01
ey =  0.0
ez =  0.0
exy = 0.02
exz = 0.0
eyz = 0.0

mdb.Model(name=modelName, modelType=STANDARD_EXPLICIT)
p = mdb.models[modelName].Part(name='Part-1', dimensionality=THREE_D, 
    type=DEFORMABLE_BODY)

p.Node(coordinates=(0.0, 0.0, 0.0))
p.Node(coordinates=(1.0, 0.0, 0.0))
p.Node(coordinates=(1.0, 1.0, 0.0))
p.Node(coordinates=(0.0, 1.0, 0.0))
p.Node(coordinates=(0.0, 0.0, 1.0))
p.Node(coordinates=(1.0, 0.0, 1.0))
p.Node(coordinates=(1.0, 1.0, 1.0))
p.Node(coordinates=(0.0, 1.0, 1.0))

n = p.nodes
p.Element(nodes=(n[0], n[1], n[2], n[3], n[4], n[5], n[6], n[7]), 
    elemShape=HEX8)
    
elemType1 = mesh.ElemType(elemCode=C3D8R, elemLibrary=STANDARD, 
    kinematicSplit=AVERAGE_STRAIN, secondOrderAccuracy=OFF, 
    hourglassControl=DEFAULT, distortionControl=DEFAULT)

elems = (p.elements[0:1],)
p.setElementType(regions=elems, elemTypes=(elemType1, ))

mdb.models[modelName].Material(name='Material-1')
mdb.models[modelName].materials['Material-1'].Elastic(table=((1000.0, 0.3), ))
mdb.models[modelName].HomogeneousSolidSection(name='Section-1', 
    material='Material-1', thickness=None)

region = p.Set(elements=elems, name='Set-1')
p.SectionAssignment(region=region, sectionName='Section-1', offset=0.0, 
    offsetType=MIDDLE_SURFACE, offsetField='', 
    thicknessAssignment=FROM_SECTION)

a = mdb.models[modelName].rootAssembly
a.DatumCsysByDefault(CARTESIAN)
a.Instance(name='Part-1-1', part=p, dependent=ON)

mdb.models[modelName].StaticStep(name='Step-1', previous='Initial')

nodes = a.instances['Part-1-1'].nodes

regions=[]
for i in range(0,8):
    regions.append( regionToolset.Region(nodes=nodes[i:i+1]) )


mdb.models[modelName].DisplacementBC(name='BC-1', createStepName='Step-1', 
    region=regions[0], u1=0.0, u2=0.0, u3=0.0)
mdb.models[modelName].DisplacementBC(name='BC-2', createStepName='Step-1', 
    region=regions[1], u1=ex, u2=exy, u3=0.0)
mdb.models[modelName].DisplacementBC(name='BC-3', createStepName='Step-1', 
    region=regions[2], u1=ex, u2=exy+ey, u3=0.0)
mdb.models[modelName].DisplacementBC(name='BC-4', createStepName='Step-1', 
    region=regions[3], u1=0.0, u2=ey, u3=0.0)

mdb.models[modelName].DisplacementBC(name='BC-5', createStepName='Step-1', 
    region=regions[4], u1=exz, u2 = eyz, u3=ez)
mdb.models[modelName].DisplacementBC(name='BC-6', createStepName='Step-1', 
    region=regions[5], u1=ex+exz, u2=exy+eyz, u3=ez)
mdb.models[modelName].DisplacementBC(name='BC-7', createStepName='Step-1', 
    region=regions[6], u1=ex+exz, u2=exy+ey+eyz, u3=ez)
mdb.models[modelName].DisplacementBC(name='BC-8', createStepName='Step-1', 
    region=regions[7], u1=exz, u2=ey+eyz, u3=ez)
    
mdb.Job(atTime=None, contactPrint=OFF, description='', echoPrint=OFF, 
    explicitPrecision=SINGLE, getMemoryFromAnalysis=True, historyPrint=OFF, 
    memory=90, memoryUnits=PERCENTAGE, model=modelName, modelPrint=OFF, 
    multiprocessingMode=DEFAULT, name=modelName, nodalOutputPrecision=SINGLE, 
    numCpus=1, numGPUs=0, queue=None, resultsFormat=ODB, scratch='', type=
    ANALYSIS, userSubroutine='', waitHours=0, waitMinutes=0)

mdb.jobs[modelName].submit(consistencyChecking=OFF)

mdb.jobs[modelName].waitForCompletion()

workdir = os.getcwd()

odbfile=workdir+'\\'+modelName+'.odb'

odb = session.openOdb(name=odbfile)

session.viewports['Viewport: 1'].setValues(displayedObject=odb)

session.viewports['Viewport: 1'].odbDisplay.setPrimaryVariable(
    variableLabel='S', outputPosition=INTEGRATION_POINT, refinement=(COMPONENT, 
    'S11'), )
    
session.viewports['Viewport: 1'].odbDisplay.display.setValues(
    plotState=CONTOURS_ON_DEF)

Disclaimer:This site is about polymer composites, designed for educational purposes. Consumption and use of any sort & kind is solely at your own risk.
Fair use: I spent some time making all the pages, and even the figures and illustrations are my own creations. Obviously, you may steal whatever you find useful here, but please show decency and give some acknowledgment if or when copying. Thanks! Contact me: nils.p.vedvik@ntnu.no www.ntnu.edu/employees/nils.p.vedvik

Copyright 2021, All right reserved, I guess.