Hi all,

The use of diffusion data from database has been considerably reworked in MICRESS version 6.400.

First, the keyword "multi_plus" has been added which is used like "multi" but includes the intrinsic dependency of the off-diagonal terms of diffusion on the concentration of the diffusing element. It can be important to include this dependency in case strong concentration gradients are present in the simulation domain (e.g. in brazing where completely different materials may be connected) and, in particular, if the balance between diagonal and off-diagonal terms determines whether the diffusion matrix is stable or whether demixing occurs.

Furthermore, extrapolation of diffusion coefficients with respect to concentration has been reworked. One problem of such an extrapolation is that it must behave well even if concentrations diverge. A second is that the balance between diagonal and off-diagonal terms needs to be maintained (see above), and the third is the diffusion time stepping which should decrease inverse proportional with the extrapolated diffusion coefficient and thus easily slows down simulation. All three problems have been addressed in the update.

Finally some specific options have been added and additional output information is provided.

More information will be added to this thread soon.

Bernd

## Diffusion data in MICRESS

### "diagonal", "multi","multi_plus"

Hi all,

The keywords "diagonal, multi, multi_plus" provide three main options for definition of the diffusion coefficients. They should be used followed by single or multiple characters which define the way how diffusion data are retrieved and used (e.g. retrieved from database, infinite, interpolated with respect to concentration, etc.). Furthermore, there are additional keywords which allow further specifications, mostly available only in "terse mode".

Some words first on "

the user also can do the input in arbitrary order and leaving out those elements and phases where no diffusion is defined:

MICRESS automatically switches to this "terse mode" if the user types the explicit element and phase number before the first keyword in this section (please note that the corresponding "question" is added afterwards to the .in file in order to create a readable input file).

Due to its free format, "terse mode" allows further inputs belonging to already defined diffusion data, like the definition of a prefactor on the diffusion coefficient ("factor") or a "safety" factor on the numerical time step for this diffusion term ("cushion"):

Now follows a more detailed explanation of the three main keywords:

This keyword defines the diagonal term for a given element in a given phase, corresponding to Fick's law of diffusion:

j

Please note:

- This keyword should always be used when obtaining diffusion data for the liquid phase from database. If "multi" is used in this case, wrong information is created for the off-diagonal term which are not modeled in current diffusion databases.

- "diagonal" also should be used for definition of infinite diffusion (characters "i" or "I"). Use of these characters with "multi" or "multi_plus" would not make sense and is forbidden.

Examples:

define infinite diffusion for element 2 in phase 3 (terse mode):

define no diffusion of an element in standard mode:

read diagonal term from database without concentration dependency and define a prefactor of 0.5 on diffusivity:

read diagonal term from database and automatically switch to infinite when a limit value of the diffusion coefficient is exceeded (terse mode):

Defines a full line of the diffusion matrix according to the Fick-Onsager equation:

j

This keyword is typically used for solid state diffusion if diffusion data is available in a database. For each element in the line of the diffusion matrix, a character specifies how data is retrieved. If no characters are given, "g" is assumed for all (retrieval from database without concentration dependency).

Examples:

get whole line from database without interpolation (standard mode):

get whole line from database with interpolation and set interpolation limit (terse mode):

get diagonal with and off-diagonal terms without interpolation (terse mode):

read all terms of the line from file (standard mode):

read only diagonal term from manual input as frequency term and activation energy in terse mode (essentially, using "diagonal d" would be appropriate):

This keyword uses the same syntax as "multi" and should be used instead if the dependency of the off-diagonal terms of diffusion on concentration should be taken into account explicitly (i.e. directly inside the diffusion solver without the need to update diffusion data from the database). The needs for this extended option comes from the major difficulties which can arise when calculating diffusion data close to miscibility gaps like it is the case e.g. for CMSX-4. If off-diagonal terms are not small compared to the diagonal terms, or even the latter is negative, the balance between diagonal and off-diagonal terms is essential.

Please note:

- The intrinsic dependency of the off-diagonal terms on the composition of the diffusing element k is also correctly assumed if "multi" is used with character "l". However, "l" requires much more resources as extrapolation is performed with respect to all elements (not just k). Moreover, "multi_plus" with character "l" would provide a further concentration dependency on top of the linear intrinsic one.

- "multi_plus" has no effect on the diagonal term. "multi_plus" must be used with "l" for diagonal terms if these are negative (to maintain balance with off-diagonal terms).

Examples:

get whole line from database with extrapolation only for the diagonal term (terse mode):

Bernd

The keywords "diagonal, multi, multi_plus" provide three main options for definition of the diffusion coefficients. They should be used followed by single or multiple characters which define the way how diffusion data are retrieved and used (e.g. retrieved from database, infinite, interpolated with respect to concentration, etc.). Furthermore, there are additional keywords which allow further specifications, mostly available only in "terse mode".

Some words first on "

