diff --git a/dumux/common/fvproblem.hh b/dumux/common/fvproblem.hh index dd8b8956a86594b09e94b5d4655f05172ac4836b..cc521b7e1b5773619323e8edec857a124ada354d 100644 --- a/dumux/common/fvproblem.hh +++ b/dumux/common/fvproblem.hh @@ -63,6 +63,7 @@ class FVProblem using PointSourceHelper = typename GET_PROP_TYPE(TypeTag, PointSourceHelper); using SolutionVector = typename GET_PROP_TYPE(TypeTag, SolutionVector); using ElementSolutionVector = typename GET_PROP_TYPE(TypeTag, ElementSolutionVector); + using VolumeVariables = typename GET_PROP_TYPE(TypeTag, VolumeVariables); using ElementVolumeVariables = typename GET_PROP_TYPE(TypeTag, ElementVolumeVariables); enum { @@ -382,6 +383,17 @@ public: void pointSourceAtPos(PointSource& pointSource, const GlobalPosition &globalPos) const {} + /*! + * \brief Add source term derivative to the Jacobian + * \note Only needed in case of analytic differentiation and solution dependent sources + */ + template<class MatrixBlock> + void addSourceDerivatives(MatrixBlock& block, + const Element& element, + const FVElementGeometry& fvGeometry, + const VolumeVariables& volVars, + const SubControlVolume& scv) const {} + /*! * \brief Adds contribution of point sources for a specific sub control volume * to the values. diff --git a/dumux/porousmediumflow/1p/incompressiblelocalresidual.hh b/dumux/porousmediumflow/1p/incompressiblelocalresidual.hh index d75546e3303c772b78aa65234b1dde88b1866cab..9db8fc856c3bf5cb4035128c2594b6ce5bfb0cc6 100644 --- a/dumux/porousmediumflow/1p/incompressiblelocalresidual.hh +++ b/dumux/porousmediumflow/1p/incompressiblelocalresidual.hh @@ -74,7 +74,10 @@ public: const Element& element, const FVElementGeometry& fvGeometry, const VolumeVariables& curVolVars, - const SubControlVolume& scv) const {} + const SubControlVolume& scv) const + { + problem.addSourceDerivatives(partialDerivatives, element, fvGeometry, curVolVars, scv); + } //! flux derivatives for the cell-centered tpfa scheme template<class PartialDerivativeMatrices, class T = TypeTag>