Commit 4bd1a18e authored by Asutosh Padhy's avatar Asutosh Padhy
Browse files

Static and dynamic simulation cases checked with displacement boundary conditions

parent 5bbbaf5a
Loading
Loading
Loading
Loading
+1 −0
Original line number Diff line number Diff line
*.avi
*.pyc
*.odb
+27 −5
Original line number Diff line number Diff line
geometry:
    film_length : 1.5 #x length of film
    film_height : 1.5 # y height of film
    film_width : 1.5 #z width of film
    film_length : 5 #x length of film
    film_height : 5 # y height of film
    film_width : 5 #z width of film
    mesh: 0.5               #Mesh size in mm
    El_type: "C3D8" #Element type

@@ -44,5 +44,27 @@ materials:
loading:
    init_temp: 325.0
    steps: 2  #Number of steps
    type: 1 #1- Force, 2 - Displacement, 3 - Temperature
    value: 500000000 #X direction 1e8 minimum
    type: 2 #1- Force, 2 - Displacement, 3 - Temperature
    value: 1.5 #X direction 1e8 minimum
    analysis: 1 # 1- Static 2 - Dynamic Implicit


#####
# SDV1 Direction of transformation indicator
# SDV2 Martensitic volume fraction
# SDV3 Flag for transformation 0 - No 1 - Yes
# SDV5 Component of transformation strain in 11 direction
# SDV6 Component of transformation strain in 22 direction
# SDV7 Component of transformation strain in 33 direction
# SDV8 2*Component of transformation strain in 23 direction
# SDV9 2*Component of transformation strain in 13 direction
# SDV10 2*Component of transformation strain in 12 direction
# SDV14 Value of effective transformation strain
# SDV15 Current temperature
# SDV20 Component of the transformation direction tensor A in 11 direction
# SDV21 Component of the transformation direction tensor A in 22 direction
# SDV22 Component of the transformation direction tensor A in 33 direction
# SDV23 Component of the transformation direction tensor A in 23 direction
# SDV24 Component of the transformation direction tensor A in 13 direction
# SDV25 Component of the transformation direction tensor A in 12 direction
# SDV28 Value of the martensitic volume fraction at point of reversal of transformation
+35 −35
Original line number Diff line number Diff line
@@ -29,26 +29,25 @@ import math
import copy

################ create step ###############
def step(model):
def step(model,loading):
    """Define load step with solution settings
    Arguments:
        model {[model]} -- Abaqus model object
    """
    # Default parameters for FEM simulation set here
    # model.StaticStep(name='Loading', previous='Initial',
    #     timePeriod=100.0, maxNumInc=1000, initialInc=1.0, minInc=0.001,
    #     maxInc=1.0)

    # model.StaticStep(name='Unload', previous='Loading',
    #     timePeriod=100.0, maxNumInc=1000, initialInc=1.0, minInc=0.001,
    #     maxInc=1.0)

    analysis = loading["analysis"]
    if analysis==1:
        model.StaticStep(name='Loading', previous='Initial',
            timePeriod=100.0, maxNumInc=1000, initialInc=0.001, minInc=1e-6, maxInc=1.0,nlgeom=OFF)
        model.StaticStep(name='Unload', previous='Loading',
            timePeriod=100.0,maxNumInc=10000, initialInc=0.001, minInc=1e-6, maxInc=1.0,nlgeom=OFF)

    elif analysis==2:
        model.ImplicitDynamicsStep(name='Loading', previous='Initial',
            timePeriod=100.0, maxNumInc=1000, initialInc=0.001, minInc=1e-6,nlgeom=OFF)
        model.ImplicitDynamicsStep(name='Unload', previous='Loading',
            timePeriod=100.0,maxNumInc=10000, initialInc=0.001, minInc=1e-6,nlgeom=OFF)

    # AMPLITUDE
        # AMPLITUDE###
        ##################
        model.SmoothStepAmplitude(name='Amp-1', timeSpan=STEP, data=((
        0.0, 0.0), (100.0, 1.0)))
        model.SmoothStepAmplitude(name='Amp-2', timeSpan=STEP, data=((
@@ -67,6 +66,7 @@ def BC(loading, geometry, model):
    w = geometry["film_width"]
    h= geometry["film_height"]
    init_temp= loading["init_temp"]
    analysis = loading["analysis"]

    #Left face nodes fixed in X
    #####################################
@@ -113,33 +113,33 @@ def BC(loading, geometry, model):

    # Right faces prescribed displacement/force in X
    #################################################################
    if loading["type"]==1:
        s = a.instances["FILM-1"].elements.getByBoundingBox(l-mesh*2,-mesh*2,-mesh*2,l+mesh*2,h+mesh*2,w+mesh*2)
        a.Surface(face4Elements=s,name="BC-Surf")
        Surf=a.surfaces["BC-Surf"]
    if loading["type"]==1:
        model.Pressure(name='Load-1', createStepName='Loading',
        region=Surf, distributionType=UNIFORM, field='', magnitude=-value,
        amplitude="Amp-1")
        model.loads['Load-1'].setValuesInStep(stepName='Unload', magnitude=0.0,
        amplitude= "Amp-2")

        # model.loads['Load-1'].setValuesInStep(stepName='Unload', cf1=0.0)
            # mdb.models['Model-1'].boundaryConditions['Bearing1'].setValuesInStep(
        #     stepName='Unload', amplitude='Amp-2')

        #model.boundaryConditions['Disp-1'].setValuesInStep(stepName='Unload', amplitude='')
        if analysis==2:
            model.loads['Load-1'].setValuesInStep(stepName='Loading', amplitude="Amp-1")
            model.loads['Load-1'].setValuesInStep(stepName='Unload', amplitude="Amp-2")

    elif loading["type"]==2:
        s = a.instances["FILM-1"].nodes.getByBoundingBox(l-mesh,-mesh,-mesh,l+mesh,h+mesh,w+mesh)
        region = regionToolset.Region(nodes=s)
        a.Set(nodes=s, name="BC-Disp")
        model.DisplacementBC(name="BC-Disp", createStepName='Loading',
                            region=Surf, u1=value, u2=UNSET,
                            u3=UNSET, ur1=UNSET, ur2=UNSET, ur3=UNSET, amplitude=UNSET, fixed=OFF,
                            distributionType=UNIFORM, fieldName="", localCsys=None)
        model.DisplacementBC(name="BC-Disp", createStepName='Unload',
                            region=Surf, u1=0.0, u2=UNSET,
                            region=region, u1=value, u2=UNSET,
                            u3=UNSET, ur1=UNSET, ur2=UNSET, ur3=UNSET, amplitude=UNSET, fixed=OFF,
                            distributionType=UNIFORM, fieldName="", localCsys=None)
        model.boundaryConditions['BC-Disp'].setValuesInStep(stepName='Unload', u1=0.0)

        #model.boundaryConditions['Disp-1'].setValuesInStep(stepName='Unload', amplitude='')
        if analysis==2:
            model.boundaryConditions['BC-Disp'].setValuesInStep(stepName='Loading', amplitude='Amp-1')
            model.boundaryConditions['BC-Disp'].setValuesInStep(stepName='Unload', amplitude='Amp-2')

# ############### set Output requests ###############
def outputreq(model):
@@ -205,7 +205,7 @@ loading= input["loading"]
mdb.ModelFromInputFile(name='JOB',
    inputFileName=INP)
model = mdb.models["JOB"]   # Specify model number
step(model)
step(model,loading)
outputreq(model)
BC(loading, geometry, model)
mdb.saveAs(pathName=CAE)
Loading