Problem when using VTK cell structure

technical aspects of .dri file generation (e.g. debug mode ) etc...
Junny
Posts: 16
Joined: Tue Oct 18, 2016 12:27 pm
anti_bot: 333

Problem when using VTK cell structure

Post by Junny » Wed Dec 28, 2016 6:56 pm

Hi,
I was trying to simulate the cyclic transformation of pearlite to austenite and subsequently to martensite, under continuous heating and cooling condition. The heat-to-temperature was that the pearlite partially transform to austentie.So, after one cycle, the obtained microstructure is a mixture of pearlite and martensite. For the sunsequent heat-cooling cycles, I want to use the phase/grain and also the concentration structure from the first cycle. The concentration of the as-formed austenite was considered to inherit to the BCC phase, to be used as the product martensite phase.
In order to do so, 1) I firstly set the restart option to be ' restart structure_only' in the driving file. 2) I exported the .korn file to the .vtk file and use it as for the grain input. In this step, i define the grains corresponding to the previous austenite to be phase 2, the BCC. However, during the beginning of initianization, following errors occur.


Warning: trailing data ignored in file
D:\Dropbox\Micress\FeCMn\Viktor\Cyclic\ParaCycLowT-1_22.VTK

'Pausing' for 10 s.
Remaining time: 9 s.
Remaining time: 8 s.
Remaining time: 7 s.
Remaining time: 6 s.
Remaining time: 5 s.
Remaining time: 4 s.
Remaining time: 3 s.
Remaining time: 2 s.
Remaining time: 1 s.
Remaining time: 0 s.
Resuming 'normal' execution



Did you mean to have only two grains,
or did you forget to apply
'phase to grains tranformation'?

forrtl: severe (157): Program Exception - access violation
Image PC Routine Line Source
MICRESS_par_TQ9_x 00000001406A6860 Unknown Unknown Unknown
MICRESS_par_TQ9_x 00000001406DEAD2 Unknown Unknown Unknown
MICRESS_par_TQ9_x 00000001406CF495 Unknown Unknown Unknown
MICRESS_par_TQ9_x 0000000140151EE3 Unknown Unknown Unknown
MICRESS_par_TQ9_x 00000001400E05E6 Unknown Unknown Unknown
MICRESS_par_TQ9_x 000000014007537F Unknown Unknown Unknown
kernel32.dll 00000000779059CD Unknown Unknown Unknown
ntdll.dll 0000000077B3A561 Unknown Unknown Unknown

Junny
Posts: 16
Joined: Tue Oct 18, 2016 12:27 pm
anti_bot: 333

Re: Problem when using VTK cell structure

Post by Junny » Wed Dec 28, 2016 7:05 pm

I alo find one thread here (http://board.micress.de/viewtopic.php?f ... =vtk#p1013) and tried to change the keyword from point_data to cell_data. The problem remains
It was also recommended to increase the dimensions by 1. I wonder which dimension exactly? The dimension of anz and anx in the vtk file or the simulation domain in the driving file?

I have another question. Since I want to use the concentration pofiles as well. Then do I need to edit the 'initial concentration' as well in the driving file for the subsequent heat treatment cycle? Should I do the same as procedure I did for the Korn?

I attache the driving file and the .scr. I am not allowed to update the vtk file so I change in to .txt. Appologize for the so many questions and please be kind to help check.

With kind regards
Jun

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

Re: Problem when using VTK cell structure

Post by Bernd » Thu Dec 29, 2016 2:58 am

Dear Junny,

when converting from point_data to cell_data, you need to increase all three dimensions in the header of the vtk-file (each cell now is defined by its 8 corners instead of the central point). This should solve the problem technically.

Apart from that, I don't understand why you want to combine the restart option with reading from the .vtk file. What you would get is the following: You read the initial grain structure from the .vtk file, and afterwards replace grain number 15 of this structure by the microstructure (including concentration fields) which is stored in the .rest file.
If you want to use as well the grain as the concentration distribution from the prior run, why don't you just use restart structure_only? You can redefine phase numbers by changing the definition in the .dri file, or afterwards by switching them using "add_to grain" during run-time...

Bernd

Junny
Posts: 16
Joined: Tue Oct 18, 2016 12:27 pm
anti_bot: 333

Re: Problem when using VTK cell structure

Post by Junny » Thu Dec 29, 2016 12:53 pm

Dear Bernd,
Many thanks for your kind and quick response.
Sorry but I am quite new in the micress. Could you please be more specific, about how to redefine the phases in the driving file? I guess it should be the ' grain input' section? But which option should I choose, deterministic, random or from_file?

PS. Could you please also help me define the 'initial concentration'. Which option will automatically inherit the concentration file from the previous run?

Regards,
Jun

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

Re: Problem when using VTK cell structure

Post by Bernd » Fri Dec 30, 2016 11:46 am

Dear Jun,

the option "restart structure_only" inherits everything which is linked to "microstructure", i.e. grains, orientations, concentration fields, dislocation densitiy, stress fields etc., while "restart" without further options additionally contains process data like time, temperature, nucleation parameters etc.
Nevertheless, what is stored in the .rest file is not the explicit phase identity but only the phase number. Which phase of the thermodynamic database is assigned to this phase number is defined in the "Phase diagram - input data" section of the driving file, and this can be changed easily upon restart. So, e.g you easily can restart from a simulation where phase 2 was austenite and define phase 2 to be ferrite in the new simulation.

Of course you could do the same also by reading the initial microstructure from vtk: the grain structure of the former simulation from the .korn file (and manually assign the phase numbers) and the concentrations from the .conc* files. But this is more complicated, and you lose information because you can only reconstruct grain structures from sharp interfaces, small precipitates may be lost.
The option "add_to_grain" could help you in case you use restart and you want to redefine the phase of only selected grains. I am not sure, however, whether you need that.

Best regards
Bernd

Junny
Posts: 16
Joined: Tue Oct 18, 2016 12:27 pm
anti_bot: 333

Re: Problem when using VTK cell structure

Post by Junny » Tue Jan 10, 2017 2:20 pm

Dear Bernd,

Happy new year and I wish you all the best in the year 2017. :D

I came back again because I tried your suggestions but still meet problems.

1) I tried firstly with restart structure_only. And in the 'phase diagram - input data', I switch phase 1, austenite, to bcc ferrite, to introduce martensite. However, in my former simulaiton, I have mciture microstructure of approx 1.5 % austenite and untransformed ferrite and cementite. In the new simulation, I want austenite to nucleate at the martensite/ferrite boundary as well. If I did the phase switch as described, then there is no austenite.

