[SCM] Gerris Flow Solver branch, upstream, updated. b3aa46814a06c9cb2912790b23916ffb44f1f203
Stephane Popinet
popinet at users.sf.net
Fri May 15 02:55:59 UTC 2009
The following commit has been merged in the upstream branch:
commit add2c9bffe6a75ffb2a62d2b93ee6d3f9aa974a5
Author: Stephane Popinet <popinet at users.sf.net>
Date: Wed Jan 14 22:15:30 2009 +1100
Removed Riemann Roe solver from GfsRiver
darcs-hash:20090114111530-d4795-176ce0b795438f76aee896d3fc53295747ff0964.gz
diff --git a/src/river.c b/src/river.c
index 976a206..1606260 100644
--- a/src/river.c
+++ b/src/river.c
@@ -12,105 +12,6 @@ static void flux (const gdouble * u, gdouble g, gdouble * f)
f[2] = u[0]*u[1]*u[2]; /* h*u*v */
}
-#define matrix_vector_product(C, M, V) ((C)[0] = (M)[0][0]*(V)[0] + (M)[0][1]*(V)[1] + (M)[0][2]*(V)[2],\
- (C)[1] = (M)[1][0]*(V)[0] + (M)[1][1]*(V)[1] + (M)[1][2]*(V)[2],\
- (C)[2] = (M)[2][0]*(V)[0] + (M)[2][1]*(V)[1] + (M)[2][2]*(V)[2])
-
-static void riemann_roe (const gdouble * uL, const gdouble * uR,
- gdouble g,
- gdouble * f)
-{
- GtsVector V, alpha, beta, lambda;
- gdouble Hl, Hr, H, u, v, sqrtgH;
- gdouble cpsi, cU, cV;
- GtsMatrix * M, * IM;
-
- Hl = uL[0];
- Hr = uR[0];
-
- if (Hr <= 0. || Hl <= 0.) {
- g_warning ("Hr: %g Hl: %g\n", Hr, Hl);
- g_assert_not_reached ();
- }
-
- Hl = 1./sqrt (Hl);
- Hr = 1./sqrt (Hr);
-
- cpsi = (Hl*uL[0] + Hr*uR[0])/(Hl + Hr);
- cU = (Hl*uL[0]*uL[1] + Hr*uR[0]*uR[1])/(Hl + Hr);
- cV = (Hl*uL[0]*uL[2] + Hr*uR[0]*uR[2])/(Hl + Hr);
-
- H = (1./Hl + 1./Hr)/(Hl + Hr);
- g_assert (H > 0.0);
- u = cU/H;
- v = cV/H;
- sqrtgH = sqrt (g*H);
-
- lambda[0] = u - sqrtgH;
- lambda[1] = u;
- lambda[2] = u + sqrtgH;
-
- M = gts_matrix_new (1., 0., 1., 0.,
- u - sqrtgH, 0., u + sqrtgH, 0.,
- v, 1., v, 0.,
- 0., 0., 0., 0.);
-#if 0
- IM = gts_matrix3_inverse (M);
- g_assert (IM != NULL);
-#else
- IM = gts_matrix_new ((sqrtgH + u)/(2.*sqrtgH), -1./(2.*sqrtgH), 0., 0.,
- - v, 0., 1., 0.,
- (sqrtgH - u)/(2.*sqrtgH), 1./(2.*sqrtgH), 0., 0.,
- 0., 0., 0., 0.);
-#endif
-
- V[0] = uR[0] - uL[0];
- V[1] = uR[0]*uR[1] - uL[0]*uL[1];
- V[2] = uR[0]*uR[2] - uL[0]*uL[2];
- matrix_vector_product (alpha, IM, V);
- gts_matrix_destroy (IM);
-
- beta[0] = alpha[0]*MIN (lambda[0], 0.0);
- beta[1] = alpha[1]*MIN (lambda[1], 0.0);
- beta[2] = alpha[2]*MIN (lambda[2], 0.0);
- matrix_vector_product (V, M, beta);
-
- flux (uL, g, f);
- f[0] += V[0];
- f[1] += V[1];
- f[2] += V[2];
-
-#if 0
- /* Flux right -> left */
-
- u = - u;
-
- lambda[0] = u - sqrtgH;
- lambda[1] = u;
- lambda[2] = u + sqrtgH;
-
- gts_matrix_assign (M,
- 1., 0., 1., 0.,
- u - sqrtgH, 0., u + sqrtgH, 0.,
- v, 1., v, 0.,
- 0., 0., 0., 0.);
- beta[0] = - alpha[2]*MIN (lambda[0], 0.0);
- beta[1] = alpha[1]*MIN (lambda[1], 0.0);
- beta[2] = - alpha[0]*MIN (lambda[2], 0.0);
- matrix_vector_product (V, M, beta);
-
- gdouble f2[3];
- flux (uR, g, f2);
- f2[0] = - f2[0] + V[0];
- f2[1] = - f2[1] + V[1];
- f2[2] = - f2[2] + V[2];
-
- g_assert (f2[0] + f[0] < 1e-10);
-#endif
-
- gts_matrix_destroy (M);
-}
-
static gdouble min (gdouble a, gdouble b)
{
return a < b ? a : b;
--
Gerris Flow Solver
More information about the debian-science-commits
mailing list