Project

General

Profile

Adding material parameters

This tutorial shows, how to add a new material parameter to iSALE.

iSALE uses a special tool, ptool/iSALEMat, which automatically proves the material-input file (material.inp) for correctness or missing parameters. It also removes parameters which are now required for the given simulation from the input-file for more clearlyness and arranges all parameters in equally spaced columns.

Adding a new parameter requires a few steps. For demonstration, let us assume we want to create our own porosity-model named NEWPORO. This model requires the parameters alpha0 and epse0 from the existing porosity model (WUNNEMA) but requires also a new parameter named poro.

Creating this new material model and adding the new material parameter is straightforward and requires the following steps:

Adding parameter to material-structure

First, add the new parameter poro to the MATPAR-structure in iSALE/src/shared/material.F90:

     ! --- porosity properties -----------------------------
     real*8 :: alpha0 ! initial porosity
     real*8 :: epse0 ! elastic threshold
     real*8 :: alphax ! transition
     real*8 :: kappa ! exp. coefficient
     real*8 :: chi   ! sound speed ratio
     real*8 :: gamfac ! Constant for computing thermal volume strain
     real*8 :: epsx
     real*8 :: epsc
     real*8 :: alphae
     real*8 :: poro  ! new porosity parameter required for model NEWPORO

Add appropriate lines in ptool_mat_init.F90, ptool_mat_output.F90 and ptool_matfile.F90

Now we have to adjust some files which are located in iSALE/src/ptools:

ptool_mat_init.F90:

  ! --- porosity properties -----------------------------
  if (debugmode>0) then
     mm%alpha0     = val ! initial porosity
     mm%alphax     = val ! transition
     mm%kappa      = val ! exp. coefficient
     mm%chi        = val ! sound speed ratio
     mm%gamfac     = val ! Thermal volume strain factor
  else
     mm%alpha0     = 1.D0 ! initial porosity
     mm%alphax     = 1.D0 ! transition
     mm%kappa      = 1.D0 ! exp. coefficient
     mm%chi        = 1.D0 ! sound speed ratio
     mm%gamfac     = 1.D0 ! Thermal volume strain factor
  endif
  mm%epse0         = val! elastic threshold
  mm%epsx          = val
  mm%epsc          = val
  mm%alphae        = val
  mm%poro          = val

Here we decide how to initialize the material parameter. The value 'val' is usually 0.D0 (except, if ptools is started in debug-mode. Then this variable becomes a predefined value for testing/debugging purposes).

ptool_mat_output.F90:

  call ptool_text_dble(iounit,"alpha0",mm%alpha0,verb)
  call ptool_text_dble(iounit,"epse0",mm%epse0,verb)
  call ptool_text_dble(iounit,"alphax",mm%alphax,verb)
  call ptool_text_dble(iounit,"kappa",mm%kappa,verb)
  call ptool_text_dble(iounit,"chi",mm%chi,verb)
  call ptool_text_dble(iounit,"poro",mm%poro,verb)

This allows iSALE to automatically list this parameter in the log-files.

ptool_matfile.F90:

ToDo...

Add or change a model template

Add an appropriate line (abbreviation, description, default value) of the material parameter to the appropriate template (located in iSALE/src/ptools/templates).

Include a read-statement in ptool_data_*.F90

Include a line which reads the parameter in the appropriate routine 'ptool_data_*.F90' (here: ptool_data_pormod.F90 for additional porosity parameter) located in iSALE/src/ptools/.

  select case (mm%por)
  case (PORMOD_NONE)
     ! do nothing
  case (PORMOD_WUNNEMA)
     call ptool_get_dble("ALPHA0",mm%alpha0)
     call ptool_get_dble("EPSE0",mm%epse0)
     call ptool_get_dble("ALPHAX",mm%alphax)
     call ptool_get_dble("KAPPA",mm%kappa)
     call ptool_get_dble("CHI",mm%chi)
  case (PORMOD_NEWPOR)
     call ptool_get_dble("ALPHA0",mm%alpha0)
     call ptool_get_dble("EPSE0",mm%epse0)
     call ptool_get_dble("PORO",mm%poro)
  case default
     call ptool_stop("ptool_data_pormod","invalid porosity model : "//mm%por)
  end select