/*------------------------------- phasicFlow --------------------------------- O C enter of O O E ngineering and O O M ultiscale modeling of OOOOOOO F luid flow ------------------------------------------------------------------------------ Copyright (C): www.cemf.ir email: hamid.r.norouzi AT gmail.com ------------------------------------------------------------------------------ Licence: This file is part of phasicFlow code. It is a free software for simulating granular and multiphase flows. You can redistribute it and/or modify it under the terms of GNU General Public License v3 or any other later versions. phasicFlow is distributed to help others in their research in the field of granular and multiphase flows, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. -----------------------------------------------------------------------------*/ #ifndef __operationFunctions_hpp__ #define __operationFunctions_hpp__ #include #include "span.hpp" #include "regionPoints.hpp" #include "regionField.hpp" #include "includeMask.hpp" namespace pFlow::postprocessData { template regionField executeSumOperation ( const word& regFieldName, const span& field, const regionField& volFactor, const bool devideByVol, const std::vector>& weights, const span& phi, const includeMask::Mask& mask ) { const auto& regPoints = volFactor.regPoints(); regionField processedField(regFieldName, regPoints, T{}); auto vols = regPoints.volumes(); for(uint32 reg =0; reg regionField executeAverageOperation ( const word& regFieldName, const span& field, const regionField& volFactor, const bool devideByVol, const std::vector>& weights, const span& phi, const includeMask::Mask& mask ) { const auto& regPoints = volFactor.regPoints(); regionField processedField(regFieldName, regPoints, T{}); auto vols = regPoints.volumes(); for(uint32 reg =0; reg regionField executeFluctuation2Operation ( const word& regFieldName, const span& field, const regionField& fieldAvg, const regionField& volFactor, const bool devideByVol, const std::vector>& weights, const includeMask::Mask& mask ) { const auto& regPoints = fieldAvg.regPoints(); regionField processedField(regFieldName, regPoints, T{}); auto vols = regPoints.volumes(); for(uint32 reg =0; reg(2)); } sumDen += w[n]; } n++; } if(devideByVol) { processedField[reg] = sumNum / max(sumDen, smallValue) / vol; } else { processedField[reg] = sumNum / max(sumDen, smallValue); } } return processedField; } } // namespace pFlow::postprocessData #endif //__operationFunctions_hpp__