Commit 773f0ece authored by Thomas Fetzer's avatar Thomas Fetzer
Browse files

[multidomain] Rename the momentum boundary conditions.

Note: this leads to a change how to set boundary conditions for the momentum balance. Inflow now becomes Dirichlet and Outflow becomes Neumann. This is consistent with the new notation.
parent bbb0d78e
Differences Between DuMuX 2.8 and DuMuX 2.9
===================================================
* IMPORTANT NOTES:
-
* IMPROVEMENTS and ENHANCEMENTS:
-
* IMMEDIATE INTERFACE CHANGES not allowing/requiring a deprecation period:
- For the multidomain models, the notation of the boundary condition types
has changed. This is especially important for all momentum boundary conditions.
In general:
couplingInflow -> couplingNeumann
couplingOutflow -> couplingDirichlet
But for the momentum balances:
couplingInflow -> couplingDirichlet
couplingOutflow -> couplingNeumann
* Deprecated PROPERTY and PARAMETER NAMES, to be removed after 2.8: BEWARE: The
compiler will not print any warning if a deprecated property or parameter name
is used. However, a run-time warning should appear in the summary lines after
the corresponding run.
* Deprecated CLASSES/FILES, to be removed after 2.8:
-
* Deprecated MEMBER FUNCTIONS, to be removed after 2.8:
-
* Deprecated protected MEMBER VARIABLES, to be removed after 2.8: BEWARE: Older
compilers will not print any warning if a deprecated protected member variable
is used.
* DELETED classes/files, property names, constants/enums,
member functions, which have been deprecated in DuMuX 2.7:
Everything listed as deprecated below has been removed.
Differences Between DuMuX 2.7 and DuMuX 2.8
===================================================
......
......@@ -147,7 +147,7 @@ public:
// set velocity normal to the interface
if (bcTypes.isCouplingNeumann(momentumYIdx))
if (bcTypes.isCouplingDirichlet(momentumYIdx))
{
this->residual_[scvIdx][momentumYIdx] = volVars.velocity()
* boundaryVars.face().normal
......@@ -157,7 +157,7 @@ public:
// add pressure correction - required for pressure coupling,
// if p.n comes from the pm
if (bcTypes.isCouplingDirichlet(momentumYIdx) || bcTypes.isCouplingMortar(momentumYIdx))
if (bcTypes.isCouplingNeumann(momentumYIdx) || bcTypes.isCouplingMortar(momentumYIdx))
{
DimVector pressureCorrection(intersection.centerUnitOuterNormal());
pressureCorrection *= volVars.pressure();
......
......@@ -437,31 +437,9 @@ public:
Scalar beaversJosephCoeff = spatialParams.beaversJosephCoeffAtPos(globalPos1);
assert(beaversJosephCoeff > 0);
beaversJosephCoeff /= std::sqrt(spatialParams.intrinsicPermeability(sdElement2, cParams.fvGeometry2, vertInElem2));
// Neumann-like conditions
// TODO revise comment
// Implementation as Dirichlet-like condition
// tangential component: vx = sqrt K /alpha * (grad v n(unity))t
// Neumann-like conditions
if (cParams.boundaryTypes1.isCouplingNeumann(momentumXIdx1))
{
// TODO: Is not implemented anymore because curPrimaryVars_ is protected
// and it could be that this part of code has never been checked
DUNE_THROW(Dune::NotImplemented, "The boundary condition isCouplingNeumann(momentumXIdx1) on the Stokes side is not implemented anymore.");
// GlobalPosition tangentialVelGrad(0);
// boundaryVars1.velocityGrad().umv(elementUnitNormal, tangentialVelGrad);
// tangentialVelGrad /= -beaversJosephCoeff; // was - before
// couplingRes1.accumulate(lfsu1.child(momentumXIdx1), vertInElem1,
// this->residual_[vertInElem1][momentumXIdx1] =
// tangentialVelGrad[momentumXIdx1] - globalProblem_.localResidual1().curPriVars_(vertInElem1)[momentumXIdx1]);
}
// MOMENTUM_X Balance
// Dirichlet-like conditions
// TODO revise comment
// Implementation as Neumann-like condition: (v.n)n
if (cParams.boundaryTypes1.isCouplingDirichlet(momentumXIdx1))
{
const Scalar normalComp = boundaryVars1.velocity()*bfNormal1;
GlobalPosition normalV = bfNormal1;
......@@ -470,6 +448,7 @@ public:
// v_tau = v - (v.n)n
const GlobalPosition tangentialV = boundaryVars1.velocity() - normalV;
// Implementation as Neumann-like condition: (v.n)n
for (int dimIdx=0; dimIdx < dim; ++dimIdx)
{
couplingRes1.accumulate(lfsu1.child(momentumXIdx1), vertInElem1,
......@@ -481,15 +460,36 @@ public:
}
}
// Dirichlet-like conditions
if (cParams.boundaryTypes1.isCouplingDirichlet(momentumXIdx1))
{
// NOTE: This boundary condition is not implemented anymore because curPrimaryVars_ is protected
DUNE_THROW(Dune::NotImplemented, "The boundary condition isCouplingNeumann(momentumXIdx1) on the Stokes side is not implemented anymore.");
// tangential component: vx = sqrt K /alpha * (grad v n(unity))t
// GlobalPosition tangentialVelGrad(0);
// boundaryVars1.velocityGrad().umv(elementUnitNormal, tangentialVelGrad);
// tangentialVelGrad /= -beaversJosephCoeff; // was - before
// this->residual_[vertInElem1][momentumXIdx1] =
// tangentialVelGrad[momentumXIdx1] - globalProblem_.localResidual1().curPriVars_(vertInElem1)[momentumXIdx1]);
}
// MOMENTUM_Y Balance
// Neumann-like conditions
// TODO revise comment
// v.n as Dirichlet-like condition for the Stokes domain
// set residualStokes[momentumYIdx1] = v_y in stokesnccouplinglocalresidual.hh
if (cParams.boundaryTypes1.isCouplingNeumann(momentumYIdx1))
{
// p*A*n as condition for free flow
// pressure correction is done in stokeslocalresidual.hh
couplingRes1.accumulate(lfsu1.child(momentumYIdx1), vertInElem1,
cParams.elemVolVarsCur2[vertInElem2].pressure(nPhaseIdx2) *
boundaryVars2.face().area);
}
// Dirichlet-like conditions
if (cParams.boundaryTypes1.isCouplingDirichlet(momentumYIdx1))
{
// v.n as Dirichlet-like condition for the Stokes domain
if (globalProblem_.sdProblem2().isCornerPoint(globalPos2))
{
Scalar sumNormalPhaseFluxes = 0.0;
......@@ -504,28 +504,13 @@ public:
}
else
{
// TODO revise comment
// v.n as DIRICHLET condition for the Stokes domain (negative sign!)
// set residualStokes[momentumYIdx1] = v_y in stokesnccouplinglocalresidual.hh
couplingRes1.accumulate(lfsu1.child(momentumYIdx1), vertInElem1,
globalProblem_.localResidual2().residual(vertInElem2)[massBalanceIdx2]
/ cParams.elemVolVarsCur1[vertInElem1].density());
}
}
// MOMENTUM_Y Balance
// Dirichlet-like conditions
// TODO revise comments
//p*n as NEUMANN condition for free flow (set, if B&J defined as NEUMANN condition)
// p*A*n as NEUMANN condition for free flow (set, if B&J defined as NEUMANN condition)
if (cParams.boundaryTypes1.isCouplingDirichlet(momentumYIdx1))
{
// pressure correction is done in stokeslocalresidual.hh
couplingRes1.accumulate(lfsu1.child(momentumYIdx1), vertInElem1,
cParams.elemVolVarsCur2[vertInElem2].pressure(nPhaseIdx2) *
boundaryVars2.face().area);
}
// COMPONENT Balance
// Neumann-like conditions
......
......@@ -145,7 +145,7 @@ public:
const VolumeVariables &volVars = this->curVolVars_()[scvIdx];
// set velocity normal to the interface
if (bcTypes.isCouplingNeumann(momentumYIdx))
if (bcTypes.isCouplingDirichlet(momentumYIdx))
{
this->residual_[scvIdx][momentumYIdx] = volVars.velocity()
* boundaryVars.face().normal
......@@ -155,7 +155,7 @@ public:
// add pressure correction - required for pressure coupling,
// if p.n comes from the pm
if (bcTypes.isCouplingDirichlet(momentumYIdx) || bcTypes.isCouplingMortar(momentumYIdx))
if (bcTypes.isCouplingNeumann(momentumYIdx) || bcTypes.isCouplingMortar(momentumYIdx))
{
DimVector pressureCorrection(intersection.centerUnitOuterNormal());
pressureCorrection *= volVars.pressure();
......
......@@ -275,6 +275,8 @@ public:
if (globalPos[0] > runUpDistanceX_-eps_ && time > initializationTime_)
{
values.setAllCouplingDirichlet();
values.setCouplingNeumann(momentumXIdx);
values.setCouplingNeumann(momentumYIdx);
}
}
......
......@@ -217,6 +217,8 @@ public:
&& globalPos[0] < runUpDistanceX2_ + eps_)
{
values.setAllCouplingDirichlet();
values.setCouplingNeumann(momentumXIdx);
values.setCouplingNeumann(momentumYIdx);
}
}
......
......@@ -249,7 +249,11 @@ public:
values.setNeumann(transportEqIdx);
if (globalPos[0] > runUpDistanceX_-eps_ && time > initializationTime_)
{
values.setAllCouplingDirichlet();
values.setCouplingNeumann(momentumXIdx);
values.setCouplingNeumann(momentumYIdx);
}
}
// the mass balance has to be of type outflow
......
......@@ -227,7 +227,11 @@ public:
values.setNeumann(transportEqIdx);
if (globalPos[0] > runUpDistanceX_-eps_)
{
values.setAllCouplingDirichlet();
values.setCouplingNeumann(momentumXIdx);
values.setCouplingNeumann(momentumYIdx);
}
}
if (onLeftBoundary_(globalPos))
{
......
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