Skip to content

adam_flume_inflow_rr_object ​

ADAM, FLUME recycling-rescaling turbulent inflow of a boundary layer (issue #121, S5).

One realm face of kind inflow-recycling feeds a turbulent boundary layer with the mean profile of a table (the digital filter's, adam_flume_inflow_df_object) plus the fluctuations of the layer itself, taken from a plane downstream and rescaled, in the variant of the STREAmS solver (Pirozzoli, Bernardini & Grasso; STREAmS-2, recyc_prepare and bcrecyc) of the method of Lund, Wu & Squires (1998):

  1. Plane. The ngc cell layers ending at the station rr_x downstream of the face, a pure translation of the ghost layers by L = nint(rr_x / dx) dx (ghost layer g, g cells beyond the face, takes the cell L downstream of it): every rank writes the cells it owns into one global plane [6, ngc, ny, nz] (the 6th slot counts the writes) and an allreduce sums it, so the plane is the same on every rank and independent of the decomposition (every entry is written once).
  2. Fluctuations. Per layer and wall-normal row, the spanwise Favre mean u~ = sum(rho u) / sum(rho) and the mean density; the fluctuations u'' = u - u~ (three components) and rho' = rho - rho_mean.
  3. Rescaling. A ghost at height y above the wall takes the fluctuations at beta y (inner, the viscous length grows by beta = delta_v(x_r) / delta_v(0)) and at delta_ratio y (outer, delta_ratio = delta(x_r) / delta(0)), linear in the plane, blended by W(eta) = (1 + tanh(4 (eta - 0.2) / (0.2 + 0.6 eta)) / tanh(4)) / 2, eta = y / delta, damped by (1 - tanh(4 (eta - 2))) / 2; the velocity fluctuations are scaled by beta (the friction velocity ratio), the density one clipped to [-0.75, 4] times the mean. A source above the plane's last row centre gives no fluctuation; below its first row the first row's (STREAmS zeroes the first cell, a DNS cell at y+ < 1; here the first cell is the wall model's log layer).
  4. Span shift. The plane is read rr_shift of the span away (default half), which breaks the streamwise locking of the recycled structures; a shift needs a periodic span.
  5. State. Mean (the table) plus fluctuations, the free-stream pressure: rho = rho_mean + rho', u = U + u'', and the energy of the pressure p_inf.

beta and delta_ratio are input keys: the case generator takes them from a correlation (make_tbl.py, the momentum integral with the van Driest II skin friction), as STREAmS takes them from its mean-profile model, never from the run.

Face keys: type = inflow-recycling, r, u, p (the free stream), rr_profile (the 7-column table of the digital filter), rr_delta (the layer thickness at the face), rr_wall_axis (x, y or z, the wall on its minimum side), rr_spacing (the cell spacing of the plane, the cells at the face and at the station must have it), rr_x (the station, distance from the face), rr_delta_ratio, rr_beta, rr_shift (fraction of the span, default 0.5). Only [physics] physical_model = euler, one such face per realm.

Ghosts. Once per step, before the first stage, from the committed state (build_rows): the backends write them after the face pass of the boundary fill, as the digital filter's; rows beyond the face and another realm face (edges, corners) are extrapolated. No state of its own: a restart continues bit for bit.

Source: src/app/flume/common/adam_flume_inflow_rr_object.F90

Dependencies

Contents ​

Derived Types ​

flume_inflow_rr_object ​

Recycling-rescaling 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 at the face.
spacingreal(kind=R8P)Cell spacing of the plane.
x_rreal(kind=R8P)Station, distance from the face (as requested).
delta_ratioreal(kind=R8P)delta(x_r) / delta(0).
betareal(kind=R8P)delta_v(x_r) / delta_v(0).
shiftreal(kind=R8P)Span shift, fraction of the span.
profile_filecharacter(len=999)Profile table file.
profreal(kind=R8P)allocatableProfile table [7, rows].
face_xreal(kind=R8P)Face coordinate along axis_n.
y0real(kind=R8P)Plane origin (the domain minimum along the wall-normal and spanwise axes).
z0real(kind=R8P)Plane origin (the domain minimum along the wall-normal and spanwise axes).
nyinteger(kind=I4P)Plane cells along the wall-normal and spanwise axes.
nzinteger(kind=I4P)Plane cells along the wall-normal and spanwise axes.
nginteger(kind=I4P)Plane layers (the ghost cells).
nrinteger(kind=I4P)Translation in cells, L = nr spacing.
nshiftinteger(kind=I4P)Span shift in cells.
has_planelogicalThe plane has been built (the ghost rows can be listed).
fluctreal(kind=R8P)allocatablePlane fluctuations rho', u'', v'', w'' (x, y, z) [4, ng, ny, nz].
nrecinteger(kind=I4P)Recycle cells on this rank.
rec_cellsinteger(kind=I4P)allocatableTheir cell and block (i, j, k, b) [4, nrec].
rec_idxinteger(kind=I4P)allocatableTheir plane layer and cell (g, jy, kz) [3, nrec].
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)Size the plane.
list_recycle_cellspass(self)List this rank's cells of the plane.
build_planepass(self)Sum the plane over the ranks and take its fluctuations.
build_rowspass(self)List the ghost rows of the face and their states.
ghost_statepass(self)Conservative state of a ghost.

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_rr_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 ​

Size the plane over the domain [emin, emax]: cells of rr_spacing along the wall-normal and spanwise axes, ngc layers, the translation and the span shift in cells.

fortran
subroutine setup(self, emin, emax, periodic, ngc)

Arguments

NameTypeIntentAttributesDescription
selfclass(flume_inflow_rr_object)inoutInflow.
eminreal(kind=R8P)inDomain minimum.
emaxreal(kind=R8P)inDomain maximum.
periodiclogicalinPeriodic axes.
ngcinteger(kind=I4P)inGhost cells.

Call graph

list_recycle_cells ​

List this rank's cells of the plane: the interior cells whose centre is a plane layer's, ngc layers ending at the station, their plane layer and cell; fatal on a cell of the layers at another spacing than the plane's.

fortran
subroutine list_recycle_cells(self, nb, nc, ngc, x_cell, y_cell, z_cell, dxyz)

Arguments

NameTypeIntentAttributesDescription
selfclass(flume_inflow_rr_object)inoutInflow.
nbinteger(kind=I4P)inBlocks in use.
ncinteger(kind=I4P)inInterior cells per block (ni, nj, nk).
ngcinteger(kind=I4P)inGhost cells (the offset of the cell arrays).
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.
dxyzreal(kind=R8P)inCell spacing [3, nb].

Call graph

build_plane ​

Sum this rank's plane cells q_rec (the conservative state of rec_cells) over the ranks into the global plane and take its fluctuations: per layer and wall-normal row the spanwise Favre mean velocity and the mean density.

fortran
subroutine build_plane(self, q_rec)

Arguments

NameTypeIntentAttributesDescription
selfclass(flume_inflow_rr_object)inoutInflow.
q_recreal(kind=R8P)inConservative state of this rank's plane cells [5, nrec].

Call graph

build_rows ​

List the crown rows beyond the face only (block > 0) and their states (ghost_state, from the plane of build_plane).

fortran
subroutine build_rows(self, crown_map, x_cell, y_cell, z_cell)

Arguments

NameTypeIntentAttributesDescription
selfclass(flume_inflow_rr_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

Functions ​

ghost_state ​

Conservative state of a ghost of layer g, height y above the wall, reading the plane's span cell kz (shifted).

Attributes: pure

Returns: real(kind=R8P)

fortran
function ghost_state(self, g, y, kz) result(q)

Arguments

NameTypeIntentAttributesDescription
selfclass(flume_inflow_rr_object)inInflow.
ginteger(kind=I4P)inPlane layer.
yreal(kind=R8P)inHeight above the wall.
kzinteger(kind=I4P)inPlane span cell (shifted).

Call graph

rr_blend ​

The blend of the inner and outer fluctuations, W(eta) = (1 + tanh(4 (eta - 0.2) / (0.2 + 0.6 eta)) / tanh(4)) / 2 (STREAmS-2 recyc_prepare, alfa 4, beta 0.2): 0 at the wall, 1/2 at eta = 0.2, 1 at eta = 1.

Attributes: pure

Returns: real(kind=R8P)

fortran
function rr_blend(eta) result(w)

Arguments

NameTypeIntentAttributesDescription
etareal(kind=R8P)iny / delta.

Call graph

rr_damping ​

The damping of the fluctuations beyond the layer, (1 - tanh(4 (eta - 2))) / 2 (STREAmS-2 bcrecyc).

Attributes: pure

Returns: real(kind=R8P)

fortran
function rr_damping(eta) result(d)

Arguments

NameTypeIntentAttributesDescription
etareal(kind=R8P)iny / delta.

Call graph