Example d26: Hertz contact problem using finite elasticity and CellML.

Hertz contact problem using finite elasticity and CellML

Problem geometry Stress solution in vertical direction
Fig. 1 Problem geometry Fig. 2 Stress solution in vertical direction


The comfile run by this example is as follows:

#################################################################
# This solves the same Hertz problem but using finite elasticity
# and a St-Venant-Kirchoff constitutive law using grid based
# material properties and CellML.  
#################################################################

# 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;}

# Define parameters, regions, coordinate system and bases
fem def para;r;hertz;example
fem def region;r;two;example
fem def coord 3,1
fem def bases;r;collapsed;example

# Read in half-space described by trilinear elements
fem def nodes;r;half;example reg 1
fem def elem;r;half;example reg 1

# Refine half-space with dense mesh in region of contact 
fem refine xi 1 element 101 ntimes 2 reg 1
fem refine xi 1 element 101,103 ntimes 2 reg 1
fem refine xi 1 element 101,107,105,108 ntimes 1 reg 1
fem refine xi 1 element 101,107,111,112 ntimes 1 reg 1
fem refine xi 3 ntimes 3 reg 1

# Define fibre directions
fem def fibre;r;half;example reg 1
fem def elem;r;half;example fibre reg 1

# Define field 
fem def field;r;half;example reg 1
fem def elem;r;half;example field reg 1

# Read in rigid cylinder described by bicubic-linear elements
fem def nodes;r;cylinder;example reg 2
fem def elem;r;cylinder;example reg 2

# Update derivatives and scale-factors
fem up node deriv 1 linear reg 2
fem up node deriv 2 linear reg 2
fem up node deriv 3 linear reg 2
fem up scale_factors normalise reg 2

# Align cylinder for contact
fem change nodes rotate by -90 reg 2
fem change nodes translate by -2,2,0 reg 2

# Define fibre directions
fem def fibre;r;cylinder;example reg 2
fem def elem;r;cylinder;example fibre reg 2

## Export slave (half-space)
#fem export nodes;half as half reg 1 
#fem export elem;half as half reg 1 
 
## Export Master (cylinder)
#fem export nodes;cylinder as cylinder reg 2
#fem export elem;cylinder as cylinder reg 2

# Node groups for fixed boundary conditions
fem group nodes 101,305,221,301,179,297,217,293,107,103,303,219,299,177,295,215,291,105 as fixedx reg 1
fem group nodes 105,161,145,169,129,165,149,173,121,153,133,157,113,137,125,141,109,117,106,107 as fixedy1 reg 1
fem group nodes 162,146,170,130,166,150,174,122,154,134,158,114,138,126,142,110,118,108 as fixedy2 reg 1
fem group nodes 101..442 as fixedz reg 1
fem group nodes 1..20 as cylinderfixedz reg 2
fem group nodes 1..20 as cylinderfixedy reg 2
fem group nodes 1..20 as cylinderfixedx reg 2

# Define equations
fem def equa;r;half;example reg 1
fem def equa;r;cylinder;example reg 2

# Define material properties
fem def mat;r;half;example reg 1
fem def mat;r;cylinder;example reg 2

# Define initial fixed boundary conditions
fem def init;r;half;example reg 1
fem def init;r;cylinder;example reg 2

# Move cylinder through prescribed displacement
fem change nodes translate by 0,-0.02,0 nodes cylinderfixedy reg 2

## Export deformed Master
#fem export nodes;cylinder_def as cylinder_def reg 2 offset 2000
#fem export elem;cylinder_def as cylinder_def reg 2 offset_elem 2000

# define contact parameters
fem def contact;r;contact;example

# Define solve for reg 1
fem def solve;r;half;example reg 1

#######################################Define cell problem

# Set up a grid at gauss scheme 
# Trilinear basis to interpolate between grid points
fem def grid;r;half;example gauss class 2 

# Sets up the grid geometry
fem update grid geometry 

# Group grid points in the elements 101.244 as ALL_GRID
fem group grid element 101..244 as ALL_GRID

# Define a cellml equation 
# Options chosen allows use of structures for cardiac electrical activation 
fem def equa;r;cellml;example class 2

# Needed to setup
fem def mate;d;example class 2

# Define cellml file 
fem define cell;r;half;example class 2 