2) I tried the add_to_grain option in the out_nucleation section. I chose the parent_grain suboption and choose the ferrite phase to be new phase and the refrence phase is austenite. I applied a continuous cooling condition in order to change/transform the austenite to ferrite. But there is only gradual transformation and the transformed to ferrite did not inherit the composition of parent austenite phase. Could you please tell which step is wrong?

3) Use the .vtk file for the korn and increase the x/y/z dimension by 1. Erros of reading the vtk file still appears


Best regards,
Jun

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

Re: Problem when using VTK cell structure

Post by Bernd » Tue Jan 10, 2017 5:54 pm

Dear Jun,

wish you also all the best for the new year 2017.

@1) If you want to transform only part of the austenite to ferrite, this method is not suitable. It could only be helpful together with option 2) if remaining austenite is back-transformed using the "add_to_grain parent_grain" option.

@2) The question whether this type of transformation is continuous or instantaneous depends on how you set up the nucleation data. By setting a high negative value as critical undercooling, transformation can be made independent from temperature and local compositions. Then it can be accomplished at the very beginning of the new simulation.
The difficulty is how to select the austenite which should be transformed or not. This could be done by selecting regions or statistically by adjusting the nucleation distance accordingly. If the two types of austenite could be distinguished by their composition, it would also be viable to define the critical undercooling such that transformation is happening only in one type.
Concentration is always inherited, where should the new concentration information come from? Only the phase state is switched while the concentration field inside the switched grains stays the same. However, after switching phase properties, thermodynamics and diffusivities are changed, so that composition may adapt to the new phase identity.

@3) I think the quickest form to proceed with this problem is that you send me the input files and the vtk (to b.boettger{at}micress.de) and I try to check out what could be the problem.

Best regards
Bernd

Junny
Posts: 16
Joined: Tue Oct 18, 2016 12:27 pm
anti_bot: 333

Re: Problem when using VTK cell structure

Post by Junny » Wed Jan 11, 2017 10:58 am

Dear Bernd,
The files has been sent to you. Thanks.

Kind regards,
Jun

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

Re: Problem when using VTK cell structure

Post by Bernd » Thu Jan 12, 2017 10:13 pm

Dear Jun,

Thanks for sending your input files.

In order to make the driving file with vtk input operational and provide also concentration data, the following steps were necessary:

1.) Remove the restart option:

# Restart options
# ===============
# Restart using old results?
# Options: new restart [reset_time | structure_only]
new
#


Otherwise, everything you read from vtk is just overwritten afterwards...

2.) In the header of the vtk file for grain input, the keyword "POINT_DATA" has to be replaced with "CELL_DATA", and all 3 dimensions have to be increased by 1. The header of this file afterwards looks like:

# vtk DataFile Version 3.0
t = 0.04 s
ASCII

DATASET STRUCTURED_POINTS
DIMENSIONS 141 2 406
ORIGIN 0 0 0
SPACING 0.02 0.02 0.02

CELL_DATA 56700

SCALARS korn float
LOOKUP_TABLE default


3.) When reading the vtk in the "Grain Input" section of the MICRESS input file, the option "-1" for automatic numbers of grains should be used (the option for specifying the number of grains explicitly does not work for unknown reason...):

