From 27a90b9dfff86643f9ab9a59174effd3bead434f Mon Sep 17 00:00:00 2001 From: Marc Fehling Date: Fri, 30 Jun 2023 13:45:36 -0600 Subject: [PATCH] Make step-55 work in 3D. --- examples/step-55/step-55.cc | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/examples/step-55/step-55.cc b/examples/step-55/step-55.cc index 8aeb114bf0..6b6b671cd8 100644 --- a/examples/step-55/step-55.cc +++ b/examples/step-55/step-55.cc @@ -206,6 +206,7 @@ namespace Step55 constexpr double pi = numbers::PI; constexpr double pi2 = numbers::PI * numbers::PI; + // velocity values[0] = -1.0L / 2.0L * (-2 * std::sqrt(25.0 + 4 * pi2) + 10.0) * std::exp(R_x * (-2 * std::sqrt(25.0 + 4 * pi2) + 10.0)) - 0.4 * pi2 * std::exp(R_x * (-std::sqrt(25.0 + 4 * pi2) + 5.0)) * @@ -219,7 +220,9 @@ namespace Step55 0.05 * std::pow(-std::sqrt(25.0 + 4 * pi2) + 5.0, 3) * std::exp(R_x * (-std::sqrt(25.0 + 4 * pi2) + 5.0)) * std::sin(2 * R_y * pi) / pi; - values[2] = 0; + + // pressure + values[dim] = 0; } @@ -245,13 +248,16 @@ namespace Step55 constexpr double pi = numbers::PI; constexpr double pi2 = numbers::PI * numbers::PI; + // velocity values[0] = -std::exp(R_x * (-std::sqrt(25.0 + 4 * pi2) + 5.0)) * std::cos(2 * R_y * pi) + 1; values[1] = (1.0L / 2.0L) * (-std::sqrt(25.0 + 4 * pi2) + 5.0) * std::exp(R_x * (-std::sqrt(25.0 + 4 * pi2) + 5.0)) * std::sin(2 * R_y * pi) / pi; - values[2] = + + // pressure + values[dim] = -1.0L / 2.0L * std::exp(R_x * (-2 * std::sqrt(25.0 + 4 * pi2) + 10.0)) - 2.0 * (-6538034.74494422 + -- 2.39.5