Asking help for using restart file as initial micrstructure

technical aspects of .dri file generation (e.g. debug mode ) etc...
Post Reply
dhe
Posts: 4
Joined: Tue Oct 22, 2024 5:32 pm
anti_bot: 333

Asking help for using restart file as initial micrstructure

Post by dhe » Wed Apr 30, 2025 12:16 pm

Dear sir /Madam,
sorry to bother you, I would like to use part of the result from previous MICRESS simulation as the initial microstructure.I have tried to shift and zoom the restart file but it doesn't work. I wonder if my idea could be realized through codes.
Since the restart file is too large to put in the attachment, I upload the hole file through gigamove. Here is the link
https://gigamove.rwth-aachen.de/en/down ... 34e3dbc947
Thanks for your help and patients.
Looking forward to your reply
Kind Regards,
Dai He

ralph
Posts: 188
Joined: Wed Apr 27, 2011 4:42 pm
anti_bot: 333

Re: Asking help for using restart file as initial micrstructure

Post by ralph » Fri May 02, 2025 10:13 am

Dear Dai He,

maybe, you should start with the simplest coordinates, i.e. just zero offset:

Code: Select all

# Structure from restart file
# ---------------------------
# Shall grain(s) be replaced by initial structure(s) from a restart file(s) ?
# Options: restart_file | no_restart_file
restart_file
# How many restart files shall be read?
1
# For each restart file a grain number and (optionally)
# shift (in grid cells) and zoom factor for all 3 dimensions
# as well as a character for rotation options must be specified:
# grain number [shift X (int)  shift Y (int)  shift Z (int)
#              zoom X (int)  zoom Y (int)  zoom Z (int) rot(string)] ?
# Rotation options: "xz+90" "xz-90" "xz180" "xy+90" ... "yz180"
#0 0 500 4 1 1
0 0 0 0
# Name of restart file?
FeCMnAl-FEM
The first number is the grain no. 0. The next 3 numbers define the zero offset in x,y,z.
I tested this with MICRESS 7.3. Do you use 7.1?

What did you mean with your line: 0 0 500 4 1 1?
4 1 1 looks like zoom factors. Right?

Best,
Ralph

dhe
Posts: 4
Joined: Tue Oct 22, 2024 5:32 pm
anti_bot: 333

Re: Asking help for using restart file as initial micrstructure

Post by dhe » Mon May 05, 2025 1:13 pm

Dear Ralph,

Thank you for your response. I tried using the simplest coordinate setup, but unfortunately, the results still didn’t meet my expectations. I experimented by setting the grain number to 0, 1, and 2.

With grain numbers 0 and 2, the initial microstructure remained unchanged. When I set the grain number to 1, the liquid phase—the red region at the top in the figure below—was replaced. However, my goal is to preserve the liquid phase and replace only the initial austenite phase, which is represented by the orange region at the bottom.

I’d like to ask if this can be achieved by adjusting my code. I’ve included a link below to the version of the code I’ve been working with.

Thank you again for your time and patience. I look forward to your insights.

Kind regards,
Dai He
https://gigamove.rwth-aachen.de/en/down ... e256763a06
You do not have the required permissions to view the files attached to this post.

Bernd
Posts: 1585
Joined: Mon Jun 23, 2008 9:29 pm

Re: Asking help for using restart file as initial micrstructure

Post by Bernd » Mon May 05, 2025 3:30 pm

Dear Dai He,

Let me take over from Ralph and trace down your problems with reading initial microstructures from restart files. Firstly, it is important to know how this procedure works in order to understand what happens:

When reading in initial microstructures from one or more restart files you first need to define the spatial region(s) which should be filled by the content(s) of the .rest-file(s). To be most flexible and efficient, we define these regions by an initial grain map which is created by the standard initial grain input (which has still sharp interfaces - we automatically apply the user-defined initialisation steps after reading the initial microstructure from restart). In the most simple case, if no initial grain has been defined by the user (number of initial grain is set to 0), then, by default, grain number 0 fills the whole domain. If you now read in an initial microstructure from a restart file into grain 0, like

# Structure from restart file
# ---------------------------
# Shall grain(s) be replaced by initial structure(s) from a restart file(s) ?
# Options: restart_file | no_restart_file
restart_file
# How many restart files shall be read?
1
# For each restart file a grain number and (optionally)
# shift (in grid cells) and zoom factor for all 3 dimensions
# as well as a character for rotation options must be specified:
# grain number [shift X (int) shift Y (int) shift Z (int)
# zoom X (int) zoom Y (int) zoom Z (int) rot(string)] ?
# Rotation options: "xz+90" "xz-90" "xz180" "xy+90" ... "yz180"
0


