/home/runner/work/amr-wind/amr-wind/amr-wind/wind_energy/ShearStress.H Source File

AMR-Wind API: /home/runner/work/amr-wind/amr-wind/amr-wind/wind_energy/ShearStress.H Source File
AMR-Wind API v0.1.0
CFD solver for wind plant simulations
Loading...
Searching...
No Matches
ShearStress.H
Go to the documentation of this file.
1#ifndef ShearStress_H
2#define ShearStress_H
3
5
17namespace amr_wind {
18
20{
22 : utau2(mo.utau * mo.utau)
23 , u_mean(mo.vel_mean[0])
24 , v_mean(mo.vel_mean[1])
25 , wspd_mean(mo.vmag_mean)
27 , theta_surface(mo.surf_temp)
28 , term1(mo.utau * mo.kappa / mo.phi_h())
29 {}
30
31 AMREX_GPU_HOST_DEVICE AMREX_FORCE_INLINE amrex::Real
32 calc_vel_x(amrex::Real /* u */, amrex::Real /* wspd */) const
33 {
34 return u_mean / wspd_mean * utau2;
35 };
36
37 AMREX_GPU_HOST_DEVICE AMREX_FORCE_INLINE amrex::Real
38 calc_vel_y(amrex::Real /* u */, amrex::Real /* wspd */) const
39 {
40 return v_mean / wspd_mean * utau2;
41 };
42
43 AMREX_GPU_HOST_DEVICE AMREX_FORCE_INLINE amrex::Real
44 calc_theta(amrex::Real /* wspd */, amrex::Real /* theta */) const
45 {
46 return term1 * (theta_mean - theta_surface);
47 };
48
49 amrex::Real utau2;
50 amrex::Real u_mean;
51 amrex::Real v_mean;
52 amrex::Real wspd_mean;
53 amrex::Real theta_mean;
54 amrex::Real theta_surface;
55 amrex::Real term1;
56};
57
59{
61 : utau2(mo.utau * mo.utau)
62 , theta_surface(mo.surf_temp)
63 , term1(mo.utau * mo.kappa / mo.phi_h())
64 {}
65
66 AMREX_GPU_HOST_DEVICE AMREX_FORCE_INLINE amrex::Real
67 calc_vel_x(amrex::Real u, amrex::Real wspd) const
68 {
69 return u / amrex::max(wspd, small_vel) * utau2;
70 };
71
72 AMREX_GPU_HOST_DEVICE AMREX_FORCE_INLINE amrex::Real
73 calc_vel_y(amrex::Real v, amrex::Real wspd) const
74 {
75 return v / amrex::max(wspd, small_vel) * utau2;
76 };
77
78 AMREX_GPU_HOST_DEVICE AMREX_FORCE_INLINE amrex::Real
79 calc_theta(amrex::Real /* wspd */, amrex::Real theta) const
80 {
81 return term1 * (theta - theta_surface);
82 };
83
84 amrex::Real utau2;
85 amrex::Real theta_surface;
86 amrex::Real term1;
87 amrex::Real small_vel{1.0e-6};
88};
89
91{
93 : utau2(mo.utau * mo.utau)
94 , wspd_mean(mo.vmag_mean)
95 , theta_surface(mo.surf_temp)
96 , term1(mo.utau * mo.kappa / mo.phi_h())
97 {}
98
99 AMREX_GPU_HOST_DEVICE AMREX_FORCE_INLINE amrex::Real
100 calc_vel_x(amrex::Real u, amrex::Real /* wspd */) const
101 {
102 return u / wspd_mean * utau2;
103 };
104
105 AMREX_GPU_HOST_DEVICE AMREX_FORCE_INLINE amrex::Real
106 calc_vel_y(amrex::Real v, amrex::Real /* wspd */) const
107 {
108 return v / wspd_mean * utau2;
109 };
110
111 AMREX_GPU_HOST_DEVICE AMREX_FORCE_INLINE amrex::Real
112 calc_theta(amrex::Real /* wspd */, amrex::Real theta) const
113 {
114 return term1 * (theta - theta_surface);
115 };
116
117 amrex::Real utau2;
118 amrex::Real wspd_mean;
119 amrex::Real theta_surface;
120 amrex::Real term1;
121};
122
124{
126 : utau2(mo.utau * mo.utau)
127 , u_mean(mo.vel_mean[0])
128 , v_mean(mo.vel_mean[1])
129 , wspd_mean(mo.vmag_mean)
130 , theta_surface(mo.surf_temp)
132 , term1(mo.utau * mo.kappa / (mo.vmag_mean * mo.phi_h()))
133 {}
134
135 AMREX_GPU_HOST_DEVICE AMREX_FORCE_INLINE amrex::Real
136 calc_vel_x(amrex::Real u, amrex::Real wspd) const
137 {
138 return ((u - u_mean) * wspd_mean + wspd * u_mean) /
140 };
141
142 AMREX_GPU_HOST_DEVICE AMREX_FORCE_INLINE amrex::Real
143 calc_vel_y(amrex::Real v, amrex::Real wspd) const
144 {
145 return ((v - v_mean) * wspd_mean + wspd * v_mean) /
147 };
148
149 AMREX_GPU_HOST_DEVICE AMREX_FORCE_INLINE amrex::Real
150 calc_theta(amrex::Real wspd, amrex::Real theta) const
151 {
152 const amrex::Real num1 = (theta - theta_mean) * wspd_mean;
153 const amrex::Real num2 = (theta_mean - theta_surface) * wspd;
154 return term1 * (num1 + num2);
155 };
156
157 amrex::Real utau2;
158 amrex::Real u_mean;
159 amrex::Real v_mean;
160 amrex::Real wspd_mean;
161 amrex::Real theta_surface;
162 amrex::Real theta_mean;
163 amrex::Real term1;
164};
165
167{
169 : wspd_mean(mo.vmag_mean)
171 , theta_surface(mo.surf_temp)
172 , temp_flux_surface(mo.surf_temp_flux)
173 , alg_type(mo.alg_type)
174 {}
175
176 AMREX_GPU_HOST_DEVICE AMREX_FORCE_INLINE amrex::Real
177 calc_vel_x(amrex::Real u, amrex::Real wspd) const
178 {
179 amrex::Real Cd = 0.001;
180 const amrex::Real c = 7e-5;
181 if (wspd_mean <= 5.0) {
182 Cd = 0.001;
183 } else if (wspd_mean < 25.0 && wspd_mean > 5.0) {
184 Cd = 0.001 + c * (wspd_mean - 5.0);
185 } else {
186 Cd = 0.0024;
187 }
188
189 return Cd * u * wspd;
190 }
191
192 AMREX_GPU_HOST_DEVICE AMREX_FORCE_INLINE amrex::Real
193 calc_vel_y(amrex::Real v, amrex::Real wspd) const
194 {
195 amrex::Real Cd = 0.001;
196 const amrex::Real c = 7e-5;
197 if (wspd_mean <= 5) {
198 Cd = 0.001;
199 } else if (wspd_mean < 25.0 && wspd_mean > 5.0) {
200 Cd = 0.001 + c * (wspd_mean - 5);
201 } else {
202 Cd = 0.0024;
203 }
204
205 return Cd * v * wspd;
206 };
207
208 AMREX_GPU_HOST_DEVICE AMREX_FORCE_INLINE amrex::Real
209 calc_theta(amrex::Real /* wspd */, amrex::Real /* theta */) const
210 {
211 amrex::Real flux = 0.0;
212 switch (alg_type) {
214 flux = temp_flux_surface;
215 break;
217 flux = 0.0012 * wspd_mean * (theta_surface - theta_mean);
218 break;
219 }
220 return flux;
221 };
222
223 amrex::Real wspd_mean;
224 amrex::Real theta_mean;
225 amrex::Real theta_surface;
226 amrex::Real temp_flux_surface;
228};
229
230} // namespace amr_wind
231
232#endif /* ShearStress_H */
Definition BCInterface.cpp:7
Definition MOData.H:21
ThetaCalcType
Definition MOData.H:22
@ SURFACE_TEMPERATURE
Surface temperature specified.
@ HEAT_FLUX
Heat-flux specified.
Definition ShearStress.H:20
amrex::Real utau2
Definition ShearStress.H:49
AMREX_GPU_HOST_DEVICE AMREX_FORCE_INLINE amrex::Real calc_vel_y(amrex::Real, amrex::Real) const
Definition ShearStress.H:38
amrex::Real theta_surface
Definition ShearStress.H:54
amrex::Real wspd_mean
Definition ShearStress.H:52
ShearStressConstant(const amr_wind::MOData &mo)
Definition ShearStress.H:21
amrex::Real v_mean
Definition ShearStress.H:51
amrex::Real theta_mean
Definition ShearStress.H:53
AMREX_GPU_HOST_DEVICE AMREX_FORCE_INLINE amrex::Real calc_vel_x(amrex::Real, amrex::Real) const
Definition ShearStress.H:32
amrex::Real term1
Definition ShearStress.H:55
AMREX_GPU_HOST_DEVICE AMREX_FORCE_INLINE amrex::Real calc_theta(amrex::Real, amrex::Real) const
Definition ShearStress.H:44
amrex::Real u_mean
Definition ShearStress.H:50
Definition ShearStress.H:167
amr_wind::MOData::ThetaCalcType alg_type
Definition ShearStress.H:227
amrex::Real wspd_mean
Definition ShearStress.H:223
AMREX_GPU_HOST_DEVICE AMREX_FORCE_INLINE amrex::Real calc_theta(amrex::Real, amrex::Real) const
Definition ShearStress.H:209
amrex::Real theta_surface
Definition ShearStress.H:225
amrex::Real temp_flux_surface
Definition ShearStress.H:226
ShearStressDonelan(const amr_wind::MOData &mo)
Definition ShearStress.H:168
AMREX_GPU_HOST_DEVICE AMREX_FORCE_INLINE amrex::Real calc_vel_x(amrex::Real u, amrex::Real wspd) const
Definition ShearStress.H:177
AMREX_GPU_HOST_DEVICE AMREX_FORCE_INLINE amrex::Real calc_vel_y(amrex::Real v, amrex::Real wspd) const
Definition ShearStress.H:193
amrex::Real theta_mean
Definition ShearStress.H:224
Definition ShearStress.H:59
amrex::Real small_vel
Definition ShearStress.H:87
AMREX_GPU_HOST_DEVICE AMREX_FORCE_INLINE amrex::Real calc_theta(amrex::Real, amrex::Real theta) const
Definition ShearStress.H:79
AMREX_GPU_HOST_DEVICE AMREX_FORCE_INLINE amrex::Real calc_vel_x(amrex::Real u, amrex::Real wspd) const
Definition ShearStress.H:67
AMREX_GPU_HOST_DEVICE AMREX_FORCE_INLINE amrex::Real calc_vel_y(amrex::Real v, amrex::Real wspd) const
Definition ShearStress.H:73
ShearStressLocal(const amr_wind::MOData &mo)
Definition ShearStress.H:60
amrex::Real term1
Definition ShearStress.H:86
amrex::Real theta_surface
Definition ShearStress.H:85
amrex::Real utau2
Definition ShearStress.H:84
Definition ShearStress.H:124
ShearStressMoeng(const amr_wind::MOData &mo)
Definition ShearStress.H:125
amrex::Real theta_surface
Definition ShearStress.H:161
AMREX_GPU_HOST_DEVICE AMREX_FORCE_INLINE amrex::Real calc_theta(amrex::Real wspd, amrex::Real theta) const
Definition ShearStress.H:150
amrex::Real theta_mean
Definition ShearStress.H:162
AMREX_GPU_HOST_DEVICE AMREX_FORCE_INLINE amrex::Real calc_vel_x(amrex::Real u, amrex::Real wspd) const
Definition ShearStress.H:136
amrex::Real utau2
Definition ShearStress.H:157
amrex::Real wspd_mean
Definition ShearStress.H:160
amrex::Real v_mean
Definition ShearStress.H:159
AMREX_GPU_HOST_DEVICE AMREX_FORCE_INLINE amrex::Real calc_vel_y(amrex::Real v, amrex::Real wspd) const
Definition ShearStress.H:143
amrex::Real u_mean
Definition ShearStress.H:158
amrex::Real term1
Definition ShearStress.H:163
Definition ShearStress.H:91
AMREX_GPU_HOST_DEVICE AMREX_FORCE_INLINE amrex::Real calc_vel_y(amrex::Real v, amrex::Real) const
Definition ShearStress.H:106
amrex::Real utau2
Definition ShearStress.H:117
ShearStressSchumann(const amr_wind::MOData &mo)
Definition ShearStress.H:92
AMREX_GPU_HOST_DEVICE AMREX_FORCE_INLINE amrex::Real calc_vel_x(amrex::Real u, amrex::Real) const
Definition ShearStress.H:100
amrex::Real theta_surface
Definition ShearStress.H:119
amrex::Real wspd_mean
Definition ShearStress.H:118
amrex::Real term1
Definition ShearStress.H:120
AMREX_GPU_HOST_DEVICE AMREX_FORCE_INLINE amrex::Real calc_theta(amrex::Real, amrex::Real theta) const
Definition ShearStress.H:112