Appearance
adam_flume_inflow_df_object
ADAM, FLUME digital-filter turbulent inflow of a boundary layer (issue #119, T3.7).
One realm face of kind inflow-digital-filter feeds a turbulent boundary layer: the mean profile of a table plus fluctuations with prescribed Reynolds stresses and length scales, built by the digital filter of Klein, Sadiki & Janicka (2003) in the form of Touber & Sandham (2009) and Xie & Castro (2008):
- Plane. A uniform grid of the face,
df_spacingapart along the wall-normal and the spanwise axes (cell-centred nodes, the spacing adjusted to divide the domain), periodic along the span when that axis is periodic. - Filter. Uniform random numbers of zero mean and unit variance (MINSTD, one stream, so every rank builds the same plane and no communication is needed) are filtered along both plane axes with
b_k = exp(-pi |k| / n)normalised to unit sum of squares,n = L / spacingthe integral length in nodes, the stencil half-width2 n: the filtered field has unit variance and the exponential correlationexp(-pi r / (2 L)). - Time. The streamwise correlation becomes a temporal one,
psi = psi exp(-pi dt / (2 T)) + psi_new sqrt(1 - exp(-pi dt / T)),T = L_x / U_inf(Xie & Castro 2008): unit variance kept, correlationexp(-pi t / (2 T)). - Stresses. The three unit-variance signals become velocity fluctuations by the Cholesky factor of the Reynolds stress tensor of the table (Lund, Wu & Squires 1998), with
R_13 = R_23 = 0:u' = a11 psi1,v' = a21 psi1 + a22 psi2,w' = a33 psi3. - Thermodynamics. The strong Reynolds analogy (Morkovin; Touber & Sandham 2009),
T' / T = -(gamma - 1) M^2 u' / Uwith the local mean Mach number, writtenT' = -(gamma - 1) U u' rho / (gamma p)so it holds at U = 0; the pressure is the free-stream one,rho' / rho = -T' / T.
The table (df_profile, ASCII, # comments) has 7 columns: y / delta, U / U_inf, T / T_inf, R_uu, R_vv, R_ww, R_uv in units of U_inf^2, u streamwise, v wall-normal, w spanwise; the mean density is rho_inf T_inf / T (no pressure gradient across the layer). Beyond its last row the free stream, linearly interpolated within.
Face keys: type = inflow-digital-filter, r, u, p (the free stream: density, speed along the inward normal, pressure), df_profile, df_delta (the layer thickness), df_wall_axis (x, y or z, the wall on its minimum side), df_spacing, df_length_streamwise, df_length_normal, df_length_spanwise (integral lengths in units of df_delta), df_seed (default 1). Only [physics] physical_model = euler, one such face per realm.
Ghosts. Once per step (advance) the plane moves on by the step; build_rows then lists the ghost cells beyond the face (crown rows beyond that face only) and their states, interpolated bilinearly in the plane; the backends write them after the face pass of the boundary fill. Rows beyond the face and another realm face (edges, corners) are extrapolated. The plane state is saved with the restart (<restart_basename>.dff), so a restart continues bit for bit.
Source: src/app/flume/common/adam_flume_inflow_df_object.F90
Dependencies
Contents
- flume_inflow_df_object
- load
- setup
- advance
- build_rows
- save_state
- load_state
- load_profile
- profile_mean
- filter_coefficients
- filtered_field
- plane_states
- fluctuation
- plane_value
- next_uniform
Variables
| Name | Type | Attributes | Description |
|---|---|---|---|
PI | real(kind=R8P) | parameter | Pi. |
Derived Types
flume_inflow_df_object
Digital-filter inflow.
Components
| Name | Type | Attributes | Description |
|---|---|---|---|
is_active | logical | A face of this kind exists. | |
face | integer(kind=I4P) | The face (1 to 6). | |
axis_n | integer(kind=I4P) | Streamwise axis (the face normal). | |
axis_w | integer(kind=I4P) | Wall-normal axis. | |
axis_s | integer(kind=I4P) | Spanwise axis. | |
sgn | real(kind=R8P) | Sign of the inward normal along axis_n. | |
r_inf | real(kind=R8P) | Free-stream density. | |
u_inf | real(kind=R8P) | Free-stream speed. | |
p_inf | real(kind=R8P) | Free-stream pressure. | |
gamma | real(kind=R8P) | Specific heats ratio. | |
delta | real(kind=R8P) | Layer thickness. | |
spacing | real(kind=R8P) | Requested plane spacing. | |
length | real(kind=R8P) | Integral lengths (streamwise, normal, spanwise) / delta. | |
seed | integer(kind=I8P) | Random stream state. | |
profile_file | character(len=999) | Profile table file. | |
prof | real(kind=R8P) | allocatable | Profile table [7, rows]. |
ny | integer(kind=I4P) | Plane nodes along the wall-normal and spanwise axes. | |
nz | integer(kind=I4P) | Plane nodes along the wall-normal and spanwise axes. | |
y0 | real(kind=R8P) | Plane origin (the domain minimum along each axis). | |
z0 | real(kind=R8P) | Plane origin (the domain minimum along each axis). | |
dy | real(kind=R8P) | Plane spacing along each axis. | |
dz | real(kind=R8P) | Plane spacing along each axis. | |
span_periodic | logical | The spanwise axis is periodic. | |
hy | integer(kind=I4P) | Filter half-widths in nodes. | |
hz | integer(kind=I4P) | Filter half-widths in nodes. | |
t_scale | real(kind=R8P) | Time scale T = L_x / U_inf. | |
by | real(kind=R8P) | allocatable | Filter coefficients [-h:h]. |
bz | real(kind=R8P) | allocatable | Filter coefficients [-h:h]. |
psi | real(kind=R8P) | allocatable | Unit-variance signals [3, ny, nz]. |
node_mean | real(kind=R8P) | allocatable | Per wall-normal node: U, rho, a11, a21, a22, a33 [6, ny]. |
q_plane | real(kind=R8P) | allocatable | Conservative state at the nodes [5, ny, nz]. |
nrows | integer(kind=I4P) | Ghost rows of the face on this rank. | |
rows | integer(kind=I4P) | allocatable | Their block and cell [4, nrows]. |
q_rows | real(kind=R8P) | allocatable | Their conservative states [5, nrows]. |
Type-Bound Procedures
| Name | Attributes | Description |
|---|---|---|
load | pass(self) | Load the face keys. |
setup | pass(self) | Build the plane, the filter and the first signals. |
advance | pass(self) | Move the signals on by one step. |
build_rows | pass(self) | List the ghost rows of the face and their states. |
fluctuation | pass(self) | Velocity and temperature fluctuations at a plane node. |
save_state | pass(self) | Save the plane state. |
load_state | pass(self) | Load the plane state. |
Subroutines
load
Load the keys of the face face (section section).
fortran
subroutine load(self, file_parameters, section, face, model, gamma)Arguments
| Name | Type | Intent | Attributes | Description |
|---|---|---|---|---|
self | class(flume_inflow_df_object) | inout | Inflow. | |
file_parameters | type(file_ini) | in | Parameters file. | |
section | character(len=*) | in | Face section. | |
face | integer(kind=I4P) | in | Face (1 to 6). | |
model | integer(kind=I4P) | in | Physical model. | |
gamma | real(kind=R8P) | in | Specific heats ratio. |
Call graph
setup
Build the plane over the domain [emin, emax], the filter coefficients, the mean state of each wall-normal node, and the first signals (an independent filtered field, so the inflow is turbulent from the first step).
fortran
subroutine setup(self, emin, emax, periodic)Arguments
| Name | Type | Intent | Attributes | Description |
|---|---|---|---|---|
self | class(flume_inflow_df_object) | inout | Inflow. | |
emin | real(kind=R8P) | in | Domain minimum. | |
emax | real(kind=R8P) | in | Domain maximum. | |
periodic | logical | in | Periodic axes. |
Call graph
advance
Move the signals on by the step dt (Xie & Castro 2008) and refresh the node states.
fortran
subroutine advance(self, dt)Arguments
| Name | Type | Intent | Attributes | Description |
|---|---|---|---|---|
self | class(flume_inflow_df_object) | inout | Inflow. | |
dt | real(kind=R8P) | in | Time step. |
Call graph
build_rows
List the crown rows beyond the face only (block > 0) and their states, bilinear in the plane.
fortran
subroutine build_rows(self, crown_map, x_cell, y_cell, z_cell)Arguments
| Name | Type | Intent | Attributes | Description |
|---|---|---|---|---|
self | class(flume_inflow_df_object) | inout | Inflow. | |
crown_map | integer(kind=I8P) | in | BC crown map [rows, 9, ngc]. | |
x_cell | real(kind=R8P) | in | X cell centres [1-ngc:ni+ngc, nb] (passed 1-based). | |
y_cell | real(kind=R8P) | in | Y cell centres. | |
z_cell | real(kind=R8P) | in | Z cell centres. |
Call graph
save_state
Save the plane state to <basename>.dff (rank 0; every rank holds the same state).
fortran
subroutine save_state(self, basename)Arguments
| Name | Type | Intent | Attributes | Description |
|---|---|---|---|---|
self | class(flume_inflow_df_object) | in | Inflow. | |
basename | character(len=*) | in | Restart files basename. |
Call graph
load_state
Load the plane state from <basename>.dff; without the file the signals restart from a fresh field (warned).
fortran
subroutine load_state(self, basename)Arguments
| Name | Type | Intent | Attributes | Description |
|---|---|---|---|---|
self | class(flume_inflow_df_object) | inout | Inflow. | |
basename | character(len=*) | in | Restart files basename. |
Call graph
load_profile
Load a profile table: 7 columns (y / delta, U / U_inf, T / T_inf, R_uu, R_vv, R_ww, R_uv / U_inf^2), # comments, rows in increasing y; fatal on a malformed table.
fortran
subroutine load_profile(filename, prof)Arguments
| Name | Type | Intent | Attributes | Description |
|---|---|---|---|---|
filename | character(len=*) | in | File name. | |
prof | real(kind=R8P) | out | allocatable | Table [7, rows]. |
Call graph
profile_mean
Return the table's U / U_inf, T / T_inf and stresses (R_uu, R_vv, R_ww, R_uv) at eta = y / delta: linear within, the first row below it, the free stream (1, 1, 0) beyond the last row.
Attributes: pure
fortran
subroutine profile_mean(prof, eta, u, t, r)Arguments
| Name | Type | Intent | Attributes | Description |
|---|---|---|---|---|
prof | real(kind=R8P) | in | Table [7, rows]. | |
eta | real(kind=R8P) | in | y / delta. | |
u | real(kind=R8P) | out | Mean speed and temperature. | |
t | real(kind=R8P) | out | Mean speed and temperature. | |
r | real(kind=R8P) | out | Stresses. |
Call graph
filter_coefficients
Coefficients b_k = exp(-pi |k| / n) normalised to unit sum of squares, half-width h = ceiling(2 n) (at least 1).
fortran
subroutine filter_coefficients(n, h, b)Arguments
| Name | Type | Intent | Attributes | Description |
|---|---|---|---|---|
n | real(kind=R8P) | in | Integral length in nodes. | |
h | integer(kind=I4P) | out | Half-width. | |
b | real(kind=R8P) | out | allocatable | Coefficients [-h:h]. |
Call graph
filtered_field
A fresh filtered field of unit variance: random numbers on the plane padded by the half-widths (wrapped along a periodic span), filtered along the wall-normal then the spanwise axis.
fortran
subroutine filtered_field(self, psi)Arguments
| Name | Type | Intent | Attributes | Description |
|---|---|---|---|---|
self | type(flume_inflow_df_object) | inout | Inflow. | |
psi | real(kind=R8P) | out | Field [3, ny, nz]. |
Call graph
plane_states
The conservative state at every node from the mean and the fluctuations.
fortran
subroutine plane_states(self)Arguments
| Name | Type | Intent | Attributes | Description |
|---|---|---|---|---|
self | type(flume_inflow_df_object) | inout | Inflow. |
Call graph
Functions
fluctuation
Velocity fluctuations (streamwise, wall-normal, spanwise) and temperature fluctuation over the mean temperature at the node (j, k).
Attributes: pure
Returns: real(kind=R8P)
fortran
function fluctuation(self, j, k) result(f)Arguments
| Name | Type | Intent | Attributes | Description |
|---|---|---|---|---|
self | class(flume_inflow_df_object) | in | Inflow. | |
j | integer(kind=I4P) | in | Node. | |
k | integer(kind=I4P) | in | Node. |
Call graph
plane_value
The state at (y, z), bilinear between the nodes: clamped along the wall normal, wrapped (periodic span) or clamped along the span.
Attributes: pure
Returns: real(kind=R8P)
fortran
function plane_value(self, y, z) result(q)Arguments
| Name | Type | Intent | Attributes | Description |
|---|---|---|---|---|
self | type(flume_inflow_df_object) | in | Inflow. | |
y | real(kind=R8P) | in | Coordinates along the wall-normal and spanwise axes. | |
z | real(kind=R8P) | in | Coordinates along the wall-normal and spanwise axes. |
Call graph
next_uniform
MINSTD (Park & Miller 1993): the next value in (0, 1), portable, no overflow in 64 bits.
Returns: real(kind=R8P)
fortran
function next_uniform(r) result(v)Arguments
| Name | Type | Intent | Attributes | Description |
|---|---|---|---|---|
r | integer(kind=I8P) | inout | State. |
Call graph