Commit 6dc7978e authored by Benjamin Faigle's avatar Benjamin Faigle
Browse files

improved documentation

cleanup of variables that were basically copied for debugging purposes
cleanup of old methods

git-svn-id: svn://svn.iws.uni-stuttgart.de/DUMUX/dumux/trunk@7435 2fb0f335-1f38-0410-981e-8018bf24f1b0
parent 3aeca4f7
......@@ -80,7 +80,7 @@ protected:
Scalar dv_[numComponents];
bool volumeDerivativesAvailable_;
int globalIdx_;
Scalar perimeter_;
FluidState* fluidState_;
......@@ -96,7 +96,7 @@ public:
mobility_({0.0, 0.0}),
numericalDensity_({0.0, 0.0}), volumeError_(0.), errorCorrection_(0.),
dv_dp_(0.), dv_({0.0, 0.0}), volumeDerivativesAvailable_(false),
perimeter_(0.),fluidState_(0)
globalIdx_(0), perimeter_(0.),fluidState_(0)
{
}
......@@ -128,6 +128,8 @@ public:
return *fluidState_;
}
int& globalIdx()
{ return globalIdx_;}
const bool hasVolumeDerivatives() const
{ return volumeDerivativesAvailable_;}
void confirmVolumeDerivatives()
......@@ -145,7 +147,7 @@ public:
return fluidState_->pressure(phaseIdx);
}
const Scalar& pressure(int phaseIdx) const
const Scalar pressure(int phaseIdx) const
{
return fluidState_->pressure(phaseIdx);
}
......
......@@ -145,7 +145,7 @@ public:
return this->fluidState_->pressure(phaseIdx);
}
const Scalar& pressure(int phaseIdx) const
const Scalar pressure(int phaseIdx) const
{
if(fluidStateType_ == simple)
{
......
This diff is collapsed.
......@@ -320,6 +320,7 @@ protected:
//! initializes the simulation run
/*!
* Initializes the simulation to gain the initial pressure field.
* Output throughout initialization procedure is only done in debug mode.
*
* \param solveTwice flag to determine possible iterations of the initialization process
*/
......@@ -411,11 +412,10 @@ void FVPressureCompositional<TypeTag>::initialize(bool solveTwice)
/*!
* \brief initializes the fluid distribution and hereby the variables container
*
* This function equals the method initialguess() and transportInitial() in the old model.
* It differs from updateMaterialLaws because there are two possible initial conditions:
* It differs from updateMaterialLaws() because there are two possible initial conditions:
* saturations and concentration.
* \param compositional flag that determines if compositional effects are regarded, i.e.
* a reasonable pressure field is known.
* a reasonable pressure field is known with which compositions can be calculated.
*/
template<class TypeTag>
void FVPressureCompositional<TypeTag>::initialMaterialLaws(bool compositional)
......@@ -580,6 +580,8 @@ void FVPressureCompositional<TypeTag>::initialMaterialLaws(bool compositional)
cellData.perimeter()
+= isIt->geometry().volume();
}
cellData.globalIdx() = globalIdx;
// set dv to zero to prevent output errors
cellData.dv_dp() = 0.;
cellData.dv(wPhaseIdx) = 0.;
......
......@@ -85,7 +85,8 @@ class FVTransport2P2C
enum
{
wPhaseIdx = Indices::wPhaseIdx, nPhaseIdx = Indices::nPhaseIdx,
wCompIdx = Indices::wPhaseIdx, nCompIdx = Indices::nPhaseIdx
wCompIdx = Indices::wPhaseIdx, nCompIdx = Indices::nPhaseIdx,
contiWEqIdx=Indices::contiWEqIdx, contiNEqIdx=Indices::contiNEqIdx
};
typedef typename GridView::Traits::template Codim<0>::Entity Element;
......@@ -282,8 +283,8 @@ void FVTransport2P2C<TypeTag>::update(const Scalar t, Scalar& dt, TransportSolut
/*********** Handle source term ***************/
PrimaryVariables q(NAN);
problem().source(q, *eIt);
updateVec[wCompIdx][globalIdxI] += q[Indices::contiWEqIdx];
updateVec[nCompIdx][globalIdxI] += q[Indices::contiNEqIdx];
updateVec[wCompIdx][globalIdxI] += q[contiWEqIdx];
updateVec[nCompIdx][globalIdxI] += q[contiNEqIdx];
// account for porosity
sumfactorin = std::max(sumfactorin,sumfactorout)
......@@ -543,7 +544,7 @@ void FVTransport2P2C<TypeTag>::getFluxOnBoundary(Dune::FieldVector<Scalar, 2>& f
problem().boundaryTypes(bcTypes, intersection);
/********** Dirichlet Boundary *************/
if (bcTypes.isDirichlet(Indices::contiWEqIdx)) // if contiWEq is Dirichlet, so is contiNEq
if (bcTypes.isDirichlet(contiWEqIdx)) // if contiWEq is Dirichlet, so is contiNEq
{
//get dirichlet pressure boundary condition
PhaseVector pressBound(0.);
......@@ -645,13 +646,13 @@ void FVTransport2P2C<TypeTag>::getFluxOnBoundary(Dune::FieldVector<Scalar, 2>& f
+ velocityJIn * BCfluidState.massFraction(nPhaseIdx, nCompIdx) * densityNWBound
- velocityIJn * cellDataI.massFraction(nPhaseIdx, nCompIdx) * densityNWI ;
}//end dirichlet boundary
else if (bcTypes.isNeumann(Indices::contiWEqIdx))
else if (bcTypes.isNeumann(contiWEqIdx))
{
// Convention: outflow => positive sign : has to be subtracted from update vec
PrimaryVariables J(NAN);
problem().neumann(J, intersection);
fluxEntries[wCompIdx] = - J[Indices::contiWEqIdx] * faceArea / volume;
fluxEntries[nCompIdx] = - J[Indices::contiNEqIdx] * faceArea / volume;
fluxEntries[wCompIdx] = - J[contiWEqIdx] * faceArea / volume;
fluxEntries[nCompIdx] = - J[contiNEqIdx] * faceArea / volume;
// for timestep control
#define cflIgnoresNeumann
......@@ -708,7 +709,7 @@ void FVTransport2P2C<TypeTag>::evalBoundary(GlobalPosition globalPosFace,
problem().boundaryFormulation(bcType, intersection);
if (bcType == Indices::saturation)
{
Scalar satBound = primaryVariablesOnBoundary[Indices::contiWEqIdx];
Scalar satBound = primaryVariablesOnBoundary[contiWEqIdx];
if(GET_PROP_VALUE(TypeTag, EnableCapillarity))
{
Scalar pcBound = MaterialLaw::pC(problem().spatialParameters().materialLawParams(globalPosFace, *eIt),
......@@ -741,7 +742,7 @@ void FVTransport2P2C<TypeTag>::evalBoundary(GlobalPosition globalPosFace,
{
// saturation and hence pc and hence corresponding pressure unknown
pressBound[wPhaseIdx] = pressBound[nPhaseIdx] = primaryVariablesOnBoundary[Indices::pressureEqIdx];
Scalar Z1Bound = primaryVariablesOnBoundary[Indices::contiWEqIdx];
Scalar Z1Bound = primaryVariablesOnBoundary[contiWEqIdx];
BCfluidState.update(Z1Bound, pressBound, problem().spatialParameters().porosity(globalPosFace, *eIt),
problem().temperatureAtPos(globalPosFace));
......
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