#
# Grain input
# ===========
# Type of grain positioning?
# Options: deterministic random [deterministic_infile] from_file
from_file
# Filename of initial grain/phase structure [VTK_identifier (default=korn)] ?
ParaCycLowT1_22.vtk korn
# Treatment of data?
# (n: none, 1: 1D, x: rotate Clockwise along x-axis, y, z,
# or p: 'phase to grains transformation')
n
# Number of grains at the beginning?
# (Set to less than 1 for the number of grain to be read from the input data,
# with optionally a minimal size, in cells)
-1
# Read grain properties from a file?
# Options: input from_file identical blocks
input
# Input data for grain number 1:
# Phase number? (integer)
2
# Input data for grain number 2:
# Phase number? (integer)
3


4.) For adding concentration information, vtk files have to be created from the conc1.mcr and conc2.mcr files in the same way as for the korn.mcr. In this case, there is currently no check for cell data/point data in the MICRESS code, thus you need not (but of cause may) make the changes in the headers like above.

5.) The vtk files for concentration are read in the "Initial Concentrations" input section:

# Initial concentrations
# ======================
# How shall initial concentrations be set?
# Options: input equilibrium from_file [phase number]
from_file
# Concentration of component 1 (C) in phase 0 ? [at%] (for initialisation of TQ)
3.0420
# Filename of initial concentration profile of component 1? [VTK_identifier (default=conc)]
ParaCycLowT1_conc1_22.vtk
# Treatment of data?
# (n: none, x: rotate Clockwise along x-axis, y, z)
n
# Concentration of component 2 (MN) in phase 0 ? [at%] (for initialisation of TQ)
1.4980
# Filename of initial concentration profile of component 2? [VTK_identifier (default=conc)]
ParaCycLowT1_conc2_22.vtk
# Treatment of data?
# (n: none, x: rotate Clockwise along x-axis, y, z)
n
#


That's all...

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

Re: Problem when using VTK cell structure

Post by Bernd » Thu Jan 12, 2017 11:14 pm

Hello Jun,

now follows the second part which describes the case which uses restart instead of reading from file ("simulation-addToGrain_in.txt"):

1.) Remove reading from file in "Grain input" section, because it is completely useless:

# Grain input
# ===========
# Type of grain positioning?
# Options: deterministic random [deterministic_infile] from_file
deterministic
# NB: the origin of coordinate system is the bottom left-hand corner,
# all points within the simulation domain having positive coordinates.
# Number of grains at the beginning?
0
#


2.) You use "restart reset_time" here, which can stay for the moment. Once you want to further change input data (e.g. change the number of phase interactions etc.) or change the domain size, you will have to change to "restart structure_only" which is much more flexible.

3.) All the rest is about nucleation input. Of course, everything depends on what you exactly want to obtain. To achieve something similar as in the above case of vtk input, we want to have all nucleation at the very beginning for switching part of the austenite to martensite:
- restrict temperature interval such that nucleation is active only at the beginning (up to 0.005 s)
- make the time between checks for nucleation small enough to allow nucleation during this period
- remove the shield effect (shield time = 0) because it is not needed
- reduce the shield distance (which apart from the shield has also the meaning of a nucleation distance if the second optional parameter is omitted) to a value which is sufficiently small to hit all small austenite particles at first trial. To statistically switch only part of them you could also play with this parameter.
- you should increase the maximum number of nuclei to a sufficiently large (huge) number. Otherwise it could happen that once you scale up your simulation to a bigger domain that you run out of nuclei...
- In order not to switch all austenite grains, I use a region here which selects only those in the lower part of the domain.

The nucleation input now looks like that:

#
# Input for seed type 1:
# ----------------------
# Type of 'position' of the seeds?
# Options: bulk region interface triple quadruple [restrictive]
region
# Minimal value of x-coordinates? [micrometers]
0.0000
# Maximal value of x-coordinates? [micrometers]
2.8000
# Minimal value of z-coordinates? [micrometers]
0.0000
# Maximal value of z-coordinates? [micrometers]
4.5000
# Phase of new grains (integer) [unresolved|add_to_grain]?
2 add_to_grain
# Which grain number the new grains shall be added to?
# # Options: grain_number (number) parent_grain new_set
parent_grain
# Reference phase (integer) [min. and max. fraction (real)]?
1
# Which nucleation model shall be used?
# Options: seed_undercooling seed_density
seed_undercooling
# maximum number of new nuclei 1?
10000000000
# Grain radius [micrometers]?
0.00000
# Choice of growth mode:
# Options: stabilisation analytical_curvature
stabilisation
# min. undercooling [K] (>0)?
-20000.
# Shield effect:
# Shield time [s] [shield phase or group number] ?
0.0
# Shield distance [micrometers] [ nucleation distance [micrometers] ]?
0.1
# Nucleation range
# min. nucleation temperature for seed type 1 [K]
980.0000
# max. nucleation temperature for seed type 1 [K]
2000.000
# Time between checks for nucleation? [s]
1.00000E-03
# Shall random noise be applied?
# Options: nucleation_noise no_nucleation_noise
no_nucleation_noise
#


I hope that this does more or less what you intended.

I personally would prefer this method, because the other procedure with the .vtk files looses information as it does not transfer the diffuse interfaces. Fine structures are lost.

Post Reply