---
title: "FluidFlowPDEComponent"
language: "en"
type: "Symbol"
summary: "FluidFlowPDEComponent[vars, pars] yields a flow PDE term with variables vars and parameters pars."
keywords: 
- Navier-Stokes
- Stokes
- Laminar flow
- flow
- Newtonian flow
- non-Newtonian flow
- non Newtonian flow
- fluid
- liquid
- Reynolds
- Reynolds Number
- material model
- fluid material model
- viscosity
- dynamic viscosity
- apparent viscosity
- efficient viscosity
- power law
- Carreau
- Carreou
- Carreau-Yasuda
- Yasuda
- Bingham
- Papanastasiou
- Herschel
- Bulkley
- Cross
canonical_url: "https://reference.wolfram.com/language/ref/FluidFlowPDEComponent.html"
source: "Wolfram Language Documentation"
related_guides: 
  - 
    title: "Fluid Dynamics PDEs and Boundary Conditions"
    link: "https://reference.wolfram.com/language/guide/FluidDynamicsPDEModels.en.md"
  - 
    title: "Partial Differential Equation Terms"
    link: "https://reference.wolfram.com/language/guide/PDEModeling.en.md"
related_functions: 
  - 
    title: "DirichletCondition"
    link: "https://reference.wolfram.com/language/ref/DirichletCondition.en.md"
  - 
    title: "NeumannValue"
    link: "https://reference.wolfram.com/language/ref/NeumannValue.en.md"
  - 
    title: "HeatTransferPDEComponent"
    link: "https://reference.wolfram.com/language/ref/HeatTransferPDEComponent.en.md"
  - 
    title: "MassTransportPDEComponent"
    link: "https://reference.wolfram.com/language/ref/MassTransportPDEComponent.en.md"
  - 
    title: "SolidMechanicsPDEComponent"
    link: "https://reference.wolfram.com/language/ref/SolidMechanicsPDEComponent.en.md"
related_tutorials: 
  - 
    title: "Laminar Flow"
    link: "https://reference.wolfram.com/language/PDEModels/tutorial/FluidDynamics/LaminarFlow.en.md"
  - 
    title: "Fluid Dynamics PDE Verification"
    link: "https://reference.wolfram.com/language/PDEModels/tutorial/FluidDynamics/FluidDynamicsVerificationTests.en.md"
---
[EXPERIMENTAL]

# FluidFlowPDEComponent

FluidFlowPDEComponent[vars, pars] yields a flow PDE term with variables vars and parameters pars.

## Details

* ``FluidFlowPDEComponent`` models flow of viscous fluids subject to applied forces and constraints.

* ``FluidFlowPDEComponent`` returns a sum of differential operators to be used as a part of partial differential equations:

[image]

* ``FluidFlowPDEComponent`` models fluid flow phenomena with velocities $u$, $v$ and $w$ in units of [$m/s$] as dependent variables, $\text{\textit{$x$}}_{\text{\textit{$i$}}} \in \mathbb{R}^n$ as independent variables in units of [$m$] and time variable $t$ in units of [$s$].

[image]

* ``FluidFlowPDEComponent`` creates PDE components for stationary, time-dependent, parametric analysis.

* ``FluidFlowPDEComponent`` creates PDE components in two and three space dimensions.

* Stationary variables ``vars`` are ``vars = {{u[x1, …, xn], v[x1, …, xn], …, p[x1, …, xn]}, {x1, …, xn}}``.

* Time-dependent or eigenmode variables ``vars`` are ``vars = {{u[t, x1, …, xn], v[t, x1, …, xn], …, p[x1, …, xn]}, t, {x1, …, xn}}``.

* The equations for different analysis types that ``FluidFlowPDEComponent`` generates depend on the form of ``vars``.

* ``FluidFlowPDEComponent`` creates a system of equations with the vector-valued Navier–Stokes equation combined with the continuity equation.

* The time-dependent equilibrium equation of the fluid dynamics PDE ``FluidFlowPDEComponent`` with mass density $\rho$ [$\text{kg}\left/m^3\right.$], fluid velocity $\pmb{v}$ [$m/s$], time $t$ [$s$], viscous stress tensor $\tau$ [$\text{Pa}$], pressure $p$ [$\text{Pa}$], identity matrix $\pmb{I}$ and body load vectors $\pmb{F}$ [$N\left/m^3\right.$] is based on the Navier–Stokes equation and the continuity equation:

[image]

* In compressible form, the viscous stress tensor $\tau$ is given as:

[image]

* Here $\mu$ [$s\, \text{Pa}$] is the dynamic viscosity, and infinitesimal, small deformation strain rate measure $\dot{\epsilon }$ [1/$s$] is given as:

[image]

* ``FluidFlowPDEComponent`` creates a PDE model for compressible or incompressible fluid flow, depending on the nature of the values of the mass density $\rho$.

* The compressible fluid dynamics model is given as:

[image]

* For constant values of the mass density $\rho$, the mass continuity equation simplifies to a volumetric continuity equation $\nabla \cdot \pmb{v}\pmb{ }=0$, and with that, the viscous stress tensor simplifies to $\tau =2\mu \pmb{\dot{\pmb{\epsilon }}}$.

* The incompressible fluid dynamics model is given as:

[image]

* The stationary equilibrium equations have $\partial \pmb{v}\pmb{/}\partial t=0$.

* The units of the Navier–Stokes model terms are a force density in [$N\left/m^3\right.$].

* The units of the mass continuity equation model terms are a force density in [$\left.\text{kg}\text{/(}m^3s\right)$], and for the volumetric continuity [1/$s$].

