Skip to content

Commit

Permalink
No major change, just relabeling
Browse files Browse the repository at this point in the history
  • Loading branch information
tduretz committed Feb 22, 2024
1 parent c9778c1 commit 3f52e06
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 8 deletions.
Binary file added MDLIB/RiverTomCrouteinf
Binary file not shown.
6 changes: 3 additions & 3 deletions MDLIB/Setup.c
Original file line number Diff line number Diff line change
Expand Up @@ -396,7 +396,7 @@ void SetBCs(SetBCs_ff setBCs, MdoodzInput *instance, grid *mesh, surface *topo)
instance->topo_height->west = VxWestSum*mesh->dz;
instance->topo_height->east = VxEastSum*mesh->dz;
}

/* --------------------------------------------------------------------------------------------------------*/
/* Set the BCs for Vz on all grid levels */
/* Type 0: Dirichlet point that matches the physical boundary (Vx:
Expand Down Expand Up @@ -468,8 +468,8 @@ void SetBCs(SetBCs_ff setBCs, MdoodzInput *instance, grid *mesh, surface *topo)
}
}

printf("VzWestSum: %f, VzEastSum: %f: \n", VzWestSum, VzEastSum);
printf("total West+East+South sum: %f\n", VxWestSum + VxEastSum - VzSouthSum);
printf("VxWestSum*dx: %f, VxEastSum*dx: %f, VzEastSum*dz: %f: \n", VxWestSum*mesh->dz, VxEastSum*mesh->dz, VzSouthSum*mesh->dx);
printf("Total West+East+South sum: %f\n", fabs(VxWestSum*mesh->dz) + fabs(VxEastSum*mesh->dz) - fabs(VzSouthSum*mesh->dx) );

if (instance->model.balance_boundaries && (VzSouthSum > tolerance || VzSouthSum < -tolerance)) {
int zeroValuesCount = 0;
Expand Down
7 changes: 2 additions & 5 deletions SETS/RiverTomCrouteinf.c
Original file line number Diff line number Diff line change
Expand Up @@ -102,7 +102,7 @@ SetBC SetBCVx(MdoodzInput *instance, POSITION position, Coordinates coordinates)
// Assign BC values
if (position == N || position == S || position == NW || position == SW || position == NE || position == SE) {
bc.type = constant_shear_stress;
bc.value = 0;
bc.value = 0.0;
} else if (position == W) {
bc.type = constant_velocity;
bc.value = VxW;
Expand Down Expand Up @@ -134,16 +134,13 @@ SetBC SetBCVz(MdoodzInput *instance, POSITION position, Coordinates coordinates)
// const double VzS = -0.5 * V_tot * (hW + hE) / Lx + Vz_corr;
const double VxW_H = instance->topo_height->west;
const double VxE_H = instance->topo_height->east;
const double VzS = -(fabs(VxW_H) + fabs(VxE_H))/Lx + Vz_corr;

const double VzS = -(fabs(VxW_H) + fabs(VxE_H))/Lx + 2*Vz_corr;

// Here we need the total inflow flux: ncell_W * dz * VxW + ncell_E * dz * VxE
// ncell_W is the number of Vx points for which we apply a BC value on the west
// ncell_E is the number of Vx points for which we apply a BC value on the east
// Then: VzS = -(ncell_W * dz * VxW + ncell_E * dz * VxE)/Lx + Vz_corr

// printf("topo_height->west = %2.2e --- topo_height->east = %2.2e ", instance->topo_height->west, instance->topo_height->east);

// Set boundary nodes types and values
if (position == W || position == SW || position == NW ) {
bc.type = constant_shear_stress;
Expand Down

0 comments on commit 3f52e06

Please sign in to comment.