Commit 1e4f72d6 authored by Bernd Flemisch's avatar Bernd Flemisch
Browse files

use shorthand notation for scalar product

git-svn-id: svn://svn.iws.uni-stuttgart.de/DUMUX/dumux/trunk@7348 2fb0f335-1f38-0410-981e-8018bf24f1b0
parent 8362aa71
......@@ -335,8 +335,8 @@ protected:
// use two-point gradients
const GlobalPosition &posI = element.geometry().corner(face().i);
const GlobalPosition &posJ = element.geometry().corner(face().j);
for (int i = 0; i < Vector::dimension; ++ i)
tmp[i] = posI[i] - posJ[i];
tmp = posI;
tmp -= posJ;
Scalar dist = tmp.two_norm();
tmp = face().normal;
......
......@@ -249,10 +249,7 @@ public:
if(!useMoles)
{
// diffusive flux of the second component - massfraction
tmp = 0;
for (int i = 0; i < Vector::dimension; ++ i)
tmp += fluxVars.massFracGrad(comp1Idx)[i]*fluxVars.face().normal[i];
tmp *= -1;
tmp = -(fluxVars.massFracGrad(comp1Idx)*fluxVars.face().normal);
tmp *= fluxVars.porousDiffCoeff() * fluxVars.densityAtIP();
flux[transEqIdx] += tmp;// * FluidSystem::molarMass(comp1Idx);
......@@ -260,10 +257,7 @@ public:
else
{
// diffusive flux of the second component - molefraction
tmp = 0;
for (int i = 0; i < Vector::dimension; ++ i)
tmp += fluxVars.moleFracGrad(comp1Idx)[i]*fluxVars.face().normal[i];
tmp *= -1;
tmp = -(fluxVars.moleFracGrad(comp1Idx)*fluxVars.face().normal);
tmp *= fluxVars.porousDiffCoeff() * fluxVars.molarDensityAtIP();
// dispersive flux of second component - molefraction
......@@ -416,10 +410,7 @@ protected:
*vertVars.fluidState().massFraction(phaseIdx, comp1Idx);
// diffusive flux of comp1 component in phase0
Scalar tmp = 0;
for (int i = 0; i < Vector::dimension; ++ i)
tmp += boundaryVars.massFracGrad(comp1Idx)[i]*boundaryVars.boundaryFace().normal[i];
tmp *= -1;
Scalar tmp = -(boundaryVars.massFracGrad(comp1Idx)*boundaryVars.boundaryFace().normal);
tmp *= boundaryVars.porousDiffCoeff()*boundaryVars.densityAtIP();
values[transEqIdx] += tmp;//* FluidSystem::molarMass(comp1Idx);
......@@ -432,10 +423,7 @@ protected:
*vertVars.fluidState().moleFraction(phaseIdx, comp1Idx);
// diffusive flux of comp1 component in phase0
Scalar tmp = 0;
for (int i = 0; i < Vector::dimension; ++ i)
tmp += boundaryVars.moleFracGrad(comp1Idx)[i]*boundaryVars.boundaryFace().normal[i];
tmp *= -1;
Scalar tmp = -(boundaryVars.moleFracGrad(comp1Idx)*boundaryVars.boundaryFace().normal);
tmp *= boundaryVars.porousDiffCoeff()*boundaryVars.molarDensityAtIP();
values[transEqIdx] += tmp;
......
......@@ -147,10 +147,7 @@ public:
// current sub control volume face
fluxVars.intrinsicPermeability().mv(fluxVars.potentialGrad(phaseIdx),
tmpVec);
Scalar normalFlux = 0;
for (int i = 0; i < Vector::dimension; ++i)
normalFlux += tmpVec[i]*fluxVars.face().normal[i];
normalFlux *= -1;
Scalar normalFlux = -(tmpVec*fluxVars.face().normal);
// data attached to upstream and the downstream vertices
// of the current phase
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment