Example 5j1: Dragging a soft material against a rigid body using frictional contact

This example demonstrates the use of frictional contact between two objects. The soft body is gradually displaced against the rigid body and frictional contact provides resistance between two bodies, resulting in shear deformation of the soft body.

The comfile run by this example is as follows:

# If the example path is not set, default to current directory
if (!defined $example) {
    $example = "./";
# Drop off the trailing / in the example path
$chopped = chop $example;
if ($chopped ne "/") {
    $example .= $chopped;

$LOAD=30;      # define number of load steps
$OVER_LAP=1;   # initial overlap to solve contact                                               
set echo

fem def para;r;contact;example   # memory allocation
fem def coord 3,1                # 3D model
fem def reg;r;regi;example       # define two regions

fem def base;r;Base;example      # define basis functions. 
                                 # Tricubic for geometry, trilinear for incompressibility (see .ipequa)

# define slave geometry

fem def node;r;Slave_1by1by1;example reg 1
fem def elem;r;Slave_1by1by1;example reg 1
fem def fibr;r;Slave_1by1by1;example reg 1
fem def elem;r;Slave_1by1by1;example fib reg 1

# define master geometry

fem def node;r;Master_1by1by1;example reg 2
fem def elem;r;Master_1by1by1;example reg 2
fem def fibr;r;Master_1by1by1;example reg 2
fem def elem;r;Master_1by1by1;example fib reg 2

# re-size and re-position master body

fem change node scale by 5,5,1 reg 2
fem change node translate by -5,-5,2 reg 2

# must update scale factors after using 'fem change node scale' command

fem update scale normalise reg 2

# export slave and master bodies

#fem export node;Undeformed_Slave as Undeformed_Slave reg 1
#fem export elem;Undeformed_Slave as Undeformed_Slave reg 1

#fem export node;Undeformed_Master as Undeformed_Master reg 2
#fem export elem;Undeformed_Master as Undeformed_Master reg 2

# group element, node, faces for boundary conditions

fem group elem all s3=1 external as SLAVE_TOP reg 1
fem group elem all s3=0 external as SLAVE_BOTTOM reg 1
fem group node elem SLAVE_BOTTOM xi3=0 external as SLAVE_FIXED reg 1
fem group face all elem SLAVE_TOP xi3 high external as SLAVE_FACE reg 1

fem group elem all as MASTER_TOP reg 2
fem group node elem MASTER_TOP xi3=1 as TEMP1 reg 2
fem group node elem MASTER_TOP xi3=0 as TEMP2 reg 2
fem group node TEMP1,TEMP2 as MASTER reg 2
fem group node elem MASTER_TOP xi3=1 external as MASTER_FIXED reg 2
fem group face all elem MASTER_TOP xi3 low external as MASTER_FACE reg 2

# 3D finite elasticity with contact, neo-hookean material, and fixed boundary conditions for both bodies
# For slave body, non-contact nodes are displaced in both x, y coordinates to shift the body
# Contact mechanics will provide resistance to the contact nodes of the slave body

fem def equa;r;slave;example reg 1
fem def mate;r;slave_neo;example reg 1
fem def init;r;slave;example reg 1

fem def equa;r;master;example reg 2
fem def mate;r;master_neo;example reg 2
fem def init;r;master;example reg 2

# define contact parameter values

fem def contact;r;contact;example

# define LU solver for coupled problem. 

fem def solv;r;LU;example coupled reg 1,2

for ($i=1;$i<=$LOAD;$i++){

  # for the 1st load step, move slave body to create overlap with master body  

  if ($i==1) {
    # Copy YP1 into XP
    fem update geom from sol YP_index 1 to 1..3 reg 1

    # Translate XP
    fem change node translate by 0,0,$OVER_LAP reg 1
    # update YP1 from the translated XP
    fem update solution geometry substitute reg 1

    # Update XP from YP3
    fem update geom from sol YP_index 3 to 1..3 reg 1 
  # contact newton loop 

  while ($CONVERGED==0){
    print "                      \n";
    print " ==================== \n";
    print "    Load step = $i    \n";
    print " ==================== \n";
    print "                      \n";

    ### Projection ###

    # update XP from YP
    FEM up geom from sol to 1..3 reg 1,2

    fem def xi;c contact_friction faces SLAVE_FACE points 4 boundary reg 1
    # Define data at xi positions 
    fem def data;c from_xi

    # Update slave info
    fem update data field to slave

    # Project onto target face (Region 2)
    fem def xi;c closest_face faces MASTER_FACE region 2
    # store projection gap in data fields
    fem update data field from gap region 2  

    # Update master info
    fem update data field to master 
    # Place initial geometry YP(ny,3) into XP
    fem up geom from sol YP_index 3 to 1..3 reg 1,2


    # Solve finite elasticity/contact problem
    fem solve coupled error 0.1D-03 iterate 20 reg 1,2



# write out contact residual, which is stored in YP(ny,6)
# WARNING: The contact residual written out here contains residual 
#          for reg 1 (under nc=1) and reg 2 (under nc=2) due to the 
#          different array setting for YP(ny,6) (no class is defined)
#          It is the same case for finite elasticity residual stored in
#          YP(ny,4), so reg 2 residual is stored under nc=2 in reg 1. 
fem list variable;contact_residual number 6

# save solution
fem def init;w;conv_soln

Files used by this example are:

Name                      Modified     Size

example_5j1.com 17-Oct-2008 4.8k Base.ipbase 14-May-2008 5.6k LU.irsolv 16-Aug-2010 2.5k LU.irsolv.old 14-May-2008 2.4k Master_1by1by1.ipelem 14-May-2008 536 Master_1by1by1.ipelfb 14-May-2008 358 Master_1by1by1.ipfibr 14-May-2008 2.1k Master_1by1by1.ipnode 14-May-2008 14k Slave_1by1by1.ipelem 14-May-2008 536 Slave_1by1by1.ipelfb 14-May-2008 349 Slave_1by1by1.ipfibr 14-May-2008 2.1k Slave_1by1by1.ipnode 14-May-2008 14k Undeformed_Master.exelem 14-May-2008 8.8k Undeformed_Master.exnode 14-May-2008 6.2k Undeformed_Slave.exelem 14-May-2008 8.8k Undeformed_Slave.exnode 14-May-2008 6.2k contact.ipcont 25-Sep-2008 640 contact.ippara 24-Sep-2009 5.9k contact_residual.opvari 17-Oct-2008 18k conv_soln.ipinit 17-Oct-2008 43k master.ipequa 14-May-2008 2.1k master.ipinit 14-May-2008 2.9k master_neo.ipmate 14-May-2008 2.2k regi.ipregi 14-May-2008 93 slave.ipequa 14-May-2008 2.1k slave.ipinit 14-May-2008 2.9k slave_neo.ipmate 14-May-2008 2.2k

Download the entire example:

Name                      Modified     Size

examples_5_5j_5j1.tar.gz 17-Aug-2010 26k

Testing status by version:

StatusTestedReal time (s)
cm64SuccessWed Mar 4 01:32:21 2009101
cm64-debugSuccessTue Mar 3 03:16:10 20092172
cmSuccessSun Mar 6 00:02:54 201647
cm-debugSuccessSat Mar 5 00:15:08 2016362

Testing status by file:

Html last generated: Sun Mar 6 05:50:29 2016

Input last modified: Mon Aug 16 11:19:19 2010

CMISS Help / Examples / 5 / 5j / 5j1