/home/runner/work/amr-wind/amr-wind/amr-wind/boundary_conditions/wall_models/MOSD.H Source File

AMR-Wind API: /home/runner/work/amr-wind/amr-wind/amr-wind/boundary_conditions/wall_models/MOSD.H Source File
AMR-Wind API v0.1.0
CFD solver for wind plant simulations
Loading...
Searching...
No Matches
MOSD.H
Go to the documentation of this file.
1#ifndef MOSD_H
2#define MOSD_H
3
4#include "AMReX_AmrCore.H"
5#include <AMReX.H>
6namespace amr_wind {
7struct MOSD
8{
9 /*
10 * A dynamic wall model that calculates the stress from wave to wind
11 * based on geometric information of the wave.
12 */
13
14 amrex::Real amplitude{0.05};
15 amrex::Real wavenumber{4};
16 amrex::Real omega{0.8};
17 amrex::Real time;
18
19 AMREX_GPU_HOST_DEVICE AMREX_FORCE_INLINE amrex::Real get_dyn_tau(
20 const amrex::Real u_dx,
21 const amrex::Real v_dx,
22 const amrex::Real xc,
23 const amrex::Real unit_nor) const
24 {
25
26 // Building the wave surface, gradients, wave velocities and unit normal
27 const amrex::Real dx_eta_wave =
28 -amplitude * wavenumber * std::sin(wavenumber * xc - omega * time);
29 const amrex::Real dy_eta_wave = 0;
30 const amrex::Real dt_eta_wave =
31 amplitude * omega * std::sin(wavenumber * xc - omega * time);
32 const amrex::Real grad_eta_wave =
33 std::sqrt(dx_eta_wave * dx_eta_wave + dy_eta_wave * dy_eta_wave);
34 const amrex::Real Cx_wave =
35 -dt_eta_wave * dx_eta_wave * (1 / (grad_eta_wave * grad_eta_wave));
36 const amrex::Real Cy_wave =
37 -dt_eta_wave * dy_eta_wave * (1 / (grad_eta_wave * grad_eta_wave));
38 const amrex::Real n_x = dx_eta_wave / grad_eta_wave;
39 const amrex::Real n_y = dy_eta_wave / grad_eta_wave;
40
41 // Calculating the relative velocity, heaviside function
42 const amrex::Real u_r = u_dx - Cx_wave;
43 const amrex::Real v_r = v_dx - Cy_wave;
44 const amrex::Real ur_mag =
45 std::sqrt(u_r * u_r * n_x * n_x + v_r * v_r * n_y * n_y);
46 const amrex::Real Heavi_arg = (u_r * dx_eta_wave + v_r * dy_eta_wave);
47 const amrex::Real Heavi =
48 (Heavi_arg + std::abs(Heavi_arg)) / (2 * Heavi_arg);
49
50 // Calculating the magnitude of the stress
51 return (1 / M_PI) * ur_mag * ur_mag * grad_eta_wave * grad_eta_wave *
52 Heavi * (unit_nor == 0 ? n_x : n_y);
53 }
54};
55
56} // namespace amr_wind
57#endif /* MOSD_H */
Definition BCInterface.cpp:7
Definition MOSD.H:8
AMREX_GPU_HOST_DEVICE AMREX_FORCE_INLINE amrex::Real get_dyn_tau(const amrex::Real u_dx, const amrex::Real v_dx, const amrex::Real xc, const amrex::Real unit_nor) const
Definition MOSD.H:19
amrex::Real wavenumber
Definition MOSD.H:15
amrex::Real omega
Definition MOSD.H:16
amrex::Real time
Definition MOSD.H:17
amrex::Real amplitude
Definition MOSD.H:14