475 const bool momentum_neutral = contract.momentum_model_specified &&
476 (contract.momentum_model ==
"neutral_roughness_log" ||
477 contract.momentum_model ==
"law_of_wall_momentum");
478 const bool momentum_bulk = contract.momentum_model_specified &&
480 const bool heat_neutral = contract.heat_model_specified &&
481 contract.heat_model ==
"neutral_roughness_log";
482 const bool vapor_neutral = contract.vapor_model_specified &&
483 contract.vapor_model ==
"neutral_roughness_log";
484 const bool any_neutral =
485 momentum_neutral || heat_neutral || vapor_neutral;
487 const bool any_channel_key =
488 contract.momentum_model_specified ||
489 contract.heat_model_specified ||
490 contract.vapor_model_specified ||
491 contract.coefficient_source_specified ||
492 contract.heat_coefficient_specified ||
493 contract.vapor_coefficient_specified ||
494 contract.momentum_coefficient_specified ||
495 contract.z0_m_specified ||
496 contract.z0_h_specified ||
497 contract.z0_q_specified;
498 if (contract.legacy_aggregate_specified && any_channel_key) {
499 return "Cloud Chamber: " + face +
500 " cannot combine wall_transfer_model with per-channel wall model keys";
503 if (contract.momentum_model_specified &&
504 contract.momentum_model !=
"resolved_noslip" &&
505 !momentum_bulk && !momentum_neutral) {
506 return "Cloud Chamber: " + face +
507 ".momentum_transfer_model must be resolved_noslip, bulk_aero, bulk_aero_plus_molecular, "
508 "neutral_roughness_log, or law_of_wall_momentum";
511 const bool heat_bulk = contract.heat_model_specified &&
513 const bool vapor_bulk = contract.vapor_model_specified &&
515 if (contract.heat_model_specified &&
516 contract.heat_model !=
"resolved_molecular" && !heat_bulk && !heat_neutral) {
517 return "Cloud Chamber: " + face +
518 ".heat_transfer_model must be resolved_molecular, bulk_aero, bulk_aero_plus_molecular, or neutral_roughness_log";
520 if (contract.vapor_model_specified &&
521 contract.vapor_model !=
"resolved_molecular" && !vapor_bulk && !vapor_neutral) {
522 return "Cloud Chamber: " + face +
523 ".vapor_transfer_model must be resolved_molecular, bulk_aero, bulk_aero_plus_molecular, or neutral_roughness_log";
526 const bool bulk_active = heat_bulk || vapor_bulk || momentum_bulk;
527 if ((contract.momentum_model ==
"bulk_aero_plus_molecular" ||
528 contract.heat_model ==
"bulk_aero_plus_molecular" ||
529 contract.vapor_model ==
"bulk_aero_plus_molecular") && contract.coefficient_source !=
"fixed") {
530 return "Cloud Chamber: " + face +
" bulk_aero_plus_molecular requires coefficient_source = fixed";
532 const bool most_provider = contract.coefficient_source_specified &&
533 contract.coefficient_source ==
"most";
534 if (most_provider && !(face ==
"zlo" || face ==
"zhi")) {
535 return "Cloud Chamber: " + face +
536 " supports coefficient_source = most only on zlo or zhi";
538 if ((any_neutral || (bulk_active && most_provider)) &&
539 !contract.z0_m_specified) {
540 return "Cloud Chamber: " + face +
541 " requires z0_m for the active neutral/MOST wall-transfer channels";
543 if ((heat_neutral || (heat_bulk && most_provider)) &&
544 !contract.z0_h_specified) {
545 return "Cloud Chamber: " + face +
546 " requires z0_h for neutral roughness-log heat or MOST heat";
548 if ((vapor_neutral || (vapor_bulk && most_provider)) &&
549 !contract.z0_q_specified) {
550 return "Cloud Chamber: " + face +
551 " requires z0_q for neutral roughness-log vapor or MOST vapor";
553 if (contract.z0_m_specified &&
554 !(any_neutral || (bulk_active && most_provider))) {
555 return "Cloud Chamber: " + face +
556 ".z0_m requires a neutral_roughness_log or MOST channel";
558 if (contract.z0_h_specified &&
559 !(heat_neutral || (heat_bulk && most_provider))) {
560 return "Cloud Chamber: " + face +
561 ".z0_h requires neutral_roughness_log heat or MOST heat";
563 if (contract.z0_q_specified &&
564 !(vapor_neutral || (vapor_bulk && most_provider))) {
565 return "Cloud Chamber: " + face +
566 ".z0_q requires neutral_roughness_log vapor or MOST vapor";
568 if ((contract.z0_m_specified &&
569 (!
finite(contract.z0_m) || contract.z0_m <= amrex::Real(0.0))) ||
570 (contract.z0_h_specified &&
571 (!
finite(contract.z0_h) || contract.z0_h <= amrex::Real(0.0))) ||
572 (contract.z0_q_specified &&
573 (!
finite(contract.z0_q) || contract.z0_q <= amrex::Real(0.0)))) {
574 return "Cloud Chamber: " + face +
575 " active roughness lengths z0_m, z0_h, and z0_q must be finite and positive";
579 if (!contract.coefficient_source_specified ||
580 (contract.coefficient_source !=
"fixed" &&
581 contract.coefficient_source !=
"most")) {
582 return "Cloud Chamber: " + face +
583 " active bulk_aero channels require coefficient_source = fixed or most";
585 }
else if (contract.coefficient_source_specified) {
586 return "Cloud Chamber: " + face +
587 ".coefficient_source requires a bulk_aero or bulk_aero_plus_molecular channel";
590 if (momentum_bulk && !most_provider &&
591 !contract.momentum_coefficient_specified) {
592 return "Cloud Chamber: " + face +
593 " requires C_D when momentum_transfer_model = " + contract.momentum_model +
594 " with coefficient_source = fixed";
596 if (momentum_bulk && most_provider && contract.momentum_coefficient_specified) {
597 return "Cloud Chamber: " + face +
598 ".C_D is not valid with coefficient_source = most";
600 if (heat_bulk && !most_provider && !contract.heat_coefficient_specified) {
601 return "Cloud Chamber: " + face +
602 " requires C_H when heat_transfer_model = " + contract.heat_model +
603 " with coefficient_source = fixed";
605 if (heat_bulk && most_provider && contract.heat_coefficient_specified) {
606 return "Cloud Chamber: " + face +
607 ".C_H is not valid with coefficient_source = most";
609 if (vapor_bulk && !most_provider && !contract.vapor_coefficient_specified) {
610 return "Cloud Chamber: " + face +
611 " requires C_E when vapor_transfer_model = " + contract.vapor_model +
612 " with coefficient_source = fixed";
614 if (vapor_bulk && most_provider && contract.vapor_coefficient_specified) {
615 return "Cloud Chamber: " + face +
616 ".C_E is not valid with coefficient_source = most";
618 if (contract.momentum_coefficient_specified && !momentum_bulk) {
619 return "Cloud Chamber: " + face +
620 ".C_D requires momentum_transfer_model = bulk_aero or bulk_aero_plus_molecular";
622 if (contract.heat_coefficient_specified && !heat_bulk) {
623 return "Cloud Chamber: " + face +
624 ".C_H requires heat_transfer_model = bulk_aero or bulk_aero_plus_molecular";
626 if (contract.vapor_coefficient_specified && !vapor_bulk) {
627 return "Cloud Chamber: " + face +
628 ".C_E requires vapor_transfer_model = bulk_aero or bulk_aero_plus_molecular";
630 if ((contract.momentum_coefficient_specified &&
631 (!
finite(contract.momentum_coefficient) ||
632 contract.momentum_coefficient < amrex::Real(0.0))) ||
633 (contract.heat_coefficient_specified &&
634 (!
finite(contract.heat_coefficient) ||
635 contract.heat_coefficient < amrex::Real(0.0))) ||
636 (contract.vapor_coefficient_specified &&
637 (!
finite(contract.vapor_coefficient) ||
638 contract.vapor_coefficient < amrex::Real(0.0)))) {
639 return "Cloud Chamber: " + face +
640 " bulk coefficients C_D, C_H, and C_E must be finite and nonnegative";