R3iCe#
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 :
Push further the simulation by increasing the number of time step
nb_t
.Restart a simulation that was stop by mistake.
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 |
| ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
cti |
| ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
input |
| ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
non_linear |
| ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
orientation |
| ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
output |
| ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
solver |
| ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
time_step |
|
R3iCe parameters#
The CTI parameters are given in ["cti"]
:
\(\gamma\) :
["cti"]["gamma"]
, typefloat
\(\beta\) :
["cti"]["beta"]
, typefloat
In the case of non linear formulation the parameters are given in ["non_linear"]
:
For the non linear parameter
\(n\) :
["non_linear"]["n_ice"]
, typefloat
For the non linear solver
activate non linear solver :
["non_linear"]["n_ice"]
, typebool
(true
orfalse
)it_max_nl
:["non_linear"]["it_max_nl"]
, typeint
(recommended1
)tol_nl
:["non_linear"]["tol_nl"]
, typefloat
Time evolution#
The time evolution parameters are given in ["time_step"]
:
For the orientation evolution function
\(\mathcal{Mo}\) :
["time_step"]["mo"]
, typefloat
\(\lambda\) :
["time_step"]["lambda"]
, typefloat
For the time step
["time_step"]["no_time"]
, typebool
iftrue
do not solve \(\dot{c}\) equation.\(\delta t\) :
["time_step"]["dt"]
, typefloat
(recommended \(\delta_t << \frac{1}{\mathcal{Mo}}\))nb_t
:["time_step"]["nb_t"]
, typeint
it_max_c
:["time_step"]["it_max_c"]
, typeint
it_max_c_0
:["time_step"]["it_max_c_0"]
, typeint
, value ofit_max_c
for the first time step.tol_c
:["non_linear"]["tol_c"]
, typefloat
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"]
, valuedirichlet
,neumann
ornone
, 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"]
, valuedirichlet
,neumann
ornone
, 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"]
, valuedirichlet
,neumann
ornone
, 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"]
, typestring
output saving time \(ot\) :
["output"]["out_modulo"]
, typeint
, field are exported every \(ot\) time step
Mesh for solver#
The mesh on which the equations are solved is given in :
["input"]["mesh_file"]
, typestring
: mesh file compatible withrheolef
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"]
, typebool
["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"]
, typestring
: mesh file compatible withrheolef
. ifnone
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"]
, typestring
["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"]
, typestring
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"]
, typestring
(recommendedP2
)Polynomial order for
p
:["solver"]["p_order"]
, typestring
(recommendedP1
orP1d
)Polynomial order for
ori
:["solver"]["o_order"]
, typestring
(recommendedP0
)Use iterative algorithm to solve the linear problem :
["solver"]["iterative"]
, typebool
Tip
For ["solver"]["iterative"]
option is recommended to be set up to :
false
for mesh where grains area are definedtrue
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
).