From cc4afe5e1743638cb0b154d5517b0bcfe131336a Mon Sep 17 00:00:00 2001 From: danielque Date: Wed, 27 Mar 2019 10:29:44 +0100 Subject: [PATCH 01/23] [OF6] class 'Foam::Random' has no member named 'GaussNormal' 'GaussNormal' has been replaced by 'scalarNormal' --- .../subModels/forceModel/KochHillRWDrag/KochHillRWDrag.C | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/lagrangian/cfdemParticle/subModels/forceModel/KochHillRWDrag/KochHillRWDrag.C b/src/lagrangian/cfdemParticle/subModels/forceModel/KochHillRWDrag/KochHillRWDrag.C index 513f2cf7..3b9a8929 100755 --- a/src/lagrangian/cfdemParticle/subModels/forceModel/KochHillRWDrag/KochHillRWDrag.C +++ b/src/lagrangian/cfdemParticle/subModels/forceModel/KochHillRWDrag/KochHillRWDrag.C @@ -291,7 +291,7 @@ void KochHillRWDrag::setForce() const // modify current fluid velocity for (int dim=0; dim<3; dim++) { - partUfluct_[index][dim] = RanGen_.GaussNormal()*sqrt(2.*k/3.); + partUfluct_[index][dim] = RanGen_.scalarNormal()*sqrt(2.*k/3.); //Pout << "RW-TEST: Ufluid[" << dim << "] = " << Ufluid[dim] << " Ufluct = " << partUfluct_[index][dim] << " k = " << k << endl; // TEST-Output Ufluid[dim] = Ufluid[dim] + partUfluct_[index][dim]; } From 1cf1babc8cf4a96e0a6257e21fcde6a4f4274868 Mon Sep 17 00:00:00 2001 From: danielque Date: Wed, 27 Mar 2019 11:57:44 +0100 Subject: [PATCH 02/23] [OF6] parameters of MULES::limit MULES and CMULES have been extended so that the limits can be supplied as fields. These arguments are templated so that zeroField, oneField or UniformField can be used in place of a scalar value with no additional overhead. --- .../multiphaseMixture/multiphaseMixture.C | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/applications/solvers/cfdemSolverMultiphase/multiphaseMixture/multiphaseMixture.C b/applications/solvers/cfdemSolverMultiphase/multiphaseMixture/multiphaseMixture.C index a1ea1537..a8a502b6 100644 --- a/applications/solvers/cfdemSolverMultiphase/multiphaseMixture/multiphaseMixture.C +++ b/applications/solvers/cfdemSolverMultiphase/multiphaseMixture/multiphaseMixture.C @@ -679,8 +679,8 @@ void Foam::multiphaseMixture::solveAlphas alphaPhiCorr, zeroField(), zeroField(), - 1, - 0, + oneField(), + zeroField(), true ); From c40d8e8907c1f9ca7fae477ab43fcd8f682bfed0 Mon Sep 17 00:00:00 2001 From: Paul Kieckhefen Date: Wed, 10 Apr 2019 14:11:18 +0200 Subject: [PATCH 03/23] adapt cfdemSolverRhoPimple for OF-6. --- .../solvers/cfdemSolverRhoPimple/cfdemSolverRhoPimple.C | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/applications/solvers/cfdemSolverRhoPimple/cfdemSolverRhoPimple.C b/applications/solvers/cfdemSolverRhoPimple/cfdemSolverRhoPimple.C index eb4d2c47..03f706e3 100644 --- a/applications/solvers/cfdemSolverRhoPimple/cfdemSolverRhoPimple.C +++ b/applications/solvers/cfdemSolverRhoPimple/cfdemSolverRhoPimple.C @@ -113,7 +113,7 @@ int main(int argc, char *argv[]) particleCloud.clockM().start(26,"Flow"); - if (pimple.nCorrPIMPLE() <= 1) + if (pimple.nCorrPimple() <= 1) { #include "rhoEqn.H" } From 2fa735a2d4e39ee6b6a6db40667c37652745532a Mon Sep 17 00:00:00 2001 From: Paul Kieckhefen Date: Wed, 10 Apr 2019 14:17:18 +0200 Subject: [PATCH 04/23] adapt cfdemSolverRhoSimple for OF6. --- .../solvers/cfdemSolverRhoSimple/cfdemSolverRhoSimple.C | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/applications/solvers/cfdemSolverRhoSimple/cfdemSolverRhoSimple.C b/applications/solvers/cfdemSolverRhoSimple/cfdemSolverRhoSimple.C index 3af7f1f6..10518925 100644 --- a/applications/solvers/cfdemSolverRhoSimple/cfdemSolverRhoSimple.C +++ b/applications/solvers/cfdemSolverRhoSimple/cfdemSolverRhoSimple.C @@ -53,7 +53,6 @@ int main(int argc, char *argv[]) #include "createTime.H" #include "createMesh.H" #include "createControl.H" - #include "createTimeControls.H" #include "createRDeltaT.H" #include "initContinuityErrs.H" #include "createFields.H" @@ -71,7 +70,7 @@ int main(int argc, char *argv[]) Info<< "\nStarting time loop\n" << endl; - while (simple.loop()) + while (simple.loop(runTime)) { particleCloud.clockM().start(1,"Global"); From a9b8718c3f748df56591aa876e61bc99dcf8c588 Mon Sep 17 00:00:00 2001 From: Paul Kieckhefen Date: Wed, 10 Apr 2019 14:36:06 +0200 Subject: [PATCH 05/23] adapt cfdemSolverRhoPimpleChem for OF-6. --- .../cfdemSolverRhoPimpleChem/Make/options | 7 ------- .../solvers/cfdemSolverRhoPimpleChem/YEqn.H | 2 +- .../cfdemSolverRhoPimpleChem.C | 5 +++-- .../cfdemSolverRhoPimpleChem/createFields.H | 20 +++++++++---------- 4 files changed, 14 insertions(+), 20 deletions(-) diff --git a/applications/solvers/cfdemSolverRhoPimpleChem/Make/options b/applications/solvers/cfdemSolverRhoPimpleChem/Make/options index aa2a2273..3555fa85 100644 --- a/applications/solvers/cfdemSolverRhoPimpleChem/Make/options +++ b/applications/solvers/cfdemSolverRhoPimpleChem/Make/options @@ -19,12 +19,8 @@ EXE_INC = \ -I$(LIB_SRC)/thermophysicalModels/specie/lnInclude \ -I$(LIB_SRC)/transportModels/compressible/lnInclude \ -I$(LIB_SRC)/thermophysicalModels/basic/lnInclude \ - -I$(LIB_SRC)/thermophysicalModels/properties/liquidProperties/lnInclude \ - -I$(LIB_SRC)/thermophysicalModels/properties/liquidMixtureProperties/lnInclude \ - -I$(LIB_SRC)/thermophysicalModels/thermophysicalFunctions/lnInclude \ -I$(LIB_SRC)/thermophysicalModels/reactionThermo/lnInclude \ -I$(LIB_SRC)/thermophysicalModels/chemistryModel/lnInclude \ - -I$(LIB_SRC)/thermophysicalModels/radiationModels/lnInclude \ -I$(LIB_SRC)/regionModels/regionModel/lnInclude \ -I$(LIB_SRC)/regionModels/surfaceFilmModels/lnInclude \ -I$(LIB_SRC)/ODE/lnInclude \ @@ -48,9 +44,6 @@ EXE_LIBS = \ -l$(CFDEM_LIB_COMP_NAME) \ $(CFDEM_ADD_LIB_PATHS) \ $(CFDEM_ADD_LIBS) \ - -lliquidProperties \ - -lliquidMixtureProperties \ - -lthermophysicalFunctions \ -lreactionThermophysicalModels \ -lchemistryModel \ -lradiationModels \ diff --git a/applications/solvers/cfdemSolverRhoPimpleChem/YEqn.H b/applications/solvers/cfdemSolverRhoPimpleChem/YEqn.H index 3c82ddc8..525ef340 100644 --- a/applications/solvers/cfdemSolverRhoPimpleChem/YEqn.H +++ b/applications/solvers/cfdemSolverRhoPimpleChem/YEqn.H @@ -13,7 +13,7 @@ tmp > mvConvection { combustion->correct(); - dQ = combustion->dQ(); + dQ = combustion->Qdot(); label inertIndex = -1; volScalarField Yt(0.0*Y[0]); diff --git a/applications/solvers/cfdemSolverRhoPimpleChem/cfdemSolverRhoPimpleChem.C b/applications/solvers/cfdemSolverRhoPimpleChem/cfdemSolverRhoPimpleChem.C index 762a1cbc..460d6a78 100644 --- a/applications/solvers/cfdemSolverRhoPimpleChem/cfdemSolverRhoPimpleChem.C +++ b/applications/solvers/cfdemSolverRhoPimpleChem/cfdemSolverRhoPimpleChem.C @@ -30,7 +30,8 @@ Description #include "fvCFD.H" #include "turbulentFluidThermoModel.H" -#include "rhoCombustionModel.H" +#include "rhoReactionThermo.H" +#include "CombustionModel.H" #include "bound.H" #include "pimpleControl.H" #include "fvOptions.H" @@ -117,7 +118,7 @@ int main(int argc, char *argv[]) particleCloud.clockM().start(26,"Flow"); - if (pimple.nCorrPIMPLE() <= 1) + if (pimple.nCorrPimple() <= 1) { #include "rhoEqn.H" } diff --git a/applications/solvers/cfdemSolverRhoPimpleChem/createFields.H b/applications/solvers/cfdemSolverRhoPimpleChem/createFields.H index 80f4166e..c1013203 100644 --- a/applications/solvers/cfdemSolverRhoPimpleChem/createFields.H +++ b/applications/solvers/cfdemSolverRhoPimpleChem/createFields.H @@ -1,21 +1,15 @@ // thermodynamics, chemistry - Info<< "Creating combustion model\n" << endl; - - autoPtr combustion - ( - combustionModels::rhoCombustionModel::New(mesh) - ); - - rhoReactionThermo& thermo = combustion->thermo(); - + Info<< "Reading thermophysical properties\n" << endl; + autoPtr pThermo(rhoReactionThermo::New(mesh)); + rhoReactionThermo& thermo = pThermo(); thermo.validate(args.executable(), "h", "e"); basicSpecieMixture& composition = thermo.composition(); PtrList& Y = composition.Y(); // read molecular weight - volScalarField W(composition.W()); + volScalarField W(thermo.W()); bool propagateInertSpecie = true; @@ -209,6 +203,12 @@ ) ); + Info<< "Creating combustion model\n" << endl; + autoPtr> combustion + ( + CombustionModel::New(thermo, turbulence()) + ); + Info<< "Creating field dpdt\n" << endl; volScalarField dpdt ( From 302e8df86be2206fc97d1c9064bf267393276498 Mon Sep 17 00:00:00 2001 From: Thomas Lichtenegger Date: Thu, 2 May 2019 11:43:19 +0200 Subject: [PATCH 06/23] Cleaned up Ergun test case for cfdemSolverRhoPimple. --- .../cfdemSolverRhoPimple/ErgunTestMPI/CFD/0/U | 12 ++- .../cfdemSolverRhoPimple/ErgunTestMPI/CFD/0/p | 6 +- .../ErgunTestMPI/CFD/0/rho | 2 +- .../ErgunTestMPI/CFD/0/voidfraction | 5 +- .../CFD/constant/polyMesh/boundary | 10 +- .../ErgunTestMPI/CFD/constant/polyMesh/faces | 10 +- .../CFD/constant/polyMesh/neighbour | 10 +- .../ErgunTestMPI/CFD/constant/polyMesh/owner | 10 +- .../ErgunTestMPI/CFD/constant/polyMesh/points | 10 +- .../ErgunTestMPI/CFD/system/controlDict | 2 +- .../ErgunTestMPI/parCFDDEMrun.sh | 93 ++++++++++++++++++- 11 files changed, 127 insertions(+), 43 deletions(-) diff --git a/tutorials/cfdemSolverRhoPimple/ErgunTestMPI/CFD/0/U b/tutorials/cfdemSolverRhoPimple/ErgunTestMPI/CFD/0/U index 7c23223e..5e575b1e 100644 --- a/tutorials/cfdemSolverRhoPimple/ErgunTestMPI/CFD/0/U +++ b/tutorials/cfdemSolverRhoPimple/ErgunTestMPI/CFD/0/U @@ -28,12 +28,14 @@ boundaryField type slip; } - inlet + inlet { - type interstitialInletVelocity; - inletVelocity uniform (0 0 0.1); - alpha voidfraction; - value $internalField; + type uniformFixedValue; + uniformValue table + ( + (0.000 (0 0 0.002)) + (2.000 (0 0 1.5)) + ); } outlet diff --git a/tutorials/cfdemSolverRhoPimple/ErgunTestMPI/CFD/0/p b/tutorials/cfdemSolverRhoPimple/ErgunTestMPI/CFD/0/p index 6413dbea..0afd7bad 100644 --- a/tutorials/cfdemSolverRhoPimple/ErgunTestMPI/CFD/0/p +++ b/tutorials/cfdemSolverRhoPimple/ErgunTestMPI/CFD/0/p @@ -28,10 +28,8 @@ boundaryField inlet { - // type zeroGradient; - // type fixedFluxPressure; - // value $internalField; - type fixedFluxExtrapolatedPressure; + // type zeroGradient; + type fixedFluxExtrapolatedPressure; } outlet { diff --git a/tutorials/cfdemSolverRhoPimple/ErgunTestMPI/CFD/0/rho b/tutorials/cfdemSolverRhoPimple/ErgunTestMPI/CFD/0/rho index 235acd18..d20a10bf 100644 --- a/tutorials/cfdemSolverRhoPimple/ErgunTestMPI/CFD/0/rho +++ b/tutorials/cfdemSolverRhoPimple/ErgunTestMPI/CFD/0/rho @@ -16,7 +16,7 @@ FoamFile dimensions [1 -3 0 0 0 0 0]; -internalField uniform 1; +internalField uniform 1.18; boundaryField { diff --git a/tutorials/cfdemSolverRhoPimple/ErgunTestMPI/CFD/0/voidfraction b/tutorials/cfdemSolverRhoPimple/ErgunTestMPI/CFD/0/voidfraction index e38ca5fd..3fdf6da6 100644 --- a/tutorials/cfdemSolverRhoPimple/ErgunTestMPI/CFD/0/voidfraction +++ b/tutorials/cfdemSolverRhoPimple/ErgunTestMPI/CFD/0/voidfraction @@ -32,9 +32,8 @@ boundaryField } inlet { - //type fixedValue; - //value uniform 1; - type zeroGradient; + type fixedValue; + value uniform 1; } } diff --git a/tutorials/cfdemSolverRhoPimple/ErgunTestMPI/CFD/constant/polyMesh/boundary b/tutorials/cfdemSolverRhoPimple/ErgunTestMPI/CFD/constant/polyMesh/boundary index 2d0036f5..ac24449d 100644 --- a/tutorials/cfdemSolverRhoPimple/ErgunTestMPI/CFD/constant/polyMesh/boundary +++ b/tutorials/cfdemSolverRhoPimple/ErgunTestMPI/CFD/constant/polyMesh/boundary @@ -1,9 +1,9 @@ /*--------------------------------*- C++ -*----------------------------------*\ -| ========= | | -| \\ / F ield | OpenFOAM: The Open Source CFD Toolbox | -| \\ / O peration | Version: 4.x | -| \\ / A nd | Web: www.OpenFOAM.org | -| \\/ M anipulation | | + ========= | + \\ / F ield | OpenFOAM: The Open Source CFD Toolbox + \\ / O peration | Website: https://openfoam.org + \\ / A nd | Version: 6 + \\/ M anipulation | \*---------------------------------------------------------------------------*/ FoamFile { diff --git a/tutorials/cfdemSolverRhoPimple/ErgunTestMPI/CFD/constant/polyMesh/faces b/tutorials/cfdemSolverRhoPimple/ErgunTestMPI/CFD/constant/polyMesh/faces index 09efdf45..080d949e 100644 --- a/tutorials/cfdemSolverRhoPimple/ErgunTestMPI/CFD/constant/polyMesh/faces +++ b/tutorials/cfdemSolverRhoPimple/ErgunTestMPI/CFD/constant/polyMesh/faces @@ -1,9 +1,9 @@ /*--------------------------------*- C++ -*----------------------------------*\ -| ========= | | -| \\ / F ield | OpenFOAM: The Open Source CFD Toolbox | -| \\ / O peration | Version: 4.x | -| \\ / A nd | Web: www.OpenFOAM.org | -| \\/ M anipulation | | + ========= | + \\ / F ield | OpenFOAM: The Open Source CFD Toolbox + \\ / O peration | Website: https://openfoam.org + \\ / A nd | Version: 6 + \\/ M anipulation | \*---------------------------------------------------------------------------*/ FoamFile { diff --git a/tutorials/cfdemSolverRhoPimple/ErgunTestMPI/CFD/constant/polyMesh/neighbour b/tutorials/cfdemSolverRhoPimple/ErgunTestMPI/CFD/constant/polyMesh/neighbour index a4bab5dd..d8f1dfcc 100644 --- a/tutorials/cfdemSolverRhoPimple/ErgunTestMPI/CFD/constant/polyMesh/neighbour +++ b/tutorials/cfdemSolverRhoPimple/ErgunTestMPI/CFD/constant/polyMesh/neighbour @@ -1,9 +1,9 @@ /*--------------------------------*- C++ -*----------------------------------*\ -| ========= | | -| \\ / F ield | OpenFOAM: The Open Source CFD Toolbox | -| \\ / O peration | Version: 4.x | -| \\ / A nd | Web: www.OpenFOAM.org | -| \\/ M anipulation | | + ========= | + \\ / F ield | OpenFOAM: The Open Source CFD Toolbox + \\ / O peration | Website: https://openfoam.org + \\ / A nd | Version: 6 + \\/ M anipulation | \*---------------------------------------------------------------------------*/ FoamFile { diff --git a/tutorials/cfdemSolverRhoPimple/ErgunTestMPI/CFD/constant/polyMesh/owner b/tutorials/cfdemSolverRhoPimple/ErgunTestMPI/CFD/constant/polyMesh/owner index e6760ef3..25f2876f 100644 --- a/tutorials/cfdemSolverRhoPimple/ErgunTestMPI/CFD/constant/polyMesh/owner +++ b/tutorials/cfdemSolverRhoPimple/ErgunTestMPI/CFD/constant/polyMesh/owner @@ -1,9 +1,9 @@ /*--------------------------------*- C++ -*----------------------------------*\ -| ========= | | -| \\ / F ield | OpenFOAM: The Open Source CFD Toolbox | -| \\ / O peration | Version: 4.x | -| \\ / A nd | Web: www.OpenFOAM.org | -| \\/ M anipulation | | + ========= | + \\ / F ield | OpenFOAM: The Open Source CFD Toolbox + \\ / O peration | Website: https://openfoam.org + \\ / A nd | Version: 6 + \\/ M anipulation | \*---------------------------------------------------------------------------*/ FoamFile { diff --git a/tutorials/cfdemSolverRhoPimple/ErgunTestMPI/CFD/constant/polyMesh/points b/tutorials/cfdemSolverRhoPimple/ErgunTestMPI/CFD/constant/polyMesh/points index 68251f19..c2680b6a 100644 --- a/tutorials/cfdemSolverRhoPimple/ErgunTestMPI/CFD/constant/polyMesh/points +++ b/tutorials/cfdemSolverRhoPimple/ErgunTestMPI/CFD/constant/polyMesh/points @@ -1,9 +1,9 @@ /*--------------------------------*- C++ -*----------------------------------*\ -| ========= | | -| \\ / F ield | OpenFOAM: The Open Source CFD Toolbox | -| \\ / O peration | Version: 4.x | -| \\ / A nd | Web: www.OpenFOAM.org | -| \\/ M anipulation | | + ========= | + \\ / F ield | OpenFOAM: The Open Source CFD Toolbox + \\ / O peration | Website: https://openfoam.org + \\ / A nd | Version: 6 + \\/ M anipulation | \*---------------------------------------------------------------------------*/ FoamFile { diff --git a/tutorials/cfdemSolverRhoPimple/ErgunTestMPI/CFD/system/controlDict b/tutorials/cfdemSolverRhoPimple/ErgunTestMPI/CFD/system/controlDict index db6a8cdc..43642e2b 100644 --- a/tutorials/cfdemSolverRhoPimple/ErgunTestMPI/CFD/system/controlDict +++ b/tutorials/cfdemSolverRhoPimple/ErgunTestMPI/CFD/system/controlDict @@ -23,7 +23,7 @@ startTime 0; stopAt endTime; -endTime 0.5; +endTime 2.0; deltaT 0.00025; diff --git a/tutorials/cfdemSolverRhoPimple/ErgunTestMPI/parCFDDEMrun.sh b/tutorials/cfdemSolverRhoPimple/ErgunTestMPI/parCFDDEMrun.sh index 8c3fb91b..2785bf19 100755 --- a/tutorials/cfdemSolverRhoPimple/ErgunTestMPI/parCFDDEMrun.sh +++ b/tutorials/cfdemSolverRhoPimple/ErgunTestMPI/parCFDDEMrun.sh @@ -1,6 +1,91 @@ #!/bin/bash -cd CFD -blockMesh -decomposePar -force -mpirun -np 4 cfdemSolverRhoPimple -parallel +#===================================================================# +# allrun script for testcase as part of test routine +# run Ergun test CFD part +#===================================================================# + +#- source CFDEM env vars +. ~/.bashrc + +#- include functions +source $CFDEM_PROJECT_DIR/etc/functions.sh + +#--------------------------------------------------------------------------------# +#- define variables +casePath="$(dirname "$(readlink -f ${BASH_SOURCE[0]})")" +logpath=$casePath +headerText="run_parallel_cfdemSolverRhoPimple_ErgunTestMPI_CFDDEM" +logfileName="log_$headerText" +solverName="cfdemSolverRhoPimple" +nrProcs="4" +machineFileName="none" # yourMachinefileName | none +debugMode="off" # on | off| strict +testHarnessPath="$CFDEM_TEST_HARNESS_PATH" +runOctave="true" +postproc="false" +#--------------------------------------------------------------------------------# + +#- call function to run a parallel CFD-DEM case +parCFDDEMrun $logpath $logfileName $casePath $headerText $solverName $nrProcs $machineFileName $debugMode + + +if [ $runOctave == "true" ] + then + #------------------------------# + # octave + + #- change path + cd octave + + #- rmove old graph + rm cfdemSolverRhoPimple_ErgunTestMPI.eps + + #- run octave + octave totalPressureDrop.m + + #- show plot + evince cfdemSolverRhoPimple_ErgunTestMPI.eps + + #- copy log file to test harness + cp ../../$logfileName $testHarnessPath + cp cfdemSolverRhoPimple_ErgunTestMPI.eps $testHarnessPath +fi + +if [ $postproc == "true" ] + then + + #- keep terminal open (if started in new terminal) + echo "simulation finisehd? ...press enter to proceed" + read + + #- get VTK data from liggghts dump file + cd $casePath/DEM/post + python -i $CFDEM_LPP_DIR/lpp.py dump*.liggghts_run + + #- get VTK data from CFD sim + cd $casePath/CFD + foamToVTK #- serial run of foamToVTK + + #- start paraview + paraview + + #- keep terminal open (if started in new terminal) + echo "...press enter to clean up case" + echo "press Ctr+C to keep data" + read + +fi + +#- clean up case +echo "deleting data at: $casePath :\n" +source $WM_PROJECT_DIR/bin/tools/CleanFunctions +cd $casePath/CFD +#cleanCase +rm -r $casePath/CFD/clockData +rm $casePath/DEM/post/*.* +touch $casePath/DEM/post/.gitignore +rm $casePath/DEM/post/restart/*.* +rm $casePath/DEM/post/restart/liggghts.restartCFDEM* +touch $casePath/DEM/post/restart/.gitignore +echo "done" From d0400cdc7419c082478e58f67f85b11a8f2b3f8f Mon Sep 17 00:00:00 2001 From: danielque Date: Fri, 17 May 2019 14:24:55 +0200 Subject: [PATCH 07/23] update sourcing of OpenFOAM bashrc to OF6 --- etc/bashrc | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/etc/bashrc b/etc/bashrc index c7224a0b..ac8fda40 100755 --- a/etc/bashrc +++ b/etc/bashrc @@ -25,7 +25,7 @@ export CFDEM_VERSION=19.02 # Please set to the appropriate path if the default is not correct. # # activate compatible OpenFOAM version -. $HOME/OpenFOAM/OpenFOAM-4.x/etc/bashrc +. $HOME/OpenFOAM/OpenFOAM-6/etc/bashrc # # CFDEMcoupling export CFDEM_INST_DIR=$HOME/$CFDEM_PROJECT From cab4fdcb2f69c853367b066e03cf7aabd0ab53cd Mon Sep 17 00:00:00 2001 From: danielque Date: Fri, 17 May 2019 15:00:28 +0200 Subject: [PATCH 08/23] adjust fvSolution settings for multiphase solver in OpenFOAM6 OF6 requires pcorrFinal to be specified --- tutorials/cfdemSolverMultiphase/damBreak/CFD/system/fvSolution | 2 +- .../particlesWaterEntry/CFD/system/fvSolution | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/tutorials/cfdemSolverMultiphase/damBreak/CFD/system/fvSolution b/tutorials/cfdemSolverMultiphase/damBreak/CFD/system/fvSolution index 6907a786..b007676b 100644 --- a/tutorials/cfdemSolverMultiphase/damBreak/CFD/system/fvSolution +++ b/tutorials/cfdemSolverMultiphase/damBreak/CFD/system/fvSolution @@ -23,7 +23,7 @@ solvers cAlpha 1; } - pcorr + "pcorr.*" { solver PCG; preconditioner diff --git a/tutorials/cfdemSolverMultiphase/particlesWaterEntry/CFD/system/fvSolution b/tutorials/cfdemSolverMultiphase/particlesWaterEntry/CFD/system/fvSolution index 6907a786..b007676b 100644 --- a/tutorials/cfdemSolverMultiphase/particlesWaterEntry/CFD/system/fvSolution +++ b/tutorials/cfdemSolverMultiphase/particlesWaterEntry/CFD/system/fvSolution @@ -23,7 +23,7 @@ solvers cAlpha 1; } - pcorr + "pcorr.*" { solver PCG; preconditioner From a6be6be3cc7a16b0909f282c508c656cfb49e889 Mon Sep 17 00:00:00 2001 From: danielque Date: Fri, 17 May 2019 15:24:26 +0200 Subject: [PATCH 09/23] adjust tankDrainage case to OpenFOAM 6 caseDicts/postProcessing/surfaceRegion in OpenFOAM 4 was renamed to caseDicts/postProcessing/surfaceFieldValue OpenFOAM 6; OpenFOAM 6 requires pcorrFinal to be defined; --- .../cfdemSolverMultiphase/tankDrainage/CFD/system/fvSolution | 2 +- .../cfdemSolverMultiphase/tankDrainage/CFD/system/patchAverage | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/tutorials/cfdemSolverMultiphase/tankDrainage/CFD/system/fvSolution b/tutorials/cfdemSolverMultiphase/tankDrainage/CFD/system/fvSolution index 4bcd2197..630a1374 100644 --- a/tutorials/cfdemSolverMultiphase/tankDrainage/CFD/system/fvSolution +++ b/tutorials/cfdemSolverMultiphase/tankDrainage/CFD/system/fvSolution @@ -23,7 +23,7 @@ solvers cAlpha 1; } - pcorr + "pcorr.*" { solver PCG; preconditioner diff --git a/tutorials/cfdemSolverMultiphase/tankDrainage/CFD/system/patchAverage b/tutorials/cfdemSolverMultiphase/tankDrainage/CFD/system/patchAverage index 69c4a772..a998bebf 100644 --- a/tutorials/cfdemSolverMultiphase/tankDrainage/CFD/system/patchAverage +++ b/tutorials/cfdemSolverMultiphase/tankDrainage/CFD/system/patchAverage @@ -14,6 +14,6 @@ name outlet; fields (alpha.air alpha.water alpha.oil); operation average; -#includeEtc "caseDicts/postProcessing/surfaceRegion/patch.cfg" +#includeEtc "caseDicts/postProcessing/surfaceFieldValue/patch.cfg" // ************************************************************************* // From ef43147dc817b8f07b4333c1419702cbd420054f Mon Sep 17 00:00:00 2001 From: danielque Date: Tue, 12 Nov 2019 12:05:46 +0100 Subject: [PATCH 10/23] update libs to OF6: replace calls to osRandomInteger() and integer(...) osRandomInteger() does no longer exist in OF6; using zero as seed value for random number generator instead integer(lower, upper) does no longer exist in OF6, instead using sampleAB(lower upper); note that there is a slight difference in the used range: (upper+1-lower) vs (upper-lower) --- .../isotropicFluctuations.C | 16 ++++++++-------- src/recurrence/recPath/MarkovPath/MarkovPath.C | 5 +++-- .../multiIntervalPath/multiIntervalPath.C | 3 ++- .../recPath/simpleRandomPath/simpleRandomPath.C | 8 ++++---- 4 files changed, 17 insertions(+), 15 deletions(-) diff --git a/src/lagrangian/cfdemParticle/subModels/forceModel/isotropicFluctuations/isotropicFluctuations.C b/src/lagrangian/cfdemParticle/subModels/forceModel/isotropicFluctuations/isotropicFluctuations.C index 6c9c5579..d67b1391 100644 --- a/src/lagrangian/cfdemParticle/subModels/forceModel/isotropicFluctuations/isotropicFluctuations.C +++ b/src/lagrangian/cfdemParticle/subModels/forceModel/isotropicFluctuations/isotropicFluctuations.C @@ -1,6 +1,6 @@ /*---------------------------------------------------------------------------*\ CFDEMcoupling academic - Open Source CFD-DEM coupling - + Contributing authors: Thomas Lichtenegger Copyright (C) 2015- Johannes Kepler University, Linz @@ -83,7 +83,7 @@ isotropicFluctuations::isotropicFluctuations dimensionedScalar("D0", dimensionSet(0,0,0,0,0,0,0), D0_) ), dtDEM_(particleCloud_.dataExchangeM().DEMts()), - ranGen_(osRandomInteger()) + ranGen_(0) { if(ignoreCellsName_ != "none") { @@ -122,10 +122,10 @@ void isotropicFluctuations::setForce() const vector flucU(0,0,0); label cellI=0; scalar relVolfractionExcess(0.0); - + interpolationCellPoint voidfractionInterpolator_(voidfraction_); interpolationCellPoint voidfractionRecInterpolator_(voidfractionRec_); - + for(int index = 0;index < particleCloud_.numberOfParticles(); ++index) { cellI = particleCloud_.cellIDs()[index][0]; @@ -151,14 +151,14 @@ void isotropicFluctuations::setForce() const voidfractionRec = voidfractionRec_[cellI]; } // write particle based data to global array - + deltaVoidfrac=voidfractionRec-voidfraction; relVolfractionExcess=deltaVoidfrac/(1-voidfraction+SMALL); if(deltaVoidfrac>0) { D = D0Field_[cellI]; flucU=unitFlucDir()*fluctuationMag(relVolfractionExcess,D); - } + } // write particle based data to global array for(int j=0;j<3;j++) @@ -168,11 +168,11 @@ void isotropicFluctuations::setForce() const } } } - + if (measureDiff_) { dimensionedScalar diff( fvc::domainIntegrate( sqr( voidfraction_ - voidfractionRec_ ) ) ); - scalar t = particleCloud_.mesh().time().timeOutputValue(); + scalar t = particleCloud_.mesh().time().timeOutputValue(); recErrorFile_ << t << "\t" << diff.value() << endl; } } diff --git a/src/recurrence/recPath/MarkovPath/MarkovPath.C b/src/recurrence/recPath/MarkovPath/MarkovPath.C index 06aa3e92..2dcd427d 100644 --- a/src/recurrence/recPath/MarkovPath/MarkovPath.C +++ b/src/recurrence/recPath/MarkovPath/MarkovPath.C @@ -92,7 +92,7 @@ MarkovPath::MarkovPath } intervalSizesCumulative_[i] = sum1; } - + // check if meanIntervalSteps and correlationSteps are reasonable label critLength = meanIntervalSteps_ + 2 * correlationSteps_; for(int i=0;i& recurrenceMatrix( base_.recM().recurrenceMatrix() ); diff --git a/src/recurrence/recPath/multiIntervalPath/multiIntervalPath.C b/src/recurrence/recPath/multiIntervalPath/multiIntervalPath.C index f89e2ba7..15483e7f 100644 --- a/src/recurrence/recPath/multiIntervalPath/multiIntervalPath.C +++ b/src/recurrence/recPath/multiIntervalPath/multiIntervalPath.C @@ -113,7 +113,8 @@ void multiIntervalPath::computeRecPath() Info << "\nComputing recurrence path\n" << endl; - Random ranGen(osRandomInteger()); + const label seed = 0; + Random ranGen(seed); label virtualTimeIndex=0; label recSteps=0; diff --git a/src/recurrence/recPath/simpleRandomPath/simpleRandomPath.C b/src/recurrence/recPath/simpleRandomPath/simpleRandomPath.C index 083a9884..4d040944 100644 --- a/src/recurrence/recPath/simpleRandomPath/simpleRandomPath.C +++ b/src/recurrence/recPath/simpleRandomPath/simpleRandomPath.C @@ -69,15 +69,15 @@ void simpleRandomPath::computeRecPath() { Info << "\nComputing recurrence path\n" << endl; - - Random ranGen(osRandomInteger()); + const label seed = 0; + Random ranGen(seed); label virtualTimeIndex = 0; label recSteps = 0; label seqStart = 0; label lowerSeqLim( base_.recM().lowerSeqLim() ); label upperSeqLim( base_.recM().upperSeqLim() ); - label seqLength = ranGen.integer(lowerSeqLim, upperSeqLim); + label seqLength = ranGen.sampleAB(lowerSeqLim, upperSeqLim); virtualTimeIndex = seqEnd(seqStart,seqLength); labelPair seqStartEnd(seqStart,virtualTimeIndex); @@ -123,7 +123,7 @@ void simpleRandomPath::computeRecPath() } } - seqLength = ranGen.integer(lowerSeqLim, upperSeqLim); + seqLength = ranGen.sampleAB(lowerSeqLim, upperSeqLim); virtualTimeIndex = seqEnd(seqStart,seqLength); labelPair seqStartEnd(seqStart,virtualTimeIndex); virtualTimeIndexList_.append(seqStartEnd); From a31d9f129ee1bcc2c9eaf9eaa23af3576750d0b0 Mon Sep 17 00:00:00 2001 From: danielque Date: Tue, 12 Nov 2019 13:16:35 +0100 Subject: [PATCH 11/23] re-add include that got lost in auto-merge --- .../rcfdemSolverRhoSteadyPimple/rcfdemSolverRhoSteadyPimple.C | 1 + 1 file changed, 1 insertion(+) diff --git a/applications/solvers/rcfdemSolverRhoSteadyPimple/rcfdemSolverRhoSteadyPimple.C b/applications/solvers/rcfdemSolverRhoSteadyPimple/rcfdemSolverRhoSteadyPimple.C index 6c39a428..a2284a0f 100644 --- a/applications/solvers/rcfdemSolverRhoSteadyPimple/rcfdemSolverRhoSteadyPimple.C +++ b/applications/solvers/rcfdemSolverRhoSteadyPimple/rcfdemSolverRhoSteadyPimple.C @@ -61,6 +61,7 @@ int main(int argc, char *argv[]) #include "createTime.H" #include "createMesh.H" #include "createControl.H" + #include "createTimeControls.H" #include "createRDeltaT.H" #include "initContinuityErrs.H" #include "createFields.H" From f2f6c4bf8c4329d9fd2fe6b26d3b3ba21af0c4fa Mon Sep 17 00:00:00 2001 From: danielque Date: Tue, 12 Nov 2019 18:02:14 +0100 Subject: [PATCH 12/23] add missing methods in gerhardsRecModel just copied from standadRecModel, not tested --- .../gerhardsRecModel/gerhardsRecModel.C | 21 +++++++++++++++++++ .../gerhardsRecModel/gerhardsRecModel.H | 12 +++++++---- 2 files changed, 29 insertions(+), 4 deletions(-) diff --git a/src/recurrence/recModel/gerhardsRecModel/gerhardsRecModel.C b/src/recurrence/recModel/gerhardsRecModel/gerhardsRecModel.C index f3814b08..d9875fac 100644 --- a/src/recurrence/recModel/gerhardsRecModel/gerhardsRecModel.C +++ b/src/recurrence/recModel/gerhardsRecModel/gerhardsRecModel.C @@ -851,6 +851,27 @@ const surfaceScalarField& gerhardsRecModel::exportSurfaceScalarField(word fieldn } +PtrList& gerhardsRecModel::exportVolScalarFieldList(word fieldname) +{ + const label fieldI = getVolScalarFieldIndex(fieldname); + + return volScalarFieldList_[fieldI]; +} + +PtrList& gerhardsRecModel::exportVolVectorFieldList(word fieldname) +{ + const label fieldI = getVolVectorFieldIndex(fieldname); + + return volVectorFieldList_[fieldI]; +} + +PtrList& gerhardsRecModel::exportSurfaceScalarFieldList(word fieldname) +{ + const label fieldI = getSurfaceScalarFieldIndex(fieldname); + + return surfaceScalarFieldList_[fieldI]; +} + SymmetricSquareMatrix& gerhardsRecModel::recurrenceMatrix() diff --git a/src/recurrence/recModel/gerhardsRecModel/gerhardsRecModel.H b/src/recurrence/recModel/gerhardsRecModel/gerhardsRecModel.H index 81fb2ccd..af0b0e98 100644 --- a/src/recurrence/recModel/gerhardsRecModel/gerhardsRecModel.H +++ b/src/recurrence/recModel/gerhardsRecModel/gerhardsRecModel.H @@ -100,9 +100,9 @@ protected: scalar checkTimeStep(); - inline label getVolScalarFieldIndex(word, label) const; - inline label getVolVectorFieldIndex(word, label) const; - inline label getSurfaceScalarFieldIndex(word, label) const; + inline label getVolScalarFieldIndex(word, label=0) const; + inline label getVolVectorFieldIndex(word, label=0) const; + inline label getSurfaceScalarFieldIndex(word, label=0) const; void readFieldSeries(); @@ -143,7 +143,11 @@ public: const volVectorField& exportVolVectorField(word, label); const surfaceScalarField& exportSurfaceScalarField(word, label); - // tmp exportAveragedSurfaceScalarField(word, scalar, label index = -1); + PtrList& exportVolScalarFieldList(word); + PtrList& exportVolVectorFieldList(word); + PtrList& exportSurfaceScalarFieldList(word); + + // tmp exportAveragedSurfaceScalarField(word, scalar, label index = -1); void exportAveragedVolVectorField(volVectorField&, word, scalar, label index = -1) const; SymmetricSquareMatrix& recurrenceMatrix(); From fe81287d8dad926b773869726929a677c4ef7e92 Mon Sep 17 00:00:00 2001 From: danielque Date: Tue, 12 Nov 2019 18:04:47 +0100 Subject: [PATCH 13/23] [OF6] nCorrPIMPLE() -> nCorrPimple() adjust to renamed function --- .../rcfdemSolverRhoSteadyPimple/rcfdemSolverRhoSteadyPimple.C | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/applications/solvers/rcfdemSolverRhoSteadyPimple/rcfdemSolverRhoSteadyPimple.C b/applications/solvers/rcfdemSolverRhoSteadyPimple/rcfdemSolverRhoSteadyPimple.C index a2284a0f..c6196942 100644 --- a/applications/solvers/rcfdemSolverRhoSteadyPimple/rcfdemSolverRhoSteadyPimple.C +++ b/applications/solvers/rcfdemSolverRhoSteadyPimple/rcfdemSolverRhoSteadyPimple.C @@ -137,7 +137,7 @@ int main(int argc, char *argv[]) while (pimple.loop()) { // if needed, perform drag update here - if (pimple.nCorrPIMPLE() <= 1) + if (pimple.nCorrPimple() <= 1) { #include "rhoEqn.H" } From dc3194c857a516564a9cfd1bc8af947fe7b542af Mon Sep 17 00:00:00 2001 From: danielque Date: Wed, 13 Nov 2019 09:11:40 +0100 Subject: [PATCH 14/23] introduce OpenFOAM version flag/make code compile with OF4-OF6 extract major openfoam version from WM_PROJECT_VERSION environment variable in make/options files and use it for a preprocessor flag (OPENFOAM_VERSION_MAJOR) for conditional compilation make CFDEMcoupling compile with OF 4.x, 5.x and 6 --- .../multiphaseMixture/Make/options | 4 ++++ .../multiphaseMixture/multiphaseMixture.C | 5 +++++ .../solvers/cfdemSolverRhoPimple/Make/options | 2 ++ .../cfdemSolverRhoPimple/cfdemSolverRhoPimple.C | 4 ++++ .../cfdemSolverRhoPimpleChem/Make/options | 2 ++ .../solvers/cfdemSolverRhoPimpleChem/YEqn.H | 4 ++++ .../cfdemSolverRhoPimpleChem.C | 8 ++++++++ .../cfdemSolverRhoPimpleChem/createFields.H | 15 +++++++++++++++ .../rcfdemSolverRhoSteadyPimple/Make/options | 2 ++ .../rcfdemSolverRhoSteadyPimple.C | 4 ++++ src/lagrangian/cfdemParticle/Make/options | 2 ++ .../forceModel/KochHillRWDrag/KochHillRWDrag.C | 4 ++++ src/lagrangian/cfdemParticleComp/Make/options | 2 ++ src/recurrence/Make/options | 3 +++ .../recModel/gerhardsRecModel/gerhardsRecModel.C | 16 ++++++++++++++++ .../recPath/simpleRandomPath/simpleRandomPath.C | 8 ++++++++ 16 files changed, 85 insertions(+) diff --git a/applications/solvers/cfdemSolverMultiphase/multiphaseMixture/Make/options b/applications/solvers/cfdemSolverMultiphase/multiphaseMixture/Make/options index f8ffa1cf..15704fe2 100644 --- a/applications/solvers/cfdemSolverMultiphase/multiphaseMixture/Make/options +++ b/applications/solvers/cfdemSolverMultiphase/multiphaseMixture/Make/options @@ -1,4 +1,8 @@ +FOAM_VERSION_MAJOR := $(word 1,$(subst ., ,$(WM_PROJECT_VERSION))) +PFLAGS+= -DOPENFOAM_VERSION_MAJOR=$(FOAM_VERSION_MAJOR) + EXE_INC = \ + $(PFLAGS) \ -IalphaContactAngle \ -I$(LIB_SRC)/transportModels \ -I$(LIB_SRC)/transportModels/incompressible/lnInclude \ diff --git a/applications/solvers/cfdemSolverMultiphase/multiphaseMixture/multiphaseMixture.C b/applications/solvers/cfdemSolverMultiphase/multiphaseMixture/multiphaseMixture.C index a8a502b6..e152ae4a 100644 --- a/applications/solvers/cfdemSolverMultiphase/multiphaseMixture/multiphaseMixture.C +++ b/applications/solvers/cfdemSolverMultiphase/multiphaseMixture/multiphaseMixture.C @@ -679,8 +679,13 @@ void Foam::multiphaseMixture::solveAlphas alphaPhiCorr, zeroField(), zeroField(), +#if OPENFOAM_VERSION_MAJOR < 6 + 1, + 0, +#else oneField(), zeroField(), +#endif true ); diff --git a/applications/solvers/cfdemSolverRhoPimple/Make/options b/applications/solvers/cfdemSolverRhoPimple/Make/options index 0377ece5..cc67835d 100644 --- a/applications/solvers/cfdemSolverRhoPimple/Make/options +++ b/applications/solvers/cfdemSolverRhoPimple/Make/options @@ -1,5 +1,7 @@ include $(CFDEM_ADD_LIBS_DIR)/additionalLibs +FOAM_VERSION_MAJOR := $(word 1,$(subst ., ,$(WM_PROJECT_VERSION))) +PFLAGS+= -DOPENFOAM_VERSION_MAJOR=$(FOAM_VERSION_MAJOR) PFLAGS+= -Dcompre EXE_INC = \ diff --git a/applications/solvers/cfdemSolverRhoPimple/cfdemSolverRhoPimple.C b/applications/solvers/cfdemSolverRhoPimple/cfdemSolverRhoPimple.C index 03f706e3..88dce166 100644 --- a/applications/solvers/cfdemSolverRhoPimple/cfdemSolverRhoPimple.C +++ b/applications/solvers/cfdemSolverRhoPimple/cfdemSolverRhoPimple.C @@ -113,7 +113,11 @@ int main(int argc, char *argv[]) particleCloud.clockM().start(26,"Flow"); +#if OPENFOAM_VERSION_MAJOR < 6 + if (pimple.nCorrPIMPLE() <= 1) +#else if (pimple.nCorrPimple() <= 1) +#endif { #include "rhoEqn.H" } diff --git a/applications/solvers/cfdemSolverRhoPimpleChem/Make/options b/applications/solvers/cfdemSolverRhoPimpleChem/Make/options index 3555fa85..8f25c877 100644 --- a/applications/solvers/cfdemSolverRhoPimpleChem/Make/options +++ b/applications/solvers/cfdemSolverRhoPimpleChem/Make/options @@ -1,5 +1,7 @@ include $(CFDEM_ADD_LIBS_DIR)/additionalLibs +FOAM_VERSION_MAJOR := $(word 1,$(subst ., ,$(WM_PROJECT_VERSION))) +PFLAGS+= -DOPENFOAM_VERSION_MAJOR=$(FOAM_VERSION_MAJOR) PFLAGS+= -Dcompre EXE_INC = \ diff --git a/applications/solvers/cfdemSolverRhoPimpleChem/YEqn.H b/applications/solvers/cfdemSolverRhoPimpleChem/YEqn.H index 525ef340..d8edde75 100644 --- a/applications/solvers/cfdemSolverRhoPimpleChem/YEqn.H +++ b/applications/solvers/cfdemSolverRhoPimpleChem/YEqn.H @@ -13,7 +13,11 @@ tmp > mvConvection { combustion->correct(); +#if OPENFOAM_VERSION_MAJOR < 5 + dQ = combustion->dQ(); +#else dQ = combustion->Qdot(); +#endif label inertIndex = -1; volScalarField Yt(0.0*Y[0]); diff --git a/applications/solvers/cfdemSolverRhoPimpleChem/cfdemSolverRhoPimpleChem.C b/applications/solvers/cfdemSolverRhoPimpleChem/cfdemSolverRhoPimpleChem.C index 3947b48a..c4da39ff 100644 --- a/applications/solvers/cfdemSolverRhoPimpleChem/cfdemSolverRhoPimpleChem.C +++ b/applications/solvers/cfdemSolverRhoPimpleChem/cfdemSolverRhoPimpleChem.C @@ -30,8 +30,12 @@ Description #include "fvCFD.H" #include "turbulentFluidThermoModel.H" +#if OPENFOAM_VERSION_MAJOR < 6 +#include "rhoCombustionModel.H" +#else #include "rhoReactionThermo.H" #include "CombustionModel.H" +#endif #include "bound.H" #include "pimpleControl.H" #include "fvOptions.H" @@ -116,7 +120,11 @@ int main(int argc, char *argv[]) particleCloud.clockM().start(26,"Flow"); +#if OPENFOAM_VERSION_MAJOR < 6 + if (pimple.nCorrPIMPLE() <= 1) +#else if (pimple.nCorrPimple() <= 1) +#endif { #include "rhoEqn.H" } diff --git a/applications/solvers/cfdemSolverRhoPimpleChem/createFields.H b/applications/solvers/cfdemSolverRhoPimpleChem/createFields.H index 6cbcfeeb..64693a47 100644 --- a/applications/solvers/cfdemSolverRhoPimpleChem/createFields.H +++ b/applications/solvers/cfdemSolverRhoPimpleChem/createFields.H @@ -1,15 +1,28 @@ // thermodynamics, chemistry +#if OPENFOAM_VERSION_MAJOR < 6 + Info<< "Creating combustion model\n" << endl; + autoPtr combustion + ( + combustionModels::rhoCombustionModel::New(mesh) + ); + rhoReactionThermo& thermo = combustion->thermo(); +#else Info<< "Reading thermophysical properties\n" << endl; autoPtr pThermo(rhoReactionThermo::New(mesh)); rhoReactionThermo& thermo = pThermo(); +#endif thermo.validate(args.executable(), "h", "e"); basicSpecieMixture& composition = thermo.composition(); PtrList& Y = composition.Y(); // read molecular weight +#if OPENFOAM_VERSION_MAJOR < 6 + volScalarField W(composition.W()); +#else volScalarField W(thermo.W()); +#endif bool propagateInertSpecie = true; @@ -193,11 +206,13 @@ ) ); +#if OPENFOAM_VERSION_MAJOR >= 6 Info<< "Creating combustion model\n" << endl; autoPtr> combustion ( CombustionModel::New(thermo, turbulence()) ); +#endif Info<< "Creating field dpdt\n" << endl; volScalarField dpdt diff --git a/applications/solvers/rcfdemSolverRhoSteadyPimple/Make/options b/applications/solvers/rcfdemSolverRhoSteadyPimple/Make/options index b2b37fe7..a97830ba 100644 --- a/applications/solvers/rcfdemSolverRhoSteadyPimple/Make/options +++ b/applications/solvers/rcfdemSolverRhoSteadyPimple/Make/options @@ -1,5 +1,7 @@ include $(CFDEM_ADD_LIBS_DIR)/additionalLibs +FOAM_VERSION_MAJOR := $(word 1,$(subst ., ,$(WM_PROJECT_VERSION))) +PFLAGS+= -DOPENFOAM_VERSION_MAJOR=$(FOAM_VERSION_MAJOR) PFLAGS+= -Dcompre EXE_INC = \ diff --git a/applications/solvers/rcfdemSolverRhoSteadyPimple/rcfdemSolverRhoSteadyPimple.C b/applications/solvers/rcfdemSolverRhoSteadyPimple/rcfdemSolverRhoSteadyPimple.C index c6196942..5eaeed0b 100644 --- a/applications/solvers/rcfdemSolverRhoSteadyPimple/rcfdemSolverRhoSteadyPimple.C +++ b/applications/solvers/rcfdemSolverRhoSteadyPimple/rcfdemSolverRhoSteadyPimple.C @@ -137,7 +137,11 @@ int main(int argc, char *argv[]) while (pimple.loop()) { // if needed, perform drag update here +#if OPENFOAM_VERSION_MAJOR < 6 + if (pimple.nCorrPIMPLE() <= 1) +#else if (pimple.nCorrPimple() <= 1) +#endif { #include "rhoEqn.H" } diff --git a/src/lagrangian/cfdemParticle/Make/options b/src/lagrangian/cfdemParticle/Make/options index 8a84bb35..f8a3be9b 100644 --- a/src/lagrangian/cfdemParticle/Make/options +++ b/src/lagrangian/cfdemParticle/Make/options @@ -3,6 +3,8 @@ sinclude $(RULES)/mplib$(WM_MPLIB) GIT_VERSION := $(shell git describe --dirty --always --tags) PFLAGS+= -DGITVERSION=\"$(GIT_VERSION)\" +FOAM_VERSION_MAJOR := $(word 1,$(subst ., ,$(WM_PROJECT_VERSION))) +PFLAGS+= -DOPENFOAM_VERSION_MAJOR=$(FOAM_VERSION_MAJOR) include $(CFDEM_ADD_LIBS_DIR)/additionalLibs diff --git a/src/lagrangian/cfdemParticle/subModels/forceModel/KochHillRWDrag/KochHillRWDrag.C b/src/lagrangian/cfdemParticle/subModels/forceModel/KochHillRWDrag/KochHillRWDrag.C index 3b9a8929..496556d2 100755 --- a/src/lagrangian/cfdemParticle/subModels/forceModel/KochHillRWDrag/KochHillRWDrag.C +++ b/src/lagrangian/cfdemParticle/subModels/forceModel/KochHillRWDrag/KochHillRWDrag.C @@ -291,7 +291,11 @@ void KochHillRWDrag::setForce() const // modify current fluid velocity for (int dim=0; dim<3; dim++) { +#if OPENFOAM_VERSION_MAJOR < 6 + partUfluct_[index][dim] = RanGen_.GaussNormal()*sqrt(2.*k/3.); +#else partUfluct_[index][dim] = RanGen_.scalarNormal()*sqrt(2.*k/3.); +#endif //Pout << "RW-TEST: Ufluid[" << dim << "] = " << Ufluid[dim] << " Ufluct = " << partUfluct_[index][dim] << " k = " << k << endl; // TEST-Output Ufluid[dim] = Ufluid[dim] + partUfluct_[index][dim]; } diff --git a/src/lagrangian/cfdemParticleComp/Make/options b/src/lagrangian/cfdemParticleComp/Make/options index 65a87bc4..5bd1810f 100644 --- a/src/lagrangian/cfdemParticleComp/Make/options +++ b/src/lagrangian/cfdemParticleComp/Make/options @@ -6,6 +6,8 @@ sinclude $(RULES)/mplib$(WM_MPLIB) GIT_VERSION := $(shell git describe --dirty --always --tags) PFLAGS+= -DGITVERSION=\"$(GIT_VERSION)\" +FOAM_VERSION_MAJOR := $(word 1,$(subst ., ,$(WM_PROJECT_VERSION))) +PFLAGS+= -DOPENFOAM_VERSION_MAJOR=$(FOAM_VERSION_MAJOR) PFLAGS+= -Dcompre diff --git a/src/recurrence/Make/options b/src/recurrence/Make/options index 36523655..511a2f52 100644 --- a/src/recurrence/Make/options +++ b/src/recurrence/Make/options @@ -1,6 +1,9 @@ GIT_VERSION := $(shell git describe --abbrev=4 --dirty --always --tags) PFLAGS+= -DGITVERSION=\"$(GIT_VERSION)\" +FOAM_VERSION_MAJOR := $(word 1,$(subst ., ,$(WM_PROJECT_VERSION))) +PFLAGS+= -DOPENFOAM_VERSION_MAJOR=$(FOAM_VERSION_MAJOR) + include $(CFDEM_ADD_LIBS_DIR)/additionalLibs EXE_INC = \ diff --git a/src/recurrence/recModel/gerhardsRecModel/gerhardsRecModel.C b/src/recurrence/recModel/gerhardsRecModel/gerhardsRecModel.C index d9875fac..15a71ead 100644 --- a/src/recurrence/recModel/gerhardsRecModel/gerhardsRecModel.C +++ b/src/recurrence/recModel/gerhardsRecModel/gerhardsRecModel.C @@ -226,7 +226,11 @@ scalar gerhardsRecModel::checkTimeStep() } // set deltaT +#if OPENFOAM_VERSION_MAJOR < 6 recTime.setDeltaT(dtCur, false); +#else + recTime.setDeltaT(dtCur); +#endif if (verbose_) { @@ -296,7 +300,11 @@ void gerhardsRecModel::readFieldSeries() for OpenFOAM versions prior to OpenFOAM-5.0 Do this the other way around for OpenFOAM-5.0 and potentially later versions */ +#if OPENFOAM_VERSION_MAJOR < 5 if (! header.headerOk()) +#else + if (! header.typeHeaderOk(true)) +#endif { FatalError << "Field " << volScalarFieldNames_[i] << " not found" @@ -320,7 +328,11 @@ void gerhardsRecModel::readFieldSeries() for OpenFOAM versions prior to OpenFOAM-5.0 Do this the other way around for OpenFOAM-5.0 and potentially later versions */ +#if OPENFOAM_VERSION_MAJOR < 5 if (! header.headerOk()) +#else + if (! header.typeHeaderOk(true)) +#endif { FatalError << "Field " << volVectorFieldNames_[i] << " not found" @@ -344,7 +356,11 @@ void gerhardsRecModel::readFieldSeries() for OpenFOAM versions prior to OpenFOAM-5.0 Do this the other way around for OpenFOAM-5.0 and potentially later versions */ +#if OPENFOAM_VERSION_MAJOR < 5 if (! header.headerOk()) +#else + if (! header.typeHeaderOk(true)) +#endif { FatalError << "Field " << surfaceScalarFieldNames_[i] << " not found" diff --git a/src/recurrence/recPath/simpleRandomPath/simpleRandomPath.C b/src/recurrence/recPath/simpleRandomPath/simpleRandomPath.C index 4d040944..e31d8a66 100644 --- a/src/recurrence/recPath/simpleRandomPath/simpleRandomPath.C +++ b/src/recurrence/recPath/simpleRandomPath/simpleRandomPath.C @@ -77,7 +77,11 @@ void simpleRandomPath::computeRecPath() label seqStart = 0; label lowerSeqLim( base_.recM().lowerSeqLim() ); label upperSeqLim( base_.recM().upperSeqLim() ); +#if OPENFOAM_VERSION_MAJOR < 6 + label seqLength = ranGen.integer(lowerSeqLim, upperSeqLim); +#else label seqLength = ranGen.sampleAB(lowerSeqLim, upperSeqLim); +#endif virtualTimeIndex = seqEnd(seqStart,seqLength); labelPair seqStartEnd(seqStart,virtualTimeIndex); @@ -123,7 +127,11 @@ void simpleRandomPath::computeRecPath() } } +#if OPENFOAM_VERSION_MAJOR < 6 + seqLength = ranGen.integer(lowerSeqLim, upperSeqLim); +#else seqLength = ranGen.sampleAB(lowerSeqLim, upperSeqLim); +#endif virtualTimeIndex = seqEnd(seqStart,seqLength); labelPair seqStartEnd(seqStart,virtualTimeIndex); virtualTimeIndexList_.append(seqStartEnd); From 1643f8d908d53fbbb13fd7ac667731e2f175f1ef Mon Sep 17 00:00:00 2001 From: danielque Date: Wed, 13 Nov 2019 13:05:19 +0100 Subject: [PATCH 15/23] [OF6] fix volScalarField for heat release rate OF4 -> OF5/OF6: dimension of dQ() = dimEnergy/dimTime -> dimension of Qdot() = dimEnergy/dimVolume/dimTime --- .../solvers/cfdemSolverRhoPimpleChem/YEqn.H | 3 ++- .../cfdemSolverRhoPimpleChem/createFields.H | 16 ++++++++++++++++ 2 files changed, 18 insertions(+), 1 deletion(-) diff --git a/applications/solvers/cfdemSolverRhoPimpleChem/YEqn.H b/applications/solvers/cfdemSolverRhoPimpleChem/YEqn.H index d8edde75..e4d58344 100644 --- a/applications/solvers/cfdemSolverRhoPimpleChem/YEqn.H +++ b/applications/solvers/cfdemSolverRhoPimpleChem/YEqn.H @@ -16,7 +16,7 @@ tmp > mvConvection #if OPENFOAM_VERSION_MAJOR < 5 dQ = combustion->dQ(); #else - dQ = combustion->Qdot(); + Qdot = combustion->Qdot(); #endif label inertIndex = -1; volScalarField Yt(0.0*Y[0]); @@ -76,4 +76,5 @@ tmp > mvConvection Y[inertIndex].max(0.0); } } + particleCloud.clockM().stop("Y"); diff --git a/applications/solvers/cfdemSolverRhoPimpleChem/createFields.H b/applications/solvers/cfdemSolverRhoPimpleChem/createFields.H index 64693a47..4cda15ee 100644 --- a/applications/solvers/cfdemSolverRhoPimpleChem/createFields.H +++ b/applications/solvers/cfdemSolverRhoPimpleChem/createFields.H @@ -230,6 +230,7 @@ Info<< "Creating field kinetic energy K\n" << endl; volScalarField K("K", 0.5*magSqr(U)); +#if OPENFOAM_VERSION_MAJOR < 5 volScalarField dQ ( IOobject @@ -243,6 +244,21 @@ mesh, dimensionedScalar("dQ", dimEnergy/dimTime, 0.0) ); +#else + volScalarField Qdot + ( + IOobject + ( + "Qdot", + runTime.timeName(), + mesh, + IOobject::NO_READ, + IOobject::AUTO_WRITE + ), + mesh, + dimensionedScalar("Qdot", dimEnergy/dimVolume/dimTime, 0.0) + ); +#endif Info<< "\nReading momentum exchange field Ksl\n" << endl; volScalarField Ksl From 8f94dba403b4b7f130058d42deec964612533e0f Mon Sep 17 00:00:00 2001 From: danielque Date: Wed, 13 Nov 2019 13:42:38 +0100 Subject: [PATCH 16/23] [OF6] adjust chemistry cases to OF6 syntax OF4 -> OF5: functionObjects volRegion/surfaceRegion -> volFieldValue/surfaceFieldValue fvOptions limitTemperatureCoeffs: Tmin/Tmax -> min/max OF5 -> OF6: combustionProperties: noCombustion<> -> none (template parameters are no longer required) --- .../R2_FB/CFD/constant/combustionProperties | 7 +++++-- .../R2_FB/CFD/system/controlDict | 15 ++++++++++----- .../R2_FB/CFD/system/controlDict_test | 15 ++++++++++----- .../R2_FB/CFD/system/fvOptions | 9 ++++++--- .../CFD/constant/combustionProperties | 7 +++++-- .../30CO6H2_Hematite/CFD/system/controlDict | 6 ++++-- .../30CO6H2_Hematite/CFD/system/fvOptions | 6 ++++-- .../CFD/constant/combustionProperties | 7 +++++-- .../33CO3H2_Hematite/CFD/system/controlDict | 6 ++++-- .../33CO3H2_Hematite/CFD/system/fvOptions | 6 ++++-- .../CFD/constant/combustionProperties | 7 +++++-- .../GOD0k1_Hematite/CFD/system/controlDict | 6 ++++-- .../GOD0k1_Hematite/CFD/system/fvOptions | 7 ++++--- .../ISO4695/CFD/constant/combustionProperties | 7 +++++-- .../ISO4695/CFD/system/controlDict | 6 ++++-- .../ISO4695/CFD/system/fvOptions | 6 ++++-- 16 files changed, 83 insertions(+), 40 deletions(-) diff --git a/tutorials/cfdemSolverRhoPimpleChem/PolydisperseFluidizedBed/R2_FB/CFD/constant/combustionProperties b/tutorials/cfdemSolverRhoPimpleChem/PolydisperseFluidizedBed/R2_FB/CFD/constant/combustionProperties index c5b934a4..ecec7ca7 100644 --- a/tutorials/cfdemSolverRhoPimpleChem/PolydisperseFluidizedBed/R2_FB/CFD/constant/combustionProperties +++ b/tutorials/cfdemSolverRhoPimpleChem/PolydisperseFluidizedBed/R2_FB/CFD/constant/combustionProperties @@ -15,11 +15,14 @@ FoamFile } // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // -combustionModel noCombustion; //PaSR; //PaSR; +// OF5 -> OF6: noCombustion<> -> none (template parameters are no longer required) +//combustionModel noCombustion; //PaSR; //PaSR; +combustionModel none; // OF6 active false; //true; -noCombustionCoeffs +//noCombustionCoeffs +noneCoeffs { } diff --git a/tutorials/cfdemSolverRhoPimpleChem/PolydisperseFluidizedBed/R2_FB/CFD/system/controlDict b/tutorials/cfdemSolverRhoPimpleChem/PolydisperseFluidizedBed/R2_FB/CFD/system/controlDict index 35d4d6d1..99dd8ef8 100644 --- a/tutorials/cfdemSolverRhoPimpleChem/PolydisperseFluidizedBed/R2_FB/CFD/system/controlDict +++ b/tutorials/cfdemSolverRhoPimpleChem/PolydisperseFluidizedBed/R2_FB/CFD/system/controlDict @@ -145,7 +145,8 @@ functions globalMassFrac { - type volRegion; + //type volRegion; // OF4 + type volFieldValue; // OF5,OF6 libs ("libfieldFunctionObjects.so"); writeControl timeStep;//outputTime; writeInterval 1; @@ -167,7 +168,8 @@ functions globalMass { - type volRegion; + //type volRegion; // OF4 + type volFieldValue; // OF5,OF6 libs ("libfieldFunctionObjects.so"); writeControl timeStep;//outputTime; writeInterval 1; @@ -185,7 +187,8 @@ functions inflow_GasSpecies { - type surfaceRegion; + //type surfaceRegion; // OF4 + type surfaceFieldValue; // OF5,OF6 libs ("libfieldFunctionObjects.so"); writeControl timeStep; writeInterval 100; @@ -208,7 +211,8 @@ functions inflow_phi { - type surfaceRegion; + //type surfaceRegion; // OF4 + type surfaceFieldValue; // OF5,OF6 libs ("libfieldFunctionObjects.so"); writeControl timeStep; writeInterval 100; @@ -227,7 +231,8 @@ functions inflow_U { - type surfaceRegion; + //type surfaceRegion; // OF4 + type surfaceFieldValue; // OF5,OF6 libs ("libfieldFunctionObjects.so"); writeControl timeStep; writeInterval 100; diff --git a/tutorials/cfdemSolverRhoPimpleChem/PolydisperseFluidizedBed/R2_FB/CFD/system/controlDict_test b/tutorials/cfdemSolverRhoPimpleChem/PolydisperseFluidizedBed/R2_FB/CFD/system/controlDict_test index 973a2b63..0dce0127 100644 --- a/tutorials/cfdemSolverRhoPimpleChem/PolydisperseFluidizedBed/R2_FB/CFD/system/controlDict_test +++ b/tutorials/cfdemSolverRhoPimpleChem/PolydisperseFluidizedBed/R2_FB/CFD/system/controlDict_test @@ -145,7 +145,8 @@ functions globalMassFrac { - type volRegion; + //type volRegion; // OF4 + type volFieldValue; // OF5,OF6 libs ("libfieldFunctionObjects.so"); writeControl timeStep;//outputTime; writeInterval 1; @@ -167,7 +168,8 @@ functions globalMass { - type volRegion; + //type volRegion; // OF4 + type volFieldValue; // OF5,OF6 libs ("libfieldFunctionObjects.so"); writeControl timeStep;//outputTime; writeInterval 1; @@ -185,7 +187,8 @@ functions inflow_GasSpecies { - type surfaceRegion; + //type surfaceRegion; // OF4 + type surfaceFieldValue; // OF5,OF6 libs ("libfieldFunctionObjects.so"); writeControl timeStep; writeInterval 100; @@ -208,7 +211,8 @@ functions inflow_phi { - type surfaceRegion; + //type surfaceRegion; // OF4 + type surfaceFieldValue; // OF5,OF6 libs ("libfieldFunctionObjects.so"); writeControl timeStep; writeInterval 100; @@ -227,7 +231,8 @@ functions inflow_U { - type surfaceRegion; + //type surfaceRegion; // OF4 + type surfaceFieldValue; // OF5,OF6 libs ("libfieldFunctionObjects.so"); writeControl timeStep; writeInterval 100; diff --git a/tutorials/cfdemSolverRhoPimpleChem/PolydisperseFluidizedBed/R2_FB/CFD/system/fvOptions b/tutorials/cfdemSolverRhoPimpleChem/PolydisperseFluidizedBed/R2_FB/CFD/system/fvOptions index 5cec3738..50a3b102 100644 --- a/tutorials/cfdemSolverRhoPimpleChem/PolydisperseFluidizedBed/R2_FB/CFD/system/fvOptions +++ b/tutorials/cfdemSolverRhoPimpleChem/PolydisperseFluidizedBed/R2_FB/CFD/system/fvOptions @@ -22,7 +22,10 @@ limitedTemperature { active yes; selectionMode all; - Tmin 1020; - Tmax 1500; + //Tmin 1020; // OF4 + //Tmax 1500; // OF4 + min 1020; // OF5,OF6 + max 1500; // OF5,OF6 } -} \ No newline at end of file +} + diff --git a/tutorials/cfdemSolverRhoPimpleChem/SingleParticleCases/30CO6H2_Hematite/CFD/constant/combustionProperties b/tutorials/cfdemSolverRhoPimpleChem/SingleParticleCases/30CO6H2_Hematite/CFD/constant/combustionProperties index 2f51801a..8835a294 100644 --- a/tutorials/cfdemSolverRhoPimpleChem/SingleParticleCases/30CO6H2_Hematite/CFD/constant/combustionProperties +++ b/tutorials/cfdemSolverRhoPimpleChem/SingleParticleCases/30CO6H2_Hematite/CFD/constant/combustionProperties @@ -15,11 +15,14 @@ FoamFile } // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // -combustionModel noCombustion; +// OF5 -> OF6: noCombustion<> -> none (template parameters are no longer required) +//combustionModel noCombustion; // OF4,OF5 +combustionModel none; // OF6 active false; //true; -noCombustionCoeffs +//noCombustionCoeffs +noneCoeffs { } diff --git a/tutorials/cfdemSolverRhoPimpleChem/SingleParticleCases/30CO6H2_Hematite/CFD/system/controlDict b/tutorials/cfdemSolverRhoPimpleChem/SingleParticleCases/30CO6H2_Hematite/CFD/system/controlDict index 8d5d1b8b..310f6a32 100644 --- a/tutorials/cfdemSolverRhoPimpleChem/SingleParticleCases/30CO6H2_Hematite/CFD/system/controlDict +++ b/tutorials/cfdemSolverRhoPimpleChem/SingleParticleCases/30CO6H2_Hematite/CFD/system/controlDict @@ -143,7 +143,8 @@ functions globalMassFrac { - type volRegion; + //type volRegion; // OF4 + type volFieldValue; // OF5,OF6 libs ("libfieldFunctionObjects.so"); writeControl timeStep;//outputTime; writeInterval 1; @@ -165,7 +166,8 @@ functions globalMass { - type volRegion; + //type volRegion; // OF4 + type volFieldValue; // OF5,OF6 libs ("libfieldFunctionObjects.so"); writeControl timeStep;//outputTime; writeInterval 1; diff --git a/tutorials/cfdemSolverRhoPimpleChem/SingleParticleCases/30CO6H2_Hematite/CFD/system/fvOptions b/tutorials/cfdemSolverRhoPimpleChem/SingleParticleCases/30CO6H2_Hematite/CFD/system/fvOptions index d021b03e..0063174e 100644 --- a/tutorials/cfdemSolverRhoPimpleChem/SingleParticleCases/30CO6H2_Hematite/CFD/system/fvOptions +++ b/tutorials/cfdemSolverRhoPimpleChem/SingleParticleCases/30CO6H2_Hematite/CFD/system/fvOptions @@ -22,8 +22,10 @@ limitedTemperature { active yes; selectionMode all; - Tmin 1200; - Tmax 2500; + //Tmin 1200; // OF4 + //Tmax 2500; // OF4 + min 1200; // OF5,OF6 + max 2500; // OF5,OF6 } } diff --git a/tutorials/cfdemSolverRhoPimpleChem/SingleParticleCases/33CO3H2_Hematite/CFD/constant/combustionProperties b/tutorials/cfdemSolverRhoPimpleChem/SingleParticleCases/33CO3H2_Hematite/CFD/constant/combustionProperties index c5b934a4..ecec7ca7 100644 --- a/tutorials/cfdemSolverRhoPimpleChem/SingleParticleCases/33CO3H2_Hematite/CFD/constant/combustionProperties +++ b/tutorials/cfdemSolverRhoPimpleChem/SingleParticleCases/33CO3H2_Hematite/CFD/constant/combustionProperties @@ -15,11 +15,14 @@ FoamFile } // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // -combustionModel noCombustion; //PaSR; //PaSR; +// OF5 -> OF6: noCombustion<> -> none (template parameters are no longer required) +//combustionModel noCombustion; //PaSR; //PaSR; +combustionModel none; // OF6 active false; //true; -noCombustionCoeffs +//noCombustionCoeffs +noneCoeffs { } diff --git a/tutorials/cfdemSolverRhoPimpleChem/SingleParticleCases/33CO3H2_Hematite/CFD/system/controlDict b/tutorials/cfdemSolverRhoPimpleChem/SingleParticleCases/33CO3H2_Hematite/CFD/system/controlDict index 69f672ef..aa5b7869 100644 --- a/tutorials/cfdemSolverRhoPimpleChem/SingleParticleCases/33CO3H2_Hematite/CFD/system/controlDict +++ b/tutorials/cfdemSolverRhoPimpleChem/SingleParticleCases/33CO3H2_Hematite/CFD/system/controlDict @@ -142,7 +142,8 @@ functions globalMassFrac { - type volRegion; + //type volRegion; // OF4 + type volFieldValue; // OF5,OF6 libs ("libfieldFunctionObjects.so"); writeControl timeStep;//outputTime; writeInterval 1; @@ -164,7 +165,8 @@ functions globalMass { - type volRegion; + //type volRegion; // OF4 + type volFieldValue; // OF5,OF6 libs ("libfieldFunctionObjects.so"); writeControl timeStep;//outputTime; writeInterval 1; diff --git a/tutorials/cfdemSolverRhoPimpleChem/SingleParticleCases/33CO3H2_Hematite/CFD/system/fvOptions b/tutorials/cfdemSolverRhoPimpleChem/SingleParticleCases/33CO3H2_Hematite/CFD/system/fvOptions index fd3e0929..8291e573 100644 --- a/tutorials/cfdemSolverRhoPimpleChem/SingleParticleCases/33CO3H2_Hematite/CFD/system/fvOptions +++ b/tutorials/cfdemSolverRhoPimpleChem/SingleParticleCases/33CO3H2_Hematite/CFD/system/fvOptions @@ -22,8 +22,10 @@ limitedTemperature { active yes; selectionMode all; - Tmin 1200; - Tmax 2500; + //Tmin 1200; // OF4 + //Tmax 2500; // OF4 + min 1200; // OF5,OF6 + max 2500; // OF5,OF6 } } diff --git a/tutorials/cfdemSolverRhoPimpleChem/SingleParticleCases/GOD0k1_Hematite/CFD/constant/combustionProperties b/tutorials/cfdemSolverRhoPimpleChem/SingleParticleCases/GOD0k1_Hematite/CFD/constant/combustionProperties index c5b934a4..ecec7ca7 100644 --- a/tutorials/cfdemSolverRhoPimpleChem/SingleParticleCases/GOD0k1_Hematite/CFD/constant/combustionProperties +++ b/tutorials/cfdemSolverRhoPimpleChem/SingleParticleCases/GOD0k1_Hematite/CFD/constant/combustionProperties @@ -15,11 +15,14 @@ FoamFile } // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // -combustionModel noCombustion; //PaSR; //PaSR; +// OF5 -> OF6: noCombustion<> -> none (template parameters are no longer required) +//combustionModel noCombustion; //PaSR; //PaSR; +combustionModel none; // OF6 active false; //true; -noCombustionCoeffs +//noCombustionCoeffs +noneCoeffs { } diff --git a/tutorials/cfdemSolverRhoPimpleChem/SingleParticleCases/GOD0k1_Hematite/CFD/system/controlDict b/tutorials/cfdemSolverRhoPimpleChem/SingleParticleCases/GOD0k1_Hematite/CFD/system/controlDict index 0a1c1aec..9e547f0f 100644 --- a/tutorials/cfdemSolverRhoPimpleChem/SingleParticleCases/GOD0k1_Hematite/CFD/system/controlDict +++ b/tutorials/cfdemSolverRhoPimpleChem/SingleParticleCases/GOD0k1_Hematite/CFD/system/controlDict @@ -136,7 +136,8 @@ functions globalMassFrac { - type volRegion; + //type volRegion; // OF4 + type volFieldValue; // OF5,OF6 libs ("libfieldFunctionObjects.so"); writeControl timeStep;//outputTime; writeInterval 1; @@ -156,7 +157,8 @@ functions globalMass { - type volRegion; + //type volRegion; // OF4 + type volFieldValue; // OF5,OF6 libs ("libfieldFunctionObjects.so"); writeControl timeStep;//outputTime; writeInterval 1; diff --git a/tutorials/cfdemSolverRhoPimpleChem/SingleParticleCases/GOD0k1_Hematite/CFD/system/fvOptions b/tutorials/cfdemSolverRhoPimpleChem/SingleParticleCases/GOD0k1_Hematite/CFD/system/fvOptions index fd3e0929..0063174e 100644 --- a/tutorials/cfdemSolverRhoPimpleChem/SingleParticleCases/GOD0k1_Hematite/CFD/system/fvOptions +++ b/tutorials/cfdemSolverRhoPimpleChem/SingleParticleCases/GOD0k1_Hematite/CFD/system/fvOptions @@ -22,9 +22,10 @@ limitedTemperature { active yes; selectionMode all; - Tmin 1200; - Tmax 2500; + //Tmin 1200; // OF4 + //Tmax 2500; // OF4 + min 1200; // OF5,OF6 + max 2500; // OF5,OF6 } } - diff --git a/tutorials/cfdemSolverRhoPimpleChem/SingleParticleCases/ISO4695/CFD/constant/combustionProperties b/tutorials/cfdemSolverRhoPimpleChem/SingleParticleCases/ISO4695/CFD/constant/combustionProperties index c5b934a4..ecec7ca7 100644 --- a/tutorials/cfdemSolverRhoPimpleChem/SingleParticleCases/ISO4695/CFD/constant/combustionProperties +++ b/tutorials/cfdemSolverRhoPimpleChem/SingleParticleCases/ISO4695/CFD/constant/combustionProperties @@ -15,11 +15,14 @@ FoamFile } // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // -combustionModel noCombustion; //PaSR; //PaSR; +// OF5 -> OF6: noCombustion<> -> none (template parameters are no longer required) +//combustionModel noCombustion; //PaSR; //PaSR; +combustionModel none; // OF6 active false; //true; -noCombustionCoeffs +//noCombustionCoeffs +noneCoeffs { } diff --git a/tutorials/cfdemSolverRhoPimpleChem/SingleParticleCases/ISO4695/CFD/system/controlDict b/tutorials/cfdemSolverRhoPimpleChem/SingleParticleCases/ISO4695/CFD/system/controlDict index 7bc0f62b..1d845eb4 100644 --- a/tutorials/cfdemSolverRhoPimpleChem/SingleParticleCases/ISO4695/CFD/system/controlDict +++ b/tutorials/cfdemSolverRhoPimpleChem/SingleParticleCases/ISO4695/CFD/system/controlDict @@ -136,7 +136,8 @@ functions globalMassFrac { - type volRegion; + //type volRegion; // OF4 + type volFieldValue; // OF5,OF6 libs ("libfieldFunctionObjects.so"); writeControl timeStep;//outputTime; writeInterval 1; @@ -156,7 +157,8 @@ functions globalMass { - type volRegion; + //type volRegion; // OF4 + type volFieldValue; // OF5,OF6 libs ("libfieldFunctionObjects.so"); writeControl timeStep;//outputTime; writeInterval 1; diff --git a/tutorials/cfdemSolverRhoPimpleChem/SingleParticleCases/ISO4695/CFD/system/fvOptions b/tutorials/cfdemSolverRhoPimpleChem/SingleParticleCases/ISO4695/CFD/system/fvOptions index fd3e0929..8291e573 100644 --- a/tutorials/cfdemSolverRhoPimpleChem/SingleParticleCases/ISO4695/CFD/system/fvOptions +++ b/tutorials/cfdemSolverRhoPimpleChem/SingleParticleCases/ISO4695/CFD/system/fvOptions @@ -22,8 +22,10 @@ limitedTemperature { active yes; selectionMode all; - Tmin 1200; - Tmax 2500; + //Tmin 1200; // OF4 + //Tmax 2500; // OF4 + min 1200; // OF5,OF6 + max 2500; // OF5,OF6 } } From fe4016eb52ab68202eb804a5a6bc77ad18ef9087 Mon Sep 17 00:00:00 2001 From: Thomas Lichtenegger Date: Wed, 13 Nov 2019 15:53:27 +0100 Subject: [PATCH 17/23] Update of random number generation. Removed deprecated multiIntervalPath model. --- .../solvers/rStatAnalysis/Make/options | 2 +- .../solvers/rStatAnalysis/rStatAnalysis.C | 5 - .../isotropicFluctuations.C | 2 +- src/recurrence/Make/files | 3 +- src/recurrence/recBase/recBase.C | 20 +- .../recPath/MarkovPath/MarkovPath.C | 3 +- .../multiIntervalPath/multiIntervalPath.C | 195 ------------------ .../multiIntervalPath/multiIntervalPath.H | 103 --------- .../simpleRandomPath/simpleRandomPath.C | 3 +- .../autocorrelation/autocorrelation.C | 67 ++++-- .../autocorrelation/autocorrelation.H | 12 ++ .../recStatAnalysis/recStatAnalysis.H | 2 + 12 files changed, 81 insertions(+), 336 deletions(-) delete mode 100644 src/recurrence/recPath/multiIntervalPath/multiIntervalPath.C delete mode 100644 src/recurrence/recPath/multiIntervalPath/multiIntervalPath.H diff --git a/applications/solvers/rStatAnalysis/Make/options b/applications/solvers/rStatAnalysis/Make/options index f91d7947..0d54afbc 100644 --- a/applications/solvers/rStatAnalysis/Make/options +++ b/applications/solvers/rStatAnalysis/Make/options @@ -23,4 +23,4 @@ EXE_LIBS = \ -lmeshTools \ -l$(CFDEM_LIB_NAME) \ $(CFDEM_ADD_LIB_PATHS) \ -$(CFDEM_ADD_LIBS) + $(CFDEM_ADD_LIBS) diff --git a/applications/solvers/rStatAnalysis/rStatAnalysis.C b/applications/solvers/rStatAnalysis/rStatAnalysis.C index 38356182..72523bfd 100644 --- a/applications/solvers/rStatAnalysis/rStatAnalysis.C +++ b/applications/solvers/rStatAnalysis/rStatAnalysis.C @@ -29,11 +29,6 @@ Description \*---------------------------------------------------------------------------*/ -// #include "fvCFD.H" -// #include "singlePhaseTransportModel.H" -// #include "turbulentTransportModel.H" -// #include "fvOptions.H" - #include "recBase.H" #include "recStatAnalysis.H" diff --git a/src/lagrangian/cfdemParticle/subModels/forceModel/isotropicFluctuations/isotropicFluctuations.C b/src/lagrangian/cfdemParticle/subModels/forceModel/isotropicFluctuations/isotropicFluctuations.C index d67b1391..ea8ec320 100644 --- a/src/lagrangian/cfdemParticle/subModels/forceModel/isotropicFluctuations/isotropicFluctuations.C +++ b/src/lagrangian/cfdemParticle/subModels/forceModel/isotropicFluctuations/isotropicFluctuations.C @@ -83,7 +83,7 @@ isotropicFluctuations::isotropicFluctuations dimensionedScalar("D0", dimensionSet(0,0,0,0,0,0,0), D0_) ), dtDEM_(particleCloud_.dataExchangeM().DEMts()), - ranGen_(0) + ranGen_(clock::getTime()+pid()) { if(ignoreCellsName_ != "none") { diff --git a/src/recurrence/Make/files b/src/recurrence/Make/files index 31c09b23..eabb090e 100644 --- a/src/recurrence/Make/files +++ b/src/recurrence/Make/files @@ -12,11 +12,10 @@ recNorm/readNorm/readNorm.C recNorm/sqrDiffNorm/sqrDiffNorm.C recNorm/noRecNorm/noRecNorm.C recPath/recPath/recPath.C -recPath/recPath/newRecPath.C recPath/simpleRandomPath/simpleRandomPath.C +recPath/recPath/newRecPath.C recPath/noPath/noPath.C recPath/MarkovPath/MarkovPath.C -recPath/multiIntervalPath/multiIntervalPath.C recPath/predefinedPath/predefinedPath.C recStatAnalysis/recStatAnalysis/recStatAnalysis.C recStatAnalysis/recStatAnalysis/newRecStatAnalysis.C diff --git a/src/recurrence/recBase/recBase.C b/src/recurrence/recBase/recBase.C index 53b3fdcb..0b030bc3 100644 --- a/src/recurrence/recBase/recBase.C +++ b/src/recurrence/recBase/recBase.C @@ -83,14 +83,20 @@ recBase::recBase ), couplingSubStep_(recProperties_.lookupOrDefault