Skip to content
Snippets Groups Projects
Commit 9d12e7a4 authored by Katherina Baber's avatar Katherina Baber
Browse files

implement outflow conditions using the function

computeOutflowValues_(...)


git-svn-id: svn://svn.iws.uni-stuttgart.de/DUMUX/dumux/trunk@6944 2fb0f335-1f38-0410-981e-8018bf24f1b0
parent 95c3fdd7
No related branches found
No related tags found
No related merge requests found
...@@ -325,8 +325,7 @@ protected: ...@@ -325,8 +325,7 @@ protected:
if (!isIt->boundary()) if (!isIt->boundary())
continue; continue;
// Assemble the boundary for all vertices of the current // Assemble the boundary for all vertices of the current face
// face
int faceIdx = isIt->indexInInside(); int faceIdx = isIt->indexInInside();
int numFaceVerts = refElem.size(faceIdx, 1, dim); int numFaceVerts = refElem.size(faceIdx, 1, dim);
for (int faceVertIdx = 0; for (int faceVertIdx = 0;
...@@ -359,9 +358,7 @@ protected: ...@@ -359,9 +358,7 @@ protected:
int boundaryFaceIdx) int boundaryFaceIdx)
{ {
// temporary vector to store the neumann boundary fluxes // temporary vector to store the neumann boundary fluxes
PrimaryVariables flux(0.0);
const BoundaryTypes &bcTypes = this->bcTypes_(scvIdx); const BoundaryTypes &bcTypes = this->bcTypes_(scvIdx);
// deal with neumann boundaries // deal with neumann boundaries
if (bcTypes.hasOutflow()) if (bcTypes.hasOutflow())
{ {
...@@ -372,56 +369,72 @@ protected: ...@@ -372,56 +369,72 @@ protected:
this->curVolVars_(), this->curVolVars_(),
scvIdx); scvIdx);
const VolumeVariables& vertVars = this->curVolVars_()[scvIdx]; //calculate outflow fluxes
PrimaryVariables values(0.0);
asImp_()->computeOutflowValues_(values, boundaryVars, scvIdx, boundaryFaceIdx);
Valgrind::CheckDefined(values);
// mass balance for (int equationIdx = 0; equationIdx < numEq; ++equationIdx)
if (bcTypes.isOutflow(contiEqIdx))
{ {
if(!useMoles) //use massfractions if (!bcTypes.isOutflow(equationIdx) )
{ continue;
flux[contiEqIdx] += boundaryVars.KmvpNormal()*vertVars.density()/vertVars.viscosity(); // deduce outflow
} this->residual_[scvIdx][equationIdx] += values[equationIdx];
else //use molefractions
{
flux[contiEqIdx] += boundaryVars.KmvpNormal()*vertVars.molarDensity()/vertVars.viscosity();
}
} }
}
}
// component transport /*!
if (bcTypes.isOutflow(transEqIdx)) * \brief Compute the fluxes at the outflow boundaries
{ */
if(!useMoles)//use massfractions void computeOutflowValues_(PrimaryVariables &values,
{ const BoundaryVariables &boundaryVars,
// advective flux const int scvIdx,
flux[transEqIdx]+= boundaryVars.KmvpNormal()*vertVars.density()/vertVars.viscosity() const int boundaryFaceIdx)
*vertVars.fluidState().massFrac(phaseIdx, comp1Idx);
{
// diffusive flux of comp1 component in phase0 const VolumeVariables& vertVars = this->curVolVars_()[scvIdx];
Scalar tmp = 0;
for (int i = 0; i < Vector::size; ++ i) // mass balance
tmp += boundaryVars.massFracGrad(comp1Idx)[i]*boundaryVars.boundaryFace().normal[i]; if(!useMoles) //use massfractions
tmp *= -1; {
values[contiEqIdx] += boundaryVars.KmvpNormal()*vertVars.density()/vertVars.viscosity();
tmp *= boundaryVars.porousDiffCoeff()*boundaryVars.densityAtIP(); }
flux[transEqIdx] += tmp;//* FluidSystem::molarMass(comp1Idx); else //use molefractions
} {
else //use molefractions values[contiEqIdx] += boundaryVars.KmvpNormal()*vertVars.molarDensity()/vertVars.viscosity();
{ }
// advective flux
flux[transEqIdx]+= boundaryVars.KmvpNormal()*vertVars.molarDensity()/vertVars.viscosity() // component transport
*vertVars.fluidState().moleFrac(phaseIdx, comp1Idx); if(!useMoles)//use massfractions
{
// diffusive flux of comp1 component in phase0 // advective flux
Scalar tmp = 0; values[transEqIdx]+= boundaryVars.KmvpNormal()*vertVars.density()/vertVars.viscosity()
for (int i = 0; i < Vector::size; ++ i) *vertVars.fluidState().massFrac(phaseIdx, comp1Idx);
tmp += boundaryVars.moleFracGrad(comp1Idx)[i]*boundaryVars.boundaryFace().normal[i];
tmp *= -1; // diffusive flux of comp1 component in phase0
Scalar tmp = 0;
tmp *= boundaryVars.porousDiffCoeff()*boundaryVars.molarDensityAtIP(); for (int i = 0; i < Vector::size; ++ i)
flux[transEqIdx] += tmp; tmp += boundaryVars.massFracGrad(comp1Idx)[i]*boundaryVars.boundaryFace().normal[i];
} tmp *= -1;
}
this->residual_[scvIdx] += flux; tmp *= boundaryVars.porousDiffCoeff()*boundaryVars.densityAtIP();
values[transEqIdx] += tmp;//* FluidSystem::molarMass(comp1Idx);
}
else //use molefractions
{
// advective flux
values[transEqIdx]+= boundaryVars.KmvpNormal()*vertVars.molarDensity()/vertVars.viscosity()
*vertVars.fluidState().moleFrac(phaseIdx, comp1Idx);
// diffusive flux of comp1 component in phase0
Scalar tmp = 0;
for (int i = 0; i < Vector::size; ++ i)
tmp += boundaryVars.moleFracGrad(comp1Idx)[i]*boundaryVars.boundaryFace().normal[i];
tmp *= -1;
tmp *= boundaryVars.porousDiffCoeff()*boundaryVars.molarDensityAtIP();
values[transEqIdx] += tmp;
} }
} }
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment