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

decoupled: renaming according to refined naming rules, this time for

local variables.
Reviewed by Benjamin.


git-svn-id: svn://svn.iws.uni-stuttgart.de/DUMUX/dumux/trunk@10776 2fb0f335-1f38-0410-981e-8018bf24f1b0
parent d4423531
......@@ -38,24 +38,24 @@ namespace Dumux
struct DecoupledTwoPCommonIndices
{
// Formulations
static const int pwsn = 0; //!< Pw and Sn as primary variables
static const int pwsn = 0; //!< pw and sn as primary variables
DUNE_DEPRECATED_MSG("use pwsn (uncapitalized 's') instead")
static const int pwSn = pwsn; //!< \deprecated
static const int pnsw = 1; //!< Pn and Sw as primary variables
static const int pnsw = 1; //!< pn and sw as primary variables
DUNE_DEPRECATED_MSG("use pnsw (uncapitalized 's') instead")
static const int pnSw = pnsw; //!< \deprecated
static const int pwsw = 2; //!< Pw and Sw as primary variables
static const int pwsw = 2; //!< pw and sw as primary variables
DUNE_DEPRECATED_MSG("use pwsw (uncapitalized 'S') instead")
static const int pwSw = pwsw; //!< \deprecated
static const int pnsn = 3; //!< Pn and Sn as primary variables
static const int pnsn = 3; //!< pn and sn as primary variables
DUNE_DEPRECATED_MSG("use pnsn (uncapitalized 'S') instead")
static const int pnSn = pnsn; //!< \deprecated
static const int pGlobalSw = 4; //!< PGlobal and Sw as primary variables
static const int pGlobalSn = 5; //!< PGlobal and Sn as primary variables
static const int pGlobalSw = 4; //!< pGlobal and sw as primary variables
static const int pGlobalSn = 5; //!< pGlobal and sn as primary variables
// Phase indices
static const int wPhaseIdx = 0; //!< Index of the wetting phase in a phase vector
......
......@@ -114,9 +114,9 @@ template<class TypeTag> class FVPressure2P: public FVPressure<TypeTag>
{
pw = Indices::pressureW,
pn = Indices::pressureNw,
pglobal = Indices::pressureGlobal,
Sw = Indices::saturationW,
Sn = Indices::saturationNw,
pGlobal = Indices::pressureGlobal,
sw = Indices::saturationW,
sn = Indices::saturationNw,
pressureIdx = Indices::pressureIdx,
saturationIdx = Indices::saturationIdx,
eqIdxPress = Indices::pressureEqIdx,
......@@ -243,10 +243,10 @@ public:
Scalar sat = 0;
switch (saturationType_)
{
case Sw:
case sw:
sat = problem_.variables().cellData(i).saturation(wPhaseIdx);
break;
case Sn:
case sn:
sat = problem_.variables().cellData(i).saturation(nPhaseIdx);
break;
}
......@@ -313,7 +313,7 @@ public:
break;
}
case pglobal:
case pGlobal:
{
cellData.setGlobalPressure(this->pressure()[globalIdx]);
break;
......@@ -336,12 +336,12 @@ public:
int size = problem_.gridView().size(0);
ScalarSolutionType *pressure = writer.allocateManagedBuffer(size);
ScalarSolutionType *pressureSecond = 0;
ScalarSolutionType *pC = 0;
ScalarSolutionType *pc = 0;
if (vtkOutputLevel_ > 0)
{
pressureSecond = writer.allocateManagedBuffer(size);
pC = writer.allocateManagedBuffer(size);
pc = writer.allocateManagedBuffer(size);
}
for (int i = 0; i < size; i++)
......@@ -364,13 +364,13 @@ public:
(*pressureSecond)[i] = cellData.pressure(wPhaseIdx);
}
}
else if (pressureType_ == pglobal)
else if (pressureType_ == pGlobal)
{
(*pressure)[i] = cellData.globalPressure();
}
if (vtkOutputLevel_ > 0)
{
(*pC)[i] = cellData.capillaryPressure();
(*pc)[i] = cellData.capillaryPressure();
}
}
......@@ -390,7 +390,7 @@ public:
writer.attachCellData(*pressureSecond, "wetting pressure");
}
}
if (pressureType_ == pglobal)
if (pressureType_ == pGlobal)
{
writer.attachCellData(*pressure, "global pressure");
......@@ -398,7 +398,7 @@ public:
if (vtkOutputLevel_ > 0)
{
writer.attachCellData(*pC, "capillary pressure");
writer.attachCellData(*pc, "capillary pressure");
}
if (compressibility_)
......@@ -436,15 +436,15 @@ public:
FVPressure2P(Problem& problem) :
ParentType(problem), problem_(problem), gravity_(problem.gravity()), maxError_(0.), timeStep_(1.)
{
if (pressureType_ != pw && pressureType_ != pn && pressureType_ != pglobal)
if (pressureType_ != pw && pressureType_ != pn && pressureType_ != pGlobal)
{
DUNE_THROW(Dune::NotImplemented, "Pressure type not supported!");
}
if (pressureType_ == pglobal && compressibility_)
if (pressureType_ == pGlobal && compressibility_)
{
DUNE_THROW(Dune::NotImplemented, "Compressibility not supported for global pressure!");
}
if (saturationType_ != Sw && saturationType_ != Sn)
if (saturationType_ != sw && saturationType_ != sn)
{
DUNE_THROW(Dune::NotImplemented, "Saturation type not supported!");
}
......@@ -544,13 +544,13 @@ void FVPressure2P<TypeTag>::getStorage(EntryType& entry, const Element& element
switch (saturationType_)
{
case Sw:
case sw:
{
entry[rhs] = -(cellData.volumeCorrection()/timeStep_ * porosity * volume
* (cellData.density(wPhaseIdx) - cellData.density(nPhaseIdx)));
break;
}
case Sn:
case sn:
{
entry[rhs] = -(cellData.volumeCorrection()/timeStep_ * porosity * volume
* (cellData.density(nPhaseIdx) - cellData.density(wPhaseIdx)));
......@@ -565,10 +565,10 @@ void FVPressure2P<TypeTag>::getStorage(EntryType& entry, const Element& element
Scalar sat = 0;
switch (saturationType_)
{
case Sw:
case sw:
sat = cellData.saturation(wPhaseIdx);
break;
case Sn:
case sn:
sat = cellData.saturation(nPhaseIdx);
break;
}
......@@ -678,7 +678,7 @@ void FVPressure2P<TypeTag>::getFlux(EntryType& entry, const Intersection& inters
potentialW = cellData.pressure(wPhaseIdx) - cellDataJ.pressure(wPhaseIdx);
potentialNW = cellData.pressure(nPhaseIdx) - cellDataJ.pressure(nPhaseIdx);
if (pressureType_ == pglobal)
if (pressureType_ == pGlobal)
{
potentialW = (cellData.globalPressure() - cellDataJ.globalPressure() - fMeanNW * (pcI - pcJ));
potentialNW = (cellData.globalPressure() - cellDataJ.globalPressure() + fMeanW * (pcI - pcJ));
......@@ -796,13 +796,13 @@ const Intersection& intersection, const CellData& cellData, const bool first)
{
switch (saturationType_)
{
case Sw:
case sw:
{
satW = boundValues[saturationIdx];
satNW = 1 - boundValues[saturationIdx];
break;
}
case Sn:
case sn:
{
satW = 1 - boundValues[saturationIdx];
satNW = boundValues[saturationIdx];
......@@ -905,7 +905,7 @@ const Intersection& intersection, const CellData& cellData, const bool first)
potentialNW = (cellData.pressure(nPhaseIdx) - pressBound);
break;
}
case pglobal:
case pGlobal:
{
potentialW = (cellData.globalPressure() - pressBound - fMeanNW * (pcI - pcBound));
potentialNW = (cellData.globalPressure() - pressBound + fMeanW * (pcI - pcBound));
......@@ -1048,7 +1048,7 @@ void FVPressure2P<TypeTag>::updateMaterialLaws()
{
cellData.setCapillaryPressure(pc);
if (pressureType_ != pglobal)
if (pressureType_ != pGlobal)
{
cellData.setPressure(wPhaseIdx, pressW);
cellData.setPressure(nPhaseIdx, pressNW);
......
......@@ -67,9 +67,9 @@ template<class TypeTag> class FVPressure2PAdaptive: public FVPressure2P<TypeTag>
{
pw = Indices::pressureW,
pn = Indices::pressureNw,
pglobal = Indices::pressureGlobal,
Sw = Indices::saturationW,
Sn = Indices::saturationNw,
pGlobal = Indices::pressureGlobal,
sw = Indices::saturationW,
sn = Indices::saturationNw,
pressureIdx = Indices::pressureIdx,
saturationIdx = Indices::saturationIdx,
eqIdxPress = Indices::pressureEqIdx,
......@@ -153,7 +153,7 @@ public:
case pn:
this->pressure()[i] = cellData.pressure(nPhaseIdx);
break;
case pglobal:
case pGlobal:
this->pressure()[i] = cellData.globalPressure();
break;
}
......@@ -198,15 +198,15 @@ public:
{
DUNE_THROW(Dune::NotImplemented, "Adaptive finite volume implementation only available in 2-d!");
}
if (pressureType_ != pw && pressureType_ != pn && pressureType_ != pglobal)
if (pressureType_ != pw && pressureType_ != pn && pressureType_ != pGlobal)
{
DUNE_THROW(Dune::NotImplemented, "Pressure type not supported!");
}
if (pressureType_ == pglobal && compressibility_)
if (pressureType_ == pGlobal && compressibility_)
{
DUNE_THROW(Dune::NotImplemented, "Compressibility not supported for global pressure!");
}
if (saturationType_ != Sw && saturationType_ != Sn)
if (saturationType_ != sw && saturationType_ != sn)
{
DUNE_THROW(Dune::NotImplemented, "Saturation type not supported!");
}
......@@ -405,7 +405,7 @@ void FVPressure2PAdaptive<TypeTag>::getFlux(EntryType& entry, const Intersection
switch (pressureType_)
{
case pglobal:
case pGlobal:
{
Scalar pressJK = (cellDataJ.globalPressure() + cellDataK.globalPressure()) / 2;
......
......@@ -87,12 +87,12 @@ class FVVelocity2P
{
pw = Indices::pressureW,
pn = Indices::pressureNw,
pglobal = Indices::pressureGlobal,
pGlobal = Indices::pressureGlobal,
vw = Indices::velocityW,
vn = Indices::velocityNw,
vt = Indices::velocityTotal,
Sw = Indices::saturationW,
Sn = Indices::saturationNw,
sw = Indices::saturationW,
sn = Indices::saturationNw,
pressureIdx = Indices::pressureIdx,
saturationIdx = Indices::saturationIdx,
eqIdxPress = Indices::pressureEqIdx,
......@@ -342,7 +342,7 @@ void FVVelocity2P<TypeTag>::calculateVelocity(const Intersection& intersection,
density_[nPhaseIdx];
}
if (pressureType_ == pglobal)
if (pressureType_ == pGlobal)
{
potentialW = (cellData.globalPressure() - cellDataJ.globalPressure()
- 0.5 * (fractionalNWI + fractionalNWJ) * (pcI - pcJ));
......@@ -418,7 +418,7 @@ void FVVelocity2P<TypeTag>::calculateVelocity(const Intersection& intersection,
* ((cellData.pressure(nPhaseIdx) - cellDataJ.pressure(nPhaseIdx)) / dist + gravityTermNW);
break;
}
case pglobal:
case pGlobal:
{
velocityW *= (lambdaW + lambdaNW) * scalarPerm * (cellData.globalPressure() - cellDataJ.globalPressure()) / dist
+ scalarPerm * (lambdaW * gravityTermW + lambdaNW * gravityTermNW);
......@@ -504,13 +504,13 @@ void FVVelocity2P<TypeTag>::calculateVelocityOnBoundary(const Intersection& inte
{
switch (saturationType_)
{
case Sw:
case sw:
{
satW = boundValues[saturationIdx];
satNW = 1 - boundValues[saturationIdx];
break;
}
case Sn:
case sn:
{
satW = 1 - boundValues[saturationIdx];
satNW = boundValues[saturationIdx];
......@@ -586,7 +586,7 @@ void FVVelocity2P<TypeTag>::calculateVelocityOnBoundary(const Intersection& inte
}
//calculate potential gradient
if (pressureType_ == pglobal)
if (pressureType_ == pGlobal)
{
potentialW = (cellData.globalPressure() - pressBound - fractionalNWI * (pcI - pcBound));
potentialNW = (cellData.globalPressure() - pressBound + fractionalWI * (pcI - pcBound));
......@@ -650,7 +650,7 @@ void FVVelocity2P<TypeTag>::calculateVelocityOnBoundary(const Intersection& inte
velocityNW *= lambdaNW * scalarPerm * ((cellData.pressure(nPhaseIdx) - pressBound) / dist + gravityTermNW);
break;
}
case pglobal:
case pGlobal:
{
velocityW *= (lambdaW + lambdaNW) * scalarPerm * (cellData.globalPressure() - pressBound) / dist
+ scalarPerm * (lambdaW * gravityTermW + lambdaNW * gravityTermNW);
......
......@@ -73,12 +73,12 @@ typedef typename GridView::Traits::template Codim<0>::Entity Element;
{
pw = Indices::pressureW,
pn = Indices::pressureNw,
pglobal = Indices::pressureGlobal,
pGlobal = Indices::pressureGlobal,
vw = Indices::velocityW,
vn = Indices::velocityNw,
vt = Indices::velocityTotal,
Sw = Indices::saturationW,
Sn = Indices::saturationNw,
sw = Indices::saturationW,
sn = Indices::saturationNw,
pressureIdx = Indices::pressureIdx,
saturationIdx = Indices::saturationIdx,
eqIdxPress = Indices::pressureEqIdx,
......@@ -346,7 +346,7 @@ void FVVelocity2PAdaptive<TypeTag>::calculateVelocity(const Intersection& inters
switch (pressureType_)
{
case pglobal:
case pGlobal:
{
Scalar pressJK = (cellDataJ.globalPressure() + cellDataK.globalPressure()) / 2;
......@@ -435,7 +435,7 @@ void FVVelocity2PAdaptive<TypeTag>::calculateVelocity(const Intersection& inters
velocityNW += gravityTermNW;
break;
}
case pglobal:
case pGlobal:
{
Scalar pressJK = (cellDataJ.globalPressure() + cellDataK.globalPressure()) / 2;
......
......@@ -91,9 +91,9 @@ class FVMPFAL2PFABoundPressure2P: public FVPressure<TypeTag>
{
pw = Indices::pressureW,
pn = Indices::pressureNw,
pglobal = Indices::pressureGlobal,
Sw = Indices::saturationW,
Sn = Indices::saturationNw,
pGlobal = Indices::pressureGlobal,
sw = Indices::saturationW,
sn = Indices::saturationNw,
vw = Indices::velocityW,
vn = Indices::velocityNw,
vt = Indices::velocityTotal
......@@ -276,10 +276,10 @@ public:
Scalar sat = 0;
switch (saturationType_)
{
case Sw:
case sw:
sat = problem_.variables().cellData(i).saturation(wPhaseIdx);
break;
case Sn:
case sn:
sat = problem_.variables().cellData(i).saturation(nPhaseIdx);
break;
}
......@@ -335,7 +335,7 @@ public:
ScalarSolutionType *pressure = writer.allocateManagedBuffer(size);
ScalarSolutionType *pressureSecond = writer.allocateManagedBuffer(size);
ScalarSolutionType *potentialSecond = writer.allocateManagedBuffer(size);
ScalarSolutionType *pC = writer.allocateManagedBuffer(size);
ScalarSolutionType *pc = writer.allocateManagedBuffer(size);
ElementIterator eItBegin = problem_.gridView().template begin<0>();
ElementIterator eItEnd = problem_.gridView().template end<0>();
......@@ -344,7 +344,7 @@ public:
int idx = problem_.variables().index(*eIt);
CellData& cellData = problem_.variables().cellData(idx);
(*pC)[idx] = cellData.capillaryPressure();
(*pc)[idx] = cellData.capillaryPressure();
if (pressureType_ == pw)
{
......@@ -377,7 +377,7 @@ public:
writer.attachCellData(*potentialSecond, "wetting potential");
}
writer.attachCellData(*pC, "capillary pressure");
writer.attachCellData(*pc, "capillary pressure");
}
return;
......@@ -396,7 +396,7 @@ public:
{
DUNE_THROW(Dune::NotImplemented, "Pressure type not supported!");
}
if (saturationType_ != Sw && saturationType_ != Sn)
if (saturationType_ != sw && saturationType_ != sn)
{
DUNE_THROW(Dune::NotImplemented, "Saturation type not supported!");
}
......@@ -482,10 +482,10 @@ private:
Scalar sat = 0;
switch (saturationType_)
{
case Sw:
case sw:
sat = cellData.saturation(wPhaseIdx);
break;
case Sn:
case sn:
sat = cellData.saturation(nPhaseIdx);
break;
}
......@@ -1824,12 +1824,12 @@ void FVMPFAL2PFABoundPressure2P<TypeTag>::assemble()
Scalar satBound = interactionVolume.getDirichletValues(intVolFaceIdx)[saturationIdx];
switch (saturationType_)
{
case Sw:
case sw:
{
satWBound = satBound;
break;
}
case Sn:
case sn:
{
satWBound = 1 - satBound;
break;
......@@ -1895,24 +1895,24 @@ void FVMPFAL2PFABoundPressure2P<TypeTag>::assemble()
case pw:
{
// calculate capillary pressure gradient
DimVector pCGradient = unitDistVec;
pCGradient *= (pc - pcBound) / dist;
DimVector pcGradient = unitDistVec;
pcGradient *= (pc - pcBound) / dist;
//add capillary pressure term to right hand side
pcFlux = 0.5 * (lambda[nPhaseIdx] + lambdaBound[nPhaseIdx])
* (permTimesNormal * pCGradient) * faceArea;
* (permTimesNormal * pcGradient) * faceArea;
break;
}
case pn:
{
// calculate capillary pressure gradient
DimVector pCGradient = unitDistVec;
pCGradient *= (pc - pcBound) / dist;
DimVector pcGradient = unitDistVec;
pcGradient *= (pc - pcBound) / dist;
//add capillary pressure term to right hand side
pcFlux = 0.5 * (lambda[wPhaseIdx] + lambdaBound[wPhaseIdx])
* (permTimesNormal * pCGradient) * faceArea;
* (permTimesNormal * pcGradient) * faceArea;
break;
......
......@@ -93,9 +93,9 @@ class FVMPFAL2PFABoundPressure2PAdaptive: public FVPressure<TypeTag>
{
pw = Indices::pressureW,
pn = Indices::pressureNw,
pglobal = Indices::pressureGlobal,
Sw = Indices::saturationW,
Sn = Indices::saturationNw,
pGlobal = Indices::pressureGlobal,
sw = Indices::saturationW,
sn = Indices::saturationNw,
vw = Indices::velocityW,
vn = Indices::velocityNw,
vt = Indices::velocityTotal
......@@ -287,10 +287,10 @@ public:
Scalar sat = 0;
switch (saturationType_)
{
case Sw:
case sw:
sat = problem_.variables().cellData(i).saturation(wPhaseIdx);
break;
case Sn:
case sn:
sat = problem_.variables().cellData(i).saturation(nPhaseIdx);
break;
}
......@@ -371,7 +371,7 @@ public:
ScalarSolutionType *pressure = writer.allocateManagedBuffer(size);
ScalarSolutionType *pressureSecond = writer.allocateManagedBuffer(size);
ScalarSolutionType *potentialSecond = writer.allocateManagedBuffer(size);
ScalarSolutionType *pC = writer.allocateManagedBuffer(size);
ScalarSolutionType *pc = writer.allocateManagedBuffer(size);
ElementIterator eItBegin = problem_.gridView().template begin<0>();
ElementIterator eItEnd = problem_.gridView().template end<0>();
......@@ -380,7 +380,7 @@ public:
int idx = problem_.variables().index(*eIt);
CellData& cellData = problem_.variables().cellData(idx);
(*pC)[idx] = cellData.capillaryPressure();
(*pc)[idx] = cellData.capillaryPressure();
if (pressureType_ == pw)
{
......@@ -413,7 +413,7 @@ public:
writer.attachCellData(*potentialSecond, "wetting potential");
}
writer.attachCellData(*pC, "capillary pressure");
writer.attachCellData(*pc, "capillary pressure");
}
return;
......@@ -432,7 +432,7 @@ public:
{
DUNE_THROW(Dune::NotImplemented, "Pressure type not supported!");
}
if (saturationType_ != Sw && saturationType_ != Sn)
if (saturationType_ != sw && saturationType_ != sn)
{
DUNE_THROW(Dune::NotImplemented, "Saturation type not supported!");
}
......@@ -523,10 +523,10 @@ private:
Scalar sat = 0;
switch (saturationType_)
{
case Sw:
case sw:
sat = cellData.saturation(wPhaseIdx);
break;
case Sn:
case sn:
sat = cellData.saturation(nPhaseIdx);
break;
}
......@@ -2638,12 +2638,12 @@ void FVMPFAL2PFABoundPressure2PAdaptive<TypeTag>::assemble()
Scalar satBound = interactionVolume.getDirichletValues(intVolFaceIdx)[saturationIdx];
switch (saturationType_)
{
case Sw:
case sw:
{
satWBound = satBound;
break;
}
case Sn:
case sn:
{
satWBound = 1 - satBound;
break;
......@@ -2709,24 +2709,24 @@ void FVMPFAL2PFABoundPressure2PAdaptive<TypeTag>::assemble()
case pw:
{
// calculate capillary pressure gradient
DimVector pCGradient = unitDistVec;
pCGradient *= (pc - pcBound) / dist;
DimVector pcGradient = unitDistVec;
pcGradient *= (pc - pcBound) / dist;
//add capillary pressure term to right hand side
pcFlux = 0.5 * (lambda[nPhaseIdx] + lambdaBound[nPhaseIdx])
* (permTimesNormal * pCGradient) * faceArea;
* (permTimesNormal * pcGradient) * faceArea;
break;
}
case pn:
{
// calculate capillary pressure gradient
DimVector pCGradient = unitDistVec;
pCGradient *= (pc - pcBound) / dist;
DimVector pcGradient = unitDistVec;
pcGradient *= (pc - pcBound) / dist;
//add capillary pressure term to right hand side
pcFlux = 0.5 * (lambda[wPhaseIdx] + lambdaBound[wPhaseIdx])
* (permTimesNormal * pCGradient) * faceArea;
* (permTimesNormal * pcGradient) * faceArea;
break;