# Multi-Scale Localized Perturbation Method in OpenFOAM
## 2 Materials and Methods
### Governing Equations  
The MSLPM is applied to the governing equations of stratified turbulent flow in order to determine the equations of motion for the background fields and perturbation fields. Beginning with the incompressible unsteady Reynolds-averaged Navier-Stokes equations and a scalar transport equation for temperature \(T\), as given in Equations (6)-(8), below. Here, \(\vec{U}\) is the velocity  
Figure 1: Example of an application of multi-scale localized perturbation method (MSLPM) using nested domains. Here, one could simulate meso-scale wind pattern, including the affects of a nearby mountain range, and then perform a micro-scale simulation of a wind turbine site localized within the meso-scale domain. vector; \(\
u\), kinematic viscosity; \(\overline{R}\), Reynolds stress tensor; \(p\), deviation from the hydrostatic pressure; \(\rho_{0}\), constant reference density; \(\rho\), density of the fluid; \(\vec{g}\), gravity vector; and, \(\kappa\), molecular diffusivity of temperature. An eddy diffusivity model, such that turbulent diffusivity \(\kappa_{t}\propto\
u_{t}\), where \(\
u_{t}\) is the eddy viscosity, is used in order to close the turbulent fluxes for \(T\). The divergence of the Reynolds stress tensor accounts for the average affect of turbulent fluctuations on the mean flow. \[\
abla\cdot\vec{U} =0 \tag{6}\] \[\frac{\partial\vec{U}}{\partial t}+\vec{U}\cdot\
abla\vec{U}-\
u \
abla^{2}\vec{U} =-\frac{1}{\rho_{0}}\
abla p-\
abla\cdot\overline{R}+\frac{\rho- \rho_{0}}{\rho_{0}}\vec{g}\] (7) \[\frac{\partial T}{\partial t}+\vec{U}\cdot\
abla T-\
abla\cdot([ \kappa+\kappa_{t}]\
abla T) =0 \tag{8}\]  
The total fields are then decomposed into their background and perturbation components following the MSLPM, which results in two sets of equations, with the first set describing the motion of the background fields given in Equations (9)-(11) and the second set describing the motion of the perturbation fields, including any non-linear interaction between the background and perturbation fields, in Equations (12)-(14). A linear equation of state, as defined in Equations (15)-(17), is used, where the thermal expansion coefficient of seawater \(\beta\) is taken as \(-2.1\times 10^{-4}\ ^{\circ}\mathrm{C}/\mathrm{m}\). Equation (18) gives the Brunt-Vaisala frequency \(N\) in terms of both density and temperature. \[\
abla\cdot\vec{U}_{b} =0 \tag{9}\] \[\frac{\partial\vec{U}_{b}}{\partial t}+\vec{U}_{b}\cdot\
abla\vec {U}_{b}-\
u\
abla^{2}\vec{U}_{b} =-\frac{1}{\rho_{0}}\
abla p_{b}-\
abla\cdot\overline{R}_{b}+ \frac{\rho_{b}-\rho_{0}}{\rho_{0}}\vec{g}\] (10) \[\frac{\partial T_{b}}{\partial t}+\vec{U}_{b}\cdot\
abla T_{b}- \
abla\cdot([\kappa+\kappa_{tb}]\
abla T_{b}) =0 \tag{11}\]  
\[\
abla\cdot\delta\vec{U} =0 \tag{12}\] \[\frac{\partial\delta\vec{U}}{\partial t}+\left(\vec{U}_{b}+ \delta\vec{U}\right)\cdot\
abla\delta\vec{U}-\
u\
abla^{2}\delta\vec{U} =-\frac{1}{\rho_{0}}\
abla\delta p-\
abla\cdot\delta\overline{R }+\frac{\delta\rho}{\rho_{0}}\vec{g}-\delta\vec{U}\cdot\
abla\vec{U}_{b}\] (13) \[\frac{\partial\delta T}{\partial t}+\left(\vec{U}_{b}+\delta\vec {U}\right)\cdot\
abla\delta T-\
abla\cdot([\kappa+\kappa_{tb}+\delta\kappa_{ t}]\
abla\delta T) =-\delta\vec{U}\cdot\
abla T_{b}+\
abla\cdot(\delta\kappa_{t} \
abla T_{b}) \tag{14}\]  
\[\
abla\cdot\vec{U} =0 \tag{6}\]0 \[\
abla\cdot\vec{U} =0 \tag{6}\]1 (16) \[\
abla\cdot\vec{U} =0 \tag{6}\]2  
\[\
abla\cdot\vec{U} =0 \tag{6}\]3  
The buoyant \(k-\epsilon\) turbulence model is used in order to close the turbulent momentum fluxes [17]. This model is an extension to the popular \(k-\epsilon\) model, and it accounts for the effects of buoyancy through a source term in both the \(k\) and \(\epsilon\) equations [18]. While this model is not the most realistic for geophysical turbulence, it was chosen for its speed in the case presented here.