Allocation and management of primary flow variables (U, P, Fluxes).
This module acts as the central repository for all physical fields associated with the fluid flow. It handles the allocation, initialization, and deallocation of cell-centered and face-centered variables.
The fields are designed to support the Fractional-Step Projection Method:
1. u: The soluable, divergence-free velocity field at the new time level.
2. u_star: The intermediate predicted velocity (contains advection and diffusion).
3. phi: The scalar potential used to project u_star onto a divergence-free space.
4. face_flux: The volumetric flux at cell faces, used for conservative transport.
Container for all primary hydrodynamic fields.
| 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(:,:) |
Dynamically allocates all arrays within the flow fields container.
| Type | Intent | Optional | Attributes | Name | ||
|---|---|---|---|---|---|---|
| type(mesh_t), | intent(in) | :: | mesh |
The mesh structure defining the domain size. |
||
| type(flow_fields_t), | intent(inout) | :: | fields |
The container to be allocated. |
Deallocates all arrays and resets validity flags.
| Type | Intent | Optional | Attributes | Name | ||
|---|---|---|---|---|---|---|
| type(flow_fields_t), | intent(inout) | :: | fields |
The container to be cleared. |
Initializes flow fields and sets simulation initial conditions.
| Type | Intent | Optional | Attributes | Name | ||
|---|---|---|---|---|---|---|
| type(mesh_t), | intent(in) | :: | mesh |
The computational mesh. |
||
| type(flow_fields_t), | intent(inout) | :: | fields |
The fields container to initialize. |