* Laminar flow is typical for $\mathcal{R}\mathit{e}\lesssim 2000$, where $\mathcal{R}\mathit{e}$ is the Reynolds number.

* The Reynolds number $\mathcal{R}\mathit{e}$ is defined as $\mathcal{R}\mathit{e}=\rho uL/\mu$, where $L$ [$m$] is a characteristic length and $u\text{ }$ the flow velocity.

* The following parameters ``pars`` can be given:

|     |     |     |
| --- | --- | --- |
| *parameter* | *default* | *symbol* |
| "DynamicViscosity" |  -  | $\mu$, dynamic viscosity [$s\, \text{Pa}$] |
| "FluidLoad" | 0   | $\pmb{F}$, body force density [$N\left/m^3\right.$] |
| "FluidDynamicsMaterialModel" | "Newtonian" | none |
| "MassDensity" |  -  | $\rho$, density in [$\text{kg}\left/m^3\right.$]  |
| "Material" |  -  | none |
| "ModelForm" | "Conservative" | none |
| "RegionSymmetry" | None |  -  |
| "ReynoldsNumber" |  -  | $\mathcal{R}\mathit{e}$ |

* If a ``"Material"`` is specified, the material constants are extracted from the material data; otherwise, relevant material parameters need to be specified.

* Instead of material parameters, a Reynolds number $\mathcal{R}\mathit{e}$ can be specified:

[image]

* ``"RegionSymmetry" -> "Axisymmetric"`` uses a truncated cylindrical coordinate system and assumes $v=0$ in the $\theta$ direction and pressure $p$ and velocity components $u$ and $w$ independent of $\theta$.

* The axis of symmetry is the $z$ axis.

* The default material model is a Newtonian flow model.

* Alternate material models can be specified by setting the ``"FluidDynamicsMaterialModel"`` key in parameters ``pars``.

