1079 geom.ProbLo(), geom.ProbHi(), selected_moisture_model);
1081 amrex::Error(
"Cloud Chamber: physical wall transfer requires erf.molec_diff_type = ConstantAlpha");
1086 const auto dx_inv = geom.InvCellSizeArray();
1089 for (
int n = 0; n < 2 * AMREX_SPACEDIM; ++n) {
1090 const std::string face =
face_name(faces[n]);
1091 amrex::ParmParse pp_face(face.c_str());
1094 if (!pp_face.query(
"type", type) ||
1095 amrex::toLower(type) !=
"noslipwall") {
1096 amrex::Error(
"Cloud Chamber: " + face +
".type must be NoSlipWall");
1098 auto& wall = walls[n];
1100 const std::string transfer_error =
1102 if (!transfer_error.empty()) {
1103 amrex::Error(transfer_error);
1105 const bool any_channel_key =
1106 transfer_contract.momentum_model_specified ||
1107 transfer_contract.heat_model_specified ||
1108 transfer_contract.vapor_model_specified ||
1109 transfer_contract.coefficient_source_specified ||
1110 transfer_contract.momentum_coefficient_specified ||
1111 transfer_contract.heat_coefficient_specified ||
1112 transfer_contract.vapor_coefficient_specified ||
1113 transfer_contract.z0_m_specified ||
1114 transfer_contract.z0_h_specified ||
1115 transfer_contract.z0_q_specified;
1116 if (!
config.physical_initialization && any_channel_key) {
1117 amrex::Error(
"Cloud Chamber: per-channel wall transfer keys require physical temperature initialization");
1119 if (
config.physical_initialization) {
1120 if (pp_face.contains(
"theta") || pp_face.contains(
"qv") ||
1121 pp_face.contains(
"theta_grad") || pp_face.contains(
"qv_grad")) {
1122 amrex::Error(
"Cloud Chamber: physical walls cannot combine temperature/moisture with legacy theta/qv wall keys");
1124 std::string moisture;
1125 pp_face.get(
"moisture", moisture);
1126 moisture = amrex::toLower(moisture);
1127 if (moisture ==
"dry") {
1129 }
else if (moisture ==
"wet") {
1131 if (!
config.has_moisture) {
1132 amrex::Error(
"Cloud Chamber: wet walls require an active moisture model");
1135 amrex::Error(
"Cloud Chamber: " + face +
".moisture must be dry or wet");
1137 if (transfer_contract.momentum_model ==
"law_of_wall_momentum") {
1138 transfer_contract.momentum_model =
"neutral_roughness_log";
1140 wall.momentum.model =
1141 transfer_contract.momentum_model ==
"neutral_roughness_log" ?
1149 (transfer_contract.heat_model ==
"neutral_roughness_log" ?
1155 (transfer_contract.vapor_model ==
"neutral_roughness_log" ?
1158 wall.momentum.z0_m = transfer_contract.z0_m;
1159 wall.momentum.C_D = transfer_contract.momentum_coefficient;
1160 wall.heat.z0 = transfer_contract.z0_h;
1161 wall.vapor.z0 = transfer_contract.z0_q;
1163 wall.momentum.provider = transfer_contract.coefficient_source ==
"most" ?
1168 wall.heat.provider = transfer_contract.coefficient_source ==
"most" ?
1171 wall.heat.coefficient = transfer_contract.heat_coefficient;
1174 wall.vapor.provider = transfer_contract.coefficient_source ==
"most" ?
1177 wall.vapor.coefficient = transfer_contract.vapor_coefficient;
1180 if (!pp_face.query(
"theta", wall.thermal.temperature_K)) {
1181 amrex::Error(
"Cloud Chamber: missing required " + face +
".theta");
1184 wall.moisture =
config.has_moisture ?
1187 if (
config.has_moisture && !pp_face.contains(
"qv")) {
1188 amrex::Error(
"Cloud Chamber: legacy cloudy walls require " + face +
".qv");
1192 geom, n < 4 ? &
config.m_bands[n] :
nullptr);
1193 if (!heat_error.empty()) { amrex::Error(heat_error); }
1195 if (!coupled_error.empty()) { amrex::Error(coupled_error); }
1196 if (
config.physical_initialization) {
1199 wall, transfer_contract, dc, dx_inv[n/2], face);
1200 if (!speed_error.empty()) { amrex::Error(speed_error); }
1202 for (
int d = 0; d < AMREX_SPACEDIM; ++d) {
1203 if (pp_face.contains(
"velocity")) {
1204 amrex::Error(
"Cloud Chamber: wall velocity metadata is not active; use NoSlipWall with zero velocity");
1206 wall.wall_velocity[d] = amrex::Real(0.0);
1209 if (!wetness_error.empty()) { amrex::Error(wetness_error); }
1212 config.m_boundary = walls;
const auto config
Definition: ERF_InitCustomPert_CloudChamber.H:38
WallFace
Definition: ERF_CloudChamber.H:34
std::string parse_wall_heat(amrex::ParmParse &pp, const std::string &face, bool physical, erf_wall_thermodynamics::FaceWall &wall, const amrex::Geometry &geom, SidewallTemperatureBands *sidewall_bands)
Definition: ERF_CloudChamber.H:648
std::string wall_transfer_contract_error(const WallTransferContract &contract, const std::string &face)
Definition: ERF_CloudChamber.H:472
std::string wall_coupled_most_roughness_error(const erf_wall_thermodynamics::FaceWall &wall, const std::string &face)
Definition: ERF_CloudChamber.H:711
WallTransferContract read_wall_transfer_contract(const amrex::ParmParse &pp, const std::string &face)
Definition: ERF_CloudChamber.H:433
std::string face_name(WallFace face)
Definition: ERF_CloudChamber.H:374
std::string parse_wall_wetness(amrex::ParmParse &pp, const std::string &face, erf_wall_thermodynamics::FaceWall &wall)
Definition: ERF_CloudChamber.H:393
void validate_wall_roughness_geometry(const erf_wall_thermodynamics::Boundary &walls, const amrex::GpuArray< amrex::Real, AMREX_SPACEDIM > &dx)
Definition: ERF_CloudChamber.H:828
void reject_unsupported_face_keys(amrex::ParmParse &pp, const std::string &face)
Definition: ERF_CloudChamber.H:766
bool is_bulk_model(const std::string &model)
Definition: ERF_CloudChamber.H:466
Initialization parse_initialization(const amrex::Real *problo, const amrex::Real *probhi, const MoistureType selected_moisture_model)
Definition: ERF_CloudChamber.H:836
std::string set_wall_transport_speeds(erf_wall_thermodynamics::FaceWall &wall, const WallTransferContract &contract, const DiffChoice &dc, amrex::Real dx_inv, const std::string &face)
Definition: ERF_CloudChamber.H:1025
amrex::GpuArray< FaceWall, 2 *AMREX_SPACEDIM > Boundary
Definition: ERF_WallThermodynamics.H:133
MolecDiffType molec_diff_type
Selected molecular transport model.
Definition: ERF_DiffStruct.H:97