Skip to content

adam_flume_wall_model_library ​

ADAM, FLUME equilibrium wall model (issue #119, T3.4).

The thin-layer equations between the wall and a sample at height h, parallel velocity us, temperature ts, pressure ps (uniform across the layer): d/dy[(mu + mu_t) dU/dy] = 0, d/dy[(mu + mu_t) U dU/dy + cp (mu/Pr + mu_t/Pr_t) dT/dy] = 0, with mu_t = kappa y sqrt(rho tau_w) (1 - exp(-y+ / A+))^2, with the local density, y+ = y sqrt(tau_w rho_w) / mu_w, kappa 0.41, A+ 17, Pr_t 0.9 (Kawai & Larsson 2012). Both integrate once: (mu + mu_t) dU/dy = tau_w, cp (mu/Pr + mu_t/Pr_t) dT/dy + tau_w U = Q_w, Q_w = k_w dT/dy|_w. Given T(y), the two quadratures on a fixed stretched grid give tau_w and Q_w from the sample values: a fixed number of iterations, so a fixed cost per wall face on the device, with no tridiagonal solve.

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

Dependencies

Contents ​

Variables ​

NameTypeAttributesDescription
WM_POINTSinteger(kind=I4P)parameterIntervals of the layer; tau within 1 % up to h+ = 1e5, 5.5 % off at 1e6.
WM_ITERATIONSinteger(kind=I4P)parameterPlain fixed-point iterations (an Aitken step every second one, before #121 S4d, stopped a few samples on an extrapolated iterate, tau up to 2.7 times the fixed point).
WM_STRETCHreal(kind=R8P)parameterRatio of consecutive intervals.
WM_KAPPAreal(kind=R8P)parametervon Karman constant.
WM_APLUSreal(kind=R8P)parameterDamping constant.
WM_PRTreal(kind=R8P)parameterTurbulent Prandtl number.
WM_SRAreal(kind=R8P)parameterReynolds analogy factor of the inverse model (Griffin et al. 2023, after Zhang et al. 2014).
WM_SHOTSinteger(kind=I4P)parameterShots of the inverse model, secant on ln(tau) after the first.
WM_SUBITERATIONSinteger(kind=I4P)parameterCorrections of each step of the inverse model.
WM_CONV_CELLSinteger(kind=I4P)parameterCells below (and at) the sample whose convection feeds wall_model_solve_convective.
WM_SAMPLE_SNAPreal(kind=R8P)parameterA sample weight below it is 0: the matching height on a cell centre (sample_cells).

Subroutines ​

sample_cells ​

The cells of a wall-model sample: from the matching height hwm (0: the 3rd cell), the cell m counted from the wall and the weight w of cell m + 1, both within the n cells of the block, and the height of the sample actually taken.

Attributes: pure

fortran
subroutine sample_cells(hwm, dx, n, m, w, h)

Arguments

NameTypeIntentAttributesDescription
hwmreal(kind=R8P)inMatching height, spacing along the normal.
dxreal(kind=R8P)inMatching height, spacing along the normal.
ninteger(kind=I4P)inCells of the block along the normal.
minteger(kind=I4P)outCell counted from the wall.
wreal(kind=R8P)outWeight of cell m + 1.
hreal(kind=R8P)outHeight of the sample.

Call graph

wall_coupling_viscosity ​

The viscosity coupling of a modelled wall (wall_model_coupling = viscosity, issue #126, after De Vanna et al. 2022): the stress of the no-slip gradient of the first cell, (mu_w + mu_w^sgs) 2 v / dy, with the wall's subgrid viscosity mu_w^sgs >= 0 raised until its magnitude reaches the model's |tau|. It takes the direction t of the first cell's wall-parallel velocity v and the magnitude max(mu_w 2 |v| / dy, |tau|), so a reversed first cell reverses the wall stress whatever the sample does; a first cell at rest gives none.

Attributes: pure

fortran
subroutine wall_coupling_viscosity(tau, v1, v2, v3, dy, muw, t1, t2, t3, taum)

Arguments

NameTypeIntentAttributesDescription
taureal(kind=R8P)inThe model's wall shear stress.
v1real(kind=R8P)inWall-parallel velocity of the first cell (its normal component zero).
v2real(kind=R8P)inWall-parallel velocity of the first cell (its normal component zero).
v3real(kind=R8P)inWall-parallel velocity of the first cell (its normal component zero).
dyreal(kind=R8P)inCell spacing along the normal.
muwreal(kind=R8P)inMolecular viscosity at the wall temperature.
t1real(kind=R8P)outDirection of the stress, the unit vector of v (zero at rest).
t2real(kind=R8P)outDirection of the stress, the unit vector of v (zero at rest).
t3real(kind=R8P)outDirection of the stress, the unit vector of v (zero at rest).
taumreal(kind=R8P)outMagnitude of the stress.

Call graph

wall_model_solve ​

Return the wall shear stress tau and the heat flux q (k dT/dy at the wall, positive when the gas is hotter than the wall) of an isothermal wall.

Attributes: pure

fortran
subroutine wall_model_solve(h, us, ts, ps, tw, R, cp, pr, mu0, tref, suth, omega_mu, tau, q, semilocal)

Arguments

NameTypeIntentAttributesDescription
hreal(kind=R8P)inHeight, parallel speed, temperature and pressure of the sample.
usreal(kind=R8P)inHeight, parallel speed, temperature and pressure of the sample.
tsreal(kind=R8P)inHeight, parallel speed, temperature and pressure of the sample.
psreal(kind=R8P)inHeight, parallel speed, temperature and pressure of the sample.
twreal(kind=R8P)inWall temperature.
Rreal(kind=R8P)inGas constant, specific heat, Prandtl number.
cpreal(kind=R8P)inGas constant, specific heat, Prandtl number.
prreal(kind=R8P)inGas constant, specific heat, Prandtl number.
mu0real(kind=R8P)inViscosity law, as compute_dissipative_flux.
trefreal(kind=R8P)inViscosity law, as compute_dissipative_flux.
suthreal(kind=R8P)inViscosity law, as compute_dissipative_flux.
omega_mureal(kind=R8P)inViscosity law, as compute_dissipative_flux.
taureal(kind=R8P)outWall shear stress, wall heat flux.
qreal(kind=R8P)outWall shear stress, wall heat flux.
semilocallogicalinoptionalSemi-local damping, y* = y sqrt(rho tau) / mu with the local rho, mu (else wall units).

Call graph

wall_model_solve_pressure ​

wall_model_solve with the pressure gradient px (along the sample velocity) in the momentum balance (issue #121, S4d): (mu + mu_t) dU/dy = tau_w + px y, so U(h) = tau_w I0 + px I1, I0 = int dy / (mu + mu_t), I1 = int y dy / (mu + mu_t): an adverse gradient strong enough gives tau_w < 0 with U(h) > 0. The eddy viscosity takes the velocity scale sqrt((|tau_w| + |px| y) / rho) (u_tau and the pressure scale combined, as Duprat et al. 2011 do), so px = 0 is the equilibrium model; the energy flux cp (mu / Pr + mu_t / Pr_t) dT/dy + (tau_w + px y) U is constant across the layer. The convective terms are dropped and dp/dx kept, as Wang & Moin (2002) do. tau_w is no longer a power of the sample speed: WM_ITERATIONS plain fixed-point steps, as wall_model_solve, within 7e-5 of |tau_w| + |px| h of the converged value over a sweep of samples (sbli_oracle.py apriori, the Python port, with S4c's mean samples among them). ypg > 0 (issue #121, P1): the Bernoulli-consistent variant of Hickel, Touber, Bodart & Larsson (CTR Summer Program 2012, eq. 4.1). Above the viscous layer the convective term balances the pressure gradient, so the model takes it as -(dp/dx) min(y / y_pg, 1), y_pg = ypg (mu_w^2 / (rho_w |dp/dx|))^(1/3): the total stress is tau_w + px g(y), g(y) = y - y^2 / (2 y_pg) below y_pg and y_pg / 2 above, and g replaces y in the stress, in I1 and in the velocity scale of the eddy viscosity. Absent or 0: g = y, the model above, bit for bit.

Attributes: pure

fortran
subroutine wall_model_solve_pressure(h, us, ts, ps, tw, px, R, cp, pr, mu0, tref, suth, omega_mu, tau, q, semilocal, ypg)

Arguments

NameTypeIntentAttributesDescription
hreal(kind=R8P)inHeight, parallel speed, temperature and pressure of the sample.
usreal(kind=R8P)inHeight, parallel speed, temperature and pressure of the sample.
tsreal(kind=R8P)inHeight, parallel speed, temperature and pressure of the sample.
psreal(kind=R8P)inHeight, parallel speed, temperature and pressure of the sample.
twreal(kind=R8P)inWall temperature.
pxreal(kind=R8P)inPressure gradient along the sample velocity.
Rreal(kind=R8P)inGas constant, specific heat, Prandtl number.
cpreal(kind=R8P)inGas constant, specific heat, Prandtl number.
prreal(kind=R8P)inGas constant, specific heat, Prandtl number.
mu0real(kind=R8P)inViscosity law, as compute_dissipative_flux.
trefreal(kind=R8P)inViscosity law, as compute_dissipative_flux.
suthreal(kind=R8P)inViscosity law, as compute_dissipative_flux.
omega_mureal(kind=R8P)inViscosity law, as compute_dissipative_flux.
taureal(kind=R8P)outWall shear stress (along the sample velocity), wall heat flux.
qreal(kind=R8P)outWall shear stress (along the sample velocity), wall heat flux.
semilocallogicalinoptionalSemi-local damping, y* = y sqrt(rho tau_s) / mu with the local rho, mu (else wall units).
ypgreal(kind=R8P)inoptionalBernoulli-consistent variant: y_pg in viscous units of the pressure gradient, 0 for none.

Call graph

wall_model_solve_convective ​

wall_model_solve_pressure fed with the flow's own convection (issue #121, P2): the thin-boundary-layer balance between the wall and the sample keeps the convection with the pressure gradient (Wang & Moin 2002; Park & Moin 2014), (mu + mu_t) dU/dy = tau_w + S(y), S(y) = int_0^y F, F = px + C, with C the convection along the sample velocity of the resolved cells below the sample, cc(1:nc) at the cell centres (c - 1/2) dyc, linear in y between them, 0 at the wall (no-slip), constant beyond the last centre. S replaces px y of the pressure model in the stress, in I1 and in the velocity scale sqrt((|tau_w| + |S|) / rho); cc = 0 is that model to round-off. Where the resolved convection balances the pressure gradient (Bernoulli) the forcing vanishes, where the near-wall flow is slow it is the gradient. rc (#121 P3): the resolved shear stress <rho u'_e u'_eta> of the same cells (eta away from the wall), linear between the wall (0) and the centres, constant beyond: the mean of the instantaneous convection holds its gradient, which the model's eddy viscosity already carries, so S(y) - R(y) replaces S (the stress form of Park & Moin's 2014 reduced eddy viscosity). rc = 0 is the model without it, bit for bit. ftau (#121 P3): the velocity scale of the eddy viscosity sqrt(|tau_w| / rho), the forcing kept out of it and linear in the balance (as Wang & Moin's 2002 thin-boundary-layer model): the filtered resolved forcing fluctuates as much as tau_w itself, and |S| in the scale biases the mean tau_w up (a priori on a zero-gradient layer: +12 % with it, -1.5 % without). .false.: the scale |tau_w| + |S|.

Attributes: pure

fortran
subroutine wall_model_solve_convective(h, us, ts, ps, tw, px, nc, dyc, cc, rc, ftau, R, cp, pr, mu0, tref, suth, omega_mu, tau, q, semilocal)

Arguments

NameTypeIntentAttributesDescription
hreal(kind=R8P)inHeight, parallel speed, temperature and pressure of the sample.
usreal(kind=R8P)inHeight, parallel speed, temperature and pressure of the sample.
tsreal(kind=R8P)inHeight, parallel speed, temperature and pressure of the sample.
psreal(kind=R8P)inHeight, parallel speed, temperature and pressure of the sample.
twreal(kind=R8P)inWall temperature.
pxreal(kind=R8P)inPressure gradient along the sample velocity.
ncinteger(kind=I4P)inCells with a convection, 0 to WM_CONV_CELLS.
dycreal(kind=R8P)inCell spacing along the normal.
ccreal(kind=R8P)inConvection along the sample velocity at the centres of cells 1 to nc.
rcreal(kind=R8P)inResolved shear stress at the centres of cells 1 to nc, 0 for none.
ftaulogicalinThe velocity scale of the eddy viscosity from tau_w alone.
Rreal(kind=R8P)inGas constant, specific heat, Prandtl number.
cpreal(kind=R8P)inGas constant, specific heat, Prandtl number.
prreal(kind=R8P)inGas constant, specific heat, Prandtl number.
mu0real(kind=R8P)inViscosity law, as compute_dissipative_flux.
trefreal(kind=R8P)inViscosity law, as compute_dissipative_flux.
suthreal(kind=R8P)inViscosity law, as compute_dissipative_flux.
omega_mureal(kind=R8P)inViscosity law, as compute_dissipative_flux.
taureal(kind=R8P)outWall shear stress (along the sample velocity), wall heat flux.
qreal(kind=R8P)outWall shear stress (along the sample velocity), wall heat flux.
semilocallogicalinoptionalSemi-local damping.

Call graph

wall_model_solve_inverse ​

Return the wall shear stress tau and the heat flux q (k dT/dy at the wall, positive when the gas is hotter than the wall) of an isothermal wall by the model of Griffin, Fu & Moin (2023, JFM 970 A36): the strain of the constant-property layer at the same semi-local height, S_t = 1 / (1 + kappa y* D^2), D = 1 - exp(-y* / A+), y* = y sqrt(rho tau) / mu, mapped to the compressible one by the inverse total-stress-based transformation (their Eq. 2.2), with the temperature from the matching-anchored Reynolds analogy (Eq. 2.5) T = Tw + s Pr (Tr - Tw) (U / Ue) (1 - U / Us) + (U / Us)^2 (Ts - Tw), Tr = Te + Pr^(1/3) Ue^2 / (2 cp), s 1.14; so q = s cp tau (Tr - Tw) / Ue. Ue, Te: the state at the edge of the layer (the channel centre), given.

Eq. 2.2 written for the physical strain g = dU/dy, its property gradients through T(U): with E = (1 / S_t - 1) mu_w / mu, F = sqrt(rho / rho_w), K = tau F / mu, beta = (dT/dU) (1/2 + d ln mu / d ln T) / T (ideal gas at uniform pressure; the slope is omega_mu, less T / (T + S) under Sutherland), F beta y g^2 - (E + F + K beta y) g + K = 0; its positive root when beta < 0 (the other is negative), else the one nearer K / (E + F), the strain without the gradients (the exact tau / mu of the laminar layer, where the equation also holds the spurious root 1 / (beta y) of dy*/dy = 0). The layer is integrated from the wall on the stretched grid of wall_model_solve, each interval exact for 1 / g linear in y (the viscous and the log layer), corrected WM_SUBITERATIONS times, then shot on ln(tau) to the sample speed.

Attributes: pure

fortran
subroutine wall_model_solve_inverse(h, us, ts, ps, tw, ue, te, R, cp, pr, mu0, tref, suth, omega_mu, tau, q)

Arguments

NameTypeIntentAttributesDescription
hreal(kind=R8P)inHeight, parallel speed, temperature and pressure of the sample.
usreal(kind=R8P)inHeight, parallel speed, temperature and pressure of the sample.
tsreal(kind=R8P)inHeight, parallel speed, temperature and pressure of the sample.
psreal(kind=R8P)inHeight, parallel speed, temperature and pressure of the sample.
twreal(kind=R8P)inWall temperature.
uereal(kind=R8P)inSpeed and temperature at the edge of the layer.
tereal(kind=R8P)inSpeed and temperature at the edge of the layer.
Rreal(kind=R8P)inGas constant, specific heat, Prandtl number.
cpreal(kind=R8P)inGas constant, specific heat, Prandtl number.
prreal(kind=R8P)inGas constant, specific heat, Prandtl number.
mu0real(kind=R8P)inViscosity law, as compute_dissipative_flux.
trefreal(kind=R8P)inViscosity law, as compute_dissipative_flux.
suthreal(kind=R8P)inViscosity law, as compute_dissipative_flux.
omega_mureal(kind=R8P)inViscosity law, as compute_dissipative_flux.
taureal(kind=R8P)outWall shear stress, wall heat flux.
qreal(kind=R8P)outWall shear stress, wall heat flux.

Call graph

Functions ​

wall_eddy_viscosity ​

The eddy viscosity of the layer, kappa y sqrt(rho tau_w) D^2, D = 1 - exp(-y+ / A+) with y+ = y sqrt(tau_w rho_w) / mu_w (wall units) or, semilocal, y* = y sqrt(rho tau_w) / mu (local density and viscosity): the mu_t of wall_model_solve, at the height y of a cell below the matching height with that cell's density and viscosity (issue #119, wall_model_eddy_viscosity).

Attributes: pure

Returns: real(kind=R8P)

fortran
function wall_eddy_viscosity(y, rho, mu, tau, rhow, muw, semilocal) result(mt)

Arguments

NameTypeIntentAttributesDescription
yreal(kind=R8P)inHeight, density and viscosity of the cell.
rhoreal(kind=R8P)inHeight, density and viscosity of the cell.
mureal(kind=R8P)inHeight, density and viscosity of the cell.
taureal(kind=R8P)inWall shear stress.
rhowreal(kind=R8P)inDensity and viscosity at the wall.
muwreal(kind=R8P)inDensity and viscosity at the wall.
semilocallogicalinSemi-local damping.

Call graph

forcing_at ​

The forcing of wall_model_solve_convective at the height yy: linear between the knots yk(0:nk), constant beyond the last.

Attributes: pure

Returns: real(kind=R8P)

fortran
function forcing_at(yy, nk, yk, fk) result(f)

Arguments

NameTypeIntentAttributesDescription
yyreal(kind=R8P)inHeight.
nkinteger(kind=I4P)inLast knot.
ykreal(kind=R8P)inKnots.
fkreal(kind=R8P)inForcing at the knots.

Call graph

inverse_layer_speed ​

The speed at the height h of the layer of wall stress tau of the inverse model (wall_model_solve_inverse).

Attributes: pure

Returns: real(kind=R8P)

fortran
function inverse_layer_speed(h, tau, us, ts, ps, tw, c1, R, mu0, tref, suth, omega_mu) result(u)

Arguments

NameTypeIntentAttributesDescription
hreal(kind=R8P)inHeight, wall stress, sample speed, temperature, pressure, wall temperature.
taureal(kind=R8P)inHeight, wall stress, sample speed, temperature, pressure, wall temperature.
usreal(kind=R8P)inHeight, wall stress, sample speed, temperature, pressure, wall temperature.
tsreal(kind=R8P)inHeight, wall stress, sample speed, temperature, pressure, wall temperature.
psreal(kind=R8P)inHeight, wall stress, sample speed, temperature, pressure, wall temperature.
twreal(kind=R8P)inHeight, wall stress, sample speed, temperature, pressure, wall temperature.
c1real(kind=R8P)indT/dU at the wall.
Rreal(kind=R8P)inGas constant, viscosity law.
mu0real(kind=R8P)inGas constant, viscosity law.
trefreal(kind=R8P)inGas constant, viscosity law.
suthreal(kind=R8P)inGas constant, viscosity law.
omega_mureal(kind=R8P)inGas constant, viscosity law.

Call graph

inverse_strain ​

The strain dU/dy at the height y and speed u of the layer of wall stress tau of the inverse model (wall_model_solve_inverse).

Attributes: pure

Returns: real(kind=R8P)

fortran
function inverse_strain(y, u, tau, us, ts, ps, tw, c1, R, mu0, tref, suth, omega_mu) result(g)

Arguments

NameTypeIntentAttributesDescription
yreal(kind=R8P)inHeight, speed, wall stress, sample speed, temperature, pressure, wall temperature.
ureal(kind=R8P)inHeight, speed, wall stress, sample speed, temperature, pressure, wall temperature.
taureal(kind=R8P)inHeight, speed, wall stress, sample speed, temperature, pressure, wall temperature.
usreal(kind=R8P)inHeight, speed, wall stress, sample speed, temperature, pressure, wall temperature.
tsreal(kind=R8P)inHeight, speed, wall stress, sample speed, temperature, pressure, wall temperature.
psreal(kind=R8P)inHeight, speed, wall stress, sample speed, temperature, pressure, wall temperature.
twreal(kind=R8P)inHeight, speed, wall stress, sample speed, temperature, pressure, wall temperature.
c1real(kind=R8P)indT/dU at the wall.
Rreal(kind=R8P)inGas constant, viscosity law.
mu0real(kind=R8P)inGas constant, viscosity law.
trefreal(kind=R8P)inGas constant, viscosity law.
suthreal(kind=R8P)inGas constant, viscosity law.
omega_mureal(kind=R8P)inGas constant, viscosity law.

Call graph

log_mean_inverse ​

The mean of 1 / c(y) over an interval where c is linear between a and b.

Attributes: pure

Returns: real(kind=R8P)

fortran
function log_mean_inverse(a, b) result(r)

Arguments

NameTypeIntentAttributesDescription
areal(kind=R8P)inEnd values.
breal(kind=R8P)inEnd values.

Call graph