Periodic RVE-type simulation#

Note

Read first: Simple simulation.

A periodic polycrystal of 40 grains, generated and meshed by Neper with -periodicity all (which writes the mesh’s $Periodicity section), is used:

../../_images/mesh2.png

Fig. 11 The mesh, colored by grain. The grains are those of a periodic tessellation of the unit cube: a grain cut by a face of the cube continues on the opposite face, and the mesh keeps the grains whole, so that its boundary is not the cube’s (the mesh fills the unit cube’s volume, and repeats in the three directions).#

The domain is the unit cube. A bcc material is considered:

Table 10 Single-crystal elastic constants and plasticity parameters (saturation_isotropic hardening).#

\(c_{11}\) [MPa]

\(c_{12}\) [MPa]

\(c_{44}\) [MPa]

\(m\) [-]

\(\dot{\gamma}_0\) [1/s]

\(\tau_0\) [MPa]

\(h_0\) [MPa]

\(\tau_s\) [MPa]

\(n\) [-]

\(236.9 \times 10^3\)

\(140.6 \times 10^3\)

\(116.0 \times 10^3\)

0.02

1.0

200.0

391.9

335.0

1.0

With periodic conditions (boundary_conditions periodic, see Periodic conditions), the loading is given by components of the macroscopic velocity gradient: here plane-strain compression, with the strain rate 33 at -0.01 /s, the rates 22 and 23 zero, and 11, 12 and 13 free (no row: their macroscopic stresses are zero), to the strain -0.003 in increments of 0.001. Rigid-body motions are fixed automatically.

Input files#

## FEPX tutorial "Periodic RVE-type simulation": a 40-grain periodic bcc polycrystal under
## plane-strain compression (strain rate 33 -0.01 /s, 22 and 23 zero, the others free).

## Material
number_of_phases 1
phase 1
  crystal_type BCC
  model crystal_plasticity
  c11 236.9e3
  c12 140.6e3
  c44 116.0e3
  m 0.02
  gammadot_0 1.0
  tau_0 200.0
  hardening saturation_isotropic
  h_0 391.9
  tau_s 335.0
  n 1.0

## Loading
boundary_conditions periodic
control_component 33
strain_rate 33 -1e-2
strain_rate 22 0
strain_rate 23 0
number_of_steps 1
target_strain 33 -0.003
dstrain 0.001

## Output
print coo
print disp
print forces
print strain
print strain_eq
print strain_el
print strain_el_eq
print strain_pl
print strain_pl_eq
print stress
print stress_eq
print work
print work_pl
print ori
print slip
print sliprate
print crss

Execution#

