!***********************************************************************
! TITLE: CFVR8009 - Strip-footing collapse
! SUBTITLE: Bearing capacity of a strip footing on a Mohr-Coulomb medium
!
! DESCRIPTION: In this example the bearing capacity of an infinite-rectangular
! DESCRIPTION: footing on a Mohr-Coulom medium is analyzed. An approximate value
! DESCRIPTION: for a friction angle of 20º is given in reference cited below
! DESCRIPTION:
! DESCRIPTION:                      q = 15.*c
! DESCRIPTION:
! DESCRIPTION: where q is the bearing capacity and c is the cohesion of the
! DESCRIPTION: material.
! DESCRIPTION:
! DESCRIPTION: In the same reference the value obtained by Prandtl is also given
! DESCRIPTION:
! DESCRIPTION:                      q = 14.7*c
! 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.3: Strip-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.
!
! ELEMENT TYPE: PLANE183,TARGE169,CONTA172
! MODULES:
! UNITS: SI
! KEYWORD1: Materials
! KEYWORD2: Geotechnics
! KEYWORD3: Material Models
!
!***********************************************************************
  FINISH
  ~CFCLEAR,,1
  NomFile='CFVR8009'
  /TITLE, %NomFile%, Strip-footing collapse

  PI = ACOS(-1)

! ----------------------------------------------------------------------
! Initial data
! ----------------------------------------------------------------------
  ~UNITS,SI
  /PREP7

  IFLOW = 0 !!1      ! 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
  NTINC = 50     ! number of time increments
  U0    = -0.002 ! prescribed displacement of 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,2
  *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 impose 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,0
  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 factor'

! Warning and error tolerances
  !TOLER(1,1) = 0.23 $ TOLER(1,2) = 0.23
  TOLER(1,1) = 0.36 $ TOLER(1,2) = 0.36

! Correct values
!-----------------------------------------------------------------------

  VALUE(1,1) = 15.

! Obtained values
!-----------------------------------------------------------------------
  /SOLU

  AUTOTS,OFF
  NSUBST,NTINC
  *IF,IFLOW,EQ,1,THEN
    NROPT,UNSYM
  *ELSE
    NROPT,FULL
  *ENDIF
  NEQIT,50

  ERESX,NO
  OUTRES,ALL,NONE
  OUTRES,NSOL,5
  OUTRES,ESOL,5
  OUTRES,RSOL,5

  SOLVE

  *GET,TMP,NODE,ND0,RF,FY
  VALUE(1,2) = -2*TMP/(1.*COH)

!-----------------------------------------------------------------------
! Normalized pressure-displacement curve:
!
!    PVAL - mean pressure exerted by the footing/cohesion
!    UVAL - footing displacement/footing width
!-----------------------------------------------------------------------

!  /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,,,,,,-2/(1.*COH)
!  VGET,PVAL,3
!
!  XVAR,2
!  PLVAR,3
!
!  /IMAGE,SAVE,%NomFile%,BMP

!-----------------------------------------------------------------------
! Results comparison
!-----------------------------------------------------------------------
  COMPARA.MAC


