# Scalar Fields¶

## Basic Concepts¶

Scalar fields represent a continuous scalar value defined at all points across the fluid domain (e.g. species concentration). Scalar fields are defined by a name, diffusion coefficient, and reaction rate. Scalars enter the domain via (i) an initial background concentration, (ii) an injection box, (iii) a non-zero concentration at an inlet, or (iv) a reaction rate that drives scalar production. Scalars can be removed from a system by specifying (i) an outlet, or (ii) a reaction rate that drives scalar consumption.

The scalar field is advanced using a high-resolution van Leer scheme. This approach links the time-varying fluid flow to the advection term in the advection-diffusion equation. Chemical reactions are advanced at each time-step using a fourth order Runge-Kutta solver.

Scalar field output files are created for each species, and record the time-evolution of the mean species concentration, the standard deviation of the species concentration across the tank volume, and the species exposure. The concentrations of each species at each inlet and outlet are recorded in the inletOutletData files.

Scalar fields are characterized by a parent-child relationship. Within this relationship, the parent defines the properties of the scalar field. The children define the shape/geometry/topology of these boundary conditions.

## Parent Properties¶

- Name
Variable name used in reaction expressions. Name has the following restrictions:

Some names are reserved for other quantities:

*s*,*t*, and*T*are reserved for strain, time, and temperature.First character must be a letter

Must not contain spaces or special characters

Must only contain letters, numbers, and under score

- Background Spec Type
Molarity: Define the initial condition as a molarity

Number Of Moles: Define the initial condition as a total number of moles

- Background Initial Concentration
Initial background concentration [mol/L] This is the uniform background concentration of the species at the start of the simulation.

- Background Initial Moles
Initial background concentration in units [mol]

- Diffusion Coefficient
Diffusion coefficient [m^2/s]

Diffusion coefficient of the scalar through the base fluid.

- Scalar Density Option
Indicates if the scalar field density is to be modeled explicitly.

Off: Scalar field has no affect on local fluid density

On: Scalar field informs the local fluid density via a user-provided density and molar mass

- Transport Across Free Surface (Free Surface Simulations Only)
Indicates if the scalar field is transported across the free surface interface. If enabled, user can define a mass transfer rate as a function of the fluid properties and the local fluid species concentration.

- Injection Geometry
Inject In Volume: the scalar boundary condition is imposed on all points contained inside the geometry.

Inject At Surface: the scalar boundary condition is imposed on the surface of the child geometry.

These conditions are identical for children geometries that are thin relative to the lattice spacing.

- Scalar Injection Amount Spec Type
Molarity: Input from

`Initial Concentration Expr`

is used with units molarityNumber Of Moles: Input from

`Initial Moles Expr`

is used with units molesMolar Rate: Input from

`Initial Moles Rate Expr`

is used with units moles/s

- Initial Concentration Expr
Injection into the geometry is defined as an expression that may be a function of time ‘t’.

[molarity]

- Initial Moles Expr
Injection into the geometry is defined as an expression that may be a function of time ‘t’

[moles]

- Initial Moles Rate Expr
Injection into the geometry is defined as an expression that may be a function of time ‘t’

[moles/s]

- Start Time
Injection start time [s].

Time at which to begin adding scalar into child geometry

- Stop Time
Scalar box stop time [s].

Time at which to stop adding scalar into the defined box. Between the Start and Stop times, the scalar field inside the box will be maintained at the user-defined concentration. To mimic the effects of an instantaneous scalar dump, set the Start Time equal to the Stop Time.

- Stencil
Stencil used to define advection [Lattice, Finite Volume] The finite volume stencil considers fluxes in the +/- x,y, and z-directions. The lattice stencil

- Limiter
Flux limiter used to contain convection [VanLeer, Minmod, MUSCL, Superbee, DonorCell, LaxWendroff, DonorCell]

The Donor Cell is an upwind difference technique valid for systems with a Peclet number greater than 2 (a condition typically satisfied in turbulent systems). The other schemes are total variation diminishing, and necessary in laminar systems.

- Visible
Enable/disable the visibility of this component

**Boundary Conditions**

For each boundary condition present in the simulation, the following inputs are available

- BC Type
Specified Value: Enables use of

`Value`

InputZero Gradient (suitable for outlet boundary conditions)

Zero Flux

RecircSpecifiedValue

- Value
Specified value inlets, this defines the scalar field value at boundary condition. Units defined by the scalar field background units specification, as discussed above in SpecscalarFields .

For recirculation inlets, this can be an expression of the concentration of the coupled boundary condition, \(c\), defined by the scalar field background units specification.

For example, if this value is set to

``c`

and the scalar field background units specification were set to moles, the molar flow rate of the scalar returning to the vessel through the recirculation loop will be equal to the molar flow rate leaving the vessel. If this value were set to`0.5c`

, the molar flow rate of the scalar returning to the vessel through the recirculation loop will be 50% that leaving the vessel. Under these settings, the concentration in the tank will decrease. If this value were set to``0`

, the molar flow rate of the scalar returning to the vessel through the recirculation loop will zero. This behavior represents a system were the scalar field is removed from the recirculation line prior to returning to the vessel.