!***********************************************************************
! TITLE: CFVR8008 - Circular footing collapse
! SUBTITLE: Bearing capacity of a circular footing on a Mohr-Coulomb medium
!
! DESCRIPTION: In this example the bearing capacity of a circular footing on a
! DESCRIPTION: Mohr-Coulom medium is analyzed. Cox et al. (1961) obtained a
! DESCRIPTION: numerical solution the slip-line equations for the
! DESCRIPTION: axisymmetric-footing problem. The semi-analytical value of the
! DESCRIPTION: avarage pressure over the footing at failure for a friction angle
! DESCRIPTION: of 20º is found to be
! DESCRIPTION:
! DESCRIPTION:                      q = 20.1*c
! DESCRIPTION:
! DESCRIPTION: where q is the bearing capacity, and c is the cohesion of the
! DESCRIPTION: material.
! DESCRIPTION:
! DESCRIPTION: The example has been taken from the textbook:
! DESCRIPTION:
! DESCRIPTION:     "Computational Methods for Plasticity",
! DESCRIPTION:     E.A. de Souza Neto, D. Peric and D.R.J. Owen., Wiley (2008).
! DESCRIPTION:     Section 8.4.4: Circular-Footing Collapse
! DESCRIPTION:
! DESCRIPTION: The model has some changes from the original:
! DESCRIPTION:
! DESCRIPTION:   - Prescribed displacement along the surface of intereaction
! DESCRIPTION:     footing-soil has been modeled with a rigid-flexible contact.
! DESCRIPTION:   - Non associated plastic flow has been used, with an associated
! DESCRIPTION:     law convergence is very slow and time consuming. It is well
! DESCRIPTION:     known that dilatancy has little influence on collapse loads 
! DESCRIPTION:     in unconfined problems.
!
!
! ELEMENT TYPE: PLANE183,TARGE169,CONTA172
! MODULES:
! UNITS: SI
! KEYWORD1: Materials
! KEYWORD2: Geotechnics
! KEYWORD3: Material Models
!
!***********************************************************************
  FINISH
  ~CFCLEAR,,1
  NomFile='CFVR8008'
  /TITLE,%NomFile%,Circular-footing collapse
  
  PI = ACOS(-1)

! ----------------------------------------------------------------------
! Initial data
! ----------------------------------------------------------------------
  ~UNITS,SI
  /PREP7

  IFLOW = 0       ! type of flow law
  EMOD  = 1.E10   ! elasticity modulus
  NU    = 0.48    ! Poisson's ratio
  PHI   = 20.     ! friction angle
  COH   = 490.E3  ! cohesion
  PSI   = 10      ! dilation angle
  HYP   = 0.05*COH/TAN(PHI*PI/180) ! hyperbolicity parameter
  U0    = -0.0015 ! prescribed displacement on the footing

! ----------------------------------------------------------------------
! Model definition
! ----------------------------------------------------------------------

  ! Materials

  ~CFMP,1,LIB,SOIL,,CL
  ~CFMP,1,SOIL,EXST,,EMOD
  ~CFMP,1,SOIL,NUXYST,,NU
  ~CFMP,1,SOIL,KPLA,,2
  ~CFMP,1,SOIL,KMCSP,,1
  ~CFMP,1,SOIL,PHIMCEFF,,PHI
  ~CFMP,1,SOIL,CMCEFF,,COH
  ~CFMP,1,SOIL,DELEFF,,PSI
  ~CFMP,1,SOIL,HYP,,HYP
  ~CFMP,1,SOIL,IFLOW,,IFLOW

  ! Element types

  ET,1,PLANE183
  KEYOPT,1,3,1
  *IF,IFLOW,EQ,1,THEN
    KEYOPT,1,5,1
  *ENDIF

  ET,2,TARGE169
  KEYOPT,2,2,1
  ET,3,CONTA172
  KEYOPT,3,2,0
  KEYOPT,3,12,4

  ! Geometry

  K,1,0.,0.
  K,2,5.,0.
  K,3,5.,5.
  K,4,.5,5.
  K,5,0.,5.
  L,1,2
  L,2,3
  L,3,4
  L,4,5
  L,5,1
  AL,1,2,3,4,5

  ! Meshing

  TYPE,1
  ESIZE,0.4
  AMESH,1

  NSEL,S,LOC,X,-0.001,1.
  NSEL,R,LOC,Y,4.,5.001
  NREFINE,ALL,,,2
  NSEL,ALL

  *GET,TMP,NODE,,NUM,MAXD
  ND0 = TMP+1
  N,ND0,0.,6. ! pilot node to control displacement of the footing
  TMP  = ND0+1
  TMP1 = ND0+2
  NKPT,TMP,5
  NKPT,TMP1,4

  REAL,2
  TYPE,2
  TSHAP,PILO
  E,ND0
  TSHAPE,LINE
  E,TMP,TMP1

  TYPE,3
  LSEL,S,,,4
  NSLL,S,1
  ESLN,S
  ESURF

  LSEL,ALL
  NSEL,ALL
  ESEL,ALL

  ! Loads

  DL,1,,ALL
  DL,2,,UX
  DL,5,,UX
  D,ND0,UX
  D,ND0,UY,U0
  D,ND0,ROTZ  
  
!-----------------------------------------------------------------------
! DATA CHECK
!-----------------------------------------------------------------------
! Data comparison number
  NCOMP    = 1
  NCOMP_CH = 0

! Array dimensions
  *DIM,LABEL,CHAR,NCOMP,1
  *DIM,LABEL_CH,CHAR,NCOMP_CH,1
  *DIM,VALUE,,NCOMP,3
  *DIM,VALUE_CH,CHAR,NCOMP_CH,3
  *DIM,TOLER,,NCOMP,2

! Labels
!-----------------------------------------------------------------------
  LABEL(1) = 'Collapse' ! collapse factor

! Warning and error tolerances
  TOLER(1,1) = 1.5 $ TOLER(1,2) = 1.5

! Correct values
!-----------------------------------------------------------------------
 
  VALUE(1,1) = 20.1

! Obtained values
!-----------------------------------------------------------------------
  /SOLU

  
  *IF,IFLOW,EQ,1,THEN
    NROPT,UNSYM
  *ELSE
    NROPT,FULL
  *ENDIF
  NEQIT,50
  !CNVTOL,F,,0.01
  DELTIM,1/100.

  ERESX,NO
  OUTRES,ALL,NONE
  OUTRES,NSOL,5
  OUTRES,ESOL,5
  OUTRES,RSOL,5

  SOLVE

  *GET,TMP,NODE,ND0,RF,FY
  VALUE(1,2) = -TMP/(PI*0.25*COH)
  
!-----------------------------------------------------------------------
! Normalized pressure-displacement curve:
!
!    PVAL - mean pressure exerted by the footing/cohesion
!    UVAL - footing displacement/footing diameter
!-----------------------------------------------------------------------

!  /POST26
!
!  TIMERANGE,,1.
!
!  NSOL,2,ND0,U,Y
!  VGET,UVAL,2
!  PROD,2,2,,,,,,-1.
!  VGET,UVAL,2
!
!  RFORCE,3,ND0,F,Y
!  VGET,PVAL,3
!  PROD,3,3,,,,,,-1/(PI*0.25*COH)
!  VGET,PVAL,3
!
!  XVAR,2
!  PLVAR,3
!
!  /IMAGE,SAVE,%NomFile%,BMP

!-----------------------------------------------------------------------
! Results comparison
!-----------------------------------------------------------------------
  COMPARA.MAC
