Skip to content

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):

  1. Plane. A uniform grid of the face, df_spacing apart 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.
  2. 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 / spacing the integral length in nodes, the stencil half-width 2 n: the filtered field has unit variance and the exponential correlation exp(-pi r / (2 L)).
  3. 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, correlation exp(-pi t / (2 T)).
  4. 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.
  5. Thermodynamics. The strong Reynolds analogy (Morkovin; Touber & Sandham 2009), T' / T = -(gamma - 1) M^2 u' / U with the local mean Mach number, written T' = -(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 ​

Variables ​

NameTypeAttributesDescription
PIreal(kind=R8P)parameterPi.

Derived Types ​

flume_inflow_df_object ​

Digital-filter inflow.

Components ​

NameTypeAttributesDescription
is_activelogicalA face of this kind exists.
faceinteger(kind=I4P)The face (1 to 6).
axis_ninteger(kind=I4P)Streamwise axis (the face normal).
axis_winteger(kind=I4P)Wall-normal axis.
axis_sinteger(kind=I4P)Spanwise axis.
sgnreal(kind=R8P)Sign of the inward normal along axis_n.
r_infreal(kind=R8P)Free-stream density.
u_infreal(kind=R8P)Free-stream speed.
p_infreal(kind=R8P)Free-stream pressure.
gammareal(kind=R8P)Specific heats ratio.
deltareal(kind=R8P)Layer thickness.
spacingreal(kind=R8P)Requested plane spacing.
lengthreal(kind=R8P)Integral lengths (streamwise, normal, spanwise) / delta.
seedinteger(kind=I8P)Random stream state.
profile_filecharacter(len=999)Profile table file.
profreal(kind=R8P)allocatableProfile table [7, rows].
nyinteger(kind=I4P)Plane nodes along the wall-normal and spanwise axes.
nzinteger(kind=I4P)Plane nodes along the wall-normal and spanwise axes.
y0real(kind=R8P)Plane origin (the domain minimum along each axis).
z0real(kind=R8P)Plane origin (the domain minimum along each axis).
dyreal(kind=R8P)Plane spacing along each axis.
dzreal(kind=R8P)Plane spacing along each axis.
span_periodiclogicalThe spanwise axis is periodic.
hyinteger(kind=I4P)Filter half-widths in nodes.
hzinteger(kind=I4P)Filter half-widths in nodes.
t_scalereal(kind=R8P)Time scale T = L_x / U_inf.
byreal(kind=R8P)allocatableFilter coefficients [-h:h].
bzreal(kind=R8P)allocatableFilter coefficients [-h:h].
psireal(kind=R8P)allocatableUnit-variance signals [3, ny, nz].
node_meanreal(kind=R8P)allocatablePer wall-normal node: U, rho, a11, a21, a22, a33 [6, ny].
q_planereal(kind=R8P)allocatableConservative state at the nodes [5, ny, nz].
nrowsinteger(kind=I4P)Ghost rows of the face on this rank.
rowsinteger(kind=I4P)allocatableTheir block and cell [4, nrows].
q_rowsreal(kind=R8P)allocatableTheir conservative states [5, nrows].

Type-Bound Procedures ​

NameAttributesDescription
loadpass(self)Load the face keys.
setuppass(self)Build the plane, the filter and the first signals.
advancepass(self)Move the signals on by one step.
build_rowspass(self)List the ghost rows of the face and their states.
fluctuationpass(self)Velocity and temperature fluctuations at a plane node.
save_statepass(self)Save the plane state.
load_statepass(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

NameTypeIntentAttributesDescription
selfclass(flume_inflow_df_object)inoutInflow.
file_parameterstype(file_ini)inParameters file.
sectioncharacter(len=*)inFace section.
faceinteger(kind=I4P)inFace (1 to 6).
modelinteger(kind=I4P)inPhysical model.
gammareal(kind=R8P)inSpecific 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

NameTypeIntentAttributesDescription
selfclass(flume_inflow_df_object)inoutInflow.
eminreal(kind=R8P)inDomain minimum.
emaxreal(kind=R8P)inDomain maximum.
periodiclogicalinPeriodic 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

NameTypeIntentAttributesDescription
selfclass(flume_inflow_df_object)inoutInflow.
dtreal(kind=R8P)inTime 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

NameTypeIntentAttributesDescription
selfclass(flume_inflow_df_object)inoutInflow.
crown_mapinteger(kind=I8P)inBC crown map [rows, 9, ngc].
x_cellreal(kind=R8P)inX cell centres [1-ngc:ni+ngc, nb] (passed 1-based).
y_cellreal(kind=R8P)inY cell centres.
z_cellreal(kind=R8P)inZ 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

NameTypeIntentAttributesDescription
selfclass(flume_inflow_df_object)inInflow.
basenamecharacter(len=*)inRestart 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

NameTypeIntentAttributesDescription
selfclass(flume_inflow_df_object)inoutInflow.
basenamecharacter(len=*)inRestart 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

NameTypeIntentAttributesDescription
filenamecharacter(len=*)inFile name.
profreal(kind=R8P)outallocatableTable [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

NameTypeIntentAttributesDescription
profreal(kind=R8P)inTable [7, rows].
etareal(kind=R8P)iny / delta.
ureal(kind=R8P)outMean speed and temperature.
treal(kind=R8P)outMean speed and temperature.
rreal(kind=R8P)outStresses.

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

NameTypeIntentAttributesDescription
nreal(kind=R8P)inIntegral length in nodes.
hinteger(kind=I4P)outHalf-width.
breal(kind=R8P)outallocatableCoefficients [-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

NameTypeIntentAttributesDescription
selftype(flume_inflow_df_object)inoutInflow.
psireal(kind=R8P)outField [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

NameTypeIntentAttributesDescription
selftype(flume_inflow_df_object)inoutInflow.

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

NameTypeIntentAttributesDescription
selfclass(flume_inflow_df_object)inInflow.
jinteger(kind=I4P)inNode.
kinteger(kind=I4P)inNode.

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

NameTypeIntentAttributesDescription
selftype(flume_inflow_df_object)inInflow.
yreal(kind=R8P)inCoordinates along the wall-normal and spanwise axes.
zreal(kind=R8P)inCoordinates 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

NameTypeIntentAttributesDescription
rinteger(kind=I8P)inoutState.

Call graph