Chapter 33: Generate RVE Models from Microstructural Maps Using the CP Microstructure Add-on

The Crystal Plasticity (CP) Microstructure Add-on provides an efficient solution for creating highly realistic 3D microstructures that capture the grain geometry and texture of materials.

Engineers often face the challenge of generating accurate microstructural models for use in crystal plasticity simulations, which involve multiple steps, including preprocessing, analysis, and postprocessing. The CP Microstructure Add-on simplifies this process by offering a seamless workflow for creating voxelated Representative Volume Elements and generating input files for ANSYS analyses. It serves as a preprocessing framework for crystal plasticity (CP) simulations in Mechanical APDL.

In this tutorial, you will generate a voxelated Representative Volume Element (RVE) model from a microstructural map by using the capabilities of the CP Microstructure Add-on.

Applicable Products Workbench and Mechanical applications
Licenses Required Ansys Mechanical Enterprise
Help Resources Crystal Plasticity (CP) Microstructure Add-on
Tutorial Files CPMicrostructureTutorial01.zip

33.1. Access Data Files

Download the Zip file for this tutorial from the Ansys customer site and extract the files to a folder. CPMicrostructureTutorial01.zip contains the following files:

ebsd_316L_500x500.ang

Experimental data (grain size, grain distribution, and texture within a material) obtained from the Electron-Backscattered Diffraction (EBSD) technique.

RefStat.json

Grain statistical reference file (.json format), which stores grain statistical data for the material.

33.2. Load the CP Microstructure Materials Library

The first step in this tutorial is to load the materials library for the CP Microstructure add-on. This materials library is included in the Mechanical application installation. It contains material models and sample materials that you will need for this tutorial. The steps to import this library depend on which application you are using.

Go to a tutorial topic:

Workbench

Mechanical Application Opened Independently

33.2.1. Import Materials Library into the Engineering Data Module

Follow these steps to create a project in Workbench, import the CP Microstructure materials library into the project's Engineering Data Module, and open the Mechanical application from Workbench:

  1. Open Ansys Workbench.

  2. From the toolbox on the left-hand side of the window, double-click or drag-and-drop a Static Structural system into the Project Schematic window.

  3. Double-click the Engineering Data module to open it.

  4. Choose File > Import Engineering Data. The Open dialog box is displayed.

  5. Navigate to the following directory:

    ANSYS_INSTALL_DIR\aisol\WBAddins\MechanicalExtensions\CPMicrostructure\MaterialsLibrary\

    where ANSYS_INSTALL_DIR is the directory where you installed the Ansys software.

  6. Select the MaterialLibrary_CPMicrostructure.xml file and click Open. The Engineering Data module imports the library.

  7. Verify that the imported material Al-T3_Isotropic_CPMicroAddon is listed under Contents of Engineering Data in the Engineering Data module:

  8. Close the Engineering Data tab to return to the Project window.

  9. Load the Engineering Data materials and material models into the Mechanical application. Do the following:

    1. In the Project window, right-click the Engineering Data module to display a drop-down menu.

    2. Select Update Upstream Components. This imports the CP Microstructure materials library into your Mechanical model.

  10. Choose File > Save and save your new Workbench project as cp_micro_tutorial.

  11. Double-click Model in the Static Structural analysis system to open the Mechanical application.

33.2.2. Import Materials Library Into Mechanical Opened Independently

Follow these steps to open the Mechanical application independently, create a new project, and import the materials library for the CP Microstructure Add-on.

  1. Run the Mechanical application independently of Workbench.

  2. Click Start a New Mechanical Project. The Mechanical application appears as shown below.

  3. In the Outline pane, left-click Materials and select Import Materials from the menu. The Open dialog box is displayed.

  4. Navigate to the following directory:

    ANSYS_INSTALL_DIR\aisol\WBAddins\MechanicalExtensions\CPMicrostructure\MaterialsLibrary\

    where ANSYS_INSTALL_DIR is the directory where you installed the Ansys software.

  5. Select the MaterialLibrary_CPMicrostructure.xml file and click Open. The Mechanical application imports the library.

  6. Verify that Al-T3_Isotropic_CPMicroAddon is listed in the Engineering Data Material View:

  7. Choose File > Save and save your new project as cp_micro_tutorial.

33.3. Load the CP Microstructure Add-on

The CP Microstructure Add-on runs in the Mechanical application. To make its capabilities available, click the Crystal Plasticity Microstructure icon in the Add-ons ribbon. The icon will be highlighted in blue, indicating that the add-on is loaded.

Once the add-on is loaded, the CP Microstructure menu is visible. Click the menu to display the Crystal Plasticity Microstructure toolbar.

