Commit 9c7c80df authored by Bernd Flemisch's avatar Bernd Flemisch
Browse files

Offer outflow boundary conditions for all box models. This implements FS#117 and #99.

git-svn-id: svn://svn.iws.uni-stuttgart.de/DUMUX/dumux/trunk@8429 2fb0f335-1f38-0410-981e-8018bf24f1b0
parent d14098a2
......@@ -8,9 +8,17 @@ Differences Between DuMuX 2.1 and DuMuX 2.2
has to be replaced by
SET...PROP(..., SpatialParams ...
- TwoPIndices, TwoPNIIndices, and RichardsIndices additionally get TypeTag
as template parameter. If the Indices are not obtained via the property,
this has to be adapted.
- Implicit models: TwoPIndices, TwoPNIIndices, and RichardsIndices additionally
get TypeTag as template parameter. If the Indices are not obtained via the
property, this has to be adapted.
- Implicit models: All model-specific computeFlux functions in
...localresidual.hh have to get an additional bool parameter onBoundary,
which is by default set to false. If outflow conditions should
be properly implemented, also the constructor of the flux variables in
...fluxvariables.hh has to get the additional argument and the
class has to be adapted to deal with boundary faces. See FS#117 and #99
for details.
* Deprecated CLASSES/FILES, to be removed after 2.2:
- Model specific base box problems: The common functionality has been collected
......
......@@ -279,37 +279,6 @@ public:
this->curVolVars_());
}
/*!
* \brief Add Outflow boundary conditions for a single sub-control
* volume face to the local residual.
*
* \param isIt The intersection iterator of current element
* \param scvIdx The index of the considered face of the sub-control volume
* \param boundaryFaceIdx The index of the considered boundary face of the sub control volume
*/
void evalOutflowSegment(const IntersectionIterator &isIt,
const int scvIdx,
const int boundaryFaceIdx)
{
const BoundaryTypes &bcTypes = this->bcTypes_(scvIdx);
// deal with outflow boundaries
if (bcTypes.hasOutflow())
{
//calculate outflow fluxes
PrimaryVariables values(0.0);
asImp_()->computeFlux(values, boundaryFaceIdx, true);
Valgrind::CheckDefined(values);
for (int equationIdx = 0; equationIdx < numEq; ++equationIdx)
{
if (!bcTypes.isOutflow(equationIdx) )
continue;
// deduce outflow
this->residual_[scvIdx][equationIdx] += values[equationIdx];
}
}
}
Implementation *asImp_()
{ return static_cast<Implementation *> (this); }
const Implementation *asImp_() const
......
......@@ -132,37 +132,6 @@ class TwoPTwoCLocalResidual: public GET_PROP_TYPE(TypeTag, BaseLocalResidual)
evalPhaseStorage_(phaseIdx);
}
/*!
* \brief Evaluate the outflow conditions at a boundary face.
* This is still a beta version and only available
* for the 2p2c and the 2p2cni model yet.
*
* \param isIt The intersection iterator
* \param scvIdx The index of the sub-control volume containing the outflow face
* \param boundaryFaceIdx The index of the boundary face
*/
void evalOutflowSegment(const IntersectionIterator &isIt,
const int scvIdx,
const int boundaryFaceIdx)
{
const BoundaryTypes &bcTypes = this->bcTypes_(scvIdx);
// deal with outflow boundaries
if (bcTypes.hasOutflow())
{
PrimaryVariables values(0.0);
asImp_()->computeFlux(values, boundaryFaceIdx, true);
Valgrind::CheckDefined(values);
for (int eqIdx = 0; eqIdx < numEq; ++eqIdx)
{
if (!bcTypes.isOutflow(eqIdx) )
continue;
this->residual_[scvIdx][eqIdx] += values[eqIdx];
}
}
}
/*!
* \brief Evaluate the amount all conservation quantities
* (e.g. phase mass) within a sub-control volume.
......
......@@ -273,19 +273,6 @@ public:
#endif // HAVE_VALGRIND
}
/*!
* \brief Add Outflow boundary conditions for a single sub-control
* volume face to the local residual.
*
* \note This is so far an empty method doing not more than
* nothing. A beta version is available for the 2p2c and
* 2p2cni model. There you can find a sample implementation.
*/
void evalOutflowSegment(const IntersectionIterator &isIt,
int scvIdx,
int boundaryFaceIdx)
{ }
/*!
* \brief Returns the local residual for all sub-control
* volumes of the element.
......@@ -421,9 +408,9 @@ protected:
// evaluate the outflow conditions at the boundary face
// ATTENTION: This is so far a beta version that is only for the 2p2c and 2p2cni model
// available and not thoroughly tested.
asImp_().evalOutflowSegment(isIt,
scvIdx,
boundaryFaceIdx);
asImp_().evalOutflowSegment_(isIt,
scvIdx,
boundaryFaceIdx);
}
}
}
......@@ -464,6 +451,37 @@ protected:
}
}
/*!
* \brief Add outflow boundary conditions for a single sub-control
* volume face to the local residual.
*
* \param isIt The intersection iterator of current element
* \param scvIdx The index of the considered face of the sub-control volume
* \param boundaryFaceIdx The index of the considered boundary face of the sub control volume
*/
void evalOutflowSegment_(const IntersectionIterator &isIt,
const int scvIdx,
const int boundaryFaceIdx)
{
const BoundaryTypes &bcTypes = this->bcTypes_(scvIdx);
// deal with outflow boundaries
if (bcTypes.hasOutflow())
{
//calculate outflow fluxes
PrimaryVariables values(0.0);
asImp_().computeFlux(values, boundaryFaceIdx, true);
Valgrind::CheckDefined(values);
for (int equationIdx = 0; equationIdx < numEq; ++equationIdx)
{
if (!bcTypes.isOutflow(equationIdx) )
continue;
// deduce outflow
this->residual_[scvIdx][equationIdx] += values[equationIdx];
}
}
}
/*!
* \brief Add the flux terms to the local residual of all
* sub-control volumes of the current element.
......
Markdown is supported
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