diff --git a/applications/utilities/rSmoother/Make/files b/applications/utilities/rSmoother/Make/files new file mode 100644 index 00000000..a48ff737 --- /dev/null +++ b/applications/utilities/rSmoother/Make/files @@ -0,0 +1,3 @@ +rSmoother.C + +EXE=$(CFDEM_APP_DIR)/rSmoother diff --git a/applications/utilities/rSmoother/Make/options b/applications/utilities/rSmoother/Make/options new file mode 100644 index 00000000..f91d7947 --- /dev/null +++ b/applications/utilities/rSmoother/Make/options @@ -0,0 +1,26 @@ +include $(CFDEM_ADD_LIBS_DIR)/additionalLibs + +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) \ +$(CFDEM_ADD_LIBS) diff --git a/applications/utilities/rSmoother/createFields.H b/applications/utilities/rSmoother/createFields.H new file mode 100644 index 00000000..3e19a76f --- /dev/null +++ b/applications/utilities/rSmoother/createFields.H @@ -0,0 +1,13 @@ + volVectorField U_smooth + ( + IOobject + ( + "U_smooth", + runTime.timeName(), + mesh, + IOobject::NO_READ, + IOobject::AUTO_WRITE + ), + mesh, + dimensionedVector("zero", dimensionSet(0,1,-1,0,0,0,0), vector(0.0, 0.0, 0.0)) + ); diff --git a/applications/utilities/rSmoother/rSmoother.C b/applications/utilities/rSmoother/rSmoother.C new file mode 100644 index 00000000..a065e779 --- /dev/null +++ b/applications/utilities/rSmoother/rSmoother.C @@ -0,0 +1,79 @@ +/*---------------------------------------------------------------------------*\ + CFDEMcoupling academic - Open Source CFD-DEM coupling + + Contributing authors: + Thomas Lichtenegger + Copyright (C) 2015- Johannes Kepler University, Linz +------------------------------------------------------------------------------- +License + This file is part of CFDEMcoupling academic. + + CFDEMcoupling academic is free software: you can redistribute it and/or modify it + under the terms of the GNU General Public License as published by + the Free Software Foundation, either version 3 of the License, or + (at your option) any later version. + + CFDEMcoupling academic is distributed in the hope that it will be useful, but WITHOUT + ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License + for more details. + + You should have received a copy of the GNU General Public License + along with CFDEMcoupling academic. If not, see . + +Application + rSmoother + +Description + Loops over all recurrence times and averages fields over given similarity range + + +\*---------------------------------------------------------------------------*/ + +// #include "fvCFD.H" +// #include "singlePhaseTransportModel.H" +// #include "turbulentTransportModel.H" +// #include "fvOptions.H" + +#include "recBase.H" + + +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +int main(int argc, char *argv[]) +{ + #include "postProcess.H" + #include "setRootCase.H" + #include "createTime.H" + #include "createMesh.H" + #include "createControl.H" + + + recBase recurrenceBase(mesh); + + // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + + // set time step to that of recurrence database + runTime.setDeltaT(recBase.recM().recTimeStep()); + + scalar threshold = 0.5; + label index = -1; + + Info<< "\nSmoothing recurrence statistics\n" << endl; + + while (runTime.run()) + { + // runtime can't be larger than recurrence database size + index = runTime.timeIndex(); + #include "updateFields.H" + runTime++; + recTimeIndex++; + } + + Info<< "End\n" << endl; + + return 0; +} + + +// ************************************************************************* // diff --git a/applications/utilities/rSmoother/updateFields.H b/applications/utilities/rSmoother/updateFields.H new file mode 100644 index 00000000..2f0d84e5 --- /dev/null +++ b/applications/utilities/rSmoother/updateFields.H @@ -0,0 +1,4 @@ +Info << "averaging fields for time = " << runTime.value() <<", time index = " << index << endl; + +U_smooth = recurrenceBase.recM().exportAveragedVolVectorField("U", threshold, index); +U_smooth.write();