diff --git a/include/common/SolutionRecorderImpl.hpp b/include/common/SolutionRecorderImpl.hpp index bc245c1ed..4e43b7e24 100644 --- a/include/common/SolutionRecorderImpl.hpp +++ b/include/common/SolutionRecorderImpl.hpp @@ -339,7 +339,7 @@ class InternalStorageUnitOpRecorder : public ISolutionRecorder if (!_storeCoordinates) return; - if (!_axialCoords.empty()) + if (!_axialCoords.empty() && ((_keepBulkSingletonDim && (_nAxialCells == 1)) || (_nAxialCells > 1))) writer.template vector("AXIAL_COORDINATES", _axialCoords); if (!_radialCoords.empty()) writer.template vector("RADIAL_COORDINATES", _radialCoords); @@ -350,7 +350,7 @@ class InternalStorageUnitOpRecorder : public ISolutionRecorder unsigned int offset = 0; for (std::size_t pt = 0; pt < _nParShells.size(); ++pt) { - if (_nParShells[pt] == 0) + if (_nParShells[pt] == 0 || (!_keepParticleSingletonDim && (_nParShells[pt] == 1))) continue; oss.str(""); @@ -882,7 +882,9 @@ class InternalStorageUnitOpRecorder : public ISolutionRecorder { oss.str(""); oss << prefix << "_VOLUME"; - writer.template matrix(oss.str(), _numTimesteps, _nVolumeDof, _curStorage->volume.data(), 1); + // Note: since the CSTR is currently the only unit operation that simulates volume, and _numVolumeDof is 1, we always write this as a vector. + // Once other unit operations are implemented with more than one volume, we should add the option here to write this as a matrix (singletonDimension filed etc, see other output). + writer.template vector(oss.str(), _numTimesteps * _nVolumeDof, _curStorage->volume.data(), 1); } } diff --git a/src/libcadet/model/StirredTankModel.hpp b/src/libcadet/model/StirredTankModel.hpp index 61eb1cc4a..dc720b997 100644 --- a/src/libcadet/model/StirredTankModel.hpp +++ b/src/libcadet/model/StirredTankModel.hpp @@ -191,7 +191,7 @@ class CSTRModel : public UnitOperationBase virtual unsigned int numInletPorts() const CADET_NOEXCEPT { return 1; } virtual unsigned int numOutletPorts() const CADET_NOEXCEPT { return 1; } virtual unsigned int numParticleTypes() const CADET_NOEXCEPT { return _nParType; } - virtual unsigned int numParticleShells(unsigned int parType) const CADET_NOEXCEPT { return 1; } + virtual unsigned int numParticleShells(unsigned int parType) const CADET_NOEXCEPT { return 0; } virtual unsigned int numBoundStates(unsigned int parType) const CADET_NOEXCEPT { return _strideBound[parType]; } virtual unsigned int numMobilePhaseDofs() const CADET_NOEXCEPT { return _nComp; } virtual unsigned int numParticleMobilePhaseDofs() const CADET_NOEXCEPT { return 0; }