Peano
Loading...
Searching...
No Matches
ForcingTerms.cpph
Go to the documentation of this file.
1#pragma once
2
4
11 // frequency
12 static constexpr double omega = 0.011; // in rad/s
13 static constexpr double xZero = 450'000; // in m
14 static constexpr double zZero = 12'000; // in m
15 static constexpr double tZero = 2'000; // in s
16
17 static constexpr double kX = 0.00011; // in rad/m
18
19 static constexpr double sigmaXSq = 30'000 * 30'000; // in m
20 static constexpr double sigmaZSq = 4'000 * 4'000; // in m
21 static constexpr double sigmaTSq = 600 * 600; // in s
22
23 // forcing velocity
24 static constexpr double FZero = 0.33; // 0.33m/s
25
27 [[maybe_unused]] const double* const __restrict__ Q,
28 [[maybe_unused]] const tarch::la::Vector<DIMENSIONS, double>& x,
29 [[maybe_unused]] const tarch::la::Vector<DIMENSIONS, double>& h,
30 [[maybe_unused]] const double t,
31 [[maybe_unused]] double* const __restrict__ S
32 ) {
33 const double exponentialXTerm = tarch::la::pow((x(0) - xZero), 2) / (2 * sigmaXSq);
34 const double exponentialYTerm = tarch::la::pow((x(1) - zZero), 2) / (2 * sigmaZSq);
35 const double exponentialTTerm = tarch::la::pow((t - tZero), 2) / (2 * sigmaTSq);
36 const double cosTerm = std::cos(kX * x(0)) * std::cos(omega * t);
37
38#if !defined(WITH_GPU)
39 assertion1(!std::isnan(exponentialXTerm), exponentialXTerm);
40 assertion1(!std::isnan(exponentialYTerm), exponentialYTerm);
41 assertion1(!std::isnan(exponentialTTerm), exponentialTTerm);
42 assertion1(!std::isnan(FZero), FZero);
43 assertion1(!std::isnan(cosTerm), cosTerm);
44#endif
45
46 // 0: rho, 2: rhov
47 S[2] += Q[0] * FZero * tarch::la::pow(tarch::la::E, -exponentialXTerm - exponentialYTerm - exponentialTTerm)
48 * cosTerm;
49 ;
50 }
51} // namespace applications::exahype2::GravityWaves::Thunderstorm::ForcingTerms
static constexpr double omega
The following scenario definition is taken from: "Breaking of thunderstorm-generated gravity waves as...
void scenario(const double *const __restrict__ Q, const tarch::la::Vector< DIMENSIONS, double > &x, const tarch::la::Vector< DIMENSIONS, double > &h, const double t, double *const __restrict__ S)