/Users/huttone/Devel/sedflux-new/sedflux/trunk/ew/plume/plumejump.c

Go to the documentation of this file.
00001 //---
00002 //
00003 // This file is part of sedflux.
00004 //
00005 // sedflux is free software; you can redistribute it and/or modify
00006 // it under the terms of the GNU General Public License as published by
00007 // the Free Software Foundation; either version 2 of the License, or
00008 // (at your option) any later version.
00009 //
00010 // sedflux is distributed in the hope that it will be useful,
00011 // but WITHOUT ANY WARRANTY; without even the implied warranty of
00012 // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
00013 // GNU General Public License for more details.
00014 //
00015 // You should have received a copy of the GNU General Public License
00016 // along with sedflux; if not, write to the Free Software
00017 // Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
00018 //
00019 //---
00020 
00021 /*
00022  * PlumeJump.c  Check for hydraulic jumps
00023  *              Corrects uo, do, bo if necessary
00024  *
00025  * Input:
00026  *      river.u0        initial river mouth velocity
00027  *      river.d0        initial river mouth depth
00028  *      river.b0        initial river mouth width
00029  *
00030  * Checks for hydraulic jumps based on the Froude Number
00031  *      Fr = uo/sqrt(g*do) > 1
00032  * Then recalculates:
00033  *      uo and do
00034  * assumes the changes are small so that bo does not change
00035  *
00036  *      Author:         M.D. Morehead
00037  *      Original:       April 1998
00038  *
00039  */
00040 #include "plumeinput.h"
00041 #include "plumevars.h"
00042 
00043 //---
00044 // outputs:
00045 //   river.d0 : river depth
00046 //   river.u0 : river velocity
00047 // inputs:
00048 //   river.d0 : river depth
00049 //   river.u0 : river velocity
00050 //---
00051 
00052 int plumejump( Plume_river *river )
00053 {
00054    double froude, d1, u1;
00055 
00056    froude = river->u0/sqrt(grv*river->d0);
00057 
00058    if( froude > 1.0 )
00059    {
00060       d1 = -(river->d0/2)
00061          + sqrt( sq(river->d0/2) + ((2*river->d0*sq(river->u0))/grv) );
00062       u1 = river->u0*river->d0/d1;
00063 
00064       fprintf(stderr, " PlumeJump: Hydraulic Jump detected and fixed \n");
00065       fprintf(fidlog, " PlumeJump: Hydraulic Jump detected and fixed \n");
00066       fprintf(fidlog, "   Fr   = %g \n", froude);
00067       fprintf(fidlog, "   Uold = %g \n", river->u0);
00068       fprintf(fidlog, "   Unew = %g \n", u1);
00069       fprintf(fidlog, "   Dold = %g \n", river->d0);
00070       fprintf(fidlog, "   Dnew = %g \n\n", d1);
00071 
00072       river->u0 = u1;
00073       river->d0 = d1;
00074    }
00075 
00076 #ifdef DBG
00077    fprintf(fidlog, " PlumeJump: \n");
00078    fprintf(fidlog, "   Fr   = %g \n", froude);
00079    fprintf(fidlog, "   U    = %g \n", river->u0);
00080    fprintf(fidlog, "   D    = %g \n", river->d0);
00081 #endif
00082 
00083 return 0;
00084   
00085 } // end PlumeJump
00086 

Generated on Fri Jan 4 18:04:15 2008 for sedflux by  doxygen 1.5.2