diff --git a/applications/solvers/cfdemSolverPisoFreeStreaming/Make/files b/applications/solvers/cfdemSolverPisoFreeStreaming/Make/files new file mode 100644 index 00000000..a91d0a6c --- /dev/null +++ b/applications/solvers/cfdemSolverPisoFreeStreaming/Make/files @@ -0,0 +1,3 @@ +cfdemSolverPisoFreeStreaming.C + +EXE=$(CFDEM_APP_DIR)/cfdemSolverPisoFreeStreaming diff --git a/applications/solvers/cfdemSolverPisoFreeStreaming/Make/options b/applications/solvers/cfdemSolverPisoFreeStreaming/Make/options new file mode 100644 index 00000000..ef370ae5 --- /dev/null +++ b/applications/solvers/cfdemSolverPisoFreeStreaming/Make/options @@ -0,0 +1,28 @@ +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$(FOAM_SOLVERS)/incompressible/pisoFoam \ + -I$(CFDEM_SRC_DIR)/lagrangian/cfdemParticle/lnInclude \ + -I$(CFDEM_SRC_DIR)/lagrangian/cfdemParticle/cfdTools \ + -I$(CFDEM_SRC_DIR)/lagrangian/cfdemParticle/derived/cfdemCloudRec \ + -I$(LIB_SRC)/sampling/lnInclude + +EXE_LIBS = \ + -L$(CFDEM_LIB_DIR)\ + -lturbulenceModels \ + -lincompressibleTurbulenceModels \ + -lincompressibleTransportModels \ + -lfiniteVolume \ + -lmeshTools \ + -lfvOptions \ + -lsampling \ + -l$(CFDEM_LIB_NAME) \ + $(CFDEM_ADD_LIB_PATHS) \ + $(CFDEM_ADD_LIBS) diff --git a/applications/solvers/cfdemSolverPisoFreeStreaming/cfdemSolverPisoFreeStreaming.C b/applications/solvers/cfdemSolverPisoFreeStreaming/cfdemSolverPisoFreeStreaming.C new file mode 100644 index 00000000..7e370549 --- /dev/null +++ b/applications/solvers/cfdemSolverPisoFreeStreaming/cfdemSolverPisoFreeStreaming.C @@ -0,0 +1,126 @@ +/*---------------------------------------------------------------------------*\ + CFDEMcoupling - Open Source CFD-DEM coupling + + CFDEMcoupling is part of the CFDEMproject + www.cfdem.com + Christoph Goniva, christoph.goniva@cfdem.com + Copyright (C) 1991-2009 OpenCFD Ltd. + Copyright (C) 2009-2012 JKU, Linz + Copyright (C) 2012- DCS Computing GmbH,Linz +------------------------------------------------------------------------------- +License + This file is part of CFDEMcoupling. + + CFDEMcoupling 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 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. If not, see . + +Application + cfdemSolverPisoFreeStreaming + +Description + Transient solver for incompressible flow. + Turbulence modelling is generic, i.e. laminar, RAS or LES may be selected. + The code is an evolution of the solver pisoFoam in OpenFOAM(R) 1.6, + where additional functionality for CFD-DEM coupling is added. + the particles follow the fluid velocity +\*---------------------------------------------------------------------------*/ + +#include "fvCFD.H" +#include "singlePhaseTransportModel.H" +#include "turbulentTransportModel.H" +#include "pisoControl.H" +#include "fvOptions.H" + +#include "cfdemCloudRec.H" + +#include "cfdemCloud.H" +#include "implicitCouple.H" +#include "clockModel.H" +#include "smoothingModel.H" +#include "forceModel.H" + +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +int main(int argc, char *argv[]) +{ + #include "postProcess.H" + #include "setRootCase.H" + #include "createTime.H" + #include "createMesh.H" + #include "createControl.H" + #include "createFields.H" + #include "createFvOptions.H" + #include "initContinuityErrs.H" + + cfdemCloudRec particleCloud(mesh); + // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + Info<< "\nStarting time loop\n" << endl; + while (runTime.loop()) + { + + particleCloud.clockM().start(1,"Global"); + + Info<< "Time = " << runTime.timeName() << nl << endl; + + #include "CourantNo.H" + + // do particle stuff + particleCloud.clockM().start(2,"Coupling"); + + particleCloud.evolve(voidfraction,Us,U); + + + particleCloud.clockM().stop("Coupling"); + + particleCloud.clockM().start(26,"Flow"); + + if(particleCloud.solveFlow()) + { + // Pressure-velocity PISO corrector + { + // Momentum predictor + #include "UEqn.H" + + // --- PISO loop + + while (piso.correct()) + { + #include "pEqn.H" + } + } + + laminarTransport.correct(); + turbulence->correct(); + } + else + { + Info << "skipping flow solution." << endl; + } + + runTime.write(); + + Info<< "ExecutionTime = " << runTime.elapsedCpuTime() << " s" + << " ClockTime = " << runTime.elapsedClockTime() << " s" + << nl << endl; + + particleCloud.clockM().stop("Flow"); + particleCloud.clockM().stop("Global"); + } + + Info<< "End\n" << endl; + + return 0; +} + + +// ************************************************************************* // diff --git a/applications/solvers/cfdemSolverPisoFreeStreaming/createFields.H b/applications/solvers/cfdemSolverPisoFreeStreaming/createFields.H new file mode 100644 index 00000000..598446e0 --- /dev/null +++ b/applications/solvers/cfdemSolverPisoFreeStreaming/createFields.H @@ -0,0 +1,110 @@ + Info<< "Reading field p\n" << endl; + volScalarField p + ( + IOobject + ( + "p", + runTime.timeName(), + mesh, + IOobject::MUST_READ, + IOobject::AUTO_WRITE + ), + mesh + ); + + Info<< "Reading physical velocity field U" << endl; + Info<< "Note: only if voidfraction at boundary is 1, U is superficial velocity!!!\n" << endl; + volVectorField U + ( + IOobject + ( + "U", + runTime.timeName(), + mesh, + IOobject::MUST_READ, + IOobject::AUTO_WRITE + ), + mesh + ); + +//=============================== +// particle interaction modelling +//=============================== + + Info<< "\nReading voidfraction field voidfraction = (Vgas/Vparticle)\n" << endl; + volScalarField voidfraction + ( + IOobject + ( + "voidfraction", + runTime.timeName(), + mesh, + IOobject::MUST_READ, + IOobject::AUTO_WRITE + ), + mesh + ); + + Info<< "\nCreating density field rho\n" << endl; + volScalarField rho + ( + IOobject + ( + "rho", + runTime.timeName(), + mesh, + IOobject::MUST_READ, + IOobject::AUTO_WRITE + ), + mesh + ); + + Info<< "Reading particle velocity field Us\n" << endl; + volVectorField Us + ( + IOobject + ( + "Us", + runTime.timeName(), + mesh, + IOobject::MUST_READ, + IOobject::AUTO_WRITE + ), + mesh + ); + +//=============================== + +//# include "createPhi.H" +#ifndef createPhi_H +#define createPhi_H +Info<< "Reading/calculating face flux field phi\n" << endl; +surfaceScalarField phi +( + IOobject + ( + "phi", + runTime.timeName(), + mesh, + IOobject::READ_IF_PRESENT, + IOobject::AUTO_WRITE + ), + linearInterpolate(U) & mesh.Sf() +); +#endif + + + + label pRefCell = 0; + scalar pRefValue = 0.0; + setRefCell(p, mesh.solutionDict().subDict("PISO"), pRefCell, pRefValue); + + + singlePhaseTransportModel laminarTransport(U, phi); + + autoPtr turbulence + ( + incompressible::turbulenceModel::New(U, phi, laminarTransport) + ); + +#include "createMRF.H" diff --git a/etc/solver-list.txt b/etc/solver-list.txt index d93e4850..87f900f6 100644 --- a/etc/solver-list.txt +++ b/etc/solver-list.txt @@ -12,3 +12,4 @@ cfdemSolverPisoScalar/dir cfdemSolverRhoPimpleChem/dir cfdemSolverMultiphase/dir rctfSpeciesTransport/dir +cfdemSolverPisoFreeStreaming/dir