$ mpirun -np 4 fepx
========================    F   E   P   X    ===========================
Info   : A finite element software package for polycrystal plasticity.
Info   : Version 3.0.0-dev (git 755da754, 11-06-2026)
Info   : Built with: GCC 15.2.0|Open MPI 5.0.10|HDF5 1.14.6
Info   : Running on 4 ranks.
Info   : <https://fepx.info>
Info   : Copyright (C) 1996-2026, and MIT licensed, by the FEPX authors.
Info   : ---------------------------------------------------------------
Info   : Loading simulation...
Info   :   [i] Parsing file `simulation.cfg'...
Warning:   - simulation.cfg:33: print forces is ignored with
Warning:     boundary_conditions periodic (no face forces file; the
Warning:     macroscopic stress is written to results/macro).
Info   :   [i] Parsed file `simulation.cfg'.
Info   :   [i] Parsing file `simulation.msh'...
Info   :   [i] Parsed file `simulation.msh'.
Info   :   - Material parameters:
Info   :     > Number of phases: 1
Info   :     > Phase 1: bcc, crystal_plasticity
Info   :       . c11:                       2.3690E+05 MPa
Info   :       . c12:                       1.4060E+05 MPa
Info   :       . c44:                       1.1600E+05 MPa
Info   :       . m:                         2.0000E-02
Info   :       . gammadot_0:                1.0000E+00 1/s
Info   :       . hardening:                 saturation_isotropic
Info   :       . tau_0:                     2.0000E+02 MPa
Info   :       . h_0:                       3.9190E+02 MPa
Info   :       . tau_s:                     3.3500E+02 MPa
Info   :       . n:                         1.0000E+00
Info   :       . saturation_evolution:      off (def.)
Info   :       . cyclic_hardening:          off (def.)
Info   :       . precipitate_strengthening: off (def.)
Info   :   - Loading: boundary_conditions periodic, 1 step
Info   :     > Periodic conditions: lengths  1.0000E+00,  1.0000E+00,
Info   :       1.0000E+00 mm; drive pairs (secondary, primary) x (210,
Info   :       27), y (115, 71), z (88, 2)
Info   :     > Periodic conditions: 6249 constrained dofs, 5721
Info   :       independent dofs referenced
Info   :     > Step 1: t = 0.0000E+00 -> 3.0000E-01 s, 3 increments,
Info   :       strain 33: 0.0000E+00 -> -3.0000E-03 (rate -1.0000E-02
Info   :       1/s)
Info   :   - Options other than the defaults: (none)
Info   :   - Output: coo disp forces strain strain_eq strain_el
Info   :     strain_el_eq strain_pl strain_pl_eq stress stress_eq work
Info   :     work_pl ori slip sliprate crss (format ascii)
Info   :   - Mesh parameters:
Info   :     > Node number: 9143
Info   :     > Elt  number: 5311 (10-node tetrahedra)
Info   :     > Elsets: 40; partitions: 4
Info   :   - Partitioning: 4 ranks
Info   :     > Elements per rank: 1327 to 1328
Info   :     > Ghost nodes per rank: 223 to 748 (2108 in total)
Info   :     > Neighbors per rank: 3 to 3
Info   :   [o] Writing results to `simulation.sim'...
Info   : Initializing simulation...
Info   :   - Elastic step of 1.1581E-03 s (step 1)
Info   :     > Iteration 1 (SA): R = 7.1117E-01 (397 CG iterations)
Info   :     > Iteration 2 (SA): R = 9.1957E-05 (347 CG iterations)
Info   :     > Converged in 2 iterations (1.709 s)
Info   : Running step 1...
Info   :   - Increment 1: t = 1.0000E-01 s, dt = 9.8842E-02 s
Info   :     > Iteration 1 (SA): R = 6.1021E-04 (397 CG iterations)
Info   :     > Iteration 2 (NR): R = 3.2874E-07 (405 CG iterations)
Info   :     > Converged in 2 iterations (1.975 s)
  [...]
Info   : Final step terminated. Simulation completed successfully.
Info   :   [o] Wrote results to `simulation.sim'.
Info   :   - Increments: 3
Info   :   - Global iterations: 15 (6 NR)
Info   :   - CG iterations: 6942
Info   :   - Warnings issued: 1
Info   :   - Wall time per phase:
Info   :     > Input and setup:                      0.120 s
Info   :     > Initialization:                       1.720 s
Info   :     > Increments:                          17.343 s
Info   :       . Element and material work:         10.731 s
Info   :       . CG:                                 6.549 s
Info   :       . Other:                              0.062 s
Info   :     > Output:                               1.212 s
Info   : Elapsed time:                              20.394 s
========================================================================
simulation.sim
|-- inputs
|   |-- simulation.cfg
|   `-- simulation.msh
`-- results
    |-- elts
    |   |-- crss
    |   |   |-- crss.step0
    |   |   `-- crss.step1
    |   |-- ori
    |   |   |-- ori.step0
    |   |   `-- ori.step1
    |   |-- slip
    |   |   |-- slip.step0
    |   |   `-- slip.step1
    |   |-- sliprate
    |   |   |-- sliprate.step0
    |   |   `-- sliprate.step1
    |   |-- strain
    |   |   |-- strain.step0
    |   |   `-- strain.step1
    |   |-- strain_el
    |   |   |-- strain_el.step0
    |   |   `-- strain_el.step1
    |   |-- strain_el_eq
    |   |   |-- strain_el_eq.step0
    |   |   `-- strain_el_eq.step1
    |   |-- strain_eq
    |   |   |-- strain_eq.step0
    |   |   `-- strain_eq.step1
    |   |-- strain_pl
    |   |   |-- strain_pl.step0
    |   |   `-- strain_pl.step1
    |   |-- strain_pl_eq
    |   |   |-- strain_pl_eq.step0
    |   |   `-- strain_pl_eq.step1
    |   |-- stress
    |   |   |-- stress.step0
    |   |   `-- stress.step1
    |   |-- stress_eq
    |   |   |-- stress_eq.step0
    |   |   `-- stress_eq.step1
    |   |-- work
    |   |   |-- work.step0
    |   |   `-- work.step1
    |   `-- work_pl
    |       |-- work_pl.step0
    |       `-- work_pl.step1
    |-- macro
    |-- mesh
    |   |-- strain
    |   |   |-- strain.step0
    |   |   `-- strain.step1
    |   `-- stress
    |       |-- stress.step0
    |       `-- stress.step1
    `-- nodes
        |-- coo
        |   |-- coo.step0
        |   `-- coo.step1
        `-- disp
            |-- disp.step0
            `-- disp.step1

With periodic conditions, no face forces are written; the macroscopic deformation gradient and the volume-averaged stress are written at every increment to results/macro (see Simulation Results (simulation.cfg)).

Simulation results#

../../_images/curves6.png

Fig. 12 Macroscopic stresses 11, 22 and 33 against the macroscopic strain 33 (\(\bar F_{33} - 1\)), at every increment, from results/macro.#

../../_images/strain11.png

Fig. 13 Strain field \(\epsilon_{11}\) at -0.3 % strain 33 (displacements magnified 50 times).#

The commands:

$ neper -S simulation.sim -resmesh stress,strain
$ neper -V simulation.msh -showelt1d all -dataelt1drad 0.004 -dataelt3dedgerad 0.0015 \
    -dataelt3dedgecol 32:32:32 -cameraangle 13.5 -imagesize 800:800 -dataelsetcol id \
    -print img_mesh
$ convert img_mesh.png -trim -bordercolor white -border 20 -resize 600x600 -strip \
    PNG8:mesh.png
$ neper -V simulation.sim -step 1 -datanodecoo coo -datanodecoofact 50 -showelt1d all \
    -dataelt1drad 0.004 -dataelt3dedgerad 0.0015 -dataelt3dedgecol 32:32:32 -cameraangle \
    13.5 -imagesize 800:800 -dataeltcol strain11 -dataeltscale \
    0.0000:0.0005:0.0010:0.0015:0.0020:0.0025:0.0030:0.0035:0.0040 -print img_strain11
$ convert "(" img_strain11.png -trim ")" "(" -size 40x1 xc:white ")" "(" -size 240x \
    -background white -font DejaVu-Serif -pointsize 30 "caption:Strain 11" -bordercolor \
    white -border 0x12 "(" img_strain11-scale3d.png -trim ")" -gravity west -append ")" \
    -background white -gravity center +append -bordercolor white -border 20 -resize \
    600x600 -strip PNG8:strain11.png
$ python3 tutorial_pages.py plot periodic_rve . simulation.sim