R3iCe#

GitLab tag (self-managed) PyPI version

R3iCe formulation

Install

Tutorial : run simulation

Simulation output

Tutorial#

Example : Quick Start#

Here is just a quick example to check if your code is running correctly and to give an overview on how to run it.

This example it available in rheolef_cti/examples/2D_CTI_non_linear_with_RX/.

To run execute from this folder this command line:

R3iCe --json metadata.json

or to use the multithreading possibilities offered by rheolef :

mpirun -n 16 R3iCe -j metadata.json 2> /dev/null

The command 2> /dev/null silence the output from the iteration fo the convergence algorithm in rheolef.

Once you run the code you can visualized the simulated displacement field. To do so you need to extract them with:

branch vector_P2.branch.gz -vtk

Then you can load the vtk file in paraview.

Backup and restart simulation#

If you want to restart your simulation to push further the deformation you can use the backup.field.gz file that save all the information needed to restarts from a given point.

To use this file just run :

mpirun -n 16 R3iCe -j metatdata.json -r 2> /dev/null

Between the first run and the second you can edit the file metadata.json. Therefore it gives you the possibilities to :

  1. Push further the simulation by increasing the number of time step nb_t.

  2. Restart a simulation that was stop by mistake.

  3. Change the boundaries conditions.

Simulation options : metadata.json#

The file metadata.json contains all the option needed to run a simulation. In the following a description of all the options is given.

The json is used above is print here :

bc
top
type_xneumann
type_ydirichlet
type_zdirichlet
vx1
vy0
vz0
bottom
type_xdirichlet
type_ydirichlet
type_zdirichlet
vx0
vy0
vz0
front
type_xnone
type_ydirichlet
type_zdirichlet
vx0
vy0
vz0
back
type_xnone
type_ydirichlet
type_zdirichlet
vx0
vy0
vz0
left
type_xnone
type_ydirichlet
type_zdirichlet
vx0
vy0
vz0
right
type_xnone
type_ydirichlet
type_zdirichlet
vx0
vy0
vz0
cti
beta0.03999999910593033
gamma1.0
input
mesh_filerh_mesh_2D_s2.geo
non_linear
it_max_nl1
n_ice3.0
non_linearTrue
tol_nl1.000000013351432e-10
orientation
grainsFalse
ori_filenone
ori_meshrh_mesh_2D_s1.geo
output
out_folder./
out_modulo1
solver
o_orderP0
p_orderP1
u_orderP2
iterativeFalse
time_step
dt9.999999747378752e-06
it_max_c20
it_max_c_0100
lambda1.0
mo45.400001525878906
nb_t2
no_timeTrue
tol_c1.000000013351432e-10

R3iCe parameters#

The CTI parameters are given in ["cti"] :

  • \(\gamma\) : ["cti"]["gamma"], type float

  • \(\beta\) :["cti"]["beta"], type float

In the case of non linear formulation the parameters are given in ["non_linear"] :

  • For the non linear parameter

    • \(n\) : ["non_linear"]["n_ice"], type float

  • For the non linear solver

    • activate non linear solver : ["non_linear"]["n_ice"], type bool (true or false)

    • it_max_nl : ["non_linear"]["it_max_nl"], type int (recommended 1)

    • tol_nl : ["non_linear"]["tol_nl"], type float

Time evolution#

The time evolution parameters are given in ["time_step"]:

  • For the orientation evolution function

    • \(\mathcal{Mo}\) : ["time_step"]["mo"], type float

    • \(\lambda\) : ["time_step"]["lambda"], type float

  • For the time step

    • ["time_step"]["no_time"], type bool if true do not solve \(\dot{c}\) equation.

    • \(\delta t\) : ["time_step"]["dt"], type float (recommended \(\delta_t << \frac{1}{\mathcal{Mo}}\))

    • nb_t : ["time_step"]["nb_t"], type int

    • it_max_c : ["time_step"]["it_max_c"], type int

    • it_max_c_0 : ["time_step"]["it_max_c_0"], type int, value of it_max_c for the first time step.

    • tol_c : ["non_linear"]["tol_c"], type float

Macro stress solicitation#

Boundary condition can be applied on the top and bottom surface. For now the other surface are free, further implementation are possible in order to apply boundary condition on these surfaces.

Dirichlet (rate) and Neumann (force) conditions can be applied on each surfaces. The conditions are passed through :

