In addition to the ANSYS Fluent-specific data types presented in Data Types in ANSYS Fluent, there are special thread and domain data structures that are specific to multiphase UDFs. These data types are used to store properties and variables for the mixture of all of the phases, as well as for each individual phase when a multiphase model (Mixture, VOF, or Eulerian) is used.
In a multiphase application, the top-level domain is referred to as the superdomain. Each phase occupies a domain referred to as a subdomain. A third domain type, the interaction domain, is introduced to allow for the definition of phase interaction mechanisms. When mixture properties and variables are needed (a sum over phases), the superdomain is used for those quantities, while the subdomain carries the information for individual phases.
In single-phase, the concept of a mixture is used to represent the sum over all the species (components), while in multiphase it represents the sum over all the phases. This distinction is important, because ANSYS Fluent has the capability of handling multiphase multi-components, where, for example, a phase can consist of a mixture of species.
Because solver information is stored in thread data structures, threads must be associated with the superdomain as well as with each of the subdomains. That is, for each cell or face thread defined in the superdomain, there is a corresponding cell or face thread defined for each subdomain. Some of the information defined in one thread of the superdomain is shared with the corresponding threads of each of the subdomains. Threads associated with the superdomain are referred to as ‘superthreads’, while threads associated with the subdomain are referred to as phase-level threads, or ‘subthreads’. The domain and thread hierarchy are summarized in Figure 1.5: Domain and Thread Structure Hierarchy.
Figure 1.5: Domain and Thread Structure Hierarchy introduces the concept
of the domain_id and phase_domain_index. The domain_id can be used in UDFs to distinguish
the superdomain from the primary and secondary phase-level domains.
The superdomain (mixture domain) domain_id is always assigned the value of 1. Interaction
domains are also identified with the domain_id. The domain_id elements are not necessarily
ordered sequentially, as shown in Figure 1.5: Domain and Thread Structure Hierarchy.
The phase_domain_index can be used
in UDFs to distinguish between the primary and secondary phase-level
threads. phase_domain_index is always assigned
the value of 0 for the primary phase-level
thread.
The data structures that are passed to a UDF depend on the multiphase
model that is enabled, the property or term that is being modified,
the DEFINE macro that is used, and the domain
that is to be affected (mixture or phase). To better understand this,
consider the differences between the Mixture and Eulerian multiphase
models. In the Mixture model, a single momentum equation is solved
for a mixture whose properties are determined from the sum of its
phases. In the Eulerian model, a momentum equation is solved for each
phase. ANSYS Fluent enables you to directly specify a momentum source
for the mixture of phases (using DEFINE_SOURCE) when the mixture model is used, but not for the Eulerian model.
For the latter case, you can specify momentum sources for the individual
phases. Hence, the multiphase model, as well as the term being modified
by the UDF, determines which domain or thread is required.
UDFs that are hooked to the mixture of phases are passed superdomain
(or mixture-level) structures, while functions that are hooked to
a particular phase are passed subdomain (or phase-level) structures. DEFINE_ADJUST and DEFINE_INIT UDFs are hardwired to the mixture-level domain. Other types of UDFs
are hooked to different phase domains. For your convenience, Appendix B: DEFINE Macro Definitions contains a list of multiphase models
in ANSYS Fluent and the phase on which UDFs are specified for the given
variables. From this information, you can infer which domain structure
is passed from the solver to the UDF.