AddDataTransfer()

Given arguments that specify the coupling interface, target side, and variables to be associated with each side of the interface, adds a data transfer object to the data model.

Requires that you specify variables using their internal object names.

Data transfer definitions may be either variable-based or expression-based, depending on the Optional Keyword Arguments given. Only arguments of a single type may be used. That is, if a variable-based data transfer argument is given, then no expression-based data transfer arguments can be used. Conversely, if an expression-based data transfer argument is given, then no variable-based arguments can be used.

Cannot be run after participants have started.

Returns the name of the data transfer created.

For more detailed information on the object created, see DataTransfer.

Essential Keyword Arguments

Interface : string

String indicating the internal object name of the interface on which the data transfer is to be created.

TargetSide : string

String indicating the side of the interface to receive the data transfer variable. Possible values:

  • One

  • Two

Optional Keyword Arguments

SourceVariable, TargetVariable : string

Strings specifying the names of the variables associated with the source and target side of the interface. Used to define a variable-based data transfer.

Cannot be combined with SideOneVariable and SideTwoVariable.

SideOneVariable, SideTwoVariable : string

Note:  Ansys recommends that you use the SourceVariable and TargetVariable settings instead.


Strings specifying the names of the variables associated with sides One and Two of the interface. Used to define a variable-based data transfer.

Cannot be combined with SourceVariable and TargetVariable.

TargetVariable : string

String specifying the name of the variable on the target side of the data transfer. When used without a corresponding SourceVariable keyword, it is used to define an expression-based data transfer.

Value : string

String specifying the expression used to define the source side of the data transfer.

Return Type

String

Examples

Example 1: Add a two-way variable-based data transfer

 
AddDataTransfer(
	Interface = 'Interface-1',
	TargetSide = 'One',
	TargetVariable = 'FORC',
	SourceVariable = 'Total Force')

AddDataTransfer(
	Interface = 'Interface-1',
	TargetSide = 'Two',
	TargetVariable = 'INCD',
	SourceVariable = 'MeshDisplacement')


Example 2: Add an expression-based data transfer of a scalar quantity


AddDataTransfer(
	Interface = 'Interface-1',
	TargetSide = 'One',
	TargetVariable = 'Temperature',
	Value = '300 [K] if Step  < 3 else temperature')


Example 3: Add an expression-based data transfer of a vector quantity


AddDataTransfer(
	Interface = 'Interface-1',
	TargetSide = 'One',
	TargetVariable = 'INCD',
	Value = 'vector(INCD * Position.x / 1 [m], INCD * Position.y / 0.5 [m], INCD * Position.z / 0.02 [m])')   


Example 4: Add an expression-based data transfer of a vector quantity using X, Y, and Z components


Note:  Ansys recommends that you define new expressions using the single Value argument, as shown above in Example 3: Add an expression-based data transfer of a vector quantity.

Existing expressions defined using the ValueX, ValueY, and ValueZ arguments are still supported, but will be combined into single value.



>>> AddDataTransfer(
         Interface = 'Interface-1',
         TargetSide = 'One',
         TargetVariable = 'INCD',
         ValueX = 'INCD * Position.x / 1 [m]',
         ValueY = 'INCD * Position.y / 0.5 [m]',
         ValueZ = 'INCD * Position.z / 0.02 [m]')