> ## Documentation Index
> Fetch the complete documentation index at: https://bindi-nagda-amr-multiphase.mintlify.site/llms.txt
> Use this file to discover all available pages before exploring further.

# AMR Multiphase Fluid Solver

> A C++ library for simulating two-phase viscoelastic mixture flows on adaptively refined grids with second-order accuracy.

AMR Multiphase is a high-performance C++ solver for incompressible two-phase fluid flows. It uses Adaptive Mesh Refinement (AMR) to efficiently resolve sharp gradients in the solution — automatically refining grids where needed and coarsening them elsewhere. The solver supports both Newtonian and non-Newtonian (viscoelastic Oldroyd-B) fluid models, and is second-order accurate in $L^1$, $L^2$, and $L^\infty$ norms.

> [card] [Build & Install](https://bindi-nagda-amr-multiphase.mintlify.site/building.md)
>
> Install dependencies and compile the library with CMake

> [card] [Quickstart](https://bindi-nagda-amr-multiphase.mintlify.site/quickstart.md)
>
> Run your first multiphase simulation in minutes

> [card] [Concepts](https://bindi-nagda-amr-multiphase.mintlify.site/concepts/multiphase-model.md)
>
> Understand the physical model and numerical methods

> [card] [API Reference](https://bindi-nagda-amr-multiphase.mintlify.site/api/multiphase-staggered-hierarchy-integrator.md)
>
> Explore the full C++ API surface

## What this library solves

AMR Multiphase implements a staggered-grid (MAC) discretization of the incompressible two-fluid mixture equations. Each fluid phase — a **network** phase and a **solvent** phase — carries its own velocity field and volume fraction. The two phases interact through a drag coupling term.

> [card] [Multiphase model](https://bindi-nagda-amr-multiphase.mintlify.site/concepts/multiphase-model.md)
>
> The two-fluid mixture equations and physical parameters

> [card] [Adaptive Mesh Refinement](https://bindi-nagda-amr-multiphase.mintlify.site/concepts/amr.md)
>
> How AMR reduces cost by focusing resolution where it matters

> [card] [Numerical methods](https://bindi-nagda-amr-multiphase.mintlify.site/concepts/numerical-methods.md)
>
> Staggered-grid discretization, time stepping, and the multigrid preconditioner

> [card] [Viscoelastic fluids](https://bindi-nagda-amr-multiphase.mintlify.site/concepts/viscoelastic-fluids.md)
>
> The Oldroyd-B conformation tensor model for non-Newtonian flows

## Getting started

**1. Build IBAMR and dependencies**

Install [IBAMR](https://ibamr.github.io/building) and its dependencies. You can use [autoibamr](https://github.com/ibamr/autoibamr) for an automated build.

**2. Compile the library**

Configure with CMake pointing to your IBAMR installation, then build the `MultiphaseLib` target and any example executables.

**3. Configure your simulation**

Create an input file specifying grid geometry, fluid parameters, time stepping settings, and solver configuration.

**4. Run and visualize**

Execute the compiled binary with your input file. Visualize results with [VisIt](https://visit-dav.github.io/visit-website/).

## Key features

* **Second-order accuracy** — verified in $L^1$, $L^2$, and $L^\infty$ norms for all solution variables
* **Adaptive Mesh Refinement** — gradient-based tagging automatically refines near sharp interfaces
* **Multigrid preconditioner** — efficient FAC preconditioner solves the coupled saddle-point system
* **Viscoelastic support** — Oldroyd-B conformation tensor model via the `CFMultiphaseOldroydB` strategy
* **Multiple limiters** — UPWIND, CUI, FBICS, and MGAMMA convective operator limiters
* **Parallel-ready** — built on IBAMR/SAMRAI/PETSc for MPI-parallel computation

> [!NOTE]
>
> For full mathematical details and simulation results, see the companion paper: [Adaptive Mesh Refinement for Two-Phase Viscoelastic Fluid Mixture Models](https://arxiv.org/abs/2409.19974).


This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.