<label> : "bottom","left","right","front","back"

  • ["bc"][<label>]["type_x"], value dirichlet, neumann or none, condition type on the <label> surface along \(x\)

  • ["bc"][<label>]["vx"], value of the condition along \(x\). (dirichlet = strain rate, neumann = stress)

  • ["bc"][<label>]["type_y"], value dirichlet, neumann or none, condition type on the <label> surface along \(y\)

  • ["bc"][<label>]["vy"], value of the condition along \(y\). (dirichlet = strain rate, neumann = stress)

  • ["bc"][<label>]["type_z"], value dirichlet, neumann or none, condition type on the <label> surface along \(z\)

  • ["bc"][<label>]["vz"], value of the condition along \(z\). (dirichlet = strain rate, neumann = stress)

Typical boundary condition#

Uniaxial imposed stress
"bc": {
      "top": {
          "type_x": "none",
          "type_y": "neumann",
          "type_z": "none",
          "vx": 0,
          "vy": -1,
          "vz": 0
      },
      "bottom": {
          "type_x": "none",
          "type_y": "dirichlet",
          "type_z": "none",
          "vx": 0,
          "vy": 0,
          "vz": 0
      },
      "front": {
          "type_x": "none",
          "type_y": "none",
          "type_z": "none",
          "vx": 0,
          "vy": 0,
          "vz": 0
      },
      "back": {
          "type_x": "none",
          "type_y": "none",
          "type_z": "none",
          "vx": 0,
          "vy": 0,
          "vz": 0
      },
      "left": {
          "type_x": "none",
          "type_y": "none",
          "type_z": "none",
          "vx": 0,
          "vy": 0,
          "vz": 0
      },
      "right": {
          "type_x": "none",
          "type_y": "none",
          "type_z": "none",
          "vx": 0,
          "vy": 0,
          "vz": 0
      }
  }
Shear imposed stress
"bc": {
      "top": {
          "type_x": "neumann",
          "type_y": "dirichlet",
          "type_z": "dirichlet",
          "vx": 1,
          "vy": 0,
          "vz": 0
      },
      "bottom": {
          "type_x": "none",
          "type_y": "dirichlet",
          "type_z": "dirichlet",
          "vx": 0,
          "vy": 0,
          "vz": 0
      },
      "front": {
          "type_x": "none",
          "type_y": "dirichlet",
          "type_z": "dirichlet",
          "vx": 0,
          "vy": 0,
          "vz": 0
      },
      "back": {
          "type_x": "none",
          "type_y": "dirichlet",
          "type_z": "dirichlet",
          "vx": 0,
          "vy": 0,
          "vz": 0
      },
      "left": {
          "type_x": "none",
          "type_y": "dirichlet",
          "type_z": "dirichlet",
          "vx": 0,
          "vy": 0,
          "vz": 0
      },
      "right": {
          "type_x": "none",
          "type_y": "dirichlet",
          "type_z": "dirichlet",
          "vx": 0,
          "vy": 0,
          "vz": 0
      }
  }
Uniaxial imposed strain rate
"bc": {
      "top": {
          "type_x": "none",
          "type_y": "dirichlet",
          "type_z": "none",
          "vx": 0,
          "vy": -1,
          "vz": 0
      },
      "bottom": {
          "type_x": "none",
          "type_y": "dirichlet",
          "type_z": "none",
          "vx": 0,
          "vy": 0,
          "vz": 0
      },
      "front": {
          "type_x": "none",
          "type_y": "none",
          "type_z": "none",
          "vx": 0,
          "vy": 0,
          "vz": 0
      },
      "back": {
          "type_x": "none",
          "type_y": "none",
          "type_z": "none",
          "vx": 0,
          "vy": 0,
          "vz": 0
      },
      "left": {
          "type_x": "none",
          "type_y": "none",
          "type_z": "none",
          "vx": 0,
          "vy": 0,
          "vz": 0
      },
      "right": {
          "type_x": "none",
          "type_y": "none",
          "type_z": "none",
          "vx": 0,
          "vy": 0,
          "vz": 0
      }
  }