* The following [non-Newtonian material models](https://reference.wolfram.com/language/PDEModels/tutorial/FluidDynamics/LaminarFlow.en.md#1789304502) are available:

|     |
| --- |
| *material model name* |
| "[PowerLaw](https://reference.wolfram.com/language/PDEModels/tutorial/FluidDynamics/LaminarFlow.en.md#1686395575)" |
| "[Carreau](https://reference.wolfram.com/language/PDEModels/tutorial/FluidDynamics/LaminarFlow.en.md#1432993996)" |
| "[Bingham - Papanastasiou](https://reference.wolfram.com/language/PDEModels/tutorial/FluidDynamics/LaminarFlow.en.md#787419883)" |
| "[Herschel - Bulkley - Papanastasiou](https://reference.wolfram.com/language/PDEModels/tutorial/FluidDynamics/LaminarFlow.en.md#270042841)" |

* For compressible non-Newtonian fluids, the viscous stress tensor $\tau$ is defined as:

[image]

* The apparent viscosity $\mu _{\text{app}}$ is a function of the shear rate $\dot{\gamma }$.

* Additional material model-specific parameters for a model with ``"ModelName"`` can be specified through ``"FluidDynamicsMaterialModel" -> <|"ModelName" -> <|...|>|>``.

* The ``"[PowerLaw](https://reference.wolfram.com/language/PDEModels/tutorial/FluidDynamics/LaminarFlow.en.md#1686395575)"`` model, a general-purpose model, implements $\mu _{\text{app}}=m\left(\frac{\max \left(\dot{\gamma },\dot{\gamma }_{\min }\right)}{\dot{\gamma }_{\text{ref}}}\right){}^{n-1}$.

* The following parameters can be given for the ``"PowerLaw"`` model:

|                      |                                         |                                                                                  |
| -------------------- | --------------------------------------- | -------------------------------------------------------------------------------- |
| *parameter*          | *default*                               | *symbol*                                                                         |
| "PowerLawExponent"   | $1$       | $n$, exponent                                      |
| "MinimalShearRate"   | $10^{-2}$ | $\dot{\gamma }_{\min }$, minimal shear rate        |
| "ReferenceShearRate" | $1$       | $\dot{\gamma }_{\text{ref}}$, reference shear rate |
| "PowerLawViscosity"  | $\mu$     | $m$, power law viscosity                           |

* The generalized ``"[Carreau](https://reference.wolfram.com/language/PDEModels/tutorial/FluidDynamics/LaminarFlow.en.md#1432993996)"`` model, useful for polymer or blood flow, implements $\mu _{\text{app}}=\mu _{\infty }+\left(\mu _0-\mu _{\infty }\right)\left(1+\left(\lambda \dot{\gamma }\right)^a\right)^{\frac{n-1}{a}}$.

* The following parameters can be given for the ``"Carreau"`` model:

|                              |                                   |                                                                                              |
| ---------------------------- | --------------------------------- | -------------------------------------------------------------------------------------------- |
| *parameter*                  | *default*                         | *symbol*                                                                                     |
| "PowerLawExponent"           | $-$ | $n$, exponent                                                  |
| "TransitionExponent"         | 2                                 | $a$, exponent                                                  |
| "InfiniteShearRateViscosity" | $-$ | $\mu _{\infty }$, viscosity at inifinite shear rate            |
| "Lambda"                     | $-$ | $\lambda$, relaxation time [$s$] |
| "ZeroShearRateViscosity"     | $-$ | $\mu _0$, viscosity at zero shear rate                         |

* The ``"[Carreau](https://reference.wolfram.com/language/PDEModels/tutorial/FluidDynamics/LaminarFlow.en.md#1432993996)"`` model can also be used for a Cross model where $\mu _{\text{app}}=\mu _{\infty }+\left(\mu _0-\mu _{\infty }\right)/\left(1+\lambda \dot{\gamma }\right)^p$ with $n=-p+1$.

* The ``"[Bingham - Papanastasiou](https://reference.wolfram.com/language/PDEModels/tutorial/FluidDynamics/LaminarFlow.en.md#787419883)"`` model, useful for viscoplastic material, implements $\mu _{\text{app}}=\mu _p+\frac{\tau }{\dot{\gamma }}\left(1+e^{-m\dot{\gamma }}\right)$.

* The following parameters can be given for the ``"[Bingham - Papanastasiou](https://reference.wolfram.com/language/PDEModels/tutorial/FluidDynamics/LaminarFlow.en.md#787419883)"`` model:

|                    |                                   |                                                           |
| ------------------ | --------------------------------- | --------------------------------------------------------- |
| *parameter*        | *default*                         | *symbol*                                                  |
| "PlasticViscosity" | $-$ | $\mu _p$, plastic viscosity |
| "YieldStress"      | $-$ | $\tau$, yield stress        |
| "ShearRateFactor"  | $-$ | $m$, shear rate factor      |

* The ``"[Herschel - Bulkley - Papanastasiou](https://reference.wolfram.com/language/PDEModels/tutorial/FluidDynamics/LaminarFlow.en.md#270042841)"`` model, a mixture of a ``"[PowerLaw](https://reference.wolfram.com/language/PDEModels/tutorial/FluidDynamics/LaminarFlow.en.md#1686395575)"`` and ``"[Bingham - Papanastasiou](https://reference.wolfram.com/language/PDEModels/tutorial/FluidDynamics/LaminarFlow.en.md#787419883)"`` model, implements $\mu _{\text{app}}=
\begin{array}{ccc}
 \mu _{\text{power} \text{law}}+\frac{\tau }{\dot{\gamma }}\left(1+e^{-m\dot{\gamma }}\right) & = & m\left(\frac{\dot{\gamma }}{\dot{\gamma }_{\text{ref}}}\right){}^{n-1}+\frac{\tau
}{\dot{\gamma }}\left(1+e^{-m\dot{\gamma }}\right) \\
\end{array}$. The model uses a power law to compute the plastic viscosity $\mu _p$ of the Bingham–Papanastasiou model, and parameters for both models can be set.

* A custom apparent viscosity function ``fun`` can be specified as ``"FluidDynamicsMaterialModel" -> <|"Custom" -> <|"ApparentViscosityFunction" -> fun|>|>``.

* A custom apparent viscosity function ``fun`` has a function signature ``fun[name_, vars_, pars_, data__]``.

* Custom viscous stress tensor functions ``fun`` can be specified as ``"FluidDynamicsMaterialModel" -> fun``.

* A custom viscous stress tensor function ``fun`` has a function signature ``fun[vars_, pars_, data__]``.

* Non-isothermal flow can be modeled through the Boussinesq approximation.

* ``FluidFlowPDEComponent`` uses ``"SIBase"`` units. The geometry has to be in the same units as the PDE.

* If the ``FluidFlowPDEComponent`` depends on parameters $\text{\textit{$p_i$}}$ that are specified in the association ``pars`` as ``<|…, key -> pi…, pi -> vi, …|>``, the parameters $\text{\textit{$p_i$}}$ are replaced with $\text{\textit{$v_i$}}$.

## Examples (19)

### Basic Examples (4)

Define a flow PDE model:

```wl
In[1]:= FluidFlowPDEComponent[{{u[x, y], v[x, y], p[x, y]}, {x, y}}, Entity["Chemical", "Glycerol"]]//MatrixForm

Out[1]//MatrixForm=
(⁠|     |
| -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| {1250. u[x, y], 1250. v[x, y]}. ... . u[x, y], 1250. v[x, y]}.Inactive[Grad][v[x, y], {x, y}] + Inactive[Div][{0, p[x, y]}, {x, y ... vative[0, 1][u][x, y] + Derivative[1, 0][v][x, y]),    -1.868*Derivative[0, 1][v][x, y]}, {x, y}] |
| 1250. v^(0, 1)[x, y] + 1250. u^(1, 0)[x, y] |⁠)
```

---

Define a symbolic flow PDE:

```wl
In[1]:= FluidFlowPDEComponent[{{u[x, y], v[x, y], p[x, y]}, {x, y}}, <|"DynamicViscosity" -> μ, "MassDensity" -> ρ|>]//MatrixForm

Out[1]//MatrixForm=
(⁠|     |
| -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| {ρ u[x, y], ρ v[x, y]}.Inactive ... 
| {ρ u[x, y], ρ v[x, y]}.Inactive[Grad][v[x, y], {x, y}] + Inactive[Div][{0, p[x, y]}, {x, y}] + Ina ... rivative[0, 1][u][x, y] + Derivative[1, 0][v][x, y]),    -2*μ*Derivative[0, 1][v][x, y]}, {x, y}] |
| ρ v^(0, 1)[x, y] + ρ u^(1, 0)[x, y] |⁠)
```

---

Define a stationary flow PDE model with a Reynolds number of 100:

```wl
In[1]:= FluidFlowPDEComponent[{{u[x, y], v[x, y], p[x, y]}, {x, y}}, <|"ReynoldsNumber" -> 100|>]//MatrixForm

Out[1]//MatrixForm=
(⁠|     |
| -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| {u[x, y], v[x, y]}.Inactive[Gra ... }] |
| {u[x, y], v[x, y]}.Inactive[Grad][v[x, y], {x, y}] + Inactive[Div][{0, p[x, y]}, {x, y}] + Inactiv ... ive[0, 1][u][x, y] - Derivative[1, 0][v][x, y]),    (-(1/50))*Derivative[0, 1][v][x, y]}, {x, y}] |
| v^(0, 1)[x, y] + u^(1, 0)[x, y] |⁠)
```

---

Solve for the flow velocity and pressure in a driven cavity with a Reynolds number of 1000:

```wl
In[1]:= {uVel, vVel, pressure} = NDSolveValue[{FluidFlowPDEComponent[{{u[x, y], v[x, y], p[x, y]}, {x, y}}, <|"ReynoldsNumber" -> 1000|>] == {0, 0, 0}, DirichletCondition[{u[x, y] == 1, v[x, y] == 0}, y == 1], DirichletCondition[{u[x, y] == 0, v[x, y] == 0}, y < 1], DirichletCondition[p[x, y] == 0, x == 0 && y == 0]}, {u[x, y], v[x, y], p[x, y]}, {x, y}∈Rectangle[{0, 0}, {1, 1}], Method -> {"FiniteElement", "InterpolationOrder" -> {u -> 2, v -> 2, p -> 1}}];
```

Visualize the velocity of the fluid:

```wl
In[2]:= StreamPlot[{uVel, vVel}, {x, y}∈Rectangle[{0, 0}, {1, 1}]]

Out[2]= [image]
```

### Scope (10)

#### 2D (4)

Define a flow PDE model for a specific material:

```wl
In[1]:= FluidFlowPDEComponent[{{u[x, y], v[x, y], p[x, y]}, {x, y}}, <|"Material" -> Entity["Chemical", "Glycerol"]|>]//MatrixForm

Out[1]//MatrixForm=
(⁠|     |
| -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| {1250. u[x, y], 1250. v[x, y]}. ... . u[x, y], 1250. v[x, y]}.Inactive[Grad][v[x, y], {x, y}] + Inactive[Div][{0, p[x, y]}, {x, y ... vative[0, 1][u][x, y] + Derivative[1, 0][v][x, y]),    -1.868*Derivative[0, 1][v][x, y]}, {x, y}] |
| 1250. v^(0, 1)[x, y] + 1250. u^(1, 0)[x, y] |⁠)
```

---

Specify a flow PDE with a dynamic viscosity of $0.934$ and a mass density of $1.25$ :

```wl
In[1]:= FluidFlowPDEComponent[{{u[x, y], v[x, y], p[x, y]}, {x, y}}, <|"DynamicViscosity" -> Quantity[0.934, "Pascals"*"Seconds"], "MassDensity" -> Quantity[1.25, "Grams"/"Centimeters"^3]|>]//MatrixForm

Out[1]//MatrixForm=
(⁠|     |
| -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| {1250. u[x, y], 1250. v[x, y]}. ... . u[x, y], 1250. v[x, y]}.Inactive[Grad][v[x, y], {x, y}] + Inactive[Div][{0, p[x, y]}, {x, y ... vative[0, 1][u][x, y] + Derivative[1, 0][v][x, y]),    -1.868*Derivative[0, 1][v][x, y]}, {x, y}] |
| 1250. v^(0, 1)[x, y] + 1250. u^(1, 0)[x, y] |⁠)
```

---

``Activate`` a flow PDE model for a specific material:

```wl
In[1]:= Activate[FluidFlowPDEComponent[{{u[x, y], v[x, y], p[x, y]}, {x, y}}, <|"Material" -> Entity["Chemical", "Glycerol"]|>]]

Out[1]= {1250. v[x, y] u^(0, 1)[x, y] + p^(1, 0)[x, y] + 1250. u[x, y] u^(1, 0)[x, y] - 0.934 (u^(0, 2)[x, y] + v^(1, 1)[x, y]) - 1.868 u^(2, 0)[x, y], p^(0, 1)[x, y] + 1250. v[x, y] v^(0, 1)[x, y] - 1.868 v^(0, 2)[x, y] + 1250. u[x, y] v^(1, 0)[x, y] - 0.934 (u^(1, 1)[x, y] + v^(2, 0)[x, y]), 1250. v^(0, 1)[x, y] + 1250. u^(1, 0)[x, y]}
```

---

Specify a symbolic stationary fluid dynamics PDE in two dimensions with a dynamic viscosity of $\mu$ and a mass density of $\rho$ :

```wl
In[1]:= FluidFlowPDEComponent[{{u[x, y], v[x, y], p[x, y]}, {x, y}}, <|"DynamicViscosity" -> μ, "MassDensity" -> ρ|>]

Out[1]=
{{ρ u[x, y], ρ v[x, y]}.Inactive[Grad][u[x, y], {x, y}] + Inactive[Div][{p[x, y], 0}, {x, y}] + Inactive[Div][{-2*μ*Derivative[1, 0][u][x, y], 
  (-μ)*(Derivative[0, 1][u][x, y] + Derivative[1, 0][v][x, y])}, {x, y}], {ρ u[x, y], ρ v[x, y]}.Inactive[Grad][v[x, y], {x, y}] + Inactive[Div][{0, p[x, y]}, {x, y}] + Inactive[Div][{(-μ)*(Derivative[0, 1][u][x, y] + Derivative[1, 0][v][x, y]), 
  -2*μ*Derivative[0, 1][v][x, y]}, {x, y}], ρ v^(0, 1)[x, y] + ρ u^(1, 0)[x, y]}
```

#### 2D Axisymmetric (1)

Specify a symbolic stationary axisymmetric fluid dynamics PDE with a dynamic viscosity of $\mu$ and a mass density of $\rho$ :

```wl
In[1]:= FluidFlowPDEComponent[{{u[r, z], 0, w[r, z], p[r, z]}, {r, θ, z}}, <|"DynamicViscosity" -> μ, "MassDensity" -> ρ, "RegionSymmetry" -> "Axisymmetric"|>]

Out[1]= {{ρ u[r, z], ρ w[r, z]}.Inactive[Grad][u[r, z], {r, z}] + p^(1, 0)[r, z] + ((2 μ u[r, z]/r) - 2 μ u^(1, 0)[r, z]/r) - μ (u^(0, 2)[r, z] + w^(1, 1)[r, z]) - 2 μ u^(2, 0)[r, z], {ρ u[r, z], ρ w[r, z]}.Inactive[Grad][w[r, z], {r, z}] + p^(0, 1)[r, z] - 2 μ w^(0, 2)[r, z] - (μ (u^(0, 1)[r, z] + w^(1, 0)[r, z])/r) - μ (u^(1, 1)[r, z] + w^(2, 0)[r, z]), (ρ u[r, z]/r) + ρ w^(0, 1)[r, z] + ρ u^(1, 0)[r, z]}
```

#### 3D (1)

Specify a symbolic stationary fluid dynamics PDE in three dimensions with a dynamic viscosity of $\mu$ and a mass density of $\rho$ :

```wl
In[1]:= FluidFlowPDEComponent[{{u[x, y, z], v[x, y, z], w[x, y, z], p[x, y, z]}, {x, y, z}}, <|"DynamicViscosity" -> μ, "MassDensity" -> ρ|>]

Out[1]=
{{ρ u[x, y, z], ρ v[x, y, z], ρ w[x, y, z]}.Inactive[Grad][u[x, y, z], {x, y, z}] + Inactive[Div][{p[x, y, z], 0, 0}, {x, y, z}] + Inactive[Div][{-2*μ*Derivative[1, 0, 0][u][x, y, z], 
  (-μ)*(Derivative[0, 1, 0][u][x, y, z] + Derivative[1, 0, 0][v ...  y, z] + Derivative[1, 0, 0][w][x, y, z]), 
  (-μ)*(Derivative[0, 0, 1][v][x, y, z] + Derivative[0, 1, 0][w][x, y, z]), 
  -2*μ*Derivative[0, 0, 1][w][x, y, z]}, {x, y, z}], ρ w^(0, 0, 1)[x, y, z] + ρ v^(0, 1, 0)[x, y, z] + ρ u^(1, 0, 0)[x, y, z]}
```

---

#### Time Dependent (3)

Define a time-dependent flow PDE model:

```wl
In[1]:= FluidFlowPDEComponent[{{u[t, x, y], v[t, x, y], p[t, x, y]}, t, {x, y}}, Entity["Chemical", "Glycerol"]]//MatrixForm

Out[1]//MatrixForm=
(⁠|     |
| -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| {1250. u[t, x, y], 1250. v[t, x ... , 1250. v[t, x, y]}.Inactive[Grad][v[t, x, y], {x, y}] + Inactive[Div][-1.868*{{0 ... [t, x, y], {x, y}], {x, y}] + Inactive[Div][{0, p[t, x, y]}, {x, y}] + 1250. v^(1, 0, 0)[t, x, y] |
| 1250. v^(0, 0, 1)[t, x, y] + 1250. u^(0, 1, 0)[t, x, y] |⁠)
```

---

Specify a symbolic time-dependent fluid dynamics PDE in two dimensions with a dynamic viscosity of $\mu$ and a mass density of $\rho$ :

```wl
In[1]:= FluidFlowPDEComponent[{{u[t, x, y], v[t, x, y], p[t, x, y]}, t, {x, y}}, <|"DynamicViscosity" -> μ, "MassDensity" -> ρ|>]

Out[1]= {{ρ u[t, x, y], ρ v[t, x, y]}.Inactive[Grad][u[t, x, y], {x, y}] + Inactive[Div][-2*μ*{{0, 1/4}, {1/4, 0}} . Inactive[Grad][v[t, x, y], {x, y}], {x, y}] + Inactive[Div][-2*μ*{{1, 0}, {0, 1/2}} . Inactive[Grad][u[t, x, y], {x, y}], {x, y}] + Inactiv ... . Inactive[Grad][u[t, x, y], {x, y}], {x, y}] + Inactive[Div][-2*μ*{{1/2, 0}, {0, 1}} . Inactive[Grad][v[t, x, y], {x, y}], {x, y}] + Inactive[Div][{0, p[t, x, y]}, {x, y}] + ρ v^(1, 0, 0)[t, x, y], ρ v^(0, 0, 1)[t, x, y] + ρ u^(0, 1, 0)[t, x, y]}
```

---

Specify a symbolic time-dependent axisymmetric fluid dynamics PDE with a dynamic viscosity of $\mu$ and a mass density of $\rho$ :

```wl
In[1]:= FluidFlowPDEComponent[{{u[t, r, z], 0, w[t, r, z], p[t, r, z]}, t, {r, θ, z}}, <|"DynamicViscosity" -> μ, "MassDensity" -> ρ, "RegionSymmetry" -> "Axisymmetric"|>]

Out[1]= {{ρ u[t, r, z], ρ w[t, r, z]}.Inactive[Grad][u[t, r, z], {r, z}] + p^(0, 1, 0)[t, r, z] + ((2 μ u[t, r, z]/r) - 2 μ u^(0, 1, 0)[t, r, z]/r) - μ (u^(0, 0, 2)[t, r, z] + w^(0, 1, 1)[t, r, z]) - 2 μ u^(0, 2, 0)[t, r, z] + ρ u^(1, 0, 0)[t, r, z], {ρ u[ ... + p^(0, 0, 1)[t, r, z] - 2 μ w^(0, 0, 2)[t, r, z] - (μ (u^(0, 0, 1)[t, r, z] + w^(0, 1, 0)[t, r, z])/r) - μ (u^(0, 1, 1)[t, r, z] + w^(0, 2, 0)[t, r, z]) + ρ w^(1, 0, 0)[t, r, z], (ρ u[t, r, z]/r) + ρ w^(0, 0, 1)[t, r, z] + ρ u^(0, 1, 0)[t, r, z]}
```

#### Compressible Flow (1)

A compressible fluid dynamics PDE is generated if the mass density $\rho$ is a function of space or time $\rho (x,y)$ :

```wl
In[1]:= FluidFlowPDEComponent[{{u[x, y], v[x, y], p[x, y]}, {x, y}}, <|"DynamicViscosity" -> μ, "MassDensity" -> ρ[x, y]|>]

Out[1]=
{{u[x, y] ρ[x, y], v[x, y] ρ[x, y]}.Inactive[Grad][u[x, y], {x, y}] + Inactive[Div][{p[x, y], 0}, {x, y}] + Inactive[Div][{-2*μ*Derivative[1, 0][u][x, y] + 
   (2/3)*μ*(Derivative[0, 1][v][x, y] + Derivative[1, 0][u][x, y]), 
  (-μ)*(Derivative[0,  ... ] + Derivative[1, 0][v][x, y]), 
  -2*μ*Derivative[0, 1][v][x, y] + (2/3)*μ*(Derivative[0, 1][v][x, y] + 
     Derivative[1, 0][u][x, y])}, {x, y}], ρ[x, y] v^(0, 1)[x, y] + v[x, y] ρ^(0, 1)[x, y] + ρ[x, y] u^(1, 0)[x, y] + u[x, y] ρ^(1, 0)[x, y]}
```

An incompressible fluid dynamics PDE is generated if the mass density $\rho$ is a constant:

```wl
In[2]:= FluidFlowPDEComponent[{{u[x, y], v[x, y], p[x, y]}, {x, y}}, <|"DynamicViscosity" -> μ, "MassDensity" -> ρ|>]

Out[2]=
{{ρ u[x, y], ρ v[x, y]}.Inactive[Grad][u[x, y], {x, y}] + Inactive[Div][{p[x, y], 0}, {x, y}] + Inactive[Div][{-2*μ*Derivative[1, 0][u][x, y], 
  (-μ)*(Derivative[0, 1][u][x, y] + Derivative[1, 0][v][x, y])}, {x, y}], {ρ u[x, y], ρ v[x, y]}.Inactive[Grad][v[x, y], {x, y}] + Inactive[Div][{0, p[x, y]}, {x, y}] + Inactive[Div][{(-μ)*(Derivative[0, 1][u][x, y] + Derivative[1, 0][v][x, y]), 
  -2*μ*Derivative[0, 1][v][x, y]}, {x, y}], ρ v^(0, 1)[x, y] + ρ u^(1, 0)[x, y]}
```

---

### Applications (5)

#### Stationary Analysis (1)

Solve for the velocity and pressure in a cavity, where the flow is driven at the top of a box:

```wl
In[1]:= {uVel, vVel, pressure} = NDSolveValue[{FluidFlowPDEComponent[{{u[x, y], v[x, y], p[x, y]}, {x, y}}, <|"ReynoldsNumber" -> 1000|>] == {0, 0, 0}, DirichletCondition[{u[x, y] == 1, v[x, y] == 0}, y == 1], DirichletCondition[{u[x, y] == 0, v[x, y] == 0}, y < 1], DirichletCondition[p[x, y] == 0, x == 0 && y == 0]}, {u[x, y], v[x, y], p[x, y]}, {x, y}∈Rectangle[{0, 0}, {1, 1}], Method -> {"FiniteElement", "InterpolationOrder" -> {u -> 2, v -> 2, p -> 1}}];
```

Visualize the velocity of the fluid:

```wl
In[2]:= StreamPlot[{uVel, vVel}, {x, y}∈Rectangle[{0, 0}, {1, 1}]]

Out[2]= [image]
```

#### Non-Newtonian Flow (1)

Compute the fluid flow of a non-Newtonian fluid in an opening channel by using the power law fluid flow model.

Set up the region:

```wl
In[1]:= Ω = RegionUnion[Rectangle[{0, -1 / 2}, {5, 1 / 2}], Rectangle[{5, -3 / 2}, {30, 3 / 2}]];
```

Set up variables, flow parameters and the non-Newtonian power law for parameters for the exponent and power law viscosity:

```wl
In[2]:=
vars = {{u[x, y], v[x, y], p[x, y]}, {x, y}};
pars = <|"MassDensity" -> 1, 
	"FluidDynamicsMaterialModel" -> <|"PowerLaw" -> <|"PowerLawExponent" -> 1 / 2, "PowerLawViscosity" -> 0.008838835|>|>
	|>;
```

Solve the PDE with an inflow profile given as {1/2,0} and with the outflow pressure set to 0. The walls are set up as no-slip walls:

```wl
In[3]:=
{uVelocity, vVelocity, pressure} = NDSolveValue[{FluidFlowPDEComponent[vars, pars] == {0, 0, 0}, DirichletCondition[
	{u[x, y] == 1 / 2, v[x, y] == 0}, x == 0], DirichletCondition[{u[x, y] == 0, v[x, y] == 0}, 0 < x < 30], 
	DirichletCondition[p[x, y] == 0, x == 30]}, {u, v, p}, {x, y}∈Ω, Method -> {"FiniteElement", "InterpolationOrder" -> {u -> 2, v -> 2, p -> 1}}]

Out[3]=
{InterpolatingFunction[{{0., 30.000000000000426}, {-1.5000000000000204, 1.5000000000000204}}, 
 {5, 4225, 0, {1218, 0}, {3, 0}, 0, 0, 0, 0, Indeterminate & , {}, {}, False}, 
 {NDSolve`FEM`ElementMesh[CompressedData["«19815»"], 
   {NDSolve`FEM`Tri ...  3, 3, 3, 3, 3, 3, 3, 3, 
      3, 3, 3, 3, 3, 3, 3, 3, 4, 4, 4, 4, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 
      5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 6, 7, 7, 7, 7, 7, 7, 8}]}]}, 
 CompressedData["«3547»"], {Automatic}]}
```

Visualize the velocity in the region:

```wl
In[4]:= ContourPlot[Sqrt[uVelocity[x, y] ^ 2 + vVelocity[x, y] ^ 2], {x, y}∈Ω, ...]

Out[4]= [image]
```

Plot the flow profile from the middle of the channel to the top scaled to 1:

```wl
In[5]:= Plot[uVelocity[28, y * 1.5], {y, 0, 1}]

Out[5]= [image]
```

#### Time-Dependent Analysis (1)

Solve a time-dependent driven cavity problem.

Create and visualize an auxiliary function to ramp up the flow speed on top of the box:

```wl
In[1]:=
rampFunction[min_, max_, c_, r_] := Function[t, (min * Exp[c * r] + max * Exp[r * t]) / (Exp[c * r] + Exp[r * t])]
ramp = rampFunction[0, 1, 4, 5];
Plot[ramp[t], {t, -1, 10}, PlotRange -> All]

Out[1]= [image]
```

Set up the PDE:

```wl
In[2]:= pde = FluidFlowPDEComponent[{{u[t, x, y], v[t, x, y], p[t, x, y]}, t, {x, y}}, <|"ReynoldsNumber" -> 1000|>] == {0, 0, 0};
```

Set up the boundary conditions:

```wl
In[3]:= bcs = {DirichletCondition[{u[t, x, y] == ramp[t], v[t, x, y] == 0}, y == 1], DirichletCondition[{u[t, x, y] == 0, v[t, x, y] == 0}, y < 1], DirichletCondition[p[t, x, y] == 0, x == 0 && y == 0]};
```

Set up the initial conditions:

```wl
In[4]:= ics = {u[0, x, y] == 0, v[0, x, y] == 0, p[0, x, y] == 0};
```

Monitor the solution process and measure the time it takes to solve the PDE:

```wl
In[5]:=
AbsoluteTiming[Monitor[{uVelocity, vVelocity, pressure} = NDSolveValue[{pde, bcs, ics}, {u, v, p}, {x, y}∈Rectangle[{0, 0}, {1, 1}], {t, 0, 20}, 
	Method -> {
	"PDEDiscretization" -> {"MethodOfLines", 
	"SpatialDiscretization" -> {"FiniteElement", "InterpolationOrder" -> {u -> 2, v -> 2, p -> 1}
	}}}, EvaluationMonitor :> (monitor = Row[{"t = ", CForm[t]}])];, monitor]]

Out[5]= {4.74114, Null}
```

Visualize rasterized frames of the velocity field for various times:

```wl
In[6]:=
frames = StreamPlot[{uVelocity[#, x, y], vVelocity[#, x, y]}, {x, y}∈Rectangle[{0, 0}, {1, 1}], PlotLabel -> "Time: " <> ToString[#] <> " s", Frame -> False]& /@ Range[1, 20, 1];
frames = Rasterize[#, "Image", ImageResolution -> 120]& /@ frames;
ListAnimate[frames]

Out[6]= DynamicModule[«8»]
```

#### Axisymmetric Flow (2)

Compute the fluid flow in a narrowing cylindrical pipe driven by a parabolic inflow. Set up the axisymmetric domain:

```wl
In[1]:= domain = RegionUnion[RegionDifference[RegionDifference[RegionUnion[Rectangle[{0, 0}, {2, 7}], Rectangle[{0, 4}, {1, 10}]], Disk[{3 / 2, 7}, 1 / 2]], Disk[{2, 13 / 2}, 1 / 2]], Disk[{3 / 2, 6}, 1 / 2]]

Out[1]= [image]
```

Set up the PDE:

```wl
In[2]:= pde = FluidFlowPDEComponent[{{u[r, z], 0, w[r, z], p[r, z]}, {r, θ, z}}, <|"MassDensity" -> 1, "DynamicViscosity" -> 1, "RegionSymmetry" -> "Axisymmetric"|>] == {0, 0, 0};
```

Set up the boundary conditions:

```wl
In[3]:=
bcs = {DirichletCondition[{u[r, z] == 0, w[r, z] == 0.25 * (4 - r ^ 2)}, z == 0], 
	DirichletCondition[{u[r, z] == 0, w[r, z] == 0}, r > 0 && z != 0 && z != 10], 
	DirichletCondition[u[r, z] == 0, r == 0], 
	DirichletCondition[u[r, z] == 0, z == 10], 
	DirichletCondition[p[r, z] == 0, r == 0 && z == 10]};
```

Solve the equations:

```wl
In[4]:=
{rVel, zVel, pressure} = NDSolveValue[{pde, 
	bcs}, {u[r, z], w[r, z], p[r, z]}, {r, z}∈domain, 
	Method -> {"FiniteElement", "InterpolationOrder" -> {u -> 2, w -> 2, p -> 1}}];
```

Visualize the velocity of the solution:

```wl
In[5]:= VectorPlot[{rVel, zVel}, {r, z}∈domain]

Out[5]= [image]
```

Plot the pressure in 3D for part of the pipe:

```wl
In[6]:=
rmf = RegionMember[domain];
Legended[RegionPlot3D[rmf[{Sqrt[x ^ 2 + y ^ 2], z}] && 0 <= PlanarAngle[{0, 0} -> {{0.02, 0}, {x, y}}] <= (4 π) / 3, {x, -2, 2}, {y, -2, 2}, {z, 0, 10}, ...], BarLegend[...]]

Out[6]= [image]
```

---

Compute the velocity profile for time-dependent axisymmetric flow driven by a pressure gradient. Set up the domain:

```wl
In[1]:=
R = 3 / 2;L = 10;
domain = RegionDifference[Rectangle[{0, 0}, {R, L}], Disk[{R, L / 2}, R / 2]]

Out[1]= [image]
```

Set up the PDE:

```wl
In[2]:= pde = FluidFlowPDEComponent[{{u[t, r, z], 0, w[t, r, z], p[t, r, z]}, t, {r, θ, z}}, <|"DynamicViscosity" -> 1 / 10, "MassDensity" -> 1, "RegionSymmetry" -> "Axisymmetric"|>] == {0, 0, 0};
```

Set up the boundary conditions with a prescribed pressure gradient:

```wl
In[3]:=
bcs = {DirichletCondition[u[t, r, z] == 0, z == 0], 
	DirichletCondition[u[t, r, z] == 0, r == 0], 
	DirichletCondition[{u[t, r, z] == 0, w[t, r, z] == 0}, r > 0 && z != 0 && z != L], 
	DirichletCondition[p[t, r, z] == Min[t, 1] * 3 / 2 * L, z == 0], 
	DirichletCondition[{p[t, r, z] == 0, u[t, r, z] == 0}, z == L]};
```

Set up the initial condition:

```wl
In[4]:= ic = {u[0, r, z] == 0, w[0, r, z] == 0, p[0, r, z] == 0};
```

Solve the equations and measure the time it takes:

```wl
In[5]:=
tEnd = 5;
AbsoluteTiming[{rVel, zVel, pressure} = NDSolveValue[{pde, bcs, ic}, {u, w, p}, {r, z}∈domain, {t, 0, tEnd}, Method -> {"PDEDiscretization" -> {"MethodOfLines", "SpatialDiscretization" -> {"FiniteElement", "InterpolationOrder" -> {u -> 2, w -> 2, p -> 1}}}}];]

Out[5]= {5.85519, Null}
```

Visualize the rasterized velocity for various times:

```wl
In[6]:=
frames = VectorPlot[{rVel[#, r, z], zVel[#, r, z]}, {r, z}∈domain, ...]& /@ Range[1, tEnd, 1];
frames = Rasterize[#, "Image", ImageResolution -> 120]& /@ frames;
ListAnimate[frames]

Out[6]= DynamicModule[«8»]
```

Plot the outflow velocity profile for various times:

```wl
In[7]:= Plot[Evaluate[zVel[#, r, L]& /@ Range[1, tEnd, 1]], {r, 0, R}, ...]

Out[7]= [image]
```

## See Also

* [`DirichletCondition`](https://reference.wolfram.com/language/ref/DirichletCondition.en.md)
* [`NeumannValue`](https://reference.wolfram.com/language/ref/NeumannValue.en.md)
* [`HeatTransferPDEComponent`](https://reference.wolfram.com/language/ref/HeatTransferPDEComponent.en.md)
* [`MassTransportPDEComponent`](https://reference.wolfram.com/language/ref/MassTransportPDEComponent.en.md)
* [`SolidMechanicsPDEComponent`](https://reference.wolfram.com/language/ref/SolidMechanicsPDEComponent.en.md)

## Tech Notes

* [Laminar Flow](https://reference.wolfram.com/language/PDEModels/tutorial/FluidDynamics/LaminarFlow.en.md)
* [Fluid Dynamics PDE Verification](https://reference.wolfram.com/language/PDEModels/tutorial/FluidDynamics/FluidDynamicsVerificationTests.en.md)

## Related Guides

* [Fluid Dynamics PDEs and Boundary Conditions](https://reference.wolfram.com/language/guide/FluidDynamicsPDEModels.en.md)
* [Partial Differential Equation Terms](https://reference.wolfram.com/language/guide/PDEModeling.en.md)

## History

* [Introduced in 2024 (14.0)](https://reference.wolfram.com/language/guide/SummaryOfNewFeaturesIn140.en.md) \| [Updated in 2024 (14.1)](https://reference.wolfram.com/language/guide/SummaryOfNewFeaturesIn141.en.md) ▪ [2025 (14.3)](https://reference.wolfram.com/language/guide/SummaryOfNewFeaturesIn143.en.md)