mirror of
https://github.com/ParticulateFlow/CFDEMcoupling-PFM.git
synced 2025-12-08 06:37:44 +00:00
Utility to perform averaging over similar fields.
This commit is contained in:
3
applications/utilities/rSmoother/Make/files
Normal file
3
applications/utilities/rSmoother/Make/files
Normal file
@ -0,0 +1,3 @@
|
||||
rSmoother.C
|
||||
|
||||
EXE=$(CFDEM_APP_DIR)/rSmoother
|
||||
26
applications/utilities/rSmoother/Make/options
Normal file
26
applications/utilities/rSmoother/Make/options
Normal file
@ -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)
|
||||
13
applications/utilities/rSmoother/createFields.H
Normal file
13
applications/utilities/rSmoother/createFields.H
Normal file
@ -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))
|
||||
);
|
||||
79
applications/utilities/rSmoother/rSmoother.C
Normal file
79
applications/utilities/rSmoother/rSmoother.C
Normal file
@ -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 <http://www.gnu.org/licenses/>.
|
||||
|
||||
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;
|
||||
}
|
||||
|
||||
|
||||
// ************************************************************************* //
|
||||
4
applications/utilities/rSmoother/updateFields.H
Normal file
4
applications/utilities/rSmoother/updateFields.H
Normal file
@ -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();
|
||||
Reference in New Issue
Block a user