From 0a34f07742328967d20235956699ed9836868564 Mon Sep 17 00:00:00 2001 From: Timo Koch <timo.koch@iws.uni-stuttgart.de> Date: Wed, 25 Mar 2015 10:55:32 +0000 Subject: [PATCH] [1p2c] Delete the useTwoPointGradients function. The function is unique to the 1p2c model is not actively in use (functions in the spatial params always return false). It is still possible to globally use two point gradients with the box method by setting the property ImplicitUseTwoPointFluxes. git-svn-id: svn://svn.iws.uni-stuttgart.de/DUMUX/dumux/trunk@14442 2fb0f335-1f38-0410-981e-8018bf24f1b0 --- dumux/implicit/1p2c/1p2cfluxvariables.hh | 79 +++++++------------ .../el1p2c/el1p2cspatialparams.hh | 15 ---- test/implicit/1p/1pnispatialparams.hh | 7 -- test/implicit/1p2c/1p2cnispatialparams.hh | 7 -- .../implicit/1p2c/1p2coutflowspatialparams.hh | 7 -- test/implicit/3p/3pnispatialparams.hh | 8 -- .../richards/richardsnispatialparams.hh | 8 -- 7 files changed, 29 insertions(+), 102 deletions(-) diff --git a/dumux/implicit/1p2c/1p2cfluxvariables.hh b/dumux/implicit/1p2c/1p2cfluxvariables.hh index ff2a651a29..7f4eefda5e 100644 --- a/dumux/implicit/1p2c/1p2cfluxvariables.hh +++ b/dumux/implicit/1p2c/1p2cfluxvariables.hh @@ -293,58 +293,37 @@ protected: const VolumeVariables &volVarsI = elemVolVars[face().i]; const VolumeVariables &volVarsJ = elemVolVars[face().j]; - GlobalPosition tmp; - if (!problem.spatialParams().useTwoPointGradient(element, face().i, face().j)) { - // use finite-element gradients - tmp = 0.0; - for (unsigned int idx = 0; - idx < face().numFap; - idx++) // loop over adjacent vertices - { - // FE gradient at vertex idx - const GlobalPosition &feGrad = face().grad[idx]; - - // index for the element volume variables - int volVarsIdx = face().fapIndices[idx]; - - // the pressure gradient - tmp = feGrad; - tmp *= elemVolVars[volVarsIdx].pressure(); - potentialGrad_ += tmp; - - // the mole-fraction gradient - tmp = feGrad; - tmp *= elemVolVars[volVarsIdx].moleFraction(transportCompIdx); - moleFractionGrad_ += tmp; - - // phase viscosity - viscosity_ += elemVolVars[volVarsIdx].viscosity()*face().shapeValue[idx]; - - //phase molar density - molarDensity_ += elemVolVars[volVarsIdx].molarDensity()*face().shapeValue[idx]; - - //phase density - density_ += elemVolVars[volVarsIdx].density()*face().shapeValue[idx]; - } - } - else { - // use two-point gradients - const auto geometry = element.geometry(); - const GlobalPosition &globalPosI = geometry.corner(face().i); - const GlobalPosition &globalPosJ = geometry.corner(face().j); - tmp = globalPosI; - tmp -= globalPosJ; - Scalar dist = tmp.two_norm(); - - tmp = face().normal; - tmp /= face().normal.two_norm()*dist; - - potentialGrad_ = tmp; - potentialGrad_ *= volVarsJ.pressure() - volVarsI.pressure(); - moleFractionGrad_ = tmp; - moleFractionGrad_ *= volVarsJ.moleFraction(transportCompIdx) - volVarsI.moleFraction(transportCompIdx); + GlobalPosition tmp(0.0); + // use finite-element gradients + for (unsigned int idx = 0; idx < face().numFap; idx++) // loop over adjacent vertices + { + // FE gradient at vertex idx + const GlobalPosition &feGrad = face().grad[idx]; + + // index for the element volume variables + int volVarsIdx = face().fapIndices[idx]; + + // the pressure gradient + tmp = feGrad; + tmp *= elemVolVars[volVarsIdx].pressure(); + potentialGrad_ += tmp; + + // the mole-fraction gradient + tmp = feGrad; + tmp *= elemVolVars[volVarsIdx].moleFraction(transportCompIdx); + moleFractionGrad_ += tmp; + + // phase viscosity + viscosity_ += elemVolVars[volVarsIdx].viscosity()*face().shapeValue[idx]; + + //phase molar density + molarDensity_ += elemVolVars[volVarsIdx].molarDensity()*face().shapeValue[idx]; + + //phase density + density_ += elemVolVars[volVarsIdx].density()*face().shapeValue[idx]; } + /////////////// // correct the pressure gradients by the gravitational acceleration /////////////// diff --git a/test/geomechanics/el1p2c/el1p2cspatialparams.hh b/test/geomechanics/el1p2c/el1p2cspatialparams.hh index 3d491ba0ce..6d65645a96 100644 --- a/test/geomechanics/el1p2c/el1p2cspatialparams.hh +++ b/test/geomechanics/el1p2c/el1p2cspatialparams.hh @@ -185,21 +185,6 @@ public: return param; } - /*! - * \brief Define if the model should apply two-point approximation - * instead of a box approximation for the fluxes - * - * \param element The finite element - * \param vertexI first point for the two-point flux approximation - * \param vertexJ second point for the two-point flux approximation - */ - bool useTwoPointGradient(const Element &element, - int vertexI, - int vertexJ) const - { - return false; - } - /*! * \brief Return dispersivity (not needed here * diff --git a/test/implicit/1p/1pnispatialparams.hh b/test/implicit/1p/1pnispatialparams.hh index 42f4824c11..19895fe0cd 100644 --- a/test/implicit/1p/1pnispatialparams.hh +++ b/test/implicit/1p/1pnispatialparams.hh @@ -116,13 +116,6 @@ public: return 0; } - bool useTwoPointGradient(const Element &element, - const int vertexI, - const int vertexJ) const - { - return false; - } - /*! * \brief Returns the heat capacity \f$[J / (kg K)]\f$ of the rock matrix. * diff --git a/test/implicit/1p2c/1p2cnispatialparams.hh b/test/implicit/1p2c/1p2cnispatialparams.hh index e771c7ade9..07206f29c1 100644 --- a/test/implicit/1p2c/1p2cnispatialparams.hh +++ b/test/implicit/1p2c/1p2cnispatialparams.hh @@ -116,13 +116,6 @@ public: return 0; } - bool useTwoPointGradient(const Element &element, - const int vertexI, - const int vertexJ) const - { - return false; - } - /*! * \brief Returns the heat capacity \f$[J / (kg K)]\f$ of the rock matrix. * diff --git a/test/implicit/1p2c/1p2coutflowspatialparams.hh b/test/implicit/1p2c/1p2coutflowspatialparams.hh index deefb643f5..e329be316a 100644 --- a/test/implicit/1p2c/1p2coutflowspatialparams.hh +++ b/test/implicit/1p2c/1p2coutflowspatialparams.hh @@ -118,13 +118,6 @@ public: return 0; } - bool useTwoPointGradient(const Element &element, - const int vertexI, - const int vertexJ) const - { - return false; - } - /*! * \brief Returns the heat capacity \f$[J / (kg K)]\f$ of the rock matrix. * diff --git a/test/implicit/3p/3pnispatialparams.hh b/test/implicit/3p/3pnispatialparams.hh index 17c6695fcd..a1e4e6ab9c 100644 --- a/test/implicit/3p/3pnispatialparams.hh +++ b/test/implicit/3p/3pnispatialparams.hh @@ -158,14 +158,6 @@ public: return materialParams_; } - - bool useTwoPointGradient(const Element &element, - const int vertexI, - const int vertexJ) const - { - return false; - } - /*! * \brief Returns the heat capacity \f$[J / (kg K)]\f$ of the rock matrix. * diff --git a/test/implicit/richards/richardsnispatialparams.hh b/test/implicit/richards/richardsnispatialparams.hh index 017e393693..be724a4b11 100644 --- a/test/implicit/richards/richardsnispatialparams.hh +++ b/test/implicit/richards/richardsnispatialparams.hh @@ -165,14 +165,6 @@ public: return materialParams_; } - - bool useTwoPointGradient(const Element &element, - const int vertexI, - const int vertexJ) const - { - return false; - } - /*! * \brief Returns the heat capacity \f$[J / (kg K)]\f$ of the rock matrix. * -- GitLab