# Define cell material
fem def mate;r;half;example cell class 2 

# Default init conditions for cell class 2
fem def init;d;example class 2 

# Setup solve for cellml class 2
fem def solv;r;cell;example class 2 

#runs the cellml time integration solver stuff once to initialise cellml solver things. 
#The "0" class 2 to 0 says you have a 0 time step for the integration
#fem solve class 2 to 0        

$CONVERGED=0;
while ($CONVERGED==0) 
{
######################################Projection

# Set contact Xi points on specified faces as 8x8 points
fem def xi;c contact_points faces 381,575,531,593,479,584,548 points 8 reg 1

# Define data at xi positions 
fem def data;c from_xi reg 1

# Update slave info
fem update data field to slave

# Project onto target face 
fem def xi;c closest_face faces 623 region 2

# store projection gap in data fields
fem update data field from gap   

# 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

######################################Mechanics problem
# Solve finite elasticity/contact problem
fem solve error 0.0001 iterate 5 reg 1

FEM up geom from sol to 1..3 reg 1 
}

# Place initial geometry YP(ny,3) into XP
FEM up geom from sol YP_index 3 to 1..3 reg 1

# Stresses at gauss points  
fem up gauss stress fibre reg 1
#fem def gauss;w;stress_1 as half number 3 reg 1

# Update XP from YP
FEM up geom from sol to 1..3 reg 1
################################################

## Write out new geometry
#fem def nodes;w;half_def as half reg 1
#fem def elem;w;half_def as half reg 1
#fem exp nodes;half_def as half reg 1

Additional testing commands:



Files used by this example are:

Name                    Modified     Size

example_d26.com 23-Apr-2008 5.4k cell.ipsolv 13-Apr-2007 2.6k cellml.ipequa 01-Sep-2004 1.6k check_force.pl 01-Sep-2004 1.0k collapsed.ipbase 27-Feb-2008 9.2k contact.ipcont 25-Sep-2008 626 cylinder.ipelem 01-Sep-2004 3.3k cylinder.ipelfb 01-Sep-2004 2.4k cylinder.ipequa 29-Sep-2004 2.2k cylinder.ipfibr 01-Sep-2004 15k cylinder.ipinit 01-Sep-2004 2.2k cylinder.ipmate 01-Sep-2004 704 cylinder.ipnode 01-Sep-2004 18k cylinder.ipsolv 13-Apr-2007 1.1k fit_gauss.com 01-Sep-2004 596 half.ipcell 06-Sep-2004 2.5k half.ipelem 01-Sep-2004 506 half.ipelfb 01-Sep-2004 38k half.ipelfd 01-Sep-2004 38k half.ipequa 29-Sep-2004 2.2k half.ipfibr 01-Sep-2004 60k half.ipfiel 01-Sep-2004 68k half.ipfit 13-Apr-2007 2.0k half.ipgrid 01-Sep-2004 639 half.ipinit 01-Sep-2004 1.4k half.ipmatc 01-Sep-2004 2.1k half.ipmate 01-Sep-2004 704 half.ipnode 01-Sep-2004 2.1k half.ipsolv 16-Aug-2010 2.7k half.ipsolv.old 13-Apr-2007 2.5k half_def.ipelem 01-Sep-2004 62k half_def.ipnode 01-Sep-2004 74k hertz.ippara 09-Nov-2008 5.9k hertz.irsolv 13-Apr-2007 1.5k st_venant_kirchoff.cml 01-Sep-2004 10k strain_1.ipgaus 01-Sep-2004 167k stress_1.ipgaus 01-Sep-2004 167k test_output.com 01-Sep-2004 0 two.ipregi 01-Sep-2004 93 view.com 01-Sep-2004 2.2k

Download the entire example:

Name                      Modified     Size

examples_d_d2_d26.tar.gz 17-Aug-2010 216k

Testing status by version:

StatusTestedReal time (s)
hpc_cmo64_irixSuccessSun Jul 31 01:37:53 200526
rs6000-aix
cm64SuccessWed Mar 4 01:21:19 200927
x86_64-linux
cmSuccessSun Mar 6 00:01:46 20168

Testing status by file:


Html last generated: Sun Mar 6 05:51:25 2016

Input last modified: Mon Aug 16 11:35:03 2010


CMISS Help / Examples / d / d2 / d26