Commit f4d5a58b authored by Bernd Flemisch's avatar Bernd Flemisch
Browse files

box 2p2c: use the identity of SubControlVolumeFace and BoundaryFace.

Now, the only reason for having BoundaryVariables in addition to
FluxVariables is that a different datatype triggers a different value of
the parameter onBoundary in the corresponding constructors. 


git-svn-id: svn://svn.iws.uni-stuttgart.de/DUMUX/dumux/trunk@7395 2fb0f335-1f38-0410-981e-8018bf24f1b0
parent b5355b50
......@@ -94,10 +94,8 @@ public:
int faceIdx,
const ElementVolumeVariables &elemVolVars,
bool onBoundary = false)
: fvGeom_(elemGeom)
: fvGeom_(elemGeom), faceIdx_(faceIdx), onBoundary_(onBoundary)
{
scvfIdx_ = faceIdx;
for (int phaseIdx = 0; phaseIdx < numPhases; ++phaseIdx) {
densityAtIP_[phaseIdx] = Scalar(0);
molarDensityAtIP_[phaseIdx] = Scalar(0);
......@@ -108,10 +106,9 @@ public:
if (!onBoundary)
{
const SCVFace &face = fvGeom_.subContVolFace[scvfIdx_];
calculateValues_(problem, element, face, elemVolVars);
calculateValues_(problem, element, face(), elemVolVars);
}
}
};
protected:
template <class FaceType>
......@@ -363,11 +360,17 @@ public:
{ return molarConcGrad_[phaseIdx]; };
const SCVFace &face() const
{ return fvGeom_.subContVolFace[scvfIdx_]; }
{
if (onBoundary_)
return fvGeom_.boundaryFace[faceIdx_];
else
return fvGeom_.subContVolFace[faceIdx_];
}
protected:
const FVElementGeometry &fvGeom_;
int scvfIdx_;
const int faceIdx_;
const bool onBoundary_;
// gradients
Vector potentialGrad_[numPhases];
......
......@@ -405,7 +405,7 @@ class TwoPTwoCLocalResidual: public GET_PROP_TYPE(TypeTag, BaseLocalResidual)
}
// add diffusive flux of gas component in liquid phase
Scalar tmp = boundaryVars.molarConcGrad(lPhaseIdx)*boundaryVars.boundaryFace().normal;
Scalar tmp = boundaryVars.molarConcGrad(lPhaseIdx)*boundaryVars.face().normal;
tmp *= -1;
tmp *= boundaryVars.porousDiffCoeff(lPhaseIdx) *
boundaryVars.molarDensityAtIP(lPhaseIdx);
......@@ -416,7 +416,7 @@ class TwoPTwoCLocalResidual: public GET_PROP_TYPE(TypeTag, BaseLocalResidual)
flux[contiLEqIdx] -= tmp * FluidSystem::molarMass(lCompIdx);
// add diffusive flux of liquid component in gas phase
tmp = boundaryVars.molarConcGrad(gPhaseIdx)*boundaryVars.boundaryFace().normal;
tmp = boundaryVars.molarConcGrad(gPhaseIdx)*boundaryVars.face().normal;
tmp *= -1;
tmp *= boundaryVars.porousDiffCoeff(gPhaseIdx) *
boundaryVars.molarDensityAtIP(gPhaseIdx);
......
......@@ -63,24 +63,10 @@ public:
const FVElementGeometry &elemGeom,
int boundaryFaceIdx,
const ElementVolumeVariables &elemDat)
: ParentType(problem, element, elemGeom, boundaryFaceIdx, elemDat, /*onBoundary=*/ true),
fvGeom_(elemGeom)
: ParentType(problem, element, elemGeom, boundaryFaceIdx, elemDat, /*onBoundary=*/ true)
{
// evaluate variables at the integration point of the boundary face
boundaryFaceIdx_ = boundaryFaceIdx;
const BoundaryFace &boundaryFace = elemGeom.boundaryFace[boundaryFaceIdx_];
ParentType::calculateValues_(problem, element, boundaryFace, elemDat, /*onBoundary=*/ true);
};
// CAREFUL: use this method to address boundary faces
// DO NOT USE face() from the parent flux variables!!!
const BoundaryFace &boundaryFace() const
{ return fvGeom_.boundaryFace[boundaryFaceIdx_]; };
private:
FVElementGeometry fvGeom_;
int boundaryFaceIdx_;
ParentType::calculateValues_(problem, element, this->face(), elemDat, /*onBoundary=*/ true);
}
};
} // end namespace
......
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