Generate Digital Twin From 3D
The Generate Digital Twin From 3D uses the Generate Structure app to generate a digital twin of a 3D reference structure, combined with an optimization algorithm to iterate the twin to the target.

|
Modules needed to run this GeoApp:
GrainGeo, PoroDict+MatDict
Depending on the settings: FlowDict, DiffuDict
|
Clicking Edit... opens the Generate Digital Twin From 3D dialog. At the top, define a Result File Name for the result file and the result folder containing the generated structure.
Initial Parameter Values
Overlay Grains and Gauss Field Settings
In this panel you setup the initial structure for the local optimization.
The Overlay Strength is the field overlay strength in percentage. At 100% overlay strength the result will only show the grain package, while at 0% overlay strength the result will show only the Gaussian random field. If no Random Field is used, this value is automatically set to 100%. If no Grain Generator is used, this value is automatically set to 0%.
|
Grain Generator
Select the basic shape used to generate the 3D structure. Select None as Grain Generator to use only the Gaussian random field for the structure generation. The app uses the GrainGeo - Create command to create the grain structure. Be aware that all lengths are given in the unit voxel.
The values entered for diameters, standard deviations and aspect ratios define the initial structure for the local optimization. They are only used if UseManual was selected for Initial Parameter Values.
For the Sphere shape, the diameters are Gaussian distributed. Select the mean diameter and the standard deviation.
For the Ellipsoid shape, the first diameter is Gaussian distributed. Select the mean diameter and the standard deviation. For the other two diameters, fixed aspect ratios are used.
For the Convex Polyhedron shape, an ellipsoid is used as enclosing object. Select the mean diameter and the standard deviation. For the other two diameters, fixed aspect ratios are used.
|
Random Field
Criteria to Match
The error function is a combination of several components. Define the error function components from the list of physical properties. These structure properties will be matched by the twin as good as possible.

Select Pore and Solid Granulometry to use the PoroDict - Pore Size Distribution (Granulometry) and MatDict - Solid Size Distribution commands to compare the digital twin with the original 3D image.
Select Porosimetry to use the PoroDict - Pore Size Distribution (Porosimetry) command to compare the digital twin with the original 3D image.
Select Pore and Solid Chord Length to use the PoroDict - Chord Length Distribution and MatDict - Chord Length Distribution commands to compare the digital twin with the original 3D image.
Select Specific Surface Area to use the MatDict - Estimate Surface Area command to compare the digital twin with the original 3D image.
Select Permeability to use the FlowDict-Stokes command to determine the permeability. Select the space directions used to compare the digital twin with the original 3D structure. To use this option, a FlowDict license is required.
Select Diffusivity to use the DiffuDict - Bulk Diffusion command to determine the diffusivity. Select the space directions used to compare the digital twin with the original 3D structure. To use this option, a DiffuDict license is required.
You must select at least one of these criteria, otherwise the optimizer will fail with an error message.
|
Optimization Components
Select the sets of parameters to be used as optimization variables for fitting the reference structure. If not selected, the according parameters from the Digital Twin Setup will stay constant during the optimization.

Select Optimize Overlay Strength to vary the Overlay Strength.
Select Optimize Grain Generator Parameters to vary the diameter, standard deviation and aspect ratio parameters of the Grain Generator. Note that the optimizer does not optimize the generator type, i.e. does not vary between Sphere, Ellipsoid and ConvexPolyhedron shapes.
Select Optimize Random Field Parameters to vary the correlation length(s) and the relative influence parameters of the Random Field. Note that the optimizer does not vary between the OneIsotropicGauss and TwoIsotropicGauss models.
You must select at least one of these options, otherwise the optimizer will fail with an error message
|
Optimization Stopping Criterion
Set the stopping criterion by choosing a maximal number of iterations or set a tolerance accuracy to reach. Note that choosing none or setting the Maximal Number of Optimization Iterations to 0 will perform one single iteration step only.
The selected tolerance applies to the structure generation parameters varied in each iteration step. If the change in these parameters becomes smaller that the selected tolerance, the optimizer stops. The tolerance does not set a limit value for the resulting error function of the found digital twin.

|
Set Geometry Size
Check the box to set the size of the generated 3D structure model.

If the box is not checked, the size of the reference structure is used.
|
Clean up after completion
If checked, all intermediate results are deleted.
|
Set Expert Structure Generation Settings
Activating the check box enables to set one additional parameter.

Check Invert Grains for Overlay to switch pore and solid material. In this case, the grain generator creates the pore space, and the background becomes the solid material.
|
Results
After the generation is finished, the corresponding result file is opened in the Result Viewer.
The Report tab
In the Structure Details table reports the grid size, voxel length and solid volume percentage of the reference structure and the digital twin.
The Structure Generation Parameters table shows the found optimal structure generation parameters. You can use these parameters as input in the Generate Structure app to create multiple digital twin models.
The Structure Comparison table compares the computed measures of the reference structure and the digital twin and states the error in the respective measure.
The Optimization table report the number of iterations and function evaluations needed. Below, the total runtime of the optimization is reported.
Plots tab
The Parameters by Evaluation and Parameters by Iteration plots show the evolution and convergence of the structure generation parameters in each step.
The Target Errors by Evaluation / Iteration plots show the results of the structure comparison in each step.
Data Visualization

In this tab, you can load the reference structure and the realized digital twin.
Result folder content
In the result folder, find the following:
- The analysis results of the reference structure is stored in the Reference Structure folder.
- The analysis results of the found digital twin is stored in the Digital Twin folder.
- The intermediate evaluation results, if Clean up after completion is not checked.
- The used parameters, the corresponding simulation results and the error function evaluation of every step are contained in the DigitalTwinGlobal.csv and DigitalTwin.csv files.
- The final statistical digital twin Structure.gdt.