tracer storage derivative is zero
What happened / Problem description: The storage time-derivative in the tracer model is always zero for me, because the mass/moleFractions in the used prevElemVolVars
and curElemVolVars
in the evalStorage
function at dumux/assembly/fvlocalresidual.hh
are the same:
void evalStorage(ElementResidualVector& residual,
const Problem& problem,
const Element& element,
const FVElementGeometry& fvGeometry,
const ElementVolumeVariables& prevElemVolVars,
const ElementVolumeVariables& curElemVolVars,
const SubControlVolume& scv) const
{
const auto& curVolVars = curElemVolVars[scv];
const auto& prevVolVars = prevElemVolVars[scv];
std::cout << "prevMassFrac: " << prevVolVars.massFraction(0, 0) << std::endl;
std::cout << "curMassFrac: " << curVolVars.massFraction(0, 0) << std::endl;
//! Compute storage with the model specific storage residual
NumEqVector prevStorage = asImp().computeStorage(problem, scv, prevVolVars);
NumEqVector storage = asImp().computeStorage(problem, scv, curVolVars);
prevStorage *= prevVolVars.extrusionFactor();
storage *= curVolVars.extrusionFactor();
storage -= prevStorage;
storage *= Extrusion::volume(scv);
storage /= timeLoop_->timeStepSize();
residual[scv.localDofIndex()] += storage;
}
What you expected to happen: MassFractions should be different between the timesteps when they change.
How to reproduce it (as minimally and precisely as possible): Just write a quick output for the massFractions in the evalStorage function in dumux/assembly/fvlocalresidual.hh
for e.g the tracer/constvel
test.
Anything else we need to know?: I am very confused, that tests with only storage and source terms still seem to work fine, even though the storage derivative is 0.
Is there something I am missing, maybe about the tracer model?