Commit 89460468 authored by Katherina Baber's avatar Katherina Baber
Browse files

changed index names:

xIdx = x1Idx
comp1Idx = comp0Idx
comp2Idx = comp1Idx


git-svn-id: svn://svn.iws.uni-stuttgart.de/DUMUX/dumux/trunk@5311 2fb0f335-1f38-0410-981e-8018bf24f1b0
parent c389152b
......@@ -73,8 +73,8 @@ class OnePTwoCBoundaryVariables
enum {
phaseIdx = Indices::phaseIdx,
comp1pIdx = Indices::comp1Idx,
comp2Idx = Indices::comp2Idx,
comp0Idx = Indices::comp0Idx,
comp1Idx = Indices::comp1Idx,
numPhases = GET_PROP_VALUE(TypeTag, PTAG(NumPhases))
};
......@@ -166,11 +166,11 @@ protected:
// the concentration gradient of the non-wetting
// component in the wetting phase
tmp = feGrad;
tmp *= elemDat[idx].fluidState().massFrac(phaseIdx, comp2Idx);
tmp *= elemDat[idx].fluidState().massFrac(phaseIdx, comp1Idx);
concentrationGrad_ += tmp;
tmp = feGrad;
tmp *= elemDat[idx].fluidState().moleFrac(phaseIdx, comp2Idx);
tmp *= elemDat[idx].fluidState().moleFrac(phaseIdx, comp1Idx);
molarConcGrad_ += tmp;
pressureAtIP_ += elemDat[idx].pressure()*boundaryFace_->shapeValue[idx];
......
......@@ -48,14 +48,14 @@ class OnePTwoCFluidState : public FluidState<typename GET_PROP_TYPE(TypeTag, PTA
enum {
pressureIdx = Indices::pressureIdx,
xIdx = Indices::xIdx,
x1Idx = Indices::x1Idx,
contiEqIdx = Indices::contiEqIdx,
transEqIdx = Indices::transEqIdx,
phaseIdx = Indices::phaseIdx,
comp0Idx = Indices::comp0Idx,
comp1Idx = Indices::comp1Idx,
comp2Idx = Indices::comp2Idx,
};
public:
......@@ -76,15 +76,15 @@ public:
temperature_ = temperature;
phasePressure_ = primaryVars[pressureIdx];
x_ = primaryVars[xIdx]; //mole fraction of component 2
x1_ = primaryVars[x1Idx]; //mole fraction of component 2
meanMolarMass_ =
(1 - x_)*FluidSystem::molarMass(comp1Idx) +
(x_ )*FluidSystem::molarMass(comp2Idx);
(1 - x1_)*FluidSystem::molarMass(comp0Idx) +
(x1_ )*FluidSystem::molarMass(comp1Idx);
density_ = FluidSystem::phaseDensity(phaseIdx, temperature_, phasePressure_, *this);
molarDensity_ = density_ / meanMolarMass_;
Valgrind::CheckDefined(x_);
Valgrind::CheckDefined(x1_);
Valgrind::CheckDefined(phasePressure_);
Valgrind::CheckDefined(density_);
Valgrind::CheckDefined(meanMolarMass_);
......@@ -111,10 +111,10 @@ public:
// we are a single phase model!
if (phaseIndex != phaseIdx) return 0.0;
if (compIdx==comp1Idx)
return 1-x_;
else if (compIdx==comp2Idx)
return x_;
if (compIdx==comp0Idx)
return 1-x1_;
else if (compIdx==comp1Idx)
return x1_;
return 0.0;
}
......@@ -213,7 +213,7 @@ public:
{ return temperature_; };
public:
Scalar x_;
Scalar x1_;
Scalar phasePressure_;
Scalar density_;
Scalar molarDensity_;
......
......@@ -73,8 +73,8 @@ class OnePTwoCFluxVariables
typedef typename GridView::template Codim<0>::Entity Element;
enum {
phaseIdx = Indices::phaseIdx,
comp0Idx = Indices::comp0Idx,
comp1Idx = Indices::comp1Idx,
comp2Idx = Indices::comp2Idx,
};
public:
/*
......@@ -228,11 +228,11 @@ protected:
// the concentration gradient
tmp = feGrad;
tmp *= elemDat[idx].concentration(comp2Idx);
tmp *= elemDat[idx].concentration(comp1Idx);
concentrationGrad_ += tmp;
tmp = feGrad;
tmp *= elemDat[idx].moleFrac(comp2Idx);
tmp *= elemDat[idx].moleFrac(comp1Idx);
molarConcGrad_ += tmp;
// phase viscosity
......@@ -254,9 +254,9 @@ protected:
potentialGrad_ = tmp;
potentialGrad_ *= vVars_j.pressure() - vVars_i.pressure();
concentrationGrad_ = tmp;
concentrationGrad_ *= vVars_j.concentration(comp2Idx) - vVars_i.concentration(comp2Idx);
concentrationGrad_ *= vVars_j.concentration(comp1Idx) - vVars_i.concentration(comp1Idx);
molarConcGrad_ = tmp;
molarConcGrad_ *= vVars_j.moleFrac(comp2Idx) - vVars_i.moleFrac(comp2Idx);
molarConcGrad_ *= vVars_j.moleFrac(comp1Idx) - vVars_i.moleFrac(comp1Idx);
}
// correct the pressure by the hydrostatic pressure due to
......
......@@ -48,9 +48,9 @@ struct OnePTwoCIndices
static const int phaseIdx = 0;
//! Set the default for the first component the fluid system's first component
static const int comp1Idx = 0;
static const int comp0Idx = 0;
//! Set the default for the second component the fluid system's second component
static const int comp2Idx = 1;
static const int comp1Idx = 1;
// Equation indices
static const int contiEqIdx = PVOffset + 0; //!< continuity equation index
......@@ -58,7 +58,7 @@ struct OnePTwoCIndices
// primary variable indices
static const int pressureIdx = PVOffset + 0; //!< pressure
static const int xIdx = PVOffset + 1; //!< mole fraction of the second component
static const int x1Idx = PVOffset + 1; //!< mole fraction of the second component
//in my case the therapeutic agent
};
......
......@@ -74,11 +74,11 @@ protected:
// indices of the primary variables
pressureIdx = Indices::pressureIdx,
xIdx = Indices::xIdx,
x1Idx = Indices::x1Idx,
phaseIdx = Indices::phaseIdx,
comp0Idx = Indices::comp0Idx,
comp1Idx = Indices::comp1Idx,
comp2Idx = Indices::comp2Idx,
// indices of the equations
contiEqIdx = Indices::contiEqIdx,
......@@ -120,7 +120,7 @@ public:
// storage term of the transport equation
result[transEqIdx] =
volVars.concentration(comp2Idx) *
volVars.concentration(comp1Idx) *
volVars.porosity();
}
......@@ -175,9 +175,9 @@ public:
// advective flux of the second component
flux[transEqIdx] +=
normalFlux *
(( upwindAlpha)*up.concentration(comp2Idx)/up.viscosity()
(( upwindAlpha)*up.concentration(comp1Idx)/up.viscosity()
+
(1 - upwindAlpha)*dn.concentration(comp2Idx)/dn.viscosity());
(1 - upwindAlpha)*dn.concentration(comp1Idx)/dn.viscosity());
}
......@@ -199,7 +199,7 @@ public:
Vector normalDisp;
fluxVars.dispersionTensor().mv(fluxVars.face().normal, normalDisp);
flux[transEqIdx] -=
(normalDisp * fluxVars.concentrationGrad(comp2Idx));
(normalDisp * fluxVars.concentrationGrad(comp1Idx));
}
/*!
* \brief Calculate the source term of the equation
......
......@@ -63,8 +63,8 @@ class OnePTwoCVolumeVariables : public BoxVolumeVariables<TypeTag>
dimWorld = GridView::dimensionworld,
phaseIdx = Indices::phaseIdx,
comp0Idx = Indices::comp0Idx,
comp1Idx = Indices::comp1Idx,
comp2Idx = Indices::comp2Idx,
contiEqIdx = Indices::contiEqIdx,
transEqIdx = Indices::transEqIdx
......@@ -112,8 +112,8 @@ public:
fluidState_);
diffCoeff_ = FluidSystem::diffCoeff(phaseIdx,
comp0Idx,
comp1Idx,
comp2Idx,
temperature_,
pressure(),
*this);
......@@ -149,21 +149,21 @@ public:
* \param compIdx The index of the component
*/
Scalar moleFrac(int compIdx) const
{ return fluidState_.moleFrac(phaseIdx, (compIdx==0)?comp1Idx:comp2Idx); }
{ return fluidState_.moleFrac(phaseIdx, (compIdx==0)?comp0Idx:comp1Idx); }
/*!
* \brief Returns mass fraction of a component in the phase
* \param compIdx The index of the component
*/
Scalar massFrac(int compIdx) const
{ return fluidState_.massFrac(phaseIdx, (compIdx==0)?comp1Idx:comp2Idx); }
{ return fluidState_.massFrac(phaseIdx, (compIdx==0)?comp0Idx:comp1Idx); }
/*!
* \brief Returns concentration of a component in the phase
* \param compIdx The index of the component
*/
Scalar concentration(int compIdx) const
{ return fluidState_.concentration(phaseIdx, (compIdx==0)?comp1Idx:comp2Idx); }
{ return fluidState_.concentration(phaseIdx, (compIdx==0)?comp0Idx:comp1Idx); }
/*!
* \brief Returns the effective pressure of a given phase within
......
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