**terse mode"**: While in standard mode, the user is requested to input consecutively diffusion data for each element in each phase, e.g.*# How shall diffusion of component 1 in phase 0 be solved?*

diagonal n

# How shall diffusion of component 1 in phase 1 be solved?

multi ggg

...

# How shall diffusion of component 3 in phase 2 be solved?

multi gggdiagonal n

# How shall diffusion of component 1 in phase 1 be solved?

multi ggg

...

# How shall diffusion of component 3 in phase 2 be solved?

multi ggg

the user also can do the input in arbitrary order and leaving out those elements and phases where no diffusion is defined:

*# How shall diffusion of component 1 in phase 1 be solved?*

1 1 multi ggg

# How shall diffusion of component 2 in phase 1 be solved?

1 2 multi ggg

...1 1 multi ggg

# How shall diffusion of component 2 in phase 1 be solved?

1 2 multi ggg

...

MICRESS automatically switches to this "terse mode" if the user types the explicit element and phase number before the first keyword in this section (please note that the corresponding "question" is added afterwards to the .in file in order to create a readable input file).

Due to its free format, "terse mode" allows further inputs belonging to already defined diffusion data, like the definition of a prefactor on the diffusion coefficient ("factor") or a "safety" factor on the numerical time step for this diffusion term ("cushion"):

*# How shall diffusion of component 2 in phase 1 be solved?*

1 2 multi ggg

...

1 2 factor 0.9

1 2 cushion 0.5

...1 2 multi ggg

...

1 2 factor 0.9

1 2 cushion 0.5

...

Now follows a more detailed explanation of the three main keywords:

**"diagonal":**This keyword defines the diagonal term for a given element in a given phase, corresponding to Fick's law of diffusion:

j

_{k}=-D_{k}nabla_{ck}Please note:

- This keyword should always be used when obtaining diffusion data for the liquid phase from database. If "multi" is used in this case, wrong information is created for the off-diagonal term which are not modeled in current diffusion databases.

- "diagonal" also should be used for definition of infinite diffusion (characters "i" or "I"). Use of these characters with "multi" or "multi_plus" would not make sense and is forbidden.

Examples:

define infinite diffusion for element 2 in phase 3 (terse mode):

*2 3 diagonal i*define no diffusion of an element in standard mode:

*diagonal n*read diagonal term from database without concentration dependency and define a prefactor of 0.5 on diffusivity:

*1 2 diagonal g*

1 2 factor 0.51 2 factor 0.5

read diagonal term from database and automatically switch to infinite when a limit value of the diffusion coefficient is exceeded (terse mode):

*2 4 diagonal g*

2 4 infinite_limit 1.E-52 4 infinite_limit 1.E-5

**"multi":**Defines a full line of the diffusion matrix according to the Fick-Onsager equation:

j

_{k}=-Sigma D_{kl}nabla c_{l}This keyword is typically used for solid state diffusion if diffusion data is available in a database. For each element in the line of the diffusion matrix, a character specifies how data is retrieved. If no characters are given, "g" is assumed for all (retrieval from database without concentration dependency).

Examples:

get whole line from database without interpolation (standard mode):

*multi*get whole line from database with interpolation and set interpolation limit (terse mode):

*1 1 multi llll*

1 1 maxfactor_local 2.01 1 maxfactor_local 2.0

get diagonal with and off-diagonal terms without interpolation (terse mode):

*3 2 multi llgl*read all terms of the line from file (standard mode):

*multi fff*

[path/]filename#1

[path/]filename#2

[path/]filename#3[path/]filename#1

[path/]filename#2

[path/]filename#3

read only diagonal term from manual input as frequency term and activation energy in terse mode (essentially, using "diagonal d" would be appropriate):

*1 1 multi dnn*

1.456E5

30456.

1.456E5

30456.

**"multi_plus":**This keyword uses the same syntax as "multi" and should be used instead if the dependency of the off-diagonal terms of diffusion on concentration should be taken into account explicitly (i.e. directly inside the diffusion solver without the need to update diffusion data from the database). The needs for this extended option comes from the major difficulties which can arise when calculating diffusion data close to miscibility gaps like it is the case e.g. for CMSX-4. If off-diagonal terms are not small compared to the diagonal terms, or even the latter is negative, the balance between diagonal and off-diagonal terms is essential.

Please note:

- The intrinsic dependency of the off-diagonal terms on the composition of the diffusing element k is also correctly assumed if "multi" is used with character "l". However, "l" requires much more resources as extrapolation is performed with respect to all elements (not just k). Moreover, "multi_plus" with character "l" would provide a further concentration dependency on top of the linear intrinsic one.

- "multi_plus" has no effect on the diagonal term. "multi_plus" must be used with "l" for diagonal terms if these are negative (to maintain balance with off-diagonal terms).

Examples:

get whole line from database with extrapolation only for the diagonal term (terse mode):

*2 3 multi-plus glggggg*Bernd