From 0878c19a981a288a8d762eb1c9642f33ea933af9 Mon Sep 17 00:00:00 2001 From: Martin Schneider <martin.schneider@iws.uni-stuttgart.de> Date: Wed, 30 Oct 2019 21:56:47 +0100 Subject: [PATCH] [fix][cakegrid] Get rid of well radius The well radius was a seperate parameter that has been added to all given radial coordinates, which results on different coordinates then expected --- dumux/io/grid/cakegridmanager.hh | 20 +++++++++---------- .../gridmanager/test_gridmanager_cake.input | 3 +-- 2 files changed, 10 insertions(+), 13 deletions(-) diff --git a/dumux/io/grid/cakegridmanager.hh b/dumux/io/grid/cakegridmanager.hh index 91015b09e0..08cb95fad3 100644 --- a/dumux/io/grid/cakegridmanager.hh +++ b/dumux/io/grid/cakegridmanager.hh @@ -112,6 +112,9 @@ public: { positions[i] = getParamFromGroup<std::vector<Scalar>>(modelParamGroup, "Grid.Radial" + std::to_string(i)); indices[0] = i; // Index specifying radial direction + + if(positions[i][0] < 1.0e-8) + DUNE_THROW(Dune::GridError, "Make sure that the first radial entry corresponds to the well radius (>1e-8)"); } else if (hasAngular) @@ -130,6 +133,8 @@ public: DUNE_THROW(Dune::GridError, "Make sure to specify a monotone increasing \"Positions\" array"); } + + // check that all indices are specified i.e. > 0 for (int i = 0; i < dim; ++i) if (indices[i] < 0) @@ -207,7 +212,6 @@ public: if (verbose) std::cout << " -> h " << height * length << std::endl; } - // if grading factor is not 1.0, do power law spacing else { @@ -298,16 +302,13 @@ public: { for (int i = 0; i <= dR.size()- 1; ++i) { - // Get radius for the well (= a hole) in the center - const auto wellRadius = getParamFromGroup<Scalar>(modelParamGroup, "Grid.WellRadius"); - // transform into Cartesian coordinates using std::cos; using std::sin; Dune::FieldVector <double, dim> v(0.0); v[indices[2]] = dZ[l]; - v[indices[0]] = cos(dA[j])*wellRadius + cos(dA[j])*dR[i]; - v[indices[1]] = sin(dA[j])*wellRadius + sin(dA[j])*dR[i]; + v[indices[0]] = cos(dA[j])*dR[i]; + v[indices[1]] = sin(dA[j])*dR[i]; if (verbose) { std::cout << "Coordinates of : " @@ -390,14 +391,11 @@ public: { for (int i = 0; i <= dR.size()- 1; ++i) { - // Get radius for the well (= a hole) in the center - const Scalar wellRadius = getParamFromGroup<Scalar>(modelParamGroup, "Grid.WellRadius"); - // transform into Cartesian coordinates Dune::FieldVector <double, dim> v(0.0); - v[indices[0]] = cos(dA[j])*wellRadius + cos(dA[j])*dR[i]; - v[indices[1]] = sin(dA[j])*wellRadius + sin(dA[j])*dR[i]; + v[indices[0]] = cos(dA[j])*dR[i]; + v[indices[1]] = sin(dA[j])*dR[i]; if(verbose) std::cout << "Coordinates of : " << v[0] << " " << v[1] << std::endl; gridFactory.insertVertex(v); diff --git a/test/io/gridmanager/test_gridmanager_cake.input b/test/io/gridmanager/test_gridmanager_cake.input index bafe5dc24a..d9785ff71d 100644 --- a/test/io/gridmanager/test_gridmanager_cake.input +++ b/test/io/gridmanager/test_gridmanager_cake.input @@ -5,7 +5,6 @@ Cells2 = 3 Grading0 = 1.5 Grading1 = 1.0 Grading2 = 1.5 -Radial0 = 0.0 1.0 +Radial0 = 0.005 1.0 Angular1 = 0.0 360.0 Axial2 = 0.0 1.0 -WellRadius = 0.005 -- GitLab