# Material

*The Material section defines the physical properties of the simulated fluid inside the Fluid model. For a gas, this is air by default, and you can edit its viscosity model and Prandtl numbers. For a liquid, it is water, defined by its density and dynamic viscosity.*

```{note}
The material **type** (Air or Water) follows the Gas/Liquid selection made in the **[Operating Condition](../../../01.flow-conditions/README.md)**: choosing Gas exposes the Air parameters, choosing Liquid exposes the Water parameters. The freestream state (velocity, density, temperature, etc.) is still defined in the Operating Condition; the Material section only describes the substance itself.
```

---

## Available Options

### Air (gas)

| *Option* | *Description* | *Applicable* |
|----------|---------------|--------------|
| **Dynamic viscosity** | Method used to evaluate the dynamic viscosity: `Sutherland` (temperature-dependent) or `Constant` | always |
| **Reference viscosity** | Reference dynamic viscosity $\mu_{ref}$ in Sutherland's law | **Dynamic viscosity** is `Sutherland` |
| **Reference temperature** | Reference temperature $T_{ref}$ associated with the reference viscosity | **Dynamic viscosity** is `Sutherland` |
| **Effective temperature** | Sutherland constant $S$ | **Dynamic viscosity** is `Sutherland` |
| **Value** | A single constant dynamic viscosity | **Dynamic viscosity** is `Constant` |
| **Prandtl number** | Laminar Prandtl number | always |
| **Turbulent Prandtl number** | Turbulent Prandtl number | always |

### Water (liquid)

| *Option* | *Description* | *Applicable* |
|----------|---------------|--------------|
| **Density** | Density of the liquid | always |
| **Dynamic viscosity** | Dynamic viscosity of the liquid | always |

---

## Detailed Descriptions

### Dynamic viscosity (Air)

*Selects how the dynamic viscosity of the gas is evaluated.*

- **Default:** `Sutherland`
- **Options:**
  - `Sutherland`: temperature-dependent viscosity following Sutherland's law:
    $\mu(T) = \mu_{ref} \left(\dfrac{T}{T_{ref}}\right)^{1.5} \dfrac{T_{ref} + S}{T + S}$
  - `Constant`: a single, temperature-independent viscosity value.

#### Reference viscosity

*The reference dynamic viscosity $\mu_{ref}$ at the reference temperature.*

- **Required** when **Dynamic viscosity** is `Sutherland`
- **Default:** `1.716e-5 Pa·s`

#### Reference temperature

*The reference temperature $T_{ref}$ associated with the reference viscosity.*

- **Required** when **Dynamic viscosity** is `Sutherland`
- **Default:** `273.15 K`

#### Effective temperature

*The Sutherland constant $S$ used in Sutherland's formula.*

- **Required** when **Dynamic viscosity** is `Sutherland`
- **Default:** `110.4 K`

#### Value

*A single constant dynamic viscosity, used instead of the Sutherland model.*

- **Required** when **Dynamic viscosity** is `Constant`
- **Example:** `1.825e-5 Pa·s`

### Prandtl number

*The laminar Prandtl number of the gas.*

- **Required**
- **Default:** `0.72`

### Turbulent Prandtl number

*The turbulent Prandtl number of the gas.*

- **Required**
- **Default:** `0.9`

### Density (Water)

*The density of the liquid.*

- **Required**
- **Default:** `1000 kg/m³`

### Dynamic viscosity (Water)

*The dynamic viscosity of the liquid.*

- **Required**
- **Default:** `0.001002 Pa·s`

```{note}
A liquid is described only by its density and dynamic viscosity; it carries no thermal properties such as thermal conductivity or specific heat. Conjugate heat transfer (CHT) is therefore only available with a gas.
```

---

## Available Through the Python API

*These settings have no control in the Material panel. Configure them through the Python API.*

### `Gas`

*A gas other than the air preset, defined by its species with temperature-dependent (NASA 9-coefficient) thermodynamics. The species either form a mixture of fixed composition ({py:class}`~flow360.FrozenSpeciesSolver`) or are transported through the domain as mass-fraction fields ({py:class}`~flow360.SpeciesTransportSolver`), as chosen on the `Fluid` model's {py:attr}`~flow360.Fluid.species_transport_solver`.*

- Set it as the material of the operating condition's thermal state, {py:attr}`~flow360.ThermalState.material`.
- See {doc}`Gas Mixtures </user_guide/Formulations/GasMixtures>` for how to choose between the two and how to set up species, boundary composition, and the species transport solver.

---

<details>
<summary><h3 style="display:inline-block"> 🐍 Python Example Usage</h3></summary>

```{seealso}
Python API:
- {py:class}`~flow360.Air`
- {py:class}`~flow360.Water`
- {py:class}`~flow360.Sutherland`
- {py:class}`~flow360.Gas`
- {py:class}`~flow360.ThermalState`
- {py:class}`~flow360.AerospaceCondition`
- {py:class}`~flow360.LiquidOperatingCondition`
```

The material is carried by the operating condition, not by the `Fluid` model. For a gas it sits on the operating condition's thermal state; for a liquid it sits directly on {py:class}`~flow360.LiquidOperatingCondition`.

```python
import flow360 as fl
from flow360 import u

with fl.SI_unit_system:
    # Default air: Sutherland viscosity, calorically perfect gas (gamma = 1.4)
    condition = fl.AerospaceCondition(
        velocity_magnitude=100,
        thermal_state=fl.ThermalState(material=fl.Air()),
    )

    # Air with a custom Sutherland model and Prandtl numbers
    condition_custom = fl.AerospaceCondition(
        velocity_magnitude=100,
        thermal_state=fl.ThermalState(
            material=fl.Air(
                dynamic_viscosity=fl.Sutherland(
                    reference_viscosity=1.716e-5 * u.Pa * u.s,
                    reference_temperature=273.15 * u.K,
                    effective_temperature=110.4 * u.K,
                ),
                prandtl_number=0.72,
                turbulent_prandtl_number=0.9,
            ),
        ),
    )

    # Air as a constant-viscosity gas
    condition_constant = fl.AerospaceCondition(
        velocity_magnitude=100,
        thermal_state=fl.ThermalState(
            material=fl.Air(dynamic_viscosity=1.825e-5 * u.Pa * u.s),
        ),
    )

    # Liquid (water) defined by density and dynamic viscosity. Liquids carry the
    # material on the operating condition itself, not on a thermal state.
    condition_liquid = fl.LiquidOperatingCondition(
        velocity_magnitude=5,
        material=fl.Water(
            name="Water",
            density=1000 * u.kg / u.m**3,
            dynamic_viscosity=0.001002 * u.Pa * u.s,
        ),
    )
```

</details>
