Skip to content

Commit

Permalink
parse integrated boundary flux instead of altitude
Browse files Browse the repository at this point in the history
  • Loading branch information
tduretz committed Feb 20, 2024
1 parent d899378 commit 728da6a
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 3 deletions.
4 changes: 4 additions & 0 deletions MDLIB/Setup.c
Original file line number Diff line number Diff line change
Expand Up @@ -391,6 +391,10 @@ void SetBCs(SetBCs_ff setBCs, MdoodzInput *instance, grid *mesh, surface *topo)
free(newBoundary);
}

// override by integrated velocity values
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
10 changes: 7 additions & 3 deletions SETS/RiverTomCrouteinf.c
Original file line number Diff line number Diff line change
Expand Up @@ -129,9 +129,13 @@ SetBC SetBCVz(MdoodzInput *instance, POSITION position, Coordinates coordinates)
const double surf_Winc = instance->model.surf_Winc;
const double surf_Vinc = instance->model.surf_Vinc;
const double Vz_corr = surf_Winc*surf_Vinc / Lx;
const double hW = instance->topo_height->west - instance->model.zmin;
const double hE = instance->topo_height->east - instance->model.zmin;
const double VzS = -0.5 * V_tot * (hW + hE) / Lx + Vz_corr;
// const double hW = instance->topo_height->west - instance->model.zmin;
// const double hE = instance->topo_height->east - instance->model.zmin;
// 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;


// 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
Expand Down

0 comments on commit 728da6a

Please sign in to comment.