Shear imposed strain rate
"bc": {
      "top": {
          "type_x": "dirichlet",
          "type_y": "dirichlet",
          "type_z": "dirichlet",
          "vx": 1,
          "vy": 0,
          "vz": 0
      },
      "bottom": {
          "type_x": "none",
          "type_y": "dirichlet",
          "type_z": "dirichlet",
          "vx": 0,
          "vy": 0,
          "vz": 0
      },
      "front": {
          "type_x": "none",
          "type_y": "dirichlet",
          "type_z": "dirichlet",
          "vx": 0,
          "vy": 0,
          "vz": 0
      },
      "back": {
          "type_x": "none",
          "type_y": "dirichlet",
          "type_z": "dirichlet",
          "vx": 0,
          "vy": 0,
          "vz": 0
      },
      "left": {
          "type_x": "none",
          "type_y": "dirichlet",
          "type_z": "dirichlet",
          "vx": 0,
          "vy": 0,
          "vz": 0
      },
      "right": {
          "type_x": "none",
          "type_y": "dirichlet",
          "type_z": "dirichlet",
          "vx": 0,
          "vy": 0,
          "vz": 0
      }
  }
Combined Shear and Uniaxial imposed strain rate
"bc": {
      "top": {
          "type_x": "dirichlet",
          "type_y": "dirichlet",
          "type_z": "none",
          "vx": 1,
          "vy": -0.2,
          "vz": 0
      },
      "bottom": {
          "type_x": "dirichlet",
          "type_y": "dirichlet",
          "type_z": "none",
          "vx": 0,
          "vy": 0,
          "vz": 0
      },
      "front": {
          "type_x": "none",
          "type_y": "none",
          "type_z": "none",
          "vx": 0,
          "vy": 0,
          "vz": 0
      },
      "back": {
          "type_x": "none",
          "type_y": "none",
          "type_z": "none",
          "vx": 0,
          "vy": 0,
          "vz": 0
      },
      "left": {
          "type_x": "none",
          "type_y": "none",
          "type_z": "none",
          "vx": 0,
          "vy": 0,
          "vz": 0
      },
      "right": {
          "type_x": "none",
          "type_y": "none",
          "type_z": "none",
          "vx": 0,
          "vy": 0,
          "vz": 0
      }
  }

Output file#

The simulation output are standardized and a description is given in output page.

The options from the output are :

  • output folder path : ["output"]["out_folder"], type string

  • output saving time \(ot\) : ["output"]["out_modulo"], type int, field are exported every \(ot\) time step

Mesh for solver#

The mesh on which the equations are solved is given in :

  • ["input"]["mesh_file"], type string : mesh file compatible with rheolef

Mesh for orientation definition#

There is various possibilities in order to prescribe orientation to the mesh. Either by defining grains volumes in the mesh or by giving one orientation at each mesh elements. This choice is controlled by the variable :

  • ["orientation"]["grains"], type bool

["orientation"]["grains"]=false#

The mesh to initially pick random orientation within an uniform ODF and then interpolate orientation on the mesh for solver, is given in :

  • ["orientation"]["ori_mesh"], type string : mesh file compatible with rheolef. if none directly use the mesh for solver to pick orientation

It is also possible to prescribe a file of orientations in which orientation will be picked for each element. The orientation file can be generated using orientation generation page and mush have a specific format. The file name is given in :

  • ["orientation"]["ori_file"], type string

["orientation"]["grains"]=true#

The mesh for solver need specific area definition mesh generation page and the orientation file orientation generation page can be given in

  • ["orientation"]["ori_file"], type string

Polynomial order for R3iCe solver#

The R3iCe solver is using a Stokes formulation therefore it is needed to choose the polynomial order for the displacement field uh, the pressure field p and the orientation field ori

  • Polynomial order for uh: ["solver"]["u_order"] , type string (recommended P2)

  • Polynomial order for p: ["solver"]["p_order"] , type string (recommended P1 or P1d)

  • Polynomial order for ori: ["solver"]["o_order"] , type string (recommended P0)

  • Use iterative algorithm to solve the linear problem : ["solver"]["iterative"], type bool

Tip

For ["solver"]["iterative"] option is recommended to be set up to :

  1. false for mesh where grains area are defined

  2. true if one orientation per element is defined

The best is still to test both. Then you can compare the running time.

Be careful that convergence is reach when using ["solver"]["iterative"] to true. sopt_residue value in fix_point_nl.txt file should be lower then the machine precision\(+10^3\) to ensure correct convergence.

For ["solver"]["iterative"]\(=\)false, the convergence is ensured by construction (sopt_residue\(=\)0).