PostprocessData update

Modifications on fieldsDataBase to work both during simulation and post-simulation
Some bug fixes and changes to the code based
Correction for region volume
This commit is contained in:
Hamidreza
2025-04-18 15:32:53 +03:30
parent 61be8c60fb
commit d69203168e
44 changed files with 1065 additions and 383 deletions

View File

@ -36,6 +36,12 @@ pFlow::PostprocessComponent<RegionType,ProcessMethodType>::PostprocessComponent
(
regionPointsPtr_().size()
),
volumeFactor_
(
"volumeFactor",
regionPointsPtr_(),
1.0
),
operationDicts_(readDictList("operations", dict))
{
@ -106,7 +112,7 @@ bool pFlow::PostprocessComponent<RegionType, ProcessMethodType>::execute
for(auto& op:operatios_)
{
if( !op->execute(weights) )
if( !op->execute(weights, volumeFactor_) )
{
fatalErrorInFunction
<<"error occured in executing operatoin defined in dict "

View File

@ -51,6 +51,8 @@ private:
/// Method for processing the selected particles data
std::vector<ProcessMethodType> regionsProcessMethod_;
regionField<real> volumeFactor_;
bool executed_{false};
dictionaryList operationDicts_;
@ -62,6 +64,16 @@ protected:
return regionsProcessMethod_;
}
regionField<real>& volumeFactor()
{
return volumeFactor_;
}
const regionField<real>& volumeFactor()const
{
return volumeFactor_;
}
public:
// type info

View File

@ -51,10 +51,12 @@ public:
auto d = this->regPoints().eqDiameters();
auto c = this->regPoints().centers();
auto& regs = this->regionProecessMethod();
auto& volFactor = this->volumeFactor();
const uint32 n = d.size();
for(uint32 i=0; i<n; i++)
{
regs[i] = arithmetic(); // Changed from uniformDistribution() to arithmetic()
volFactor[i] = 1.0;
}
}

View File

@ -23,6 +23,7 @@ Licence:
#include "PostprocessComponent.hpp"
#include "GaussianDistribution.hpp"
#include "numericConstants.hpp"
namespace pFlow
{
@ -51,15 +52,20 @@ public:
auto d = this->regPoints().eqDiameters();
auto c = this->regPoints().centers();
auto& regs = this->regionProecessMethod();
auto& volFactor = this->volumeFactor();
const uint32 n = d.size();
for(uint32 i=0; i<n; i++)
{
regs[i] = GaussianDistribution(c[i], pow(d[i],2));
auto r = d[i]/2;
regs[i] = GaussianDistribution(c[i], pow(r/3.0,2));
volFactor[i] = 0.677683 / (4.0/3.0*Pi*r);
}
}
// add the virtual constructor
add_vCtor(
add_vCtor
(
postprocessComponent,
PostprocessComponentGaussian,
dictionary

View File

@ -51,10 +51,12 @@ public:
auto d = this->regPoints().eqDiameters();
auto c = this->regPoints().centers();
auto& regs = this->regionProecessMethod();
auto& volFactor = this->volumeFactor();
const uint32 n = d.size();
for(uint32 i=0; i<n; i++)
{
regs[i] = uniformDistribution();
volFactor[i] = 1.0;
}
}

View File

@ -24,10 +24,19 @@ Licence:
// region types
#include "sphereRegionPoints.hpp"
#include "lineRegionPoints.hpp"
#include "multipleSpheresRegionPoints.hpp"
template class pFlow::PostprocessComponentGaussian<pFlow::sphereRegionPoints>;
template class pFlow::PostprocessComponentUniform<pFlow::sphereRegionPoints>;
template class pFlow::PostprocessComponentArithmetic<pFlow::sphereRegionPoints>;
template class pFlow::PostprocessComponentGaussian<pFlow::multipleSpheresRegionPoints>;
template class pFlow::PostprocessComponentUniform<pFlow::multipleSpheresRegionPoints>;
template class pFlow::PostprocessComponentArithmetic<pFlow::multipleSpheresRegionPoints>;
template class pFlow::PostprocessComponentGaussian<pFlow::lineRegionPoints>;
template class pFlow::PostprocessComponentUniform<pFlow::lineRegionPoints>;
template class pFlow::PostprocessComponentArithmetic<pFlow::lineRegionPoints>;

View File

@ -135,7 +135,7 @@ bool pFlow::particleProbePostprocessComponent::write(const fileSystem& parDir)co
if( !osPtr_)
{
// file is not open yet
fileSystem path = parDir + (name_+".Start_"+ti.prevTimeName());
fileSystem path = parDir + (name_+".Start_"+ti.timeName());
osPtr_ = makeUnique<oFstream>(path);
regionPointsPtr_().write(osPtr_());
}