Tutorial

In this tutorial, we will model the mechanical behavior of the round wire considered in the previous tutorials subject to electromagnetic constraints and thermal dilatation due to Joules losses

The geometry is the same as in the thermo-electric tutorial. We will recall:

  • the plane circles (V0 and V1) on which will be applied some electric potential

  • the cylindrical surface (Bord) on which we will apply some cooling boundary conditions.

The elasticity model will be used to model the displacements and the constraints; the temperature field \(T\) and the Lorentz forces distribution \(\mathbf j \times b\) will be computed using respectively the thermoelectric and magnetostatic model. This is transparent for the user.

1. Data

Table 1. Elasticity Boundary conditions

V0

\(\mathbf{u} = \mathbf{0}\)

V1

\(\mathbf{u}_Z = 0\)

The wire is assumed to be clamped in V0 and we block the displacement along the \(Z\) axis on V1.

2. Prerequisites

  • Linux OS,

  • Basic knowledge of Unix commands,

  • NVIDIA Graphic video card,

  • singularity

  • Thermoelectric model tutorial

  • Magentostatic model tutorial

3. Setup study

  • Start a terminal

  • Create a directory to hold the study

  • Move to the created directory

  • Create an STORAGE environment variable pointing to the directory holding singularity images:

export STORAGE=/home/singularity

4. Prepare Cfg and Json files

As before we have to define a cfg ` configuration file for the simulation and add a `json model file for specifying the elasticity problem. For the other physics we can use the previous json model files.

4.1. cfg file definition

We use the same cfg file as before. Now we:

  • set the compute_elasticty flag to true,

  • add a section (namely [elasticity]) for the Elasticity model definition.

dim=3
geofile=cylindre.msh
geofile-path=$cfgdir

conductor_volume=Cylinder_1

compute_magnetism=true
compute_bg_magfield=false
compute_bg_magfield_bmap=false
compute_elasticity=true

[thermoelectric]
model_json=$cfgdir/thermoelec.json
weakdir=false
resolution=linear

[electro]
pc-type=boomeramg #gamg
#ksp-monitor=true
ksp-rtol=1e-7
ksp-atol=1e-5
ksp-maxit=2000
ksp-use-initial-guess-nonzero=1

[thermal]
pc-type=boomeramg #gamg
#ksp-monitor=true
ksp-rtol=1e-8
ksp-atol=1e-6
ksp-use-initial-guess-nonzero=1

[magnetostatic]
model_json=$cfgdir/magnetostatic.json
weakdir=false

[ms]
pc-type=boomeramg #gamg
ksp-monitor=true
ksp-rtol=1e-7
ksp-atol=1e-5
ksp-use-initial-guess-nonzero=1

[elasticity]
filename=$cfgdir/elasticity.json
on.type=elimination_symmetric
thermal_dilatation=true
lorentz_forces=true
pc-type=gamg
ksp-monitor=true
ksp-converged-reason=1

4.2. json model for Elasticity model

For the considered elasticity boundary conditions, the model file will be:

{
    "Name": "CoupledCart",
    "ShortName":"MSC",
    "Models":
    {
        "equations":"Elasticity"
    },
    "Materials":
    {
        "Cylinder_1":
        {
            "name":"Copper",
            "filename":"$cfgdir/Cu.json"
        }
    },
    "BoundaryConditions":
    {
    {
        "displacement":
        {
            "Dirichlet":
            {
                "V0":
                {
                    "expr":"{0,0,0}"
                }
	    }
	},
        "displacement_z":
        {
            "Dirichlet":
            {
                "V1":
                {
                    "expr":"0"
                }
            }
        }
    },
    "PostProcess":
    {
        "Fields":["displacement","Von-Mises","tresca","principal-stresses"]
    }
}

Do not forget to verify that the json file are correct. To do so use for instance:

jsonlint-php thermoelec.json

5. Run the Simulation

  • Create a directory for storing the results

mkdir Coupled
  • Run the simulation

singularity exec -B ${PWD}/Coupled:/feel \
 ${STORAGE}/hifimagnet-hifimagnet_v0.105.img \
  feelpp_hfm_coupledcartmodel_3DP1N1 --config-file cylinder.cfg

Checkout the output of the above command for any errors. You can save the output to a file log using the redirection:

singularity exec -B ${PWD}/Coupled:/feel \
 ${STORAGE}/hifimagnet-hifimagnet_v0.105.img \
  feelpp_hfm_coupledcartmodel_3DP1N1 --config-file cylinder.cfg > log 2>&1

6. Post-processing

  • Move to the directory where the results are stored

cd Coupled/.../exports/ensightgold
  • Start ensight102

  • Load the electric case

  • Load the thermoelectric case

  • Load the magnetostatic case

  • Load the elasticity case

The results for the elasticty model may be stored in an "unusual" directory name elasticity.exports which shall be in …​