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