Transfers System
When running simulations that contain MultiApps—simulations running other sub-simulations—it is often required to move data to and from the sub-applications. Transfer objects in MOOSE are designed for this purpose.
Example Transfer
Assuming that the concept of MultiApps is understood, Transfers are best understood via an example problem. First, consider a "master" simulation that is solving the transient diffusion equation. This master simulation also includes two "sub" applications that rely on the average value of the unknown from the master application.
The "master" Simulation
Listing 1 is an input file snippet showing the MultiApps block that includes a TransientMultiApp, this sub-application will execute along with the master (at the end of each timestep) as time progresses.
Listing 1: The MultiApps block of the "master" application that contains two sub-application that solves along with the master as time progresses.
[MultiApps]
[pp_sub]
type = TransientMultiApp
app_type = MooseTestApp
positions = '0.5 0.5 0 0.7 0.7 0'
execute_on = timestep_end
input_files = sub.i
[]
[]
(test/tests/transfers/multiapp_postprocessor_to_scalar/master.i)For this example, the sub-applications require that the average from the master in the form of a scalar AuxVariable, see the AuxVariables documentation for further information. Therefore the master will transfer the average value (computed via the ElementAverageValue Postprocessor) to a scalar AuxVariable on each sub-application. As shown in Listing 2, the MultiAppPostprocessorToAuxScalarTransfer is provided for this purpose.
Listing 2: The Transfers block of the "master" application that contains a Transfer of a Postprocessor to a scalar AuxVariable on sub-applications.
[Transfers]
[pp_transfer]
type = MultiAppPostprocessorToAuxScalarTransfer
direction = to_multiapp
multi_app = pp_sub
from_postprocessor = average
to_aux_scalar = from_master_app
[]
[]
(test/tests/transfers/multiapp_postprocessor_to_scalar/master.i)The "sub" Simulations
For this simple example the sub-application must contain an appropriate AuxVariable to receiving the Postprocessor value from the master application.
Listing 3: The AuxVariables block of the "sub" application that contains a scalar that the master application will update.
[AuxVariables]
[./from_master_app]
order = FIRST
family = SCALAR
[../]
[]
(test/tests/transfers/multiapp_postprocessor_to_scalar/sub.i)The sub-applications do not have any "knowledge" of the master application, and simply perform calculations that utilize the scalar variable, regardless of how this scalar is computed. This approach allows the sub-application input file to run in union of independent from the master without modification, which is useful for development and testing.
Available Transfer Objects
The following is a complete list of the available Transfer objects, each links to a page with further details.
Available Objects
- Moose App
- MultiAppCopyTransferCopies variables (nonlinear and auxiliary) between multiapps that have identical meshes.
- MultiAppInterpolationTransferTransfers the value to the target domain from the nearest node in the source domain.
- MultiAppMeshFunctionTransferTransfers field data at the MultiApp position using solution the finite element function from the master application, via a 'libMesh::MeshFunction' object.
- MultiAppNearestNodeTransferTransfer the value to the target domain from the nearest node in the source domain.
- MultiAppPostprocessorInterpolationTransferTransfer postprocessor data from sub-application into field data on the master application.
- MultiAppPostprocessorToAuxScalarTransferTransfers from a postprocessor to an scalar auxiliary variable.
- MultiAppPostprocessorTransferTransfers postprocessor data between the master application and sub-application(s).
- MultiAppProjectionTransferPerform a projection between a master and sub-application mesh of a field variable.
- MultiAppScalarToAuxScalarTransferTransfers data between a scalar non-linear variable and a scalar auxiliary variable.
- MultiAppUserObjectTransferSamples a variable's value in the Master domain at the point where the MultiApp is and copies that value into a post-processor in the MultiApp
- MultiAppVariableValueSamplePostprocessorTransferTransfers the value of a variable within the master application at each sub-application position and transfers the value to a postprocessor on the sub-application(s).
- MultiAppVariableValueSampleTransferTransfers the value of a variable within the master application at each sub-application position and transfers the value to a field variable on the sub-application(s).
- MultiAppVectorPostprocessorTransferThis transfer distributes the N values of a VectorPostprocessor to Postprocessors located in N sub-apps or collects Postprocessor values from N sub-apps into a VectorPostprocessor
- Stochastic Tools App
- SamplerParameterTransferCopies Sampler data to a SamplerReceiver object.
- SamplerPostprocessorTransferTransfers data from Postprocessors on the sub-application to a VectorPostprocessor on the master application.
- SamplerTransferCopies Sampler data to a SamplerReceiver object.
- Functional Expansion Tools App
- MultiAppFXTransferTransfers coefficient arrays between objects that are derived from MutableCoefficientsInterface; currently includes the following types: FunctionSeries, FXBoundaryUserObject, and FXVolumeUserObject
- Level Set App
- LevelSetMeshRefinementTransferTransfers the mesh from the master application to the sub application for the purposes of level set reinitialization problems with mesh adaptivity.
Available Actions
- Moose App
- AddTransferActionAction for creating Transfer objects.