then the content of the .rest-file will be copied into the whole MICRESS domain (voxel by voxel), so that it looks exactly like the latest time step of the prior simulation where the .rest-file had been taken from (at least if the domain sizes have been identical). This means, by default, the lower left corner of the .rest file structure is put to the lower left corner of the new domain. The length scale is not taken into account, so that the microstructure is imported voxel by voxel even if you would have changed the grid spacing.
I you want to manipulate the position, orientation, and size of the initial microstructure, you may use the shift, rotation, or zoom options, respectively which are all written (optionally) into one line. But with these options, the user has to be careful:
First, it is not allowed to only partially fill the region of the marker grain (this would lead to unexpected errors). However, in all the cases where the microstructure in the .rest-file had been simulated using symmetric or periodic boundary conditions, there will be no such problem, because MICRESS will automatically expand the represented microstructure by mirroring or continuation where needed.
To simplify the procedure for the user, the operations are performed on the .rest-file coordinates proceeding backwards through the input, i.e. rotation is done first (if specified), then comes the zoom, and finally the shifting operation. With respect to the input syntax this means that, if you e.g. want to do just a rotation, you need to input first zero shift and no zoom, i.e. in the case above you would write


# For each restart file a grain number and (optionally)
# shift (in grid cells) and zoom factor for all 3 dimensions
# as well as a character for rotation options must be specified:
# grain number [shift X (int) shift Y (int) shift Z (int)
# zoom X (int) zoom Y (int) zoom Z (int) rot(string)] ?
# Rotation options: "xz+90" "xz-90" "xz180" "xy+90" ... "yz180"
0 0 0 0 1 1 1 xz+90


Note that you need to specify all 3 coordinates always, even in case of a 2D-simulation.
Furthermore, it is important that rotation is possible only in multiples of 90° (to avoid interpolation). When using the zoom function, only integer numbers >0 are allowed for each direction. Please note that using a too large factor (>3) probably leads to unexpected results, because noise will be amplified to random structures. Please further note that to achieve a zoom into a microstructure with diffuse interfaces, a complex contraction process of the enlarged interface regions will be performed which requires that the user specifies a sufficiently large number of initialisation steps. There is always a risk of getting numerical artefacts in this step if thermodynamics are complex (because the concentration fields need also to be adjusted here).
Finally, for reading in microstructures from .rest-files, all components (elements) need to be chosen in the same way, and the phases used in the .rest-file should have the same phase numbers as in the new simulation setup. Thermodynamic phase equilibria have to be re-initialized based on already existing diffuse interfaces, which is more difficult than the "normal" initial equilibria in standard simulations. Therefore, initial concentrations should always be specified by "input" when using initial microstructure from file (i.e. by definition of all initial compositions in all phases). This does not have any direct effect on the composition distribution in the initial microstructure, as they have been read from the .rest-file, but allows MICRESS to use reasonable composition values for the initialisation process. It is a good practice to take these values form the last line in the .TabC output file of the former simulation (which created the .rest-file). The corresponding temperature from the same line in .TabC should also be used as temperature for initialisation in the new simulation.

In your case, the confusion probably comes from the fact that your .rest-file already contains the same grain at the bottom which you define as grain 1 in your second simulation. Thus, when choosing grain 1 as filter for reading the initial microstructure, it seems that nothing is happening - in reality you overwrite grain 1 with grain 1 of the former simulation, the grain number of which is incremented to 2. What you probably want to do instead is to downshift you solidification microstructure of the first simulation into the region of grain 1:


# For each restart file a grain number and (optionally)
# shift (in grid cells) and zoom factor for all 3 dimensions
# as well as a character for rotation options must be specified:
# grain number [shift X (int) shift Y (int) shift Z (int)
# zoom X (int) zoom Y (int) zoom Z (int) rot(string)] ?
# Rotation options: "xz+90" "xz-90" "xz180" "xy+90" ... "yz180"
1 0 0 -1500


Best wishes
Bernd

dhe
Posts: 4
Joined: Tue Oct 22, 2024 5:32 pm
anti_bot: 333

Re: Asking help for using restart file as initial micrstructure

Post by dhe » Wed May 07, 2025 2:21 pm

Dear Bernd,
The issue has been resolved. Thank you very much for your help and guidance.

Best regards,
Dai He

Post Reply