18th May 2022: CFD Direct are delighted to announce the release of the new Non-Conformal Coupling (NCC) in OpenFOAM. NCC connects regions of a domain with independent meshes and is used particularly for cases when one or more regions are moving, e.g. to simulate rotating geometry. It is a replacement for the Arbitrary Mesh Interface (AMI) and the related ACMI and Repeat AMI functionalities which are non-conservative and consequently unreliable for many problems.
For details on how to use NCC, see Using NCC in OpenFOAM.
The flaws in AMI
Both the NCC and A(C)MI methods connect boundary patches, whose faces and vertices do not match, at the interface between independent regions of mesh. The methods critically differ in the way the connection is made. AMI (and ACMI) are interpolation methods which calculate values of variables on one patch as a weighted sum of values on the coupled patch. Interpolated velocities generate fluxes of fluid volume and/or mass. The main drawback of the method is that the fluxes are not guaranteed to be conservative. For example, there can then be mismatches between the fluid volume/mass leaving one mesh region and entering the other.
These mismatches can be a significant source of solution error. Moreover, they prevent accurate solution of mass continuity, represented by a pressure equation, which causes poor convergence. For incompressible solution on closed domains, the pressure equation often diverges as the error simply travels around the domain, unable to find an outlet to escape. In compressible flows, the mass error causes a change in density and consequently pressure. For example, in simulation of a closed mixer vessel, the AMI generates an incorrect increase in pressure of ~40 kPa above the initialised pressure of 100 kPa, as shown in the graph below.
A conservative discretisation of advection yields bounded solutions with bounded schemes, e.g. upwind, only when mass conservation is satisfied. Failure to enforce conservation therefore causes instabilities associated with unboundedness. Inevitably, reports of instabilities with AMI have been common in cases where boundedness is critical, e.g. with phase fraction in multiphase flows.
The success of NCC
NCC first projects one of the patches onto its couple patch in a way that fills the space between them. It creates new faces at the intersections of overlapping faces on the coupled patches. These faces become part of the finite volume meshes on both sides. The mesh is closed, meaning that the area vectors sum to zero for all the faces of each cell. Since the coupled patches contain the same faces, conservation is assured by the normal discretisation practices of the finite volume method. In the mixer example (graph above), it correctly predicts a modest decrease in pressure, unlike AMI. Its conservation is demonstrated by a simulation of flow along a channel which includes a coupled interface. Using NCC, the conservation error between inlet and outlet is negligible. With AMI, it reaches ~0.1% and critically never returns to zero at convergence.
The failure of ACMI
ACMI is an extension of AMI for coupled patches which only partially overlap. Where faces overlap, they couple to one another. Faces which do not overlap the opposing patch adopt a suitable boundary condition, e.g. wall. For faces that partially overlap, ACMI determines the overlapping fraction from interpolation weights.
This approach is completely unreliable unless the coupled patches are entirely flat. With curved patches the weights used for interpolation do not sum to unity for each face. In AMI the weights are normalised to unity to prevent unphysical scaling of the interpolated variables. In ACMI, the normalisation cannot be evaluated so the interpolated variables contain an error proportional to their absolute value. An error of 1% in ACMI, for a case with an ambient pressure is ~100 kPa, can induce an error of 1 kPa — which could be of the scale of the pressure variation in the domain.
NCC for partially overlapping patches
Since NCC creates new faces by cutting intersecting faces, each face belongs unambiguously to either the overlapping region or to a separate boundary patch. This allows NCC to extend naturally to coupled patches which partially overlap. The animation below shows an example of a three-way ball valve. It begins with the inlet pipe connected to the outlet pipe to the right. As the valve turns, the opening inside the ball is slowly disconnected from the right-hand pipe before engaging with the pipe on the left. NCC connects the patches formed at the openings in the ball with patches at the ends of the three pipes. The solution is conservative with the sum of outlet flow rates matching the inlet precisely.
NCC can also simulate cases with a geometry that is periodically repeating, by creating multiple couples between patches that include transformations. It replaces the existing Repeat AMI functionality in OpenFOAM.
Introduction of NCC
NCC was introduced to OpenFOAM-dev
on 18th May 2022. It supersedes the ACMI and Repeat AMI functionalities which have been removed, due to their unreliability. It also supersedes the general AMI functionality which is however retained for the OpenFOAM-10
release in July 2022 which will contain both NCC and general AMI. AMI will then be removed from OpenFOAM-dev
, so that it is deprecated in the subsequent version release of OpenFOAM.
Developers and funding
NCC was created and developed by Will Bainbridge, with support from Henry Weller. It was funded by supporters of OpenFOAM which fund its maintenance, in particular the companies in the Process Engineering Consortium. It received no public funding.