Some debugging for rSmoother.
This commit is contained in:
@ -4,23 +4,15 @@ EXE_INC = \
|
||||
-I$(CFDEM_OFVERSION_DIR) \
|
||||
-I$(LIB_SRC)/finiteVolume/lnInclude \
|
||||
-I$(LIB_SRC)/meshTools/lnInclude \
|
||||
-I$(LIB_SRC)/TurbulenceModels/turbulenceModels/lnInclude \
|
||||
-I$(LIB_SRC)/TurbulenceModels/incompressible/lnInclude \
|
||||
-I$(LIB_SRC)/transportModels \
|
||||
-I$(LIB_SRC)/transportModels/incompressible/singlePhaseTransportModel \
|
||||
-I$(CFDEM_SRC_DIR)/lagrangian/cfdemParticle/lnInclude \
|
||||
-I$(CFDEM_SRC_DIR)/lagrangian/cfdemParticle/cfdTools \
|
||||
-I$(CFDEM_SRC_DIR)/recurrence/lnInclude \
|
||||
-I$(CFDEM_SRC_DIR)/lagrangian/cfdemParticle/derived/cfdemCloudRec \
|
||||
|
||||
EXE_LIBS = \
|
||||
-L$(CFDEM_LIB_DIR)\
|
||||
-lrecurrence \
|
||||
-lturbulenceModels \
|
||||
-lincompressibleTurbulenceModels \
|
||||
-lincompressibleTransportModels \
|
||||
-lfiniteVolume \
|
||||
-lmeshTools \
|
||||
-l$(CFDEM_LIB_NAME) \
|
||||
$(CFDEM_ADD_LIB_PATHS) \
|
||||
-lsampling \
|
||||
-lfvOptions \
|
||||
$(CFDEM_ADD_LIBS)
|
||||
|
||||
@ -1,4 +1,19 @@
|
||||
volVectorField U_smooth
|
||||
IOdictionary recProperties
|
||||
(
|
||||
IOobject
|
||||
(
|
||||
"recProperties",
|
||||
mesh.time().constant(),
|
||||
mesh,
|
||||
IOobject::MUST_READ,
|
||||
IOobject::NO_WRITE
|
||||
)
|
||||
);
|
||||
|
||||
dimensionedScalar dThreshold(recProperties.lookup("threshold"));
|
||||
scalar threshold = dThreshold.value();
|
||||
|
||||
volVectorField U_smooth
|
||||
(
|
||||
IOobject
|
||||
(
|
||||
|
||||
@ -30,13 +30,11 @@ Description
|
||||
|
||||
\*---------------------------------------------------------------------------*/
|
||||
|
||||
// #include "fvCFD.H"
|
||||
// #include "singlePhaseTransportModel.H"
|
||||
// #include "turbulentTransportModel.H"
|
||||
// #include "fvOptions.H"
|
||||
#include "fvCFD.H"
|
||||
#include "fvOptions.H"
|
||||
|
||||
#include "recBase.H"
|
||||
|
||||
#include "recModel.H"
|
||||
|
||||
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
||||
|
||||
@ -47,6 +45,7 @@ int main(int argc, char *argv[])
|
||||
#include "createTime.H"
|
||||
#include "createMesh.H"
|
||||
#include "createControl.H"
|
||||
#include "createFields.H"
|
||||
|
||||
|
||||
recBase recurrenceBase(mesh);
|
||||
@ -54,9 +53,8 @@ int main(int argc, char *argv[])
|
||||
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
||||
|
||||
// set time step to that of recurrence database
|
||||
runTime.setDeltaT(recBase.recM().recTimeStep());
|
||||
runTime.setDeltaT(recurrenceBase.recM().recTimeStep());
|
||||
|
||||
scalar threshold = 0.5;
|
||||
label index = -1;
|
||||
|
||||
Info<< "\nSmoothing recurrence statistics\n" << endl;
|
||||
@ -67,7 +65,6 @@ int main(int argc, char *argv[])
|
||||
index = runTime.timeIndex();
|
||||
#include "updateFields.H"
|
||||
runTime++;
|
||||
recTimeIndex++;
|
||||
}
|
||||
|
||||
Info<< "End\n" << endl;
|
||||
|
||||
@ -1,4 +1,4 @@
|
||||
Info << "averaging fields for time = " << runTime.value() <<", time index = " << index << endl;
|
||||
|
||||
U_smooth = recurrenceBase.recM().exportAveragedVolVectorField("U", threshold, index);
|
||||
U_smooth = recurrenceBase.recM().exportAveragedVolVectorField("UMean", threshold, index)();
|
||||
U_smooth.write();
|
||||
|
||||
@ -130,8 +130,8 @@ public:
|
||||
virtual const volVectorField& exportVolVectorField(word, label) const = 0;
|
||||
virtual const surfaceScalarField& exportSurfaceScalarField(word, label) const = 0;
|
||||
|
||||
virtual tmp<surfaceScalarField> exportAveragedSurfaceScalarField(word, scalar, label index = -1) const = 0;
|
||||
virtual tmp<volVectorField> exportAveragedVolVectorField(word, scalar, label index = -1) const = 0;
|
||||
// virtual tmp<surfaceScalarField> exportAveragedSurfaceScalarField(word, scalar, label index = -1) = 0;
|
||||
virtual tmp<volVectorField> exportAveragedVolVectorField(word, scalar, label index = -1) = 0;
|
||||
|
||||
virtual SymmetricSquareMatrix<scalar>& recurrenceMatrix() = 0;
|
||||
|
||||
|
||||
@ -407,7 +407,45 @@ void standardRecModel::writeRecMatrix() const
|
||||
|
||||
|
||||
|
||||
tmp<surfaceScalarField> standardRecModel::exportAveragedSurfaceScalarField(word fieldname, scalar threshold, label index) const
|
||||
// tmp<surfaceScalarField> standardRecModel::exportAveragedSurfaceScalarField(word fieldname, scalar threshold, label index)
|
||||
// {
|
||||
// label timeIndex;
|
||||
// if (index < 0)
|
||||
// {
|
||||
// timeIndex = virtualTimeIndex;
|
||||
// }
|
||||
// else
|
||||
// {
|
||||
// timeIndex = index;
|
||||
// }
|
||||
// const label fieldI = getSurfaceScalarFieldIndex(fieldname, timeIndex);
|
||||
//
|
||||
// tmp<surfaceScalarField> tAveragedSurfaceScalarField(surfaceScalarFieldList_[fieldI][timeIndex]);
|
||||
//
|
||||
// label counter = 1;
|
||||
// scalar recErr;
|
||||
// label delay = 10;
|
||||
// label lastMin = -1000;
|
||||
//
|
||||
// for(int runningTimeIndex = 1; runningTimeIndex < numRecFields_-1 ; runningTimeIndex++)
|
||||
// {
|
||||
// recErr = recurrenceMatrix_[timeIndex][runningTimeIndex];
|
||||
// if(recErr > threshold) continue;
|
||||
// if(recErr > recurrenceMatrix_[timeIndex][runningTimeIndex-1]) continue;
|
||||
// if(recErr > recurrenceMatrix_[timeIndex][runningTimeIndex+1]) continue;
|
||||
// if(abs(runningTimeIndex - timeIndex) < delay) continue;
|
||||
// if(abs(runningTimeIndex - lastMin) < delay) continue;
|
||||
//
|
||||
// lastMin = runningTimeIndex;
|
||||
// counter++;
|
||||
// tAveragedSurfaceScalarField += surfaceScalarFieldList_[fieldI][runningTimeIndex];
|
||||
// }
|
||||
//
|
||||
// tAveragedSurfaceScalarField /= counter;
|
||||
// return tAveragedSurfaceScalarField;
|
||||
// }
|
||||
|
||||
tmp<volVectorField> standardRecModel::exportAveragedVolVectorField(word fieldname, scalar threshold, label index)
|
||||
{
|
||||
label timeIndex;
|
||||
if (index < 0)
|
||||
@ -418,15 +456,15 @@ tmp<surfaceScalarField> standardRecModel::exportAveragedSurfaceScalarField(word
|
||||
{
|
||||
timeIndex = index;
|
||||
}
|
||||
const label fieldI = getSurfaceScalarFieldIndex(fieldname, timeIndex);
|
||||
|
||||
tmp<surfaceScalarField> tAveragedSurfaceScalarField(surfaceScalarFieldList_[fieldI][timeIndex]);
|
||||
const label fieldI = getVolVectorFieldIndex(fieldname, timeIndex);
|
||||
|
||||
tmp<volVectorField> tAveragedVolVectorField(volVectorFieldList_[fieldI][timeIndex]);
|
||||
|
||||
label counter = 1;
|
||||
scalar recErr;
|
||||
label delay = 10;
|
||||
label lastMin = -1000;
|
||||
|
||||
|
||||
for(int runningTimeIndex = 1; runningTimeIndex < numRecFields_-1 ; runningTimeIndex++)
|
||||
{
|
||||
recErr = recurrenceMatrix_[timeIndex][runningTimeIndex];
|
||||
@ -438,48 +476,10 @@ tmp<surfaceScalarField> standardRecModel::exportAveragedSurfaceScalarField(word
|
||||
|
||||
lastMin = runningTimeIndex;
|
||||
counter++;
|
||||
tAveragedSurfaceScalarField += surfaceScalarFieldList_[fieldI][runningTimeIndex];
|
||||
tAveragedVolVectorField() += volVectorFieldList_[fieldI][runningTimeIndex];
|
||||
}
|
||||
|
||||
tAveragedSurfaceScalarField /= counter;
|
||||
return tAveragedSurfaceScalarField;
|
||||
}
|
||||
|
||||
tmp<volVectorField> standardRecModel::exportAveragedVolVectorField(word fieldname, scalar threshold, label index) const
|
||||
{
|
||||
label timeIndex;
|
||||
if (index < 0)
|
||||
{
|
||||
timeIndex = virtualTimeIndex;
|
||||
}
|
||||
else
|
||||
{
|
||||
timeIndex = index;
|
||||
}
|
||||
const label fieldI = getSurfaceScalarFieldIndex(fieldname, timeIndex);
|
||||
|
||||
tmp<volVectorField> tAveragedVolVectorField(surfaceScalarFieldList_[fieldI][timeIndex]);
|
||||
|
||||
label counter = 1;
|
||||
scalar recErr;
|
||||
label delay = 10;
|
||||
label lastMin = -1000;
|
||||
|
||||
for(int runningTimeIndex = 1; runningTimeIndex < numRecFields_-1 ; runningTimeIndex++)
|
||||
{
|
||||
recErr = recurrenceMatrix_[timeIndex][runningTimeIndex];
|
||||
if(recErr > threshold) continue;
|
||||
if(recErr > recurrenceMatrix_[timeIndex][runningTimeIndex-1]) continue;
|
||||
if(recErr > recurrenceMatrix_[timeIndex][runningTimeIndex+1]) continue;
|
||||
if(abs(runningTimeIndex - timeIndex) < delay) continue;
|
||||
if(abs(runningTimeIndex - lastMin) < delay) continue;
|
||||
|
||||
lastMin = runningTimeIndex;
|
||||
counter++;
|
||||
tAveragedVolVectorField += volVectorFieldList_[fieldI][runningTimeIndex];
|
||||
}
|
||||
|
||||
tAveragedVolVectorField /= counter;
|
||||
Info << "time index = " << index << ", counter = " << counter << endl;
|
||||
tAveragedVolVectorField() /= counter;
|
||||
return tAveragedVolVectorField;
|
||||
}
|
||||
|
||||
|
||||
@ -102,8 +102,8 @@ public:
|
||||
const volVectorField& exportVolVectorField(word, label) const;
|
||||
const surfaceScalarField& exportSurfaceScalarField(word, label) const;
|
||||
|
||||
tmp<surfaceScalarField> exportAveragedSurfaceScalarField(word, scalar, label index = -1) const;
|
||||
tmp<volVectorField> exportAveragedvolVectorField(word, scalar, label index = -1) const;
|
||||
// tmp<surfaceScalarField> exportAveragedSurfaceScalarField(word, scalar, label index = -1);
|
||||
tmp<volVectorField> exportAveragedVolVectorField(word, scalar, label index = -1);
|
||||
|
||||
SymmetricSquareMatrix<scalar>& recurrenceMatrix();
|
||||
|
||||
|
||||
Reference in New Issue
Block a user