Skip to content
Snippets Groups Projects
Commit 380761f6 authored by Dennis Gläser's avatar Dennis Gläser Committed by Timo Koch
Browse files

[ImplicitProblem] Adaptions to point sources interface

parent de41928c
No related branches found
No related tags found
Loading
...@@ -391,11 +391,9 @@ public: ...@@ -391,11 +391,9 @@ public:
* Positive values mean that the conserved quantity is created, negative ones mean that it vanishes. * Positive values mean that the conserved quantity is created, negative ones mean that it vanishes.
* E.g. for the mass balance that would be a mass rate in \f$ [ kg / s ] \f$. * E.g. for the mass balance that would be a mass rate in \f$ [ kg / s ] \f$.
*/ */
void solDependentPointSource(PointSource& pointSource, PrimaryVariables pointSource(PointSource& pointSource,
const Element &element, const Element &element,
const FVElementGeometry &fvGeometry, const SubControlVolume &scv) const
const int scvIdx,
const ElementVolumeVariables &elemVolVars) const
{ {
// forward to space dependent interface method // forward to space dependent interface method
asImp_().pointSourceAtPos(pointSource, pointSource.position()); asImp_().pointSourceAtPos(pointSource, pointSource.position());
...@@ -978,12 +976,11 @@ public: ...@@ -978,12 +976,11 @@ public:
* Caution: Only overload this method in the implementation if you know * Caution: Only overload this method in the implementation if you know
* what you are doing. * what you are doing.
*/ */
void scvPointSources(PrimaryVariables &values, PrimaryVariables scvPointSources(const Element &element, const SubControlVolume &scv) const
const Element &element,
const FVElementGeometry &fvGeometry,
const int scvIdx,
const ElementVolumeVariables &elemVolVars) const
{ {
PrimaryVariables source(0);
int scvIdx = scv.indexInElement();
auto key = std::make_pair(this->gridView().indexSet().index(element), scvIdx); auto key = std::make_pair(this->gridView().indexSet().index(element), scvIdx);
if (pointSourceMap_.count(key)) if (pointSourceMap_.count(key))
{ {
...@@ -994,8 +991,7 @@ public: ...@@ -994,8 +991,7 @@ public:
// Add the contributions to the dof source values // Add the contributions to the dof source values
// We divide by the volume. In the local residual this will be multiplied with the same // We divide by the volume. In the local residual this will be multiplied with the same
// factor again. That's because the user specifies absolute values in kg/s. // factor again. That's because the user specifies absolute values in kg/s.
const Scalar volume = fvGeometry.subContVol[scvIdx].volume const Scalar volume = scv.volume()*model().curVolVars(scv).extrusionFactor();
* asImp_().boxExtrusionFactor(element, fvGeometry, scvIdx);
for (auto&& pointSource : pointSources) for (auto&& pointSource : pointSources)
{ {
...@@ -1008,15 +1004,17 @@ public: ...@@ -1008,15 +1004,17 @@ public:
// The second one might be more convenient for e.g. a solution dependent point source. // The second one might be more convenient for e.g. a solution dependent point source.
// we do an update e.g. used for TimeDependentPointSource // we do an update e.g. used for TimeDependentPointSource
pointSource.update(asImp_(), element, fvGeometry, scvIdx, elemVolVars); pointSource.update(asImp_(), element, scv);
// call convienience problem interface function // call convienience problem interface function
asImp_().solDependentPointSource(pointSource, element, fvGeometry, scvIdx, elemVolVars); source = asImp_().pointSource(pointSource, element, scv);
// at last take care about multiplying with the correct volume // at last take care about multiplying with the correct volume
pointSource /= volume; source /= volume;
// add the point source values to the local residual // add the point source values to the local residual
values += pointSource.values(); source += pointSource.values();
} }
} }
return source;
} }
/*! /*!
......
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