(wall_model_IBM)= # Wall Model - IBM This is the second of the two coupling routes introduced on the {ref}`LBM boundary-condition page `. Use it when the solid surface is an immersed STL body that does not align with the Cartesian lattice, which is the common case in CWE: the curved roofs, inclined facades and sharp edges of buildings and vehicles. The wall function is the same as for the boundary-condition route; the difference is that here the modeled stress is applied as a velocity correction, spread back to the fluid through the immersed-boundary interpolation rather than written directly into a wall-node tensor. To couple the wall model to fluid flow simulation, the immersed boundary method (IBM) operates with a velocity correction calculated from the selected {ref}`wall function `. From the Lagrangian mesh, some auxiliary points must be defined as illustrated below ( {footcite:t}`shi2019wall`, {footcite:t}`du2022wall`, {footcite:t}`wang2024wall`): ```{figure} /_static/img/theory/wall_model/ibm_wall_model.svg --- align: center width: 50% --- ``` where the point P is the reference point $\mathrm{P_{N}}$ at normal direction in which the velocity will be linearly interpolated from nearest points. It is usual to fix a distance $H$ of at least $3\Delta x$ from the wall, which will be located in a point external to IBM diffusive layer. ```{admonition} A subtle trap: keep the reference point outside the diffusive layer --- class: warning --- P must sit beyond the IBM diffusive layer, where the velocity field is already free of the spreading kernel's smoothing. Sampling P inside that layer reads a velocity the immersed-boundary forcing has artificially damped, so the wall function is fed a corrupted matching-point state. The $H \geq 3\Delta x$ rule of thumb places P clear of the layer. ``` This velocity profile between P and the wall is modeled and the velocity at Q is calculated. The distance from W to Q is usually fixed $h=0.1 - 0.25\Delta x$. The point Q is also distanced from the wall towards normal direction and is an auxiliary point where a calculated velocity will be imposed. The correction will be applied using an interpolation-spread procedure from IBM at Q point. ```{admonition} Activate the wall model only after the flow has settled --- class: important --- Let the simulation reach a stable flow with the standard IBM before switching on the wall model. Once activated, the wall model replaces the standard IBM, which ceases execution. Enabling it on a transient start-up field feeds the wall function an unconverged matching-point state. ``` Hence the algorithm for the WM-IB-LBM executes the following sequence of operations: - Reference velocity $\mathbf{u}$ is interpolated at P using a linear interpolation between nearest nodes and decomposed in its tangential $t$ and normal $n$ components with: $$ \mathbf{u}_{n} = \left(\mathbf{u}\cdot \mathbf{n}\right)\mathbf{n} $$ (wm_normal_velocity) $$ \mathbf{u}_{t} = \mathbf{u}-\mathbf{u}_{n} $$ (wm_tangential_velocity) - The magnitude of $\mathbf{u}_{t}$ is then assumed as $u_{\mathrm{t,P_{N}}}$ and replaced in the {ref}`wall function ` for the calculation of tangential velocity at Q. Concretely, for the log-law closure the friction velocity is recovered from the matching-point tangential velocity via {math:numref}`wm_friction_velocity_log`, $$ u^{*} = \kappa\, u_{\mathrm{t,P_{N}}} \left[\mathrm{ln}\left(\frac{z_{\mathrm{P_{N}}}}{z_{0}}\right)\right]^{-1}, $$ and the tangential velocity at the near-wall point Q follows from evaluating the log law {math:numref}`wm_velocity_terrain` at $z_{\mathrm{Q}}$: $$ u_{\mathrm{t,Q}} = \frac{u^{*}}{\kappa}\,\mathrm{ln}\left(\frac{z_{\mathrm{Q}}}{z_{0}}\right). $$ - The magnitude from $u_{\mathrm{t,Q}}$ is multiplied by the unit vector $\mathbf{u}_{t}/ |\mathbf{u}_{t}|$ to obtain $\mathbf{u}_{\mathrm{t,Q}}$ - The normal velocity at Q is given by a quadratic relation ({footcite:t}`du2022wall`): $$ \mathbf{u}_{\mathrm{n,Q}}=\left(\frac{h}{H}\right)^{2}\mathbf{u}_{n} $$ (wm_normal_velocity_q) - Then, the target velocity at Q is given by $\mathbf{u}_{\mathrm{Q}}=\mathbf{u}_{\mathrm{t,Q}}+\mathbf{u}_{\mathrm{n,Q}}$. - The velocity correction is implemented using a traditional interpolation-spread procedure from Q. % The implementation of a wall model using the immersed boundary method (IBM) follows the same principles as that from the regularized bounce-back BC. % The friction velocity is calculated using the log-law of the wall: % .. math:: % u^{*}=\frac{\kappa u\left(\mathbf{x}_{1,\mathrm{out}}\right)}{\mathrm{ln}\left(y/y_{0}\right)} % :label: wm_ibm_friction_velocity % where :math:`\kappa=0.41` is the Von Karman constant, :math:`u\left(\mathbf{x}_{1,\mathrm{out}}\right)` is the tangential to surface velocity after the diffusive layer from IBM (which is where the IB forces are spread into), consisted of the blue nodes in the figure below: % .. figure:: /_static/img/theory/wall_model/ibm_wall_model.svg % :width: 50% % :align: center % The velocity at the reference point is found using IBM interpolation. % The subgrid viscosity of the nodes contained within the IBM diffusive layer is then adjusted using the Van Driest damping function :footcite:t:`ma2019dynamic`: % .. math:: % \nu_{\mathrm{SGS}}=\nu \kappa y_{n}^{+}\left(1- e^{-y_{n}^{+}/A}\right)^{2} % :label: wm_ibm_sgs_viscosity % where :math:`A=19`, and :math:`y_{n}^{+}` denotes the normal distance to the wall on local wall viscosity units. % For this adjustment with IBM, a spreading operation of the subgrid viscosity is performed as: % .. math:: % \nu_{\mathrm{SGS}}=\sum_{\mathrm{fluid\;nodes}}\nu_{\mathrm{SGS}}\left(r_{n}\right)\phi_{1}\left(r_{t}\right) % :label: wm_viscosity_spread % where :math:`\nu_{\mathrm{SGS}}\left(r_{n}\right)` is the subgrid viscosity calculated with the normal distance from the Lagrangian node, and :math:`\phi_{1}\left(r_{t}\right)` is a 1-point kernel function with :math:`r_{t}` being the tangential distance to the referred Lagrangian node: % .. math:: % \phi\left(r\right)= % \begin{cases} % 1 - |r| & \text{, $|r| \leq 1.0$}\\ % 0 & \text{, $1.0\leq |r|$}\\ % \end{cases} % :label: wm_deltaf % The distance between LBM grid node :math:`\mathbf{x}` and IB mesh point :math:`\mathbf{X}` is given by :math:`\mathbf{r}=\mathbf{x}-\mathbf{X}`. % The normal distance is :math:`r_{n}=\mathbf{r}\cdot\mathbf{n}`, and tangential distance :math:`r_{t}=|\mathbf{r}-r_{n}\mathbf{n}|`. ```{eval-rst} .. footbibliography:: ```