/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 <numbers>
5#include "AMReX_AmrCore.H"
6#include "AMReX.H"
7#include "AMReX_REAL.H"
8
9using namespace amrex::literals;
10namespace amr_wind {
11struct MOSD
12{
13 /*
14 * A dynamic wall model that calculates the stress from wave to wind
15 * based on geometric information of the wave.
16 */
17
18 amrex::Real amplitude{0.05_rt};
19 amrex::Real wavenumber{4.0_rt};
20 amrex::Real omega{0.8_rt};
21 amrex::Real time;
22
23 AMREX_GPU_HOST_DEVICE AMREX_FORCE_INLINE amrex::Real get_dyn_tau(
24 const amrex::Real u_dx,
25 const amrex::Real v_dx,
26 const amrex::Real xc,
27 const amrex::Real unit_nor) const
28 {
29
30 // Building the wave surface, gradients, wave velocities and unit normal
31 const amrex::Real dx_eta_wave =
33 std::sin((wavenumber * xc) - (omega * time));
34 const amrex::Real dy_eta_wave = 0;
35 const amrex::Real dt_eta_wave =
36 amplitude * omega * std::sin((wavenumber * xc) - (omega * time));
37 const amrex::Real grad_eta_wave = std::sqrt(
38 (dx_eta_wave * dx_eta_wave) + (dy_eta_wave * dy_eta_wave));
39 const amrex::Real Cx_wave = -dt_eta_wave * dx_eta_wave *
40 (1.0_rt / (grad_eta_wave * grad_eta_wave));
41 const amrex::Real Cy_wave = -dt_eta_wave * dy_eta_wave *
42 (1.0_rt / (grad_eta_wave * grad_eta_wave));
43 const amrex::Real n_x = dx_eta_wave / grad_eta_wave;
44 const amrex::Real n_y = dy_eta_wave / grad_eta_wave;
45
46 // Calculating the relative velocity, heaviside function
47 const amrex::Real u_r = u_dx - Cx_wave;
48 const amrex::Real v_r = v_dx - Cy_wave;
49 const amrex::Real ur_mag =
50 std::sqrt((u_r * u_r * n_x * n_x) + (v_r * v_r * n_y * n_y));
51 const amrex::Real Heavi_arg =
52 ((u_r * dx_eta_wave) + (v_r * dy_eta_wave));
53 const amrex::Real Heavi =
54 (Heavi_arg + std::abs(Heavi_arg)) / (2.0_rt * Heavi_arg);
55
56 // Calculating the magnitude of the stress
57 return (1.0_rt / std::numbers::pi_v<amrex::Real>)*ur_mag * ur_mag *
58 grad_eta_wave * grad_eta_wave * Heavi *
59 (unit_nor == 0 ? n_x : n_y);
60 }
61};
62
63} // namespace amr_wind
64#endif /* MOSD_H */
This test case is intended as an evaluation of the momentum advection scheme.
Definition BCInterface.cpp:10
Definition MOSD.H:12
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:23
amrex::Real wavenumber
Definition MOSD.H:19
amrex::Real omega
Definition MOSD.H:20
amrex::Real time
Definition MOSD.H:21
amrex::Real amplitude
Definition MOSD.H:18