Commit 574c902a authored by Andreas Lauser's avatar Andreas Lauser
Browse files

box models: make solution dependent neumann conditions and the source term non-disruptive

now the problems do not need to specify 'using ParentType::neumann'
anymore. this is pretty much a temporary API, the real solution would
be that the methods get a context plus an entity index and an entity
codimension. the context stores the current solution and volume
variables, as well as the current element and its element
geometry. for other discretizations it may store other things...

git-svn-id: svn://svn.iws.uni-stuttgart.de/DUMUX/dumux/trunk@5462 2fb0f335-1f38-0410-981e-8018bf24f1b0
parent c19e047b
......@@ -149,10 +149,11 @@ public:
*/
void computeSource(PrimaryVariables &q, int localVertexIdx)
{
this->problem_().source(q,
this->elem_(),
this->fvElemGeom_(),
localVertexIdx);
this->problem_().boxSDSource(q,
this->elem_(),
this->fvElemGeom_(),
localVertexIdx,
this->curVolVars_());
}
/*!
......
......@@ -235,10 +235,11 @@ public:
*/
void computeSource(PrimaryVariables &q, int localVertexIdx)
{
this->problem_().source(q,
this->elem_(),
this->fvElemGeom_(),
localVertexIdx);
this->problem_().boxSDSource(q,
this->elem_(),
this->fvElemGeom_(),
localVertexIdx,
this->curVolVars_());
}
Implementation *asImp_()
......
......@@ -210,10 +210,11 @@ public:
void computeSource(PrimaryVariables &q, int localVertexIdx)
{
// retrieve the source term intrinsic to the problem
this->problem_().source(q,
this->elem_(),
this->fvElemGeom_(),
localVertexIdx);
this->problem_().boxSDSource(q,
this->elem_(),
this->fvElemGeom_(),
localVertexIdx,
this->curVolVars_());
}
......
......@@ -286,10 +286,11 @@ public:
*/
void computeSource(PrimaryVariables &q, int localVertexIdx)
{
this->problem_().source(q,
this->elem_(),
this->fvElemGeom_(),
localVertexIdx);
this->problem_().boxSDSource(q,
this->elem_(),
this->fvElemGeom_(),
localVertexIdx,
this->curVolVars_());
}
protected:
......
......@@ -465,13 +465,13 @@ protected:
// deal with neumann boundaries
if (bcTypes.hasNeumann()) {
problem_().neumann(values,
elem_(),
fvElemGeom_(),
*isIt,
scvIdx,
boundaryFaceIdx,
curVolVars_());
problem_().boxSDNeumann(values,
elem_(),
fvElemGeom_(),
*isIt,
scvIdx,
boundaryFaceIdx,
curVolVars_());
values *= fvElemGeom_().boundaryFace[boundaryFaceIdx].area;
Valgrind::CheckDefined(values);
residual_[scvIdx] += values;
......
......@@ -224,23 +224,28 @@ public:
* \brief Evaluate the boundary conditions for a neumann
* boundary segment.
*
* This is the method for the case where the Neumann condition is
* potentially solution dependent and requires some box method
* specific things.
*
* \param values The neumann values for the conservation equations [kg / (m^2 *s )]
* \param element The finite element
* \param fvElemGeom The finite-volume geometry in the box scheme
* \param is The intersection between element and boundary
* \param scvIdx The local vertex index
* \param boundaryFaceIdx The index of the boundary face
* \param elemVolVars All volume variables for the element
*
* For this method, the \a values parameter stores the mass flux
* in normal direction of each phase. Negative values mean influx.
*/
void neumann(PrimaryVariables &values,
const Element &element,
const FVElementGeometry &fvElemGeom,
const Intersection &is,
int scvIdx,
int boundaryFaceIdx,
const ElementVolumeVariables &elemVolVars) const
void boxSDNeumann(PrimaryVariables &values,
const Element &element,
const FVElementGeometry &fvElemGeom,
const Intersection &is,
int scvIdx,
int boundaryFaceIdx,
const ElementVolumeVariables &elemVolVars) const
{
// forward it to the interface without the volume variables
asImp_().neumann(values,
......@@ -297,20 +302,25 @@ public:
* \brief Evaluate the source term for all phases within a given
* sub-control-volume.
*
* This is the method for the case where the source term is
* potentially solution dependent and requires some box method
* specific things.
*
* \param values The source and sink values for the conservation equations
* \param element The finite element
* \param fvElemGeom The finite-volume geometry in the box scheme
* \param scvIdx The local vertex index
* \param elemVolVars All volume variables for the element
*
* For this method, the \a values parameter stores the rate mass
* generated or annihilate per volume unit. Positive values mean
* that mass is created, negative ones mean that it vanishes.
*/
void source(PrimaryVariables &values,
const Element &element,
const FVElementGeometry &fvElemGeom,
int scvIdx,
const ElementVolumeVariables &elemVolVars) const
void boxSDSource(PrimaryVariables &values,
const Element &element,
const FVElementGeometry &fvElemGeom,
int scvIdx,
const ElementVolumeVariables &elemVolVars) const
{
// forward to solution independent, box specific interface
asImp_().source(values, element, fvElemGeom, scvIdx);
......
......@@ -148,11 +148,11 @@ public:
*/
void computeSource(PrimaryVariables &q, int scvIdx)
{
this->problem_().source(q,
this->elem_(),
this->fvElemGeom_(),
scvIdx,
this->curVolVars_());
this->problem_().boxSDSource(q,
this->elem_(),
this->fvElemGeom_(),
scvIdx,
this->curVolVars_());
}
};
......
......@@ -171,7 +171,7 @@ int invertQuadraticPolynomial(SolContainer &sol,
* \param d The coefficiont for the constant term
*/
template <class Scalar, class SolContainer>
int invertCubicPolynomial(SolContainer &sol,
int invertCubicPolynomial(SolContainer *sol,
Scalar a,
Scalar b,
Scalar c,
......@@ -336,6 +336,7 @@ int invertCubicPolynomial(SolContainer &sol,
// NOT REACHABLE!
return 0;
}
template <class Scalar, class SolContainer>
void invertCubicPolynomialPostProcess_(SolContainer &sol,
int numSol,
......
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