From: Guido Kanschat Date: Wed, 26 Sep 2007 04:03:31 +0000 (+0000) Subject: fix Kovasnzay flow X-Git-Tag: v8.0.0~9818 X-Git-Url: https://gitweb.dealii.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=819f611be6fa57f99e62f0283b1d1eecc1b41872;p=dealii.git fix Kovasnzay flow git-svn-id: https://svn.dealii.org/trunk@15244 0785d39b-7218-0410-832d-ea1e28bc413d --- diff --git a/deal.II/base/include/base/flow_function.h b/deal.II/base/include/base/flow_function.h index ca49d35955..794c1f9dbd 100644 --- a/deal.II/base/include/base/flow_function.h +++ b/deal.II/base/include/base/flow_function.h @@ -226,7 +226,6 @@ namespace Functions std::vector > >& gradients) const; virtual void vector_laplacians (const std::vector > &points, std::vector > &values) const; - private: /// The auxiliary function Psi. double Psi(double phi) const; @@ -286,9 +285,11 @@ namespace Functions virtual void vector_laplacians (const std::vector > &points, std::vector > &values) const; + /// The value of lambda. + double lambda () const; private: const double Reynolds; - double lambda; + double lbda; double p_average; const bool stokes; }; diff --git a/deal.II/base/source/flow_function.cc b/deal.II/base/source/flow_function.cc index 8c219bb703..74412a12b0 100644 --- a/deal.II/base/source/flow_function.cc +++ b/deal.II/base/source/flow_function.cc @@ -613,7 +613,7 @@ namespace Functions long double r2 = Reynolds/2.; long double b = 4*M_PI*M_PI; long double l = -b/(r2+std::sqrt(r2*r2+b)); - lambda = l; + lbda = l; // mean pressure for a domain // spreading from -.5 to 1.5 in // x-direction @@ -640,11 +640,11 @@ namespace Functions const Point<2>& p = points[k]; const double x = p(0); const double y = 2. * deal_II_numbers::PI * p(1); - const double elx = std::exp(lambda*x); + const double elx = std::exp(lbda*x); values[0][k] = 1. - elx * cos(y); - values[1][k] = .5 / deal_II_numbers::PI * lambda * elx * sin(y); - values[2][k] = .5 * elx * elx - p_average - this->mean_pressure; + values[1][k] = .5 / deal_II_numbers::PI * lbda * elx * sin(y); + values[2][k] = -.5 * elx * elx + p_average - this->mean_pressure; } } @@ -653,29 +653,28 @@ namespace Functions const std::vector >& points, std::vector > >& gradients) const { - Assert(false, ExcNotImplemented()); unsigned int n = points.size(); - Assert (gradients.size() == n, ExcDimensionMismatch(gradients.size(), n)); - Assert (gradients[0].size() >= this->n_components, - ExcDimensionMismatch(gradients[0].size(), this->n_components)); + Assert (gradients.size() == 3, ExcDimensionMismatch(gradients.size(), 3)); + Assert (gradients[0].size() == n, + ExcDimensionMismatch(gradients[0].size(), n)); for (unsigned int i=0;i& p = points[k]; const double x = p(0); const double y = zp * p(1); - const double elx = std::exp(lambda*x); + const double elx = std::exp(lbda*x); const double u = 1. - elx * cos(y); - const double ux = -lambda * elx * cos(y); + const double ux = -lbda * elx * cos(y); const double uy = elx * zp * sin(y); - const double v = lambda/zp * elx * sin(y); - const double vx = lambda*lambda/zp * elx * sin(y); - const double vy = zp*lambda/zp * elx * cos(y); + const double v = lbda/zp * elx * sin(y); + const double vx = lbda*lbda/zp * elx * sin(y); + const double vy = zp*lbda/zp * elx * cos(y); values[0][k] = u*ux+v*uy; values[1][k] = u*vx+v*vy; @@ -720,6 +719,11 @@ namespace Functions } } + double + Kovasznay::lambda () const + { + return lbda; + }