Skip to content

Commit

Permalink
fix for most zref check
Browse files Browse the repository at this point in the history
  • Loading branch information
baperry2 committed Apr 5, 2024
1 parent b266d1f commit 1ddbf21
Showing 1 changed file with 10 additions and 2 deletions.
12 changes: 10 additions & 2 deletions Source/Diffusion/PBLModels.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -286,8 +286,16 @@ ComputeTurbulentViscosityPBL (const MultiFab& xvel,
const Real most_zref = most->get_zref();

// Require that MOST zref is 10 m so we get the wind speed at 10 m from most
if (most_zref != 10.0) {
amrex::Print() << "most_zref = " << most_zref << std::endl;
bool invalid_zref = false;
if (use_terrain) {
invalid_zref = most_zref != 10.0;
} else {
// zref gets reset to nearest cell center, so assert that zref is in the same cell as the 10m point
Real dz = geom.CellSize(2);
invalid_zref = int((most_zref - 0.5*dz)/dz) != int((10.0 - 0.5*dz)/dz);
}
if (invalid_zref) {
Print() << "most_zref = " << most_zref << std::endl;
Abort("MOST Zref must be 10m for YSU PBL scheme");
}

Expand Down

0 comments on commit 1ddbf21

Please sign in to comment.