flow_fields_t Derived Type

type, public :: flow_fields_t

Container for all primary hydrodynamic fields.


Components

Type Visibility Attributes Name Initial
real(kind=rk), public, allocatable :: div(:)
real(kind=rk), public, allocatable :: face_flux(:)

Conservative face-centered volumetric flux . Oriented according to the face normal (owner neighbor).

real(kind=rk), public, allocatable :: p(:)
real(kind=rk), public, allocatable :: phi(:)
real(kind=rk), public, allocatable :: rhs_old(:,:)

Storage for the previous explicit RHS (Advection + Diffusion). Required for 2nd-order Adams-Bashforth (AB2) time marching.

logical, public :: rhs_old_valid = .false.
real(kind=rk), public, allocatable :: u(:,:)
real(kind=rk), public, allocatable :: u_old(:,:)
real(kind=rk), public, allocatable :: u_star(:,:)

Source Code

   type, public :: flow_fields_t
      real(rk), allocatable :: u(:,:)        !< Current cell-centered velocity vector \((u, v, w)\) [m/s].
      real(rk), allocatable :: u_old(:,:)    !< Velocity vector from the previous time step \(n\) [m/s].
      real(rk), allocatable :: u_star(:,:)   !< Intermediate predicted velocity field [m/s].

      real(rk), allocatable :: p(:)          !< Static pressure field \(P\) [Pa].
      real(rk), allocatable :: phi(:)        !< Pressure correction potential \(\phi\). Used in the Poisson solver.
      real(rk), allocatable :: div(:)        !< Local velocity divergence \(\nabla \cdot \mathbf{u}\). Should be \(\approx 0\) after projection.

      !> Conservative face-centered volumetric flux \(U_f = \mathbf{u}_f \cdot \mathbf{n}_f A_f\).
      !! Oriented according to the face normal (owner \(\rightarrow\) neighbor).
      real(rk), allocatable :: face_flux(:)  !< Volumetric flux across faces [m^3/s].

      !> Storage for the previous explicit RHS (Advection + Diffusion).
      !! Required for 2nd-order Adams-Bashforth (AB2) time marching.
      real(rk), allocatable :: rhs_old(:,:)  !< Momentum RHS from step \(n-1\).
      logical :: rhs_old_valid = .false.     !< False on the first step (triggers Euler fallback).
   end type flow_fields_t