1 #ifndef ERF_CLOUD_CHAMBER_WALL_FLUX_H_
2 #define ERF_CLOUD_CHAMBER_WALL_FLUX_H_
4 #include <AMReX_Array4.H>
6 #include <AMReX_GpuContainers.H>
7 #include <AMReX_Math.H>
8 #include <AMReX_MultiFab.H>
21 #include <type_traits>
42 amrex::Real
C_D = amrex::Real(0.0);
43 amrex::Real
C_H = amrex::Real(0.0);
44 amrex::Real
C_E = amrex::Real(0.0);
45 amrex::Real
u_star = amrex::Real(0.0);
46 amrex::Real
zeta = amrex::Real(0.0);
51 amrex::Real
zeta = amrex::Real(0.0);
63 amrex::Real
rho = amrex::Real(0.0);
65 amrex::Real
p_hse = amrex::Real(0.0);
66 amrex::Real
U_t = amrex::Real(0.0);
69 amrex::Real
dx_inv = amrex::Real(0.0);
70 amrex::Real
rdOcp = amrex::Real(0.0);
74 amrex::Real
qv_air = amrex::Real(0.0);
79 amrex::Real
log_m = amrex::Real(0.0);
80 amrex::Real
C_D = amrex::Real(0.0);
81 amrex::Real
u_star = amrex::Real(0.0);
85 amrex::Real
rho = amrex::Real(0.0);
86 amrex::GpuArray<amrex::Real, AMREX_SPACEDIM>
u_t{};
87 amrex::Real
U_t = amrex::Real(0.0);
90 amrex::Real
qv_air = amrex::Real(0.0);
91 amrex::Real
p_hse = amrex::Real(0.0);
92 amrex::Real
rdOcp = amrex::Real(0.0);
101 static_assert(std::is_trivially_copyable_v<WallFlux>);
102 static_assert(std::is_standard_layout_v<WallFlux>);
103 static_assert(std::is_trivially_copyable_v<FaceRuntimeCoefficients>);
104 static_assert(std::is_standard_layout_v<FaceRuntimeCoefficients>);
105 static_assert(std::is_trivially_copyable_v<MostStabilityResult>);
106 static_assert(std::is_standard_layout_v<MostStabilityResult>);
107 static_assert(std::is_trivially_copyable_v<ScalarWallSample>);
108 static_assert(std::is_standard_layout_v<ScalarWallSample>);
109 static_assert(std::is_trivially_copyable_v<NeutralLogMomentumState>);
110 static_assert(std::is_standard_layout_v<NeutralLogMomentumState>);
111 static_assert(std::is_trivially_copyable_v<MomentumWallSample>);
112 static_assert(std::is_standard_layout_v<MomentumWallSample>);
113 static_assert(std::is_trivially_copyable_v<ScalarFluxReplacement>);
114 static_assert(std::is_standard_layout_v<ScalarFluxReplacement>);
116 AMREX_GPU_HOST_DEVICE
121 return wall.heat_uses_most();
124 AMREX_GPU_HOST_DEVICE
129 return wall.vapor_uses_most();
132 AMREX_GPU_HOST_DEVICE
137 return wall.momentum_uses_most() || wall.heat_uses_most() || wall.vapor_uses_most();
140 AMREX_GPU_HOST_DEVICE
151 AMREX_GPU_HOST_DEVICE
169 AMREX_GPU_HOST_DEVICE
180 return wall.thermal.mode != ThermalMode::LegacyNumerical;
183 return wall.moisture != MoistureMode::LegacyNumerical;
191 AMREX_GPU_HOST_DEVICE
210 AMREX_GPU_HOST_DEVICE
218 AMREX_GPU_HOST_DEVICE
220 NeutralLogMomentumState
222 amrex::Real wall_distance,
223 amrex::Real z0_m) noexcept
225 const amrex::Real log_m = std::log(wall_distance / z0_m);
226 const amrex::Real k_over_log =
KAPPA / log_m;
227 return {log_m, k_over_log * k_over_log, k_over_log * U_t};
230 AMREX_GPU_HOST_DEVICE
235 amrex::Real z0_scalar) noexcept
237 const amrex::Real log_m = std::log(wall_distance / z0_m);
238 const amrex::Real log_s = std::log(wall_distance / z0_scalar);
242 AMREX_GPU_HOST_DEVICE
249 AMREX_IF_ON_DEVICE((AMREX_DEVICE_PRINTF(
"%s\n",
message);))
250 #if defined(AMREX_USE_CUDA)
251 AMREX_IF_ON_DEVICE((__trap();))
253 AMREX_IF_ON_DEVICE((__builtin_trap();))
255 AMREX_IF_ON_HOST((amrex::Abort(
message); std::abort();))
259 AMREX_GPU_HOST_DEVICE
264 amrex::Real D_s) noexcept
267 constexpr amrex::Real tolerance = amrex::Real(1.0e-3);
268 if (Ri > amrex::Real(0.0)) {
271 [=] AMREX_GPU_HOST_DEVICE(
272 amrex::Real
z) noexcept -> amrex::GpuArray<amrex::Real, 3> {
275 const amrex::Real A_m = amrex::max(D_m - psi_m, amrex::Real(1.0));
276 const amrex::Real A_s = amrex::max(D_s - psi_s, amrex::Real(1.0));
277 const amrex::Real rhs = Ri * A_m * A_m / A_s;
279 amrex::Math::isfinite(
static_cast<double>(psi_m)) &&
280 amrex::Math::isfinite(
static_cast<double>(psi_s)) &&
281 amrex::Math::isfinite(
static_cast<double>(A_m)) &&
282 amrex::Math::isfinite(
static_cast<double>(A_s)) &&
283 amrex::Math::isfinite(
static_cast<double>(rhs)) &&
284 amrex::Math::isfinite(
static_cast<double>(
z - rhs)),
285 "Cloud Chamber MOST produced a nonfinite stable residual");
286 return {A_m, A_s,
z - rhs};
289 amrex::Math::isfinite(
static_cast<double>(Ri)) &&
290 amrex::Math::isfinite(
static_cast<double>(D_m)) &&
291 amrex::Math::isfinite(
static_cast<double>(D_s)) &&
292 D_m > amrex::Real(0.0) && D_s > amrex::Real(0.0),
293 "Cloud Chamber MOST requires finite positive stable resistances");
295 const auto interpolate = [=] AMREX_GPU_HOST_DEVICE(
296 amrex::Real a, amrex::Real b,
297 amrex::Real fa, amrex::Real fb) noexcept {
299 b > a && b - a <= tolerance && fa <= amrex::Real(0.0) &&
300 fb >= amrex::Real(0.0) && fb > fa &&
301 amrex::Math::isfinite(
static_cast<double>(fb - fa)),
302 "Cloud Chamber MOST requires a certified stable root bracket");
303 const amrex::Real
z = a + (b - a) * (-fa / (fb - fa));
305 amrex::Math::isfinite(
static_cast<double>(
z)) &&
z >= a &&
307 "Cloud Chamber MOST produced an invalid bracket interpolation");
311 amrex::Real seed = amrex::Real(0.0);
312 for (
int iter = 0; iter < 100; ++iter) {
313 const auto value = state(seed);
315 if (value[2] == amrex::Real(0.0)) {
316 return {seed, iterations};
318 const amrex::Real next = seed - amrex::Real(0.5) * value[2];
320 amrex::Math::isfinite(
static_cast<double>(next)),
321 "Cloud Chamber MOST produced a nonfinite stability coordinate");
322 const bool small_update =
323 std::abs(next - seed) <= amrex::Real(0.125) * tolerance;
331 amrex::Real a = amrex::max(amrex::Real(0.0), seed - tolerance);
332 amrex::Real b = seed + tolerance;
335 if (va[2] <= amrex::Real(0.0) && vb[2] >= amrex::Real(0.0)) {
336 for (
int iter = 0; iter < 64; ++iter) {
338 if (va[2] == amrex::Real(0.0)) {
339 return {a, iterations};
341 if (vb[2] == amrex::Real(0.0)) {
342 return {b, iterations};
344 const amrex::Real mid = a + amrex::Real(0.5) * (b - a);
345 if (b - a <= tolerance) {
346 return {interpolate(a, b, va[2], vb[2]), iterations};
350 "Cloud Chamber MOST exhausted stable root precision");
351 const auto vm = state(mid);
352 if (vm[2] < amrex::Real(0.0)) {
365 constexpr
int max_depth = 64;
366 amrex::GpuArray<amrex::Real, max_depth> pending{};
368 amrex::Real unresolved = amrex::Real(-1.0);
369 a = amrex::Real(0.0);
370 b = amrex::max(amrex::Real(1.0), seed);
373 for (
int search = 0; search < 8192; ++search) {
376 amrex::Math::isfinite(
static_cast<double>(a)) &&
377 amrex::Math::isfinite(
static_cast<double>(b)) && b > a &&
378 va[2] <= amrex::Real(0.0),
379 "Cloud Chamber MOST exhausted stable bracket range");
380 if (unresolved >= amrex::Real(0.0)) {
381 const amrex::Real limit = unresolved + tolerance;
384 "Cloud Chamber MOST cannot resolve the stable root branch");
390 if (va[2] == amrex::Real(0.0)) {
391 return {a, iterations};
393 const amrex::Real mid = a + amrex::Real(0.5) * (b - a);
394 if (vb[2] >= amrex::Real(0.0) && b - a <= tolerance) {
395 return {interpolate(a, b, va[2], vb[2]), iterations};
397 const amrex::Real lower_rhs = Ri * va[0] * va[0] / vb[1];
398 const amrex::Real roundoff =
401 amrex::max(b, lower_rhs);
402 if (vb[2] < amrex::Real(0.0) && b - lower_rhs < -roundoff) {
405 b = depth > 0 ? pending[--depth] : amrex::Real(2.0) * b;
406 }
else if (depth < max_depth && mid > a && mid < b) {
407 pending[depth++] = b;
413 b - a <= tolerance && vb[2] < amrex::Real(0.0),
414 "Cloud Chamber MOST exhausted stable root precision");
415 if (unresolved < amrex::Real(0.0)) {
420 b = depth > 0 ? pending[--depth] : amrex::Real(2.0) * b;
423 amrex::Math::isfinite(
static_cast<double>(b)) && b > a,
424 "Cloud Chamber MOST exhausted stable bracket range");
428 false,
"Cloud Chamber MOST exhausted stable root search budget");
429 return {std::numeric_limits<amrex::Real>::quiet_NaN(), -iterations};
432 amrex::Real zeta = amrex::Real(0.0);
433 bool converged =
false;
435 constexpr
int max_iters = 100;
436 for (
int iter = 0; iter < max_iters; ++iter) {
437 const amrex::Real zeta_old = zeta;
438 const amrex::Real psi_m = sfuns.
calc_psi_m2(zeta_old);
439 const amrex::Real psi_s = sfuns.
calc_psi_h2(zeta_old);
440 const amrex::Real A_m = amrex::max(D_m - psi_m, amrex::Real(1.0));
441 const amrex::Real A_s = amrex::max(D_s - psi_s, amrex::Real(1.0));
442 const amrex::Real zeta_new = amrex::Real(0.5) * zeta_old +
443 amrex::Real(0.5) * Ri * A_m * A_m / A_s;
445 amrex::Math::isfinite(
static_cast<double>(zeta_new)),
446 "Cloud Chamber MOST produced a nonfinite stability coordinate");
448 iterations = iter + 1;
449 if (std::abs(zeta - zeta_old) <= amrex::Real(1.0e-3)) {
455 converged,
"Cloud Chamber MOST fixed-point iteration did not converge");
456 return {zeta, iterations};
459 AMREX_GPU_HOST_DEVICE
466 const amrex::Real e = wall.wetness *
erf_esatw(wall.thermal.temperature_K);
470 AMREX_GPU_HOST_DEVICE
472 FaceRuntimeCoefficients
475 amrex::Real theta_air,
480 amrex::Real wall_distance,
481 int gravity_sign) noexcept
485 const bool most_momentum = wall.momentum_uses_most();
488 if (!(most_momentum || most_heat || most_vapor)) {
493 amrex::Real qv_wall = qv_air;
494 if (wall.vapor_is_wet()) {
497 const bool adiabatic = wall.thermal.mode == ThermalMode::Adiabatic;
498 amrex::Real delta_theta_v;
502 delta_theta_v = theta_air *
epsv * (qv_air - qv_wall);
504 const amrex::Real theta_wall = wall.thermal.temperature_K *
506 const amrex::Real theta_v_air = theta_air * (amrex::Real(1.0) +
epsv * qv_air);
507 const amrex::Real theta_v_wall = theta_wall * (amrex::Real(1.0) +
epsv * qv_wall);
508 delta_theta_v = theta_v_air - theta_v_wall;
510 const amrex::Real U_most = amrex::max(U_t, amrex::Real(0.01));
511 const amrex::Real Ri_b = gravity_sign == 0 ? amrex::Real(0.0) :
512 amrex::Real(gravity_sign) *
CONST_GRAV * wall_distance / theta_air *
513 delta_theta_v / (U_most * U_most);
514 const amrex::Real Ri = amrex::max(amrex::Real(-4.0),
515 amrex::min(amrex::Real(4.0), Ri_b));
517 const amrex::Real z0_m = wall.momentum.z0_m;
518 const amrex::Real z0_q = wall.vapor.z0 > amrex::Real(0.0) ?
519 wall.vapor.z0 : z0_m;
520 const amrex::Real D_m = std::log(wall_distance / z0_m);
522 const amrex::Real D_h = wall.heat_is_conductive() && wall.heat.z0 > amrex::Real(0.0) ?
523 std::log(wall_distance / wall.heat.z0) : D_m;
524 const amrex::Real D_q = std::log(wall_distance / z0_q);
529 const amrex::Real D_stability = most_heat ? D_h : (most_vapor ? D_q : D_m);
531 const amrex::Real zeta = stability.zeta;
533 stability.iterations > 0 &&
534 amrex::Math::isfinite(
static_cast<double>(zeta)),
535 "Cloud Chamber MOST returned an uncertified stability coordinate");
540 const amrex::Real A_m = amrex::max(D_m - psi_m, amrex::Real(1.0));
541 const amrex::Real A_h = amrex::max(D_h - psi_h, amrex::Real(1.0));
542 const amrex::Real A_q = amrex::max(D_q - psi_h, amrex::Real(1.0));
546 result.u_star =
KAPPA * U_most / A_m;
550 amrex::Math::isfinite(
static_cast<double>(result.C_D)) &&
551 amrex::Math::isfinite(
static_cast<double>(result.C_H)) &&
552 amrex::Math::isfinite(
static_cast<double>(result.C_E)),
553 "Cloud Chamber MOST produced nonfinite transfer coefficients");
557 AMREX_GPU_HOST_DEVICE
559 amrex::GpuArray<amrex::Real, AMREX_SPACEDIM>
563 const amrex::Real factor =
564 -sample.rho * neutral.C_D * sample.U_t;
565 return {factor * sample.u_t[0],
566 factor * sample.u_t[1],
567 factor * sample.u_t[2]};
570 AMREX_GPU_HOST_DEVICE
575 amrex::Real dx_inv) noexcept
577 return coefficient * U_t * dx_inv;
581 AMREX_GPU_HOST_DEVICE
589 return (amrex::Real(3.0) + std::sqrt(amrex::Real(2.0))) / amrex::Real(2.0);
599 AMREX_GPU_HOST_DEVICE
603 AMREX_SPACEDIM>& rates) noexcept
608 amrex::Real modeled = 0, resolved = 0;
609 bool combined =
false;
610 for (
int dir = 0; dir < AMREX_SPACEDIM; ++dir) {
611 if (dir != component) {
612 modeled += rates[dir].modeled;
613 resolved += rates[dir].resolved;
614 combined |= rates[dir].combined;
617 return combined ? modeled + resolved : modeled;
620 AMREX_GPU_HOST_DEVICE
630 amrex::Real C_D = amrex::Real(0.0);
631 const amrex::Real wall_distance = amrex::Real(0.5) / dx_inv;
633 MomentumModel::ResolvedNoSlip) {
634 if (wall.
momentum.
model == MomentumModel::NeutralRoughnessLog) {
650 AMREX_GPU_HOST_DEVICE
670 AMREX_GPU_HOST_DEVICE
679 AMREX_GPU_HOST_DEVICE
696 AMREX_GPU_HOST_DEVICE AMREX_FORCE_INLINE
698 amrex::Real U_t, amrex::Real dx_inv, amrex::Real z0_m,
699 amrex::Real most_coefficient) noexcept
702 amrex::Real rate = 0;
703 switch (scalar.model) {
704 case ScalarModel::ResolvedMolecular:
705 sum += scalar.resolved_speed * dx_inv;
707 case ScalarModel::BulkAero: {
708 const auto C = scalar.provider == CoefficientProvider::MOST ?
709 most_coefficient : scalar.coefficient;
713 combined |= scalar.molecular_speed > 0;
716 case ScalarModel::NeutralRoughnessLog:
718 amrex::Real(0.5) / dx_inv, z0_m, scalar.z0), U_t, dx_inv);
725 AMREX_GPU_HOST_DEVICE AMREX_FORCE_INLINE
732 template <
int DIR,
bool HIGH>
733 AMREX_GPU_HOST_DEVICE
740 amrex::ignore_unused(DIR);
741 return HIGH ? -inward : inward;
744 template <
int DIR,
bool HIGH>
745 AMREX_GPU_HOST_DEVICE
747 amrex::GpuArray<amrex::Real, AMREX_SPACEDIM>
749 amrex::Real tangent_a,
750 amrex::Real tangent_b) noexcept
754 amrex::GpuArray<amrex::Real, AMREX_SPACEDIM> result{};
755 result[DIR] = to_coordinate_flux<DIR,HIGH>(normal_in);
756 if constexpr (DIR == 0) {
757 result[1] = tangent_a;
758 result[2] = tangent_b;
759 }
else if constexpr (DIR == 1) {
760 result[0] = tangent_a;
761 result[2] = tangent_b;
763 result[0] = tangent_a;
764 result[1] = tangent_b;
769 AMREX_GPU_HOST_DEVICE
775 amrex::Real wall_temperature_K,
776 amrex::Real theta_air,
779 amrex::Real molecular_speed = amrex::Real(0)) noexcept
781 const amrex::Real theta_wall =
782 wall_temperature_K * std::pow(
p_0 / p_hse,
rdOcp);
783 return (
rho * C_H * U_t +
rho * molecular_speed) * (theta_wall - theta_air);
786 AMREX_GPU_HOST_DEVICE
795 amrex::Real molecular_speed = amrex::Real(0)) noexcept
797 const amrex::Real qv_wall =
wet_wall_qv(wall, p_hse);
798 return (
rho * C_E * U_t +
rho * molecular_speed) * (qv_wall - qv_air);
801 AMREX_GPU_HOST_DEVICE
803 amrex::GpuArray<amrex::Real, AMREX_SPACEDIM>
805 int dir,
int i,
int j,
int k,
806 const amrex::Array4<const amrex::Real>& u,
807 const amrex::Array4<const amrex::Real>& v,
808 const amrex::Array4<const amrex::Real>& w,
811 const amrex::Real uc =
812 amrex::Real(0.5) * (u(i,j,k) + u(i+1,j,k)) - wall.
wall_velocity[0];
813 const amrex::Real vc =
814 amrex::Real(0.5) * (v(i,j,k) + v(i,j+1,k)) - wall.
wall_velocity[1];
815 const amrex::Real wc =
816 amrex::Real(0.5) * (w(i,j,k) + w(i,j,k+1)) - wall.
wall_velocity[2];
817 amrex::GpuArray<amrex::Real, AMREX_SPACEDIM> result{uc, vc, wc};
818 result[dir] = amrex::Real(0.0);
822 AMREX_GPU_HOST_DEVICE
826 const amrex::GpuArray<amrex::Real, AMREX_SPACEDIM>& u_t) noexcept
828 return std::sqrt(u_t[0]*u_t[0] + u_t[1]*u_t[1] + u_t[2]*u_t[2]);
831 AMREX_GPU_HOST_DEVICE
836 const amrex::Array4<const amrex::Real>& u,
837 const amrex::Array4<const amrex::Real>& v,
838 const amrex::Array4<const amrex::Real>& w,
845 AMREX_GPU_HOST_DEVICE
850 const amrex::Array4<const amrex::Real>& velocity,
853 const amrex::Real uc = velocity(i,j,k,0) - wall.
wall_velocity[0];
854 const amrex::Real vc = velocity(i,j,k,1) - wall.
wall_velocity[1];
855 const amrex::Real wc = velocity(i,j,k,2) - wall.
wall_velocity[2];
856 const amrex::Real normal = (dir == 0) ? uc : ((dir == 1) ? vc : wc);
857 const amrex::Real
t0 = uc - ((dir == 0) ? normal : amrex::Real(0.0));
858 const amrex::Real t1 = vc - ((dir == 1) ? normal : amrex::Real(0.0));
859 const amrex::Real t2 = wc - ((dir == 2) ? normal : amrex::Real(0.0));
860 return std::sqrt(
t0*
t0 + t1*t1 + t2*t2);
865 AMREX_GPU_HOST_DEVICE
870 const amrex::GpuArray<amrex::Real, AMREX_SPACEDIM>& dx_inv,
871 const amrex::Array4<const amrex::Real>& velocity) noexcept
874 const amrex::IntVect cell(i,j,k);
875 amrex::GpuArray<DirectionalMomentumRate, AMREX_SPACEDIM> momentum{};
877 for (
int dir = 0; dir < AMREX_SPACEDIM; ++dir) {
878 for (
int side = 0; side < 2; ++side) {
879 if (cell[dir] != (side ? domain.bigEnd(dir) : domain.smallEnd(dir))) {
continue; }
880 const auto& wall = walls[2*dir+side];
881 const auto inv = dx_inv[dir];
888 wall, velocity(i,j,k,3), velocity(i,j,k,4), velocity(i,j,k,5),
889 velocity(i,j,k,6), U_t, amrex::Real(0.5) / inv, dir == 2 ? 1-2*side : 0);
907 auto rate = amrex::max(heat.max_rate(), vapor.max_rate());
908 for (
int component = 0; component < AMREX_SPACEDIM; ++component) {
914 AMREX_GPU_HOST_DEVICE
920 amrex::Real wall_temperature_K,
921 amrex::Real theta_air,
924 amrex::Real
rdOcp) noexcept
926 const amrex::Real theta_wall =
927 wall_temperature_K * std::pow(
p_0 / p_hse,
rdOcp);
928 return rho * alpha_T * (theta_wall - theta_air) *
929 amrex::Real(2.0) * dx_inv;
932 AMREX_GPU_HOST_DEVICE
941 amrex::Real dx_inv) noexcept
943 const amrex::Real qv_wall =
wet_wall_qv(wall, p_hse);
944 return rho * alpha_C * (qv_wall - qv_air) *
945 amrex::Real(2.0) * dx_inv;
948 AMREX_GPU_HOST_DEVICE
959 case MomentumModel::ResolvedNoSlip:
961 case MomentumModel::NeutralRoughnessLog: {
965 result.traction_on_fluid =
969 case MomentumModel::BulkAero: {
971 if (sample.U_t == amrex::Real(0.0)) {
return result; }
975 wall, sample.theta_air, sample.qv_air, sample.p_hse,
976 sample.rdOcp, sample.U_t, sample.wall_distance,
977 sample.gravity_sign);
982 result.traction_on_fluid = {
983 factor * sample.u_t[0], factor * sample.u_t[1], factor * sample.u_t[2]};
991 AMREX_GPU_HOST_DEVICE
1012 if (sample.U_t == amrex::Real(0.0) &&
1017 case ScalarModel::ResolvedMolecular:
1028 case ScalarModel::BulkAero: {
1032 wall, sample.theta_air, sample.qv_air, sample.p_hse,
1033 sample.rdOcp, sample.U_t, sample.wall_distance,
1034 sample.gravity_sign);
1048 case ScalarModel::NeutralRoughnessLog:
1052 sample.wall_distance,
1067 if (sample.U_t == amrex::Real(0.0) &&
1072 case ScalarModel::ResolvedMolecular:
1082 case ScalarModel::BulkAero: {
1086 wall, sample.theta_air, sample.qv_air, sample.p_hse,
1087 sample.rdOcp, sample.U_t, sample.wall_distance,
1088 sample.gravity_sign);
1101 case ScalarModel::NeutralRoughnessLog:
1105 sample.wall_distance,
1127 AMREX_GPU_HOST_DEVICE
1134 return flux.rhoTheta_in;
1136 return flux.rhoQv_in;
1138 return flux.rhoQc_in;
1140 return amrex::Real(0.0);
1143 return amrex::Real(0.0);
1148 AMREX_GPU_HOST_DEVICE AMREX_FORCE_INLINE
1156 if (!bands.offsets || !uses_temperature) {
1159 const int row = k - bands.k_lo;
1160 auto panel_wall = wall;
1161 amrex::Real inward = 0;
1162 for (
int n = bands.offsets[row]; n < bands.offsets[row+1]; ++n) {
1163 const auto panel = bands.panels[n];
1170 template <
int DIR,
bool HIGH>
1171 AMREX_GPU_HOST_DEVICE
1173 ScalarFluxReplacement
1175 amrex::Real old_flux,
1176 amrex::Real inward_flux,
1177 amrex::Real dx_inv) noexcept
1179 const amrex::Real new_flux =
1180 to_coordinate_flux<DIR,HIGH>(inward_flux);
1181 const amrex::Real correction =
1182 (new_flux - old_flux) * dx_inv;
1185 HIGH ? -correction : correction
1189 template <
int DIR,
bool HIGH>
1192 const amrex::Box& domain,
1194 const int flux_comp,
1195 const amrex::Array4<const amrex::Real>& state,
1196 const amrex::Array4<const amrex::Real>& prim,
1197 const amrex::Array4<const amrex::Real>& base_state,
1198 const amrex::Array4<const amrex::Real>& u,
1199 const amrex::Array4<const amrex::Real>& v,
1200 const amrex::Array4<const amrex::Real>& w,
1201 const amrex::Array4<amrex::Real>& rhs,
1202 const amrex::Array4<amrex::Real>& xflux,
1203 const amrex::Array4<amrex::Real>& yflux,
1204 const amrex::Array4<amrex::Real>& zflux,
1205 const amrex::GpuArray<amrex::Real, AMREX_SPACEDIM>& dx_inv,
1207 const amrex::Real alpha_T,
1208 const amrex::Real alpha_C,
1209 const amrex::Real
rdOcp,
1215 if constexpr (HIGH) {
1216 if (bx.bigEnd(DIR) != domain.bigEnd(DIR)) {
return; }
1218 if (bx.smallEnd(DIR) != domain.smallEnd(DIR)) {
return; }
1225 const auto wall = walls[2*DIR + (HIGH ? 1 : 0)];
1231 const int cell_face = HIGH ? domain.bigEnd(DIR) : domain.smallEnd(DIR);
1232 amrex::Box face_cells = bx;
1233 face_cells.setSmall(DIR, cell_face);
1234 face_cells.setBig(DIR, cell_face);
1235 face_cells &= domain;
1236 if (face_cells.isEmpty()) {
return; }
1241 (DIR == 0) ? xflux : ((DIR == 1) ? yflux : zflux);
1244 [=] AMREX_GPU_DEVICE (
int i,
int j,
int k) noexcept
1246 const int fi = HIGH && DIR == 0 ? i + 1 : i;
1247 const int fj = HIGH && DIR == 1 ? j + 1 : j;
1248 const int fk = HIGH && DIR == 2 ? k + 1 : k;
1250 const amrex::Real old_flux = flux(
fi,fj,fk,flux_comp);
1251 const ScalarWallSample sample{
1253 prim(i,j,k,prim_comp),
1262 amrex::Real(0.5) / dx_inv[DIR],
1265 DIR == 2 ? (HIGH ? -1 : 1) : 0
1270 const ScalarFluxReplacement update =
1271 scalar_flux_replacement<DIR,HIGH>(old_flux, inward, dx_inv[DIR]);
1273 flux(
fi,fj,fk,flux_comp) = update.coordinate_flux;
1274 rhs(i,j,k,quantity) += update.rhs_delta;
1278 inline void apply (
const amrex::Box& bx,
const amrex::Box& domain,
1279 const int quantity,
const int flux_comp,
1280 const amrex::Array4<const amrex::Real>& state,
1281 const amrex::Array4<const amrex::Real>& prim,
1282 const amrex::Array4<const amrex::Real>& base_state,
1283 const amrex::Array4<const amrex::Real>& u,
1284 const amrex::Array4<const amrex::Real>& v,
1285 const amrex::Array4<const amrex::Real>& w,
1286 const amrex::Array4<amrex::Real>& rhs,
1287 const amrex::Array4<amrex::Real>& xflux,
1288 const amrex::Array4<amrex::Real>& yflux,
1289 const amrex::Array4<amrex::Real>& zflux,
1290 const amrex::GpuArray<amrex::Real, AMREX_SPACEDIM>& dx_inv,
1292 const amrex::Real alpha_T,
const amrex::Real alpha_C,
1293 const amrex::Real
rdOcp,
1294 const bool cloudy =
false,
1297 apply_face<0,false>(bx,domain,quantity,flux_comp,state,prim,base_state,u,v,w,rhs,xflux,yflux,zflux,dx_inv,walls,alpha_T,alpha_C,
rdOcp,cloudy,bands[0]);
1298 apply_face<0,true >(bx,domain,quantity,flux_comp,state,prim,base_state,u,v,w,rhs,xflux,yflux,zflux,dx_inv,walls,alpha_T,alpha_C,
rdOcp,cloudy,bands[1]);
1299 apply_face<1,false>(bx,domain,quantity,flux_comp,state,prim,base_state,u,v,w,rhs,xflux,yflux,zflux,dx_inv,walls,alpha_T,alpha_C,
rdOcp,cloudy,bands[2]);
1300 apply_face<1,true >(bx,domain,quantity,flux_comp,state,prim,base_state,u,v,w,rhs,xflux,yflux,zflux,dx_inv,walls,alpha_T,alpha_C,
rdOcp,cloudy,bands[3]);
1301 apply_face<2,false>(bx,domain,quantity,flux_comp,state,prim,base_state,u,v,w,rhs,xflux,yflux,zflux,dx_inv,walls,alpha_T,alpha_C,
rdOcp,cloudy);
1302 apply_face<2,true >(bx,domain,quantity,flux_comp,state,prim,base_state,u,v,w,rhs,xflux,yflux,zflux,dx_inv,walls,alpha_T,alpha_C,
rdOcp,cloudy);
1308 for (
const auto& wall : walls) {
1320 amrex::Real wall_cfl = amrex::Real(0.5)) noexcept
1322 return max_rate > amrex::Real(0.0) ?
1323 wall_cfl / max_rate : amrex::Real(1.0e30);
constexpr amrex::Real epsv
Definition: ERF_Constants.H:56
constexpr amrex::Real KAPPA
Definition: ERF_Constants.H:71
constexpr amrex::Real p_0
Definition: ERF_Constants.H:69
constexpr amrex::Real CONST_GRAV
Definition: ERF_Constants.H:72
#define PrimQ1_comp
Definition: ERF_IndexDefines.H:94
#define PrimQ2_comp
Definition: ERF_IndexDefines.H:95
#define Rho_comp
Definition: ERF_IndexDefines.H:61
#define RhoTheta_comp
Definition: ERF_IndexDefines.H:62
#define RhoQ2_comp
Definition: ERF_IndexDefines.H:79
#define PrimTheta_comp
Definition: ERF_IndexDefines.H:91
#define RhoQ1_comp
Definition: ERF_IndexDefines.H:78
const Real rdOcp
Definition: ERF_InitCustomPert_ABL.H:128
AMREX_ALWAYS_ASSERT(bx.length()[2]==khi+1)
AMREX_GPU_HOST_DEVICE AMREX_FORCE_INLINE amrex::Real erf_qsat_from_esat(amrex::Real esat, amrex::Real p)
Definition: ERF_MicrophysicsUtils.H:234
AMREX_GPU_HOST_DEVICE AMREX_FORCE_INLINE amrex::Real erf_esatw(amrex::Real t, bool use_empirical=false)
Definition: ERF_MicrophysicsUtils.H:160
ParallelFor(fab_box, [=] AMREX_GPU_DEVICE(int i, int j, int k) { qrcuten_arr(i, j, k)=Real(0);qscuten_arr(i, j, k)=Real(0);qicuten_arr(i, j, k)=Real(0);})
@ p0_comp
Definition: ERF_IndexDefines.H:110
@ fi
Definition: ERF_AdvanceMorrison.cpp:109
@ rho
Definition: ERF_Kessler.H:25
Definition: ERF_ConsoleIO.cpp:17
Definition: ERF_CloudChamberWallFlux.H:23
AMREX_GPU_HOST_DEVICE AMREX_FORCE_INLINE bool owns(const WallFlux &flux, ScalarChannel channel) noexcept
Definition: ERF_CloudChamberWallFlux.H:213
AMREX_GPU_HOST_DEVICE AMREX_FORCE_INLINE amrex::Real tangential_magnitude(const amrex::GpuArray< amrex::Real, AMREX_SPACEDIM > &u_t) noexcept
Definition: ERF_CloudChamberWallFlux.H:825
AMREX_GPU_HOST_DEVICE AMREX_FORCE_INLINE amrex::Real bulk_vapor_flux_in(amrex::Real rho, amrex::Real C_E, amrex::Real U_t, const erf_wall_thermodynamics::FaceWall &wall, amrex::Real qv_air, amrex::Real p_hse, amrex::Real molecular_speed=amrex::Real(0)) noexcept
Definition: ERF_CloudChamberWallFlux.H:789
AMREX_GPU_HOST_DEVICE AMREX_FORCE_INLINE WallFlux evaluate_momentum_traction(const erf_wall_thermodynamics::FaceWall &wall, const MomentumWallSample &sample) noexcept
Definition: ERF_CloudChamberWallFlux.H:951
AMREX_GPU_HOST_DEVICE AMREX_FORCE_INLINE amrex::Real wet_wall_qv(const erf_wall_thermodynamics::FaceWall &wall, amrex::Real p_hse) noexcept
Definition: ERF_CloudChamberWallFlux.H:462
AMREX_GPU_HOST_DEVICE AMREX_FORCE_INLINE amrex::Real resolved_vapor_flux_in(amrex::Real rho, amrex::Real alpha_C, const erf_wall_thermodynamics::FaceWall &wall, amrex::Real qv_air, amrex::Real p_hse, amrex::Real dx_inv) noexcept
Definition: ERF_CloudChamberWallFlux.H:935
AMREX_GPU_HOST_DEVICE AMREX_FORCE_INLINE MostStabilityResult most_stability_coordinate(amrex::Real Ri, amrex::Real D_m, amrex::Real D_s) noexcept
Definition: ERF_CloudChamberWallFlux.H:262
AMREX_GPU_HOST_DEVICE AMREX_FORCE_INLINE amrex::Real tangential_speed_cell_centered(int dir, int i, int j, int k, const amrex::Array4< const amrex::Real > &velocity, const erf_wall_thermodynamics::FaceWall &wall) noexcept
Definition: ERF_CloudChamberWallFlux.H:848
AMREX_GPU_HOST_DEVICE AMREX_FORCE_INLINE amrex::Real momentum_row_sum_rate(int component, const amrex::GpuArray< DirectionalMomentumRate, AMREX_SPACEDIM > &rates) noexcept
Definition: ERF_CloudChamberWallFlux.H:602
bool has_velocity_dependent_scalar_wall(const erf_wall_thermodynamics::Boundary &walls) noexcept
Definition: ERF_CloudChamberWallFlux.H:1305
AMREX_GPU_HOST_DEVICE AMREX_FORCE_INLINE amrex::Real neutral_log_scalar_coefficient(amrex::Real wall_distance, amrex::Real z0_m, amrex::Real z0_scalar) noexcept
Definition: ERF_CloudChamberWallFlux.H:233
AMREX_GPU_HOST_DEVICE AMREX_FORCE_INLINE WallFlux evaluate_scalar_flux_in(const erf_wall_thermodynamics::FaceWall &wall, ScalarChannel channel, const ScalarWallSample &sample) noexcept
Definition: ERF_CloudChamberWallFlux.H:994
AMREX_GPU_HOST_DEVICE AMREX_FORCE_INLINE NeutralLogMomentumState neutral_log_momentum_state(amrex::Real U_t, amrex::Real wall_distance, amrex::Real z0_m) noexcept
Definition: ERF_CloudChamberWallFlux.H:221
AMREX_FORCE_INLINE amrex::Real wall_dt_from_max_rate(amrex::Real max_rate, amrex::Real wall_cfl=amrex::Real(0.5)) noexcept
Definition: ERF_CloudChamberWallFlux.H:1319
AMREX_GPU_HOST_DEVICE AMREX_FORCE_INLINE void most_stability_require(bool condition, const char *message) noexcept
Definition: ERF_CloudChamberWallFlux.H:245
AMREX_GPU_HOST_DEVICE AMREX_FORCE_INLINE amrex::Real evaluate_face_scalar_flux_in(const erf_wall_thermodynamics::FaceWall &wall, ScalarChannel channel, const ScalarWallSample &sample, const erf_wall_thermodynamics::TemperatureBandView &bands, int k) noexcept
Definition: ERF_CloudChamberWallFlux.H:1149
AMREX_GPU_HOST_DEVICE AMREX_FORCE_INLINE bool wall_rate_requires_tangential_speed(const erf_wall_thermodynamics::FaceWall &wall) noexcept
Definition: ERF_CloudChamberWallFlux.H:682
AMREX_GPU_HOST_DEVICE AMREX_FORCE_INLINE amrex::GpuArray< amrex::Real, AMREX_SPACEDIM > traction_from_local_inward(amrex::Real normal_in, amrex::Real tangent_a, amrex::Real tangent_b) noexcept
Definition: ERF_CloudChamberWallFlux.H:748
AMREX_GPU_HOST_DEVICE AMREX_FORCE_INLINE amrex::Real to_coordinate_flux(amrex::Real inward) noexcept
Definition: ERF_CloudChamberWallFlux.H:736
AMREX_GPU_HOST_DEVICE AMREX_FORCE_INLINE amrex::GpuArray< amrex::Real, AMREX_SPACEDIM > relative_tangential_velocity_cell_centered(int dir, int i, int j, int k, const amrex::Array4< const amrex::Real > &u, const amrex::Array4< const amrex::Real > &v, const amrex::Array4< const amrex::Real > &w, const erf_wall_thermodynamics::FaceWall &wall) noexcept
Definition: ERF_CloudChamberWallFlux.H:804
AMREX_GPU_HOST_DEVICE AMREX_FORCE_INLINE bool requires_tangential_speed(const erf_wall_thermodynamics::FaceWall &wall, ScalarChannel channel) noexcept
Definition: ERF_CloudChamberWallFlux.H:653
ScalarChannel
Definition: ERF_CloudChamberWallFlux.H:55
AMREX_GPU_HOST_DEVICE AMREX_FORCE_INLINE FaceRuntimeCoefficients most_wall_coefficients(const erf_wall_thermodynamics::FaceWall &wall, amrex::Real theta_air, amrex::Real qv_air, amrex::Real p_hse, amrex::Real rdOcp, amrex::Real U_t, amrex::Real wall_distance, int gravity_sign) noexcept
Definition: ERF_CloudChamberWallFlux.H:473
AMREX_GPU_HOST_DEVICE AMREX_FORCE_INLINE amrex::GpuArray< amrex::Real, AMREX_SPACEDIM > neutral_log_traction_on_fluid(const MomentumWallSample &sample, const NeutralLogMomentumState &neutral) noexcept
Definition: ERF_CloudChamberWallFlux.H:560
AMREX_GPU_HOST_DEVICE AMREX_FORCE_INLINE amrex::Real resolved_theta_flux_in(amrex::Real rho, amrex::Real alpha_T, amrex::Real wall_temperature_K, amrex::Real theta_air, amrex::Real p_hse, amrex::Real dx_inv, amrex::Real rdOcp) noexcept
Definition: ERF_CloudChamberWallFlux.H:917
AMREX_GPU_HOST_DEVICE AMREX_FORCE_INLINE ScalarChannel scalar_channel_from_quantity(int quantity) noexcept
Definition: ERF_CloudChamberWallFlux.H:143
AMREX_GPU_HOST_DEVICE AMREX_FORCE_INLINE amrex::Real scalar_flux_in(const WallFlux &flux, ScalarChannel channel) noexcept
Definition: ERF_CloudChamberWallFlux.H:1130
AMREX_GPU_HOST_DEVICE AMREX_FORCE_INLINE unsigned char scalar_channel_mask(ScalarChannel channel) noexcept
Definition: ERF_CloudChamberWallFlux.H:194
void apply(const amrex::Box &bx, const amrex::Box &domain, const int quantity, const int flux_comp, const amrex::Array4< const amrex::Real > &state, const amrex::Array4< const amrex::Real > &prim, const amrex::Array4< const amrex::Real > &base_state, const amrex::Array4< const amrex::Real > &u, const amrex::Array4< const amrex::Real > &v, const amrex::Array4< const amrex::Real > &w, const amrex::Array4< amrex::Real > &rhs, const amrex::Array4< amrex::Real > &xflux, const amrex::Array4< amrex::Real > &yflux, const amrex::Array4< amrex::Real > &zflux, const amrex::GpuArray< amrex::Real, AMREX_SPACEDIM > &dx_inv, const erf_wall_thermodynamics::Boundary &walls, const amrex::Real alpha_T, const amrex::Real alpha_C, const amrex::Real rdOcp, const bool cloudy=false, const erf_wall_thermodynamics::SidewallBandViews &bands={})
Definition: ERF_CloudChamberWallFlux.H:1278
AMREX_GPU_HOST_DEVICE AMREX_FORCE_INLINE bool wall_uses_most_heat(const erf_wall_thermodynamics::FaceWall &wall) noexcept
Definition: ERF_CloudChamberWallFlux.H:119
AMREX_GPU_HOST_DEVICE AMREX_FORCE_INLINE amrex::Real wall_rate_for_cell(int i, int j, int k, const amrex::Box &domain, const erf_wall_thermodynamics::Boundary &walls, const amrex::GpuArray< amrex::Real, AMREX_SPACEDIM > &dx_inv, const amrex::Array4< const amrex::Real > &velocity) noexcept
Definition: ERF_CloudChamberWallFlux.H:868
AMREX_GPU_HOST_DEVICE AMREX_FORCE_INLINE amrex::Real momentum_rate_for_face(const erf_wall_thermodynamics::FaceWall &wall, amrex::Real U_t, amrex::Real dx_inv, const FaceRuntimeCoefficients &runtime=FaceRuntimeCoefficients{}) noexcept
Definition: ERF_CloudChamberWallFlux.H:623
AMREX_GPU_HOST_DEVICE AMREX_FORCE_INLINE bool wall_owns_scalar_channel(const erf_wall_thermodynamics::FaceWall &wall, ScalarChannel channel) noexcept
Definition: ERF_CloudChamberWallFlux.H:172
AMREX_GPU_HOST_DEVICE AMREX_FORCE_INLINE bool wall_uses_most_vapor(const erf_wall_thermodynamics::FaceWall &wall) noexcept
Definition: ERF_CloudChamberWallFlux.H:127
OwnedChannel
Definition: ERF_CloudChamberWallFlux.H:25
@ OwnVapor
Definition: ERF_CloudChamberWallFlux.H:29
@ OwnNone
Definition: ERF_CloudChamberWallFlux.H:26
@ OwnHeat
Definition: ERF_CloudChamberWallFlux.H:28
@ OwnCloudWater
Definition: ERF_CloudChamberWallFlux.H:30
@ OwnMomentum
Definition: ERF_CloudChamberWallFlux.H:27
AMREX_GPU_HOST_DEVICE AMREX_FORCE_INLINE amrex::Real neutral_scalar_rate(amrex::Real coefficient, amrex::Real U_t, amrex::Real dx_inv) noexcept
Definition: ERF_CloudChamberWallFlux.H:573
AMREX_FORCE_INLINE void apply_face(const amrex::Box &bx, const amrex::Box &domain, const int quantity, const int flux_comp, const amrex::Array4< const amrex::Real > &state, const amrex::Array4< const amrex::Real > &prim, const amrex::Array4< const amrex::Real > &base_state, const amrex::Array4< const amrex::Real > &u, const amrex::Array4< const amrex::Real > &v, const amrex::Array4< const amrex::Real > &w, const amrex::Array4< amrex::Real > &rhs, const amrex::Array4< amrex::Real > &xflux, const amrex::Array4< amrex::Real > &yflux, const amrex::Array4< amrex::Real > &zflux, const amrex::GpuArray< amrex::Real, AMREX_SPACEDIM > &dx_inv, const erf_wall_thermodynamics::Boundary &walls, const amrex::Real alpha_T, const amrex::Real alpha_C, const amrex::Real rdOcp, const bool cloudy, const erf_wall_thermodynamics::TemperatureBandView bands={})
Definition: ERF_CloudChamberWallFlux.H:1191
AMREX_GPU_HOST_DEVICE AMREX_FORCE_INLINE int primitive_component(ScalarChannel channel) noexcept
Definition: ERF_CloudChamberWallFlux.H:154
AMREX_GPU_HOST_DEVICE AMREX_FORCE_INLINE amrex::Real bulk_theta_flux_in(amrex::Real rho, amrex::Real C_H, amrex::Real U_t, amrex::Real wall_temperature_K, amrex::Real theta_air, amrex::Real p_hse, amrex::Real rdOcp, amrex::Real molecular_speed=amrex::Real(0)) noexcept
Definition: ERF_CloudChamberWallFlux.H:772
AMREX_GPU_HOST_DEVICE AMREX_FORCE_INLINE bool requires_tangential_momentum(const erf_wall_thermodynamics::FaceWall &wall) noexcept
Definition: ERF_CloudChamberWallFlux.H:673
AMREX_GPU_HOST_DEVICE AMREX_FORCE_INLINE amrex::Real tangential_speed(int dir, int i, int j, int k, const amrex::Array4< const amrex::Real > &u, const amrex::Array4< const amrex::Real > &v, const amrex::Array4< const amrex::Real > &w, const erf_wall_thermodynamics::FaceWall &wall) noexcept
Definition: ERF_CloudChamberWallFlux.H:834
AMREX_GPU_HOST_DEVICE AMREX_FORCE_INLINE ScalarFluxReplacement scalar_flux_replacement(amrex::Real old_flux, amrex::Real inward_flux, amrex::Real dx_inv) noexcept
Definition: ERF_CloudChamberWallFlux.H:1174
AMREX_GPU_HOST_DEVICE AMREX_FORCE_INLINE amrex::Real momentum_infinity_row_sum_factor() noexcept
Definition: ERF_CloudChamberWallFlux.H:584
AMREX_GPU_HOST_DEVICE AMREX_FORCE_INLINE bool wall_uses_most(const erf_wall_thermodynamics::FaceWall &wall) noexcept
Definition: ERF_CloudChamberWallFlux.H:135
Definition: ERF_WallThermodynamics.H:10
amrex::GpuArray< TemperatureBandView, 4 > SidewallBandViews
Definition: ERF_WallThermodynamics.H:63
amrex::GpuArray< FaceWall, 2 *AMREX_SPACEDIM > Boundary
Definition: ERF_WallThermodynamics.H:133
real(c_double), parameter t0
Definition: ERF_module_model_constants.F90:39
real(c_double), parameter epsilon
Definition: ERF_module_model_constants.F90:12
Definition: ERF_MOSTStress.H:20
Definition: ERF_CloudChamberWallFlux.H:691
amrex::Real sum
Definition: ERF_CloudChamberWallFlux.H:693
AMREX_GPU_HOST_DEVICE AMREX_FORCE_INLINE void add(const erf_wall_thermodynamics::ScalarTransfer &scalar, amrex::Real U_t, amrex::Real dx_inv, amrex::Real z0_m, amrex::Real most_coefficient) noexcept
Definition: ERF_CloudChamberWallFlux.H:697
bool combined
Definition: ERF_CloudChamberWallFlux.H:694
AMREX_GPU_HOST_DEVICE AMREX_FORCE_INLINE amrex::Real max_rate() const noexcept
Definition: ERF_CloudChamberWallFlux.H:726
amrex::Real max_wall_law
Definition: ERF_CloudChamberWallFlux.H:692
Definition: ERF_CloudChamberWallFlux.H:593
amrex::Real resolved
Definition: ERF_CloudChamberWallFlux.H:595
bool combined
Definition: ERF_CloudChamberWallFlux.H:596
amrex::Real modeled
Definition: ERF_CloudChamberWallFlux.H:594
Definition: ERF_CloudChamberWallFlux.H:41
amrex::Real C_E
Definition: ERF_CloudChamberWallFlux.H:44
amrex::Real C_H
Definition: ERF_CloudChamberWallFlux.H:43
unsigned char valid
Definition: ERF_CloudChamberWallFlux.H:47
amrex::Real C_D
Definition: ERF_CloudChamberWallFlux.H:42
amrex::Real zeta
Definition: ERF_CloudChamberWallFlux.H:46
amrex::Real u_star
Definition: ERF_CloudChamberWallFlux.H:45
Definition: ERF_CloudChamberWallFlux.H:84
amrex::Real rho
Definition: ERF_CloudChamberWallFlux.H:85
amrex::Real U_t
Definition: ERF_CloudChamberWallFlux.H:87
int gravity_sign
Definition: ERF_CloudChamberWallFlux.H:93
amrex::Real wall_distance
Definition: ERF_CloudChamberWallFlux.H:88
amrex::Real p_hse
Definition: ERF_CloudChamberWallFlux.H:91
amrex::Real theta_air
Definition: ERF_CloudChamberWallFlux.H:89
amrex::Real rdOcp
Definition: ERF_CloudChamberWallFlux.H:92
amrex::GpuArray< amrex::Real, AMREX_SPACEDIM > u_t
Definition: ERF_CloudChamberWallFlux.H:86
amrex::Real qv_air
Definition: ERF_CloudChamberWallFlux.H:90
Definition: ERF_CloudChamberWallFlux.H:50
int iterations
Definition: ERF_CloudChamberWallFlux.H:52
amrex::Real zeta
Definition: ERF_CloudChamberWallFlux.H:51
Definition: ERF_CloudChamberWallFlux.H:78
amrex::Real C_D
Definition: ERF_CloudChamberWallFlux.H:80
amrex::Real u_star
Definition: ERF_CloudChamberWallFlux.H:81
amrex::Real log_m
Definition: ERF_CloudChamberWallFlux.H:79
Definition: ERF_CloudChamberWallFlux.H:96
amrex::Real coordinate_flux
Definition: ERF_CloudChamberWallFlux.H:97
amrex::Real rhs_delta
Definition: ERF_CloudChamberWallFlux.H:98
Definition: ERF_CloudChamberWallFlux.H:62
amrex::Real rdOcp
Definition: ERF_CloudChamberWallFlux.H:70
int gravity_sign
Definition: ERF_CloudChamberWallFlux.H:75
amrex::Real scalar_air
Definition: ERF_CloudChamberWallFlux.H:64
amrex::Real qv_air
Definition: ERF_CloudChamberWallFlux.H:74
amrex::Real rho
Definition: ERF_CloudChamberWallFlux.H:63
amrex::Real dx_inv
Definition: ERF_CloudChamberWallFlux.H:69
amrex::Real theta_air
Definition: ERF_CloudChamberWallFlux.H:73
amrex::Real wall_distance
Definition: ERF_CloudChamberWallFlux.H:72
amrex::Real alpha_T
Definition: ERF_CloudChamberWallFlux.H:67
amrex::Real p_hse
Definition: ERF_CloudChamberWallFlux.H:65
amrex::Real alpha_C
Definition: ERF_CloudChamberWallFlux.H:68
amrex::Real U_t
Definition: ERF_CloudChamberWallFlux.H:66
Definition: ERF_CloudChamberWallFlux.H:33
amrex::Real rhoTheta_in
Definition: ERF_CloudChamberWallFlux.H:35
amrex::Real rhoQv_in
Definition: ERF_CloudChamberWallFlux.H:36
unsigned char owned_channels
Definition: ERF_CloudChamberWallFlux.H:38
amrex::Real rhoQc_in
Definition: ERF_CloudChamberWallFlux.H:37
amrex::GpuArray< amrex::Real, AMREX_SPACEDIM > traction_on_fluid
Definition: ERF_CloudChamberWallFlux.H:34
Definition: ERF_WallThermodynamics.H:86
constexpr AMREX_GPU_HOST_DEVICE bool heat_is_conductive() const noexcept
Definition: ERF_WallThermodynamics.H:96
amrex::GpuArray< amrex::Real, AMREX_SPACEDIM > wall_velocity
Definition: ERF_WallThermodynamics.H:93
ScalarTransfer vapor
Definition: ERF_WallThermodynamics.H:92
ScalarTransfer heat
Definition: ERF_WallThermodynamics.H:91
constexpr AMREX_GPU_HOST_DEVICE bool has_wall_rate_channel() const noexcept
Definition: ERF_WallThermodynamics.H:129
constexpr AMREX_GPU_HOST_DEVICE bool vapor_is_wet() const noexcept
Definition: ERF_WallThermodynamics.H:99
MomentumTransfer momentum
Definition: ERF_WallThermodynamics.H:90
ThermalBoundary thermal
Definition: ERF_WallThermodynamics.H:87
constexpr AMREX_GPU_HOST_DEVICE bool vapor_requires_speed() const noexcept
Definition: ERF_WallThermodynamics.H:126
constexpr AMREX_GPU_HOST_DEVICE bool momentum_requires_speed() const noexcept
Definition: ERF_WallThermodynamics.H:120
constexpr AMREX_GPU_HOST_DEVICE bool heat_requires_speed() const noexcept
Definition: ERF_WallThermodynamics.H:123
amrex::Real resolved_row_rate
Definition: ERF_WallThermodynamics.H:72
amrex::Real z0_m
Definition: ERF_WallThermodynamics.H:70
CoefficientProvider provider
Definition: ERF_WallThermodynamics.H:68
amrex::Real C_D
Definition: ERF_WallThermodynamics.H:69
MomentumModel model
Definition: ERF_WallThermodynamics.H:67
amrex::Real molecular_speed
Definition: ERF_WallThermodynamics.H:71
Definition: ERF_WallThermodynamics.H:75
amrex::Real coefficient
Definition: ERF_WallThermodynamics.H:78
CoefficientProvider provider
Definition: ERF_WallThermodynamics.H:77
amrex::Real z0
Definition: ERF_WallThermodynamics.H:79
amrex::Real molecular_speed
Definition: ERF_WallThermodynamics.H:81
ScalarModel model
Definition: ERF_WallThermodynamics.H:76
Definition: ERF_WallThermodynamics.H:57
amrex::Real temperature_K
Definition: ERF_WallThermodynamics.H:46
Definition: ERF_MOSTUtils.H:84
AMREX_GPU_HOST_DEVICE AMREX_FORCE_INLINE amrex::Real calc_psi_h2(amrex::Real zeta) const
Definition: ERF_MOSTUtils.H:121
AMREX_GPU_HOST_DEVICE AMREX_FORCE_INLINE amrex::Real calc_psi_m2(amrex::Real zeta) const
Definition: ERF_MOSTUtils.H:96