33.4. Change Units to Microns

Change the base units of measurement for your project to microns (μm), which are typically used in crystal plasticity analyses.

  1. In the right-hand side of the status bar (located at the bottom of the Mechanical application window), click the current units of measurement (by default, Metric (m, kg, N, s, V, A)). A menu of available unit systems appears.

  2. Select Metric (μm, kg, μN, s, v, mA) from the Unit Systems menu.

The status bar now shows the new unit system for the project (Metric (μm, kg, μN, s, v, mA)).

33.5. Insert a CP Microstructure Object into Model

Next, insert a CP Microstructure object into your Model tree.

  1. To add a CP Microstructure object to the project, do one of the following:

    • Click the Crystal Plasticity Microstructure icon   in the ribbon.

    • Right-click the Model object to open the context menu, then choose Insert>CP Microstructure.

  2. Verify that the CP Microstructure object is inserted to the Model tree. The new object has a question mark (?) state, which indicates that one or more fields have not yet been completed or contain invalid information.


Note:  You do not need to import a geometry to use the CP Microstructure object.


33.6. Load the EBSD File

The next step in this tutorial is to load an Electron-Backscattered Diffraction (EBSD) file into the CP Microstructure object.

An EBSD file contains Euler angles that specify the orientation of each grain in the material. The CP Microstructure Add-on uses this information to compute grain statistics and a microstructural map of the material.

  1. Click the CP Microstructure object to display its Details pane.

  2. Under the Grain Statistics header in the Details pane, set the File Type to EBSD.

  3. Click the yellow field next to EBSD File to open the system's file selection dialog. Browse to the folder where data files for this tutorial are saved (see Access Data Files). Select the file ebsd_316L_500x500.ang and click Open.

  4. Use your system file dialog to verify that the above EBSD file is copied to the user_files folder in the working directory of the project. The add-on automatically creates a subfolder SysA_MicrostructureXX (where XX is the internal ID of the CP Microstructure object) to store the files for each CP Microstructure object. A copy of the EBSD file is automatically saved in this folder as GrainStat_EBSD.ang

33.7. Generate and View Grain Statistics

After you finish loading the EBSD file, generate grain statistics. This step reduces the number of grains to an adequate quantity for reproducing the equivalent statistics for the crystal plasticity analysis.

  1. Click the Reload button   in the Grain Statistics window. This extracts grain statistical data from the EBSD file.

    The following figure shows the computed grain statistics. Depending on your computing resources, the extraction process may take several minutes to complete.


    Note:  The Grain Statistics worksheet uses statistical data fitting. The data that you see after loading the EBSD file might not be exactly the same as the statistics shown in this tutorial.


  2. Verify that the Grain Statistics status is changed to Up-to-date. The Status heading under the Details view shows the status of each step in the CP Microstructure modeling process. Incomplete steps are highlighted in red.

33.8. View the Microstructural Map and Grain Statistical Plots

After you load the EBSD file, you can view plots of grain characteristics and statistics.


Note:  The Grain Statistics plots use statistical data fitting. The plots that you see might not be exactly the same as the plots shown in this tutorial.


  1. Click the CP Microstructure Charts tab to view a microstructural map of the material. In this map, grains are color-coded according to their respective orientation angles. The Plot Type in the Grain Statistics worksheet at the bottom of the window should be set to EBSD Image.

  2. In the Grain Statistics worksheet, change the Plot Type to Grain Statistical Data. The following data is plotted in the CP Microstructure Charts pane (replacing the microstructural map).

  3. Review the histogram and fitted log-normal distributions of grain area, equivalent diameter, aspect ratio, and rotations.

33.9. Specify RVE Parameters

After you view the grain statistics plots, set the Representative Volume Elements (RVE) for the CP Microstructure object. These values determine the number and size of the voxels in your model (and therefore the elements in the mesh), the units of measurement, and other meshing parameters.

  1. Click the CP Microstructure object to display the Details view.

  2. Enter the following values in the fields under Representative Volume Elements (RVE):

    X-Dimension, Y-Dimension, and Z-Dimension

    100

    Divisions along X, Divisions along Y and Divisions along Z

    60

    Periodicity

    True

    Output Units

    microns

    Generate Log

    No

  3. Under Phase, set Name to Simulanium_1.

When you are finished, the Representative Volume Elements (RVE) and Phase parameters should look like this.

33.10. Assign Material

