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>
19 #include <type_traits>
84 amrex::GpuArray<amrex::Real, AMREX_SPACEDIM>
u_t{};
99 static_assert(std::is_trivially_copyable_v<WallFlux>);
100 static_assert(std::is_standard_layout_v<WallFlux>);
101 static_assert(std::is_trivially_copyable_v<FaceRuntimeCoefficients>);
102 static_assert(std::is_standard_layout_v<FaceRuntimeCoefficients>);
103 static_assert(std::is_trivially_copyable_v<MostStabilityResult>);
104 static_assert(std::is_standard_layout_v<MostStabilityResult>);
105 static_assert(std::is_trivially_copyable_v<ScalarWallSample>);
106 static_assert(std::is_standard_layout_v<ScalarWallSample>);
107 static_assert(std::is_trivially_copyable_v<NeutralLogMomentumState>);
108 static_assert(std::is_standard_layout_v<NeutralLogMomentumState>);
109 static_assert(std::is_trivially_copyable_v<MomentumWallSample>);
110 static_assert(std::is_standard_layout_v<MomentumWallSample>);
111 static_assert(std::is_trivially_copyable_v<ScalarFluxReplacement>);
112 static_assert(std::is_standard_layout_v<ScalarFluxReplacement>);
114 AMREX_GPU_HOST_DEVICE
120 return wall.moisture == MoistureMode::WetEquilibrium &&
121 wall.vapor.model == ScalarModel::BulkAero &&
122 wall.vapor.provider == CoefficientProvider::MOST;
125 AMREX_GPU_HOST_DEVICE
131 return (wall.momentum.model == MomentumModel::BulkAero &&
132 wall.momentum.provider == CoefficientProvider::MOST) ||
133 (wall.heat.model == ScalarModel::BulkAero &&
134 wall.heat.provider == CoefficientProvider::MOST) ||
138 AMREX_GPU_HOST_DEVICE
149 AMREX_GPU_HOST_DEVICE
167 AMREX_GPU_HOST_DEVICE
178 return wall.thermal.mode == ThermalMode::FixedPhysicalTemperature;
181 return wall.moisture != MoistureMode::LegacyNumerical;
189 AMREX_GPU_HOST_DEVICE
208 AMREX_GPU_HOST_DEVICE
216 AMREX_GPU_HOST_DEVICE
218 NeutralLogMomentumState
223 const amrex::Real log_m = std::log(wall_distance / z0_m);
225 return {log_m, k_over_log * k_over_log, k_over_log * U_t};
228 AMREX_GPU_HOST_DEVICE
235 const amrex::Real log_m = std::log(wall_distance / z0_m);
236 const amrex::Real log_s = std::log(wall_distance / z0_scalar);
240 AMREX_GPU_HOST_DEVICE
249 bool converged =
false;
251 constexpr
int max_iters = 100;
252 for (
int iter = 0; iter < max_iters; ++iter) {
261 amrex::Math::isfinite(
static_cast<double>(zeta_new)),
262 "Cloud Chamber MOST produced a nonfinite stability coordinate");
264 iterations = iter + 1;
265 if (std::abs(zeta - zeta_old) <=
amrex::Real(1.0e-3)) {
271 converged,
"Cloud Chamber MOST fixed-point iteration did not converge");
272 return {zeta, iterations};
275 AMREX_GPU_HOST_DEVICE
277 FaceRuntimeCoefficients
286 int gravity_sign) noexcept
290 const bool most_momentum =
291 wall.momentum.model == MomentumModel::BulkAero &&
292 wall.momentum.provider == CoefficientProvider::MOST;
293 const bool most_heat =
294 wall.heat.model == ScalarModel::BulkAero &&
295 wall.heat.provider == CoefficientProvider::MOST;
297 if (!(most_momentum || most_heat || most_vapor)) {
302 const amrex::Real theta_wall = wall.thermal.temperature_K *
305 if (wall.moisture == MoistureMode::WetEquilibrium) {
313 (theta_v_air - theta_v_wall) / (U_most * U_most);
321 wall.vapor.z0 : z0_m;
322 const amrex::Real D_m = std::log(wall_distance / z0_m);
323 const amrex::Real D_h = std::log(wall_distance / z0_h);
324 const amrex::Real D_q = std::log(wall_distance / z0_q);
329 const amrex::Real z0_stability = most_heat ? z0_h :
330 (most_vapor ? z0_q : z0_m);
331 const amrex::Real D_stability = std::log(wall_distance / z0_stability);
344 result.u_star =
KAPPA * U_most / A_m;
348 amrex::Math::isfinite(
static_cast<double>(result.C_D)) &&
349 amrex::Math::isfinite(
static_cast<double>(result.C_H)) &&
350 amrex::Math::isfinite(
static_cast<double>(result.C_E)),
351 "Cloud Chamber MOST produced nonfinite transfer coefficients");
355 AMREX_GPU_HOST_DEVICE
357 amrex::GpuArray<amrex::Real, AMREX_SPACEDIM>
362 -sample.rho * neutral.C_D * sample.U_t;
363 return {factor * sample.u_t[0],
364 factor * sample.u_t[1],
365 factor * sample.u_t[2]};
368 AMREX_GPU_HOST_DEVICE
375 return coefficient * U_t * dx_inv;
379 AMREX_GPU_HOST_DEVICE
390 AMREX_GPU_HOST_DEVICE
395 const amrex::GpuArray<amrex::Real, AMREX_SPACEDIM>& low_rate,
396 const amrex::GpuArray<amrex::Real, AMREX_SPACEDIM>& high_rate) noexcept
399 for (
int dir = 0; dir < AMREX_SPACEDIM; ++dir) {
400 if (dir != component) {
401 result += low_rate[dir] + high_rate[dir];
407 AMREX_GPU_HOST_DEVICE
420 MomentumModel::ResolvedNoSlip) {
421 if (wall.
momentum.
model == MomentumModel::NeutralRoughnessLog) {
436 AMREX_GPU_HOST_DEVICE
447 return wall.
thermal.
mode == ThermalMode::FixedPhysicalTemperature &&
448 (wall.
heat.
model == ScalarModel::BulkAero ||
449 wall.
heat.
model == ScalarModel::NeutralRoughnessLog);
451 return wall.
moisture == MoistureMode::WetEquilibrium &&
453 wall.
vapor.
model == ScalarModel::NeutralRoughnessLog);
462 AMREX_GPU_HOST_DEVICE
472 AMREX_GPU_HOST_DEVICE
483 AMREX_GPU_HOST_DEVICE
502 if (wall.
thermal.
mode == ThermalMode::FixedPhysicalTemperature) {
503 if (wall.
heat.
model == ScalarModel::BulkAero) {
507 }
else if (wall.
heat.
model == ScalarModel::NeutralRoughnessLog) {
514 if (wall.
moisture == MoistureMode::WetEquilibrium) {
515 if (wall.
vapor.
model == ScalarModel::BulkAero) {
519 }
else if (wall.
vapor.
model == ScalarModel::NeutralRoughnessLog) {
529 AMREX_GPU_HOST_DEVICE
540 AMREX_GPU_HOST_DEVICE
551 int gravity_sign) noexcept
554 wall, theta_air, qv_air, p_hse,
rdOcp, U_t,
559 template <
int DIR,
bool HIGH>
560 AMREX_GPU_HOST_DEVICE
567 amrex::ignore_unused(DIR);
568 return HIGH ? -inward : inward;
571 template <
int DIR,
bool HIGH>
572 AMREX_GPU_HOST_DEVICE
574 amrex::GpuArray<amrex::Real, AMREX_SPACEDIM>
581 amrex::GpuArray<amrex::Real, AMREX_SPACEDIM> result{};
582 result[DIR] = to_coordinate_flux<DIR,HIGH>(normal_in);
583 if constexpr (DIR == 0) {
584 result[1] = tangent_a;
585 result[2] = tangent_b;
586 }
else if constexpr (DIR == 1) {
587 result[0] = tangent_a;
588 result[2] = tangent_b;
590 result[0] = tangent_a;
591 result[1] = tangent_b;
596 AMREX_GPU_HOST_DEVICE
608 wall_temperature_K * std::pow(
p_0 / p_hse,
rdOcp);
609 return rho * C_H * U_t * (theta_wall - theta_air);
612 AMREX_GPU_HOST_DEVICE
624 return rho * C_E * U_t * (qv_wall - qv_air);
627 AMREX_GPU_HOST_DEVICE
629 amrex::GpuArray<amrex::Real, AMREX_SPACEDIM>
631 int dir,
int i,
int j,
int k,
632 const amrex::Array4<const amrex::Real>& u,
633 const amrex::Array4<const amrex::Real>& v,
634 const amrex::Array4<const amrex::Real>&
w,
643 amrex::GpuArray<amrex::Real, AMREX_SPACEDIM> result{uc, vc, wc};
648 AMREX_GPU_HOST_DEVICE
652 const amrex::GpuArray<amrex::Real, AMREX_SPACEDIM>& u_t) noexcept
654 return std::sqrt(u_t[0]*u_t[0] + u_t[1]*u_t[1] + u_t[2]*u_t[2]);
657 AMREX_GPU_HOST_DEVICE
662 const amrex::Array4<const amrex::Real>& u,
663 const amrex::Array4<const amrex::Real>& v,
664 const amrex::Array4<const amrex::Real>&
w,
671 AMREX_GPU_HOST_DEVICE
676 const amrex::Array4<const amrex::Real>& velocity,
682 const amrex::Real normal = (dir == 0) ? uc : ((dir == 1) ? vc : wc);
686 return std::sqrt(
t0*
t0 + t1*t1 + t2*t2);
689 AMREX_GPU_HOST_DEVICE
702 wall_temperature_K * std::pow(
p_0 / p_hse,
rdOcp);
703 return rho * alpha_T * (theta_wall - theta_air) *
707 AMREX_GPU_HOST_DEVICE
723 return rho * alpha_C * (qv_wall - qv_air) *
727 AMREX_GPU_HOST_DEVICE
738 case MomentumModel::ResolvedNoSlip:
740 case MomentumModel::NeutralRoughnessLog: {
744 result.traction_on_fluid =
748 case MomentumModel::BulkAero: {
750 if (sample.U_t ==
amrex::Real(0.0)) {
return result; }
754 wall, sample.theta_air, sample.qv_air, sample.p_hse,
755 sample.rdOcp, sample.U_t, sample.wall_distance,
756 sample.gravity_sign);
760 const amrex::Real factor = -sample.rho * C_D * sample.U_t;
761 result.traction_on_fluid = {
762 factor * sample.u_t[0], factor * sample.u_t[1], factor * sample.u_t[2]};
770 AMREX_GPU_HOST_DEVICE
790 wall.
heat.
model != ScalarModel::ResolvedMolecular) {
794 case ScalarModel::ResolvedMolecular:
805 case ScalarModel::BulkAero: {
809 wall, sample.theta_air, sample.qv_air, sample.p_hse,
810 sample.rdOcp, sample.U_t, sample.wall_distance,
811 sample.gravity_sign);
825 case ScalarModel::NeutralRoughnessLog:
829 sample.wall_distance,
843 if (wall.
moisture == MoistureMode::DryImpermeable) {
847 wall.
vapor.
model != ScalarModel::ResolvedMolecular) {
851 case ScalarModel::ResolvedMolecular:
861 case ScalarModel::BulkAero: {
865 wall, sample.theta_air, sample.qv_air, sample.p_hse,
866 sample.rdOcp, sample.U_t, sample.wall_distance,
867 sample.gravity_sign);
880 case ScalarModel::NeutralRoughnessLog:
884 sample.wall_distance,
906 AMREX_GPU_HOST_DEVICE
913 return flux.rhoTheta_in;
915 return flux.rhoQv_in;
917 return flux.rhoQc_in;
925 template <
int DIR,
bool HIGH>
926 AMREX_GPU_HOST_DEVICE
928 ScalarFluxReplacement
935 to_coordinate_flux<DIR,HIGH>(inward_flux);
937 (new_flux - old_flux) * dx_inv;
940 HIGH ? -correction : correction
944 template <
int DIR,
bool HIGH>
947 const amrex::Box& domain,
950 const amrex::Array4<const amrex::Real>& state,
951 const amrex::Array4<const amrex::Real>& prim,
952 const amrex::Array4<const amrex::Real>& base_state,
953 const amrex::Array4<const amrex::Real>& u,
954 const amrex::Array4<const amrex::Real>& v,
955 const amrex::Array4<const amrex::Real>&
w,
956 const amrex::Array4<amrex::Real>& rhs,
957 const amrex::Array4<amrex::Real>& xflux,
958 const amrex::Array4<amrex::Real>& yflux,
959 const amrex::Array4<amrex::Real>& zflux,
960 const amrex::GpuArray<amrex::Real, AMREX_SPACEDIM>& dx_inv,
969 if constexpr (HIGH) {
970 if (bx.bigEnd(DIR) != domain.bigEnd(DIR)) {
return; }
972 if (bx.smallEnd(DIR) != domain.smallEnd(DIR)) {
return; }
979 const auto wall = walls[2*DIR + (HIGH ? 1 : 0)];
985 const int cell_face = HIGH ? domain.bigEnd(DIR) : domain.smallEnd(DIR);
986 amrex::Box face_cells = bx;
987 face_cells.setSmall(DIR, cell_face);
988 face_cells.setBig(DIR, cell_face);
989 face_cells &= domain;
990 if (face_cells.isEmpty()) {
return; }
995 (DIR == 0) ? xflux : ((DIR == 1) ? yflux : zflux);
998 [=] AMREX_GPU_DEVICE (
int i,
int j,
int k) noexcept
1000 const int fi = HIGH && DIR == 0 ? i + 1 : i;
1001 const int fj = HIGH && DIR == 1 ? j + 1 : j;
1002 const int fk = HIGH && DIR == 2 ? k + 1 : k;
1007 prim(i,j,k,prim_comp),
1019 DIR == 2 ? (HIGH ? -1 : 1) : 0
1024 if (!
owns(physical, channel)) {
return; }
1027 scalar_flux_replacement<DIR,HIGH>(
1033 rhs(i,j,k,quantity) += update.
rhs_delta;
1037 inline void apply (
const amrex::Box& bx,
const amrex::Box& domain,
1038 const int quantity,
const int flux_comp,
1039 const amrex::Array4<const amrex::Real>& state,
1040 const amrex::Array4<const amrex::Real>& prim,
1041 const amrex::Array4<const amrex::Real>& base_state,
1042 const amrex::Array4<const amrex::Real>& u,
1043 const amrex::Array4<const amrex::Real>& v,
1044 const amrex::Array4<const amrex::Real>&
w,
1045 const amrex::Array4<amrex::Real>& rhs,
1046 const amrex::Array4<amrex::Real>& xflux,
1047 const amrex::Array4<amrex::Real>& yflux,
1048 const amrex::Array4<amrex::Real>& zflux,
1049 const amrex::GpuArray<amrex::Real, AMREX_SPACEDIM>& dx_inv,
1053 const bool cloudy =
false)
1055 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);
1056 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);
1057 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);
1058 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);
1059 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);
1060 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);
1066 for (
const auto& wall : walls) {
constexpr amrex::Real epsv
Definition: ERF_Constants.H:40
constexpr amrex::Real KAPPA
Definition: ERF_Constants.H:55
constexpr amrex::Real p_0
Definition: ERF_Constants.H:53
constexpr amrex::Real CONST_GRAV
Definition: ERF_Constants.H:56
#define PrimQ1_comp
Definition: ERF_IndexDefines.H:61
#define PrimQ2_comp
Definition: ERF_IndexDefines.H:62
#define Rho_comp
Definition: ERF_IndexDefines.H:39
#define RhoTheta_comp
Definition: ERF_IndexDefines.H:40
#define RhoQ2_comp
Definition: ERF_IndexDefines.H:46
#define PrimTheta_comp
Definition: ERF_IndexDefines.H:58
#define RhoQ1_comp
Definition: ERF_IndexDefines.H:45
const Real rdOcp
Definition: ERF_InitCustomPert_ABL.H:72
AMREX_ALWAYS_ASSERT(bx.length()[2]==khi+1)
AMREX_ALWAYS_ASSERT_WITH_MESSAGE(m_cloud_chamber_config.active, "Cloud Chamber: initializer reached without a parsed configuration")
AMREX_GPU_HOST_DEVICE AMREX_FORCE_INLINE void erf_qsatw(amrex::Real t, amrex::Real p, amrex::Real &qsatw)
Definition: ERF_MicrophysicsUtils.H:264
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);})
Real w
Definition: ERF_Plotfile2DInterpolator.cpp:22
amrex::Real Real
Definition: ERF_ShocInterface.H:19
@ p0_comp
Definition: ERF_IndexDefines.H:77
@ fi
Definition: ERF_AdvanceMorrison.cpp:107
@ rho
Definition: ERF_Kessler.H:25
Definition: ERF_CloudChamberWallFlux.H:21
AMREX_GPU_HOST_DEVICE AMREX_FORCE_INLINE bool owns(const WallFlux &flux, ScalarChannel channel) noexcept
Definition: ERF_CloudChamberWallFlux.H:211
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:651
AMREX_GPU_HOST_DEVICE AMREX_FORCE_INLINE amrex::Real bulk_vapor_flux_in(amrex::Real rho, amrex::Real C_E, amrex::Real U_t, amrex::Real wall_temperature_K, amrex::Real qv_air, amrex::Real p_hse) noexcept
Definition: ERF_CloudChamberWallFlux.H:615
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:730
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)
Definition: ERF_CloudChamberWallFlux.H:1037
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:243
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:674
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) noexcept
Definition: ERF_CloudChamberWallFlux.H:599
bool has_velocity_dependent_scalar_wall(const erf_wall_thermodynamics::Boundary &walls) noexcept
Definition: ERF_CloudChamberWallFlux.H:1063
AMREX_GPU_HOST_DEVICE AMREX_FORCE_INLINE amrex::Real wall_rate_for_face(const erf_wall_thermodynamics::FaceWall &wall, amrex::Real U_t, amrex::Real dx_inv, const FaceRuntimeCoefficients &runtime) noexcept
Definition: ERF_CloudChamberWallFlux.H:486
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:231
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:773
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:219
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:1077
AMREX_GPU_HOST_DEVICE AMREX_FORCE_INLINE bool wall_rate_requires_tangential_speed(const erf_wall_thermodynamics::FaceWall &wall) noexcept
Definition: ERF_CloudChamberWallFlux.H:475
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:575
AMREX_GPU_HOST_DEVICE AMREX_FORCE_INLINE amrex::Real to_coordinate_flux(amrex::Real inward) noexcept
Definition: ERF_CloudChamberWallFlux.H:563
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:630
AMREX_GPU_HOST_DEVICE AMREX_FORCE_INLINE amrex::Real resolved_vapor_flux_in(amrex::Real rho, amrex::Real alpha_C, amrex::Real wall_temperature_K, amrex::Real qv_air, amrex::Real p_hse, amrex::Real dx_inv) noexcept
Definition: ERF_CloudChamberWallFlux.H:710
AMREX_GPU_HOST_DEVICE AMREX_FORCE_INLINE bool requires_tangential_speed(const erf_wall_thermodynamics::FaceWall &wall, ScalarChannel channel) noexcept
Definition: ERF_CloudChamberWallFlux.H:439
ScalarChannel
Definition: ERF_CloudChamberWallFlux.H:53
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:278
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:358
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:692
AMREX_GPU_HOST_DEVICE AMREX_FORCE_INLINE ScalarChannel scalar_channel_from_quantity(int quantity) noexcept
Definition: ERF_CloudChamberWallFlux.H:141
AMREX_GPU_HOST_DEVICE AMREX_FORCE_INLINE amrex::Real scalar_flux_in(const WallFlux &flux, ScalarChannel channel) noexcept
Definition: ERF_CloudChamberWallFlux.H:909
AMREX_GPU_HOST_DEVICE AMREX_FORCE_INLINE unsigned char scalar_channel_mask(ScalarChannel channel) noexcept
Definition: ERF_CloudChamberWallFlux.H:192
AMREX_GPU_HOST_DEVICE AMREX_FORCE_INLINE amrex::Real momentum_row_sum_rate(int component, const amrex::GpuArray< amrex::Real, AMREX_SPACEDIM > &low_rate, const amrex::GpuArray< amrex::Real, AMREX_SPACEDIM > &high_rate) noexcept
Definition: ERF_CloudChamberWallFlux.H:393
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:410
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:170
AMREX_GPU_HOST_DEVICE AMREX_FORCE_INLINE bool wall_uses_most_vapor(const erf_wall_thermodynamics::FaceWall &wall) noexcept
Definition: ERF_CloudChamberWallFlux.H:117
OwnedChannel
Definition: ERF_CloudChamberWallFlux.H:23
@ OwnVapor
Definition: ERF_CloudChamberWallFlux.H:27
@ OwnNone
Definition: ERF_CloudChamberWallFlux.H:24
@ OwnHeat
Definition: ERF_CloudChamberWallFlux.H:26
@ OwnCloudWater
Definition: ERF_CloudChamberWallFlux.H:28
@ OwnMomentum
Definition: ERF_CloudChamberWallFlux.H:25
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:371
AMREX_GPU_HOST_DEVICE AMREX_FORCE_INLINE int primitive_component(ScalarChannel channel) noexcept
Definition: ERF_CloudChamberWallFlux.H:152
AMREX_GPU_HOST_DEVICE AMREX_FORCE_INLINE bool requires_tangential_momentum(const erf_wall_thermodynamics::FaceWall &wall) noexcept
Definition: ERF_CloudChamberWallFlux.H:465
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:660
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:929
AMREX_GPU_HOST_DEVICE AMREX_FORCE_INLINE amrex::Real momentum_infinity_row_sum_factor() noexcept
Definition: ERF_CloudChamberWallFlux.H:382
AMREX_GPU_HOST_DEVICE AMREX_FORCE_INLINE bool wall_uses_most(const erf_wall_thermodynamics::FaceWall &wall) noexcept
Definition: ERF_CloudChamberWallFlux.H:128
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)
Definition: ERF_CloudChamberWallFlux.H:946
Definition: ERF_WallThermodynamics.H:9
amrex::GpuArray< FaceWall, 2 *AMREX_SPACEDIM > Boundary
Definition: ERF_WallThermodynamics.H:70
real(c_double), parameter t0
Definition: ERF_module_model_constants.F90:39
Definition: ERF_CloudChamberWallFlux.H:39
amrex::Real C_E
Definition: ERF_CloudChamberWallFlux.H:42
amrex::Real C_H
Definition: ERF_CloudChamberWallFlux.H:41
unsigned char valid
Definition: ERF_CloudChamberWallFlux.H:45
amrex::Real C_D
Definition: ERF_CloudChamberWallFlux.H:40
amrex::Real zeta
Definition: ERF_CloudChamberWallFlux.H:44
amrex::Real u_star
Definition: ERF_CloudChamberWallFlux.H:43
Definition: ERF_CloudChamberWallFlux.H:82
amrex::Real rho
Definition: ERF_CloudChamberWallFlux.H:83
amrex::Real U_t
Definition: ERF_CloudChamberWallFlux.H:85
int gravity_sign
Definition: ERF_CloudChamberWallFlux.H:91
amrex::Real wall_distance
Definition: ERF_CloudChamberWallFlux.H:86
amrex::Real p_hse
Definition: ERF_CloudChamberWallFlux.H:89
amrex::Real theta_air
Definition: ERF_CloudChamberWallFlux.H:87
amrex::Real rdOcp
Definition: ERF_CloudChamberWallFlux.H:90
amrex::GpuArray< amrex::Real, AMREX_SPACEDIM > u_t
Definition: ERF_CloudChamberWallFlux.H:84
amrex::Real qv_air
Definition: ERF_CloudChamberWallFlux.H:88
Definition: ERF_CloudChamberWallFlux.H:48
int iterations
Definition: ERF_CloudChamberWallFlux.H:50
amrex::Real zeta
Definition: ERF_CloudChamberWallFlux.H:49
Definition: ERF_CloudChamberWallFlux.H:76
amrex::Real C_D
Definition: ERF_CloudChamberWallFlux.H:78
amrex::Real u_star
Definition: ERF_CloudChamberWallFlux.H:79
amrex::Real log_m
Definition: ERF_CloudChamberWallFlux.H:77
Definition: ERF_CloudChamberWallFlux.H:94
amrex::Real coordinate_flux
Definition: ERF_CloudChamberWallFlux.H:95
amrex::Real rhs_delta
Definition: ERF_CloudChamberWallFlux.H:96
Definition: ERF_CloudChamberWallFlux.H:60
amrex::Real rdOcp
Definition: ERF_CloudChamberWallFlux.H:68
int gravity_sign
Definition: ERF_CloudChamberWallFlux.H:73
amrex::Real scalar_air
Definition: ERF_CloudChamberWallFlux.H:62
amrex::Real qv_air
Definition: ERF_CloudChamberWallFlux.H:72
amrex::Real rho
Definition: ERF_CloudChamberWallFlux.H:61
amrex::Real dx_inv
Definition: ERF_CloudChamberWallFlux.H:67
amrex::Real theta_air
Definition: ERF_CloudChamberWallFlux.H:71
amrex::Real wall_distance
Definition: ERF_CloudChamberWallFlux.H:70
amrex::Real alpha_T
Definition: ERF_CloudChamberWallFlux.H:65
amrex::Real p_hse
Definition: ERF_CloudChamberWallFlux.H:63
amrex::Real alpha_C
Definition: ERF_CloudChamberWallFlux.H:66
amrex::Real U_t
Definition: ERF_CloudChamberWallFlux.H:64
Definition: ERF_CloudChamberWallFlux.H:31
amrex::Real rhoTheta_in
Definition: ERF_CloudChamberWallFlux.H:33
amrex::Real rhoQv_in
Definition: ERF_CloudChamberWallFlux.H:34
unsigned char owned_channels
Definition: ERF_CloudChamberWallFlux.H:36
amrex::Real rhoQc_in
Definition: ERF_CloudChamberWallFlux.H:35
amrex::GpuArray< amrex::Real, AMREX_SPACEDIM > traction_on_fluid
Definition: ERF_CloudChamberWallFlux.H:32
Definition: ERF_WallThermodynamics.H:61
amrex::GpuArray< amrex::Real, AMREX_SPACEDIM > wall_velocity
Definition: ERF_WallThermodynamics.H:67
ScalarTransfer vapor
Definition: ERF_WallThermodynamics.H:66
ScalarTransfer heat
Definition: ERF_WallThermodynamics.H:65
MoistureMode moisture
Definition: ERF_WallThermodynamics.H:63
MomentumTransfer momentum
Definition: ERF_WallThermodynamics.H:64
ThermalBoundary thermal
Definition: ERF_WallThermodynamics.H:62
amrex::Real z0_m
Definition: ERF_WallThermodynamics.H:51
CoefficientProvider provider
Definition: ERF_WallThermodynamics.H:49
amrex::Real C_D
Definition: ERF_WallThermodynamics.H:50
MomentumModel model
Definition: ERF_WallThermodynamics.H:48
amrex::Real coefficient
Definition: ERF_WallThermodynamics.H:57
CoefficientProvider provider
Definition: ERF_WallThermodynamics.H:56
amrex::Real z0
Definition: ERF_WallThermodynamics.H:58
ScalarModel model
Definition: ERF_WallThermodynamics.H:55
amrex::Real temperature_K
Definition: ERF_WallThermodynamics.H:44
ThermalMode mode
Definition: ERF_WallThermodynamics.H:43
Definition: ERF_MOSTUtils.H:37
AMREX_GPU_HOST_DEVICE AMREX_FORCE_INLINE amrex::Real calc_psi_h2(amrex::Real zeta) const
Definition: ERF_MOSTUtils.H:74
AMREX_GPU_HOST_DEVICE AMREX_FORCE_INLINE amrex::Real calc_psi_m2(amrex::Real zeta) const
Definition: ERF_MOSTUtils.H:49