Skip to content

Commit e939294

Browse files
committed
debug 2nd order subcell FV
1 parent f234a71 commit e939294

File tree

2 files changed

+89
-127
lines changed

2 files changed

+89
-127
lines changed

src/libcadet/model/parts/ConvectionDispersionOperatorDG.cpp

Lines changed: 7 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -372,6 +372,8 @@ bool AxialConvectionDispersionOperatorBaseDG::notifyDiscontinuousSectionTransiti
372372
_curVelocity *= -1.0;
373373
}
374374

375+
_subcellLimiter.notifyDiscontinuousSectionTransition(_dir);
376+
375377
// Remaining case: _velocity is empty and _crossSection <= 0.0
376378
// _curVelocity is goverend by network flow rate provided in setFlowRates().
377379
// Direction never changes (always forward, that is, _dir = 1)-
@@ -517,12 +519,11 @@ int AxialConvectionDispersionOperatorBaseDG::residualImpl(const IModel& model, d
517519

518520
if (_OSmode == 2 && _maxBlending > 0.0) // Element-wise lower order subcell FV blending for advection, treat dispersion with high order DG.
519521
subcellFVconvectionIntegral<StateType, ResidualType, ParamType>(_troubledCells + comp, y + offsetC() + comp, res + offsetC() + comp);
520-
521522
// else if (_OSmode == 3) // todo ? subcell limiting with subelement-wise blending
522523

523524
else if (_OSmode == 4) // Subcell FV for both, advection and dispersion and without blending, i.e. pure FV // todo enable blending? -> ensure mass conservation for dispersive flux across DG elements
524525
{
525-
subcellFVconvDispIntegral<StateType, ResidualType, ParamType>(1.0, y + offsetC() + comp, res + offsetC() + comp, d_ax);
526+
subcellFVconvDispIntegral<StateType, ResidualType, ParamType>(y + offsetC() + comp, res + offsetC() + comp, d_ax);
526527
continue;
527528
}
528529

@@ -537,7 +538,7 @@ int AxialConvectionDispersionOperatorBaseDG::residualImpl(const IModel& model, d
537538
// Compute auxiliary system g = d c / d x //
538539
// ========================================//
539540

540-
// DG volume integral in strong form
541+
// DG volume integral in strong form
541542
volumeIntegral<StateType, StateType>(_C, _g);
542543

543544
// Calculate numerical flux values c*
@@ -569,13 +570,13 @@ int AxialConvectionDispersionOperatorBaseDG::residualImpl(const IModel& model, d
569570
// Calculate numerical flux values h*
570571
InterfaceFlux<StateType, ParamType>(y + offsetC() + comp, d_ax);
571572

572-
// Not needed, when re-accounted for in FV subcell residual (i.e. partly reverted FV subcell DG weak form formulation)
573-
//_h += 2.0 / static_cast<ParamType>(_deltaZ) * (-u * _C * FVblending).template cast<ResidualType>();
573+
// By leaving the following out, the surface integral computes B (h^* - \hat{h}) with \hat{h} = h - \alpha u c, i.e. \hat{h} equals the substitute h minus the subcell (convection) part.
574+
// This way we can leave out any interface flux computations at DG-element boundaries in the subcell FV scheme.
575+
// _h += 2.0 / static_cast<ParamType>(_deltaZ) * (-u * _C * FVblending).template cast<ResidualType>();
574576

575577
// DG surface integral in strong form
576578
surfaceIntegral<ResidualType, ResidualType>(&_h[0], res + offsetC() + comp, 1u, _nNodes, _strideNode, _strideCell);
577579
}
578-
579580
return 0;
580581
}
581582
/**

0 commit comments

Comments
 (0)