Next, assign a material to the CP Microstructure object. Set the following material properties in the Details pane under the Material header:

  1. Click the yellow field next to Assignment and select Al-T3_Isotropic_CPMicroAddon from the drop-down menu of CP Microstructure materials.


    Note:  If this material is not listed on the Assignment menu, do one of the following:

    • If you opened the Mechanical application from Workbench, right-click the Materials object and choose Refresh Materials from the drop-down menu. This reloads material definitions from the Engineering Data module.

    • If you opened the Mechanical application independently, follow the steps in Import Materials Library into Mechanical Application to reload the material library.


  2. Set Crystal Type to FCC.

  3. Set Use Idealized Texture to Yes.

When you are finished, the Material parameters should look like this.

33.11. Generate Element and Material Data Files

After you specify RVE parameters and assigned a material, you can generate the element (mesh) and material data files:

  1. Right-click the CP Microstructure object and select Generate Data from the drop-down menu.

    Depending on your available computing resources, this process may take some time. You can monitor the progress in the console window and the status bar.

  2. Unfortunately, the following error message appears at the bottom of the Mechanical application window when you try to generate the CP Microstructure data:

    The parameters from the previous section did not produce a good solution.

  3. You will need to view the error log to see what went wrong. Set the Generate Log property in the CP Microstructure object Details pane to Yes. This records solution messages in a log file.

  4. Try to regenerate the files with logging turned on. Right-click the CP Microstructure object and select Generate Data again.


    Note:  Setting Generate Log to Yes slows down the process of generating CP Microstructure files because the application must continuously write information to the output.log file. Ansys recommends that you only use this option only if there is an error and you need to log and read the error messages to take corrective action. (In other words, for cases similar to the one in this tutorial.)


  5. The same error message as earlier appears. However, this time the CP Microstructure add-on logged the messages produced during the data generation process. After the console window closes, right-click the Project object in the Outline tree and choose Open Project Files Directory from the drop-down menu. The system file dialog appears.

  6. Navigate to the folder user_files\SysA_MicrostructureXX.

  7. Open the output.log file with your favorite text editor. You should see the following error message near the end of the file:

    Creating an RVE based on user defined statistics
    Grains will not be voxelated well!
    Please increase the voxel numbers (OR) decrease the RVE side lengths

33.12. Override Grain Statistics Data and Regenerate Files

The analysis you've done so far produced grain sizes that cannot be efficiently divided up into three-dimensional units (voxelated) or meshed. You can address this problem in three different ways:

In this part of the tutorial, you will import a grain statistics file to override the equivalent diameter data from the EBSD file. This specifies a more uniform grain size for the crystal plasticity analysis. You will then regenerate the CP Microstructure files.

33.12.1. Override the Equivalent Diameter Data

First, import a grain statistics file to override the statistics computed from the EBSD file. The file specifies new equivalent diameter values for the grains in the material, which will produce a good mesh.

  1. In the CP Microstructure Details pane under Grain Statistical Data, set Override Data to Yes.

  2. Click the yellow field next to Select File to launch the system file open dialog.

  3. Select the grain statistical reference file RefStat.json from the tutorial files folder and click Open. This file contains reference data for specifying the equivalent diameter of the grains.

  4. Click the Reload button   in the Grain Statistics window. This loads the new equivalent diameter data from the RefStat.json file.

  5. Verify that the equivalent diameter values in the Grain Statistics Worksheet match the equivalent diameter values from the RefStat.json file.

RefStat.json file

{
    "Equivalent Diameter": {
        "mean": 0.557,
        "offs": 7.455,
        "cutoff_min": 0.062,
        "cutoff_max": 66.958,
        "std": 2.876
    }
}

Grain Statistics Worksheet

33.12.2. Regenerate the CP Microstructure Output Files

After you import the new equivalent diameter values, regenerate the CP Microstructure files.

  1. Do not change the RVE parameters that you specified earlier in the tutorial.

  2. Set Generate Log to No.

  3. Regenerate the CP Microstructure data files. Right-click the CP Microstructure object and select Generate Data from the drop-down menu.

    Depending on your available computing resources, this process may take some time. You can monitor its progress in the console window and the status bar.

When the CP Microstructure add-on is done generating data, a check mark appears next to the CP Microstructure object in the Model tree. The Status fields in the Details pane are no longer highlighted in red and show that RVE Data, Texture data, and Material data are now Generated.

33.12.3. Verify Generated Data Files

Finally, check whether the following output files are available in the user_files/SysA_MicrostructureXX folder in the working directory of your project:

  • apdl_px_XXXgrains_voxels.dat – Contains the generated geometry and mesh data for the microstructure. XXX is the number of grains in the output file.

  • MatAssignment.dat – Contains the material assignments for the grains in the microstructure.

These files can be used as input for a crystal plasticity analysis with Mechanical APDL.