The ESMF COUPLED_FLOW application uses the ESMF framework, including gridded and coupler components, Superstructure and Infrastructure. The application injects a tracer from one gridded component into another, which then advects the flow. Communication is handled through a coupler component. Review of this demonstration should enable the user to understand the general structure of an ESMF application.
The application is comprised of two ESMF Gridded Components and a Coupler Component. The first Gridded Component, FlowSolver, solves the compressible time-dependent fluid flow equations. The algorithm applies an explicit finite difference technique to a staggered, Arakawa C igrid that is Cartesian and uniform. State variables, including density, pressure, viscosity and temperature, are located at cell-centers, while velocities are located at the north and east cell faces. This component is initialized with a steady-state, one-dimensional flow. The second Gridded Component, Injector, injects tracer fluid into the first component normal to the flow along one of the boundaries. The injected fluid can have arbitrary velocity, temperature, density and duration, effectively setting some of the boundary conditions for the first component. The FlowSolver and Injector Components sit on different Cartesian igrids. The Coupler Component redistributes boundary condition data from the Injector to the FlowSolver.
The demonstration program consists of a top level Application Driver, a top level Gridded Component, and nested within this Gridded Component are 3 subcomponents: a Coupler Component and 2 Gridded Components.
The following diagram shows this organization. Note that there is no direct communication between the subcomponents; all interactions are mediated by the top level Gridded Component.
Each component communicates via initialize, run, and finalize subroutine calls. These go through the ESMF library where they are checked for validity, default values are supplied, and only those components involved in the computation are invoked.