Changeset 4714
- Timestamp:
- Sep 10, 2007, 4:12:43 PM (18 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
anuga_core/source/anuga/shallow_water/shallow_water_ext.c
r4710 r4714 484 484 double dz, hmin, alpha, h_diff; 485 485 486 // Compute linear combination between w-limited stages and487 // h-limited stages close to the bed elevation.486 // Compute linear combination between w-limited stages and 487 // h-limited stages close to the bed elevation. 488 488 489 489 for (k=0; k<N; k++) { … … 497 497 k3 = 3*k; 498 498 499 //FIXME: Try with this one precomputed499 500 500 dz = 0.0; 501 hmin = hv[k3]; 502 for (i=0; i<3; i++) { 503 if (tight_slope_limiters == 0) { 504 dz = max(dz, fabs(zv[k3+i]-zc[k])); 505 } 506 507 hmin = min(hmin, hv[k3+i]); 501 if (tight_slope_limiters == 0) { 502 // FIXME: Try with this one precomputed 503 for (i=0; i<3; i++) { 504 dz = max(dz, fabs(zv[k3+i]-zc[k])); 505 } 508 506 } 509 507 510 511 //Create alpha in [0,1], where alpha==0 means using the h-limited 512 //stage and alpha==1 means using the w-limited stage as 513 //computed by the gradient limiter (both 1st or 2nd order) 508 // Calculate minimal depth across all three vertices 509 hmin = min(hv[k3], min(hv[k3+1], hv[k3+2])); 514 510 515 511 512 513 // Create alpha in [0,1], where alpha==0 means using the h-limited 514 // stage and alpha==1 means using the w-limited stage as 515 // computed by the gradient limiter (both 1st or 2nd order) 516 516 if (tight_slope_limiters == 0) { 517 // If hmin > dz/alpha_balance then alpha = 1 and the bed will have no518 // effect519 // If hmin < 0 then alpha = 0 reverting to constant height above bed.520 // The parameter alpha_balance==2 by default517 // If hmin > dz/alpha_balance then alpha = 1 and the bed will have no 518 // effect 519 // If hmin < 0 then alpha = 0 reverting to constant height above bed. 520 // The parameter alpha_balance==2 by default 521 521 522 522 … … 524 524 alpha = max( min( alpha_balance*hmin/dz, 1.0), 0.0 ); 525 525 } else { 526 alpha = 1.0; // Flat bed526 alpha = 1.0; // Flat bed 527 527 } 528 528 //printf("Using old style limiter\n"); … … 530 530 } else { 531 531 532 // 2007 Balanced Limiter532 // Tight Slope Limiter (2007) 533 533 534 534 // Make alpha as large as possible but still ensure that … … 591 591 wv[k3+i] = zv[k3+i] + (1-alpha)*hvbar[k3+i] + alpha*hv[k3+i]; 592 592 593 // Update momentum as a linear combination of594 // xmomc and ymomc (shallow) and momentum595 // from extrapolator xmomv and ymomv (deep).596 // FIXME (Ole): Is this really needed?593 // Update momentum as a linear combination of 594 // xmomc and ymomc (shallow) and momentum 595 // from extrapolator xmomv and ymomv (deep). 596 // FIXME (Ole): Is this really needed? 597 597 xmomv[k3+i] = (1-alpha)*xmomc[k] + alpha*xmomv[k3+i]; 598 598 ymomv[k3+i] = (1-alpha)*ymomc[k] + alpha*ymomv[k3+i]; … … 618 618 double u, v, reduced_speed; 619 619 620 // Protect against initesimal and negative heights620 // Protect against initesimal and negative heights 621 621 for (k=0; k<N; k++) { 622 622 hc = wc[k] - zc[k];
Note: See TracChangeset
for help on using the changeset viewer.