merge tue/master > tue/develop

This commit is contained in:
s126103
2021-10-08 14:16:39 +02:00
185 changed files with 837986 additions and 198 deletions

View File

@ -38,7 +38,7 @@ divSchemes
div(((dev(grad(U).T())*rho)*dev(grad(U).T()))) Gauss linear;
div((((((alpha.water*rho)*nu.water)|(alpha.water*rho))*rho)*dev(grad(U).T()))) Gauss linear;
div(((nu*rho)*dev(grad(U).T()))) Gauss linear;
default Gauss linear;
default Gauss linear;
}
laplacianSchemes

View File

@ -0,0 +1,25 @@
/*--------------------------------*- C++ -*----------------------------------*\
| ========= | |
| \\ / F ield | OpenFOAM: The Open Source CFD Toolbox |
| \\ / O peration | Version: 1.6 |
| \\ / A nd | Web: www.OpenFOAM.org |
| \\/ M anipulation | |
\*---------------------------------------------------------------------------*/
FoamFile
{
version 2.0;
format ascii;
class dictionary;
location "constant";
object RASProperties;
}
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
RASModel laminar;
turbulence off;
printCoeffs on;
// ************************************************************************* //

View File

@ -0,0 +1,304 @@
/*---------------------------------------------------------------------------*\
| ========= | |
| \\ / F ield | OpenFOAM: The Open Source CFD Toolbox |
| \\ / O peration | Version: 1.4 |
| \\ / A nd | Web: http://www.openfoam.org |
| \\/ M anipulation | |
\*---------------------------------------------------------------------------*/
FoamFile
{
version 2.0;
format ascii;
root "";
case "";
instance "";
local "";
class dictionary;
object couplingProperties;
}
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
//===========================================================================//
// sub-models & settings
syncMode false;
//verbose;
useDDTvoidfraction;
modelType "A";
couplingInterval 5;
voidFractionModel divided;
locateModel engine;
meshMotionModel noMeshMotion;
regionModel allRegion;
IOModel basicIO;
probeModel off;
dataExchangeModel twoWayMPI;
averagingModel dense;
clockModel standardClock;
smoothingModel constDiffSmoothing;
getParticleDensities true;
getParticleAngVels true;
multiphase true;
forceModels
(
BeetstraDrag
MeiLift
virtualMassForce
ParmarBassetForce
viscForce
gradPForceSmooth
surfaceTensionForce
);
momCoupleModels
(
implicitCouple
);
energyModels
(
heatTransferGunn
wallHeatTransferYagi
);
massTransferModels
(
massTransferGunn
);
chemistryModels
(
off
);
thermCondModel SyamlalThermCond;
diffCoeffModel SyamlalDiffCoeff;
turbulenceModelType "turbulenceProperties";
//===========================================================================//
// sub-model properties
heatTransferGunnProps
{
interpolation true;
verbose false;
partRefTemp 1650;
calcPartTempField true;
partTempName "Temp";
partHeatFluxName "convectiveHeatFlux";
implicit true;
}
wallHeatTransferYagiProps
{
interpolation true;
verbose true;
wallTempName "wallTemp";
granVelFieldName "Us";
voidfractionMax 0.5;
implicit true;
}
massTransferGunnProps
{
interpolation false;
verbose false;
partMassFluxName "convectiveMassFlux";
implicit false;
coupleDEM true;
}
SyamlalThermCondProps
{
}
SyamlalDiffCoeffProps
{
}
BeetstraDragProps
{
velFieldName "U";
granVelFieldName "Us";
voidfractionFieldName "voidfraction";
interpolation true;
verbose false;
implForceDEM true;
}
dSauterProps
{
}
KochHillDragProps
{
velFieldName "U";
voidfractionFieldName "voidfraction";
implForceDEM true;
}
MeiLiftProps
{
velFieldName "U";
useShearInduced true;
useSpinInduced true;
combineShearSpin false;
interpolation true;
verbose false;
}
virtualMassForceProps
{
velFieldName "U";
voidfractionFieldName "voidfraction";
granVelFieldName "Us";
phiFieldName "phi";
useUs true;
useFelderhof true;
interpolation true;
smoothingModel constDiffAndTemporalSmoothing;
constDiffAndTemporalSmoothingProps
{
lowerLimit 1e-8;
upperLimit 1e8;
smoothingLength 0.05; // 2dp
smoothingStrength 0.0005; // timeScale = dt/gamma
correctBoundary true;
}
}
ParmarBassetForceProps
{
velFieldName "U";
granVelFieldName "Us";
useUs true;
interpolation true;
nIntegral 10;
discretisationOrder 1;
smoothingModel constDiffAndTemporalSmoothing;
constDiffAndTemporalSmoothingProps
{
lowerLimit 1e-8;
upperLimit 1e8;
smoothingLength 0.05; // 2dp
smoothingStrength 0.0005; // timeScale = dt/gamma
correctBoundary true;
}
}
viscForceProps
{
velocityFieldName "U";
}
gradPForceProps
{
pFieldName "p";
voidfractionFieldName "voidfraction";
velocityFieldName "U";
}
gradPForceSmoothProps
{
pFieldName "p_rgh";
voidfractionFieldName "voidfraction";
velocityFieldName "U";
smoothingModel "temporalSmoothing";
temporalSmoothingProps
{
lowerLimit 0.1;
upperLimit 1e10;
refField "p_rgh";
gamma 0.0005; // timeScale = dt/gamma
}
}
ArchimedesProps
{
gravityFieldName "g";
}
surfaceTensionForceProps
{
}
constDiffSmoothingProps
{
lowerLimit 0.1;
upperLimit 1e10;
smoothingLength 0.1; // 2dx
}
implicitCoupleProps
{
velFieldName "U";
granVelFieldName "Us";
voidfractionFieldName "voidfraction";
}
volWeightedAverageProps
{
scalarFieldNames
(
voidfraction
);
vectorFieldNames
(
);
upperThreshold 0.999;
lowerThreshold 0;
}
totalMomentumExchangeProps
{
implicitMomExFieldName "Ksl";
explicitMomExFieldName "none";
fluidVelFieldName "U";
granVelFieldName "Us";
}
particleCellVolumeProps
{
upperThreshold 0.999;
lowerThreshold 0.;
}
engineProps
{
treeSearch true;
}
dividedProps
{
alphaMin 0.01;
//porosity 0.5;
//interpolation true;
}
twoWayMPIProps
{
liggghtsPath "../DEM/in.liggghts_run";
}
trilinearProps
{
alphaMin 0.01;
}
}
// ************************************************************************* //

View File

@ -0,0 +1,22 @@
/*--------------------------------*- C++ -*----------------------------------*\
| ========= | |
| \\ / F ield | OpenFOAM: The Open Source CFD Toolbox |
| \\ / O peration | Version: 1.6 |
| \\ / A nd | Web: www.OpenFOAM.org |
| \\/ M anipulation | |
\*---------------------------------------------------------------------------*/
FoamFile
{
version 2.0;
format ascii;
class uniformDimensionedVectorField;
location "constant";
object g;
}
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
dimensions [0 1 -2 0 0 0 0];
value ( 0 0 -9.81 );
// ************************************************************************* //

View File

@ -0,0 +1,140 @@
/*---------------------------------------------------------------------------*\
| ========= | |
| \\ / F ield | OpenFOAM: The Open Source CFD Toolbox |
| \\ / O peration | Version: 1.4 |
| \\ / A nd | Web: http://www.openfoam.org |
| \\/ M anipulation | |
\*---------------------------------------------------------------------------*/
FoamFile
{
version 2.0;
format ascii;
root "";
case "";
instance "";
local "";
class dictionary;
object liggghtsCommands;
}
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
liggghtsCommandModels
(
execute
execute
execute
execute
runLiggghts
writeLiggghts
);
// ************************************************************************* //
/*runLiggghtsProps
{
preNo false;
}*/
writeLiggghtsProps
{
writeLast off;
writeName "post/restart/liggghts.restartCFDEM";
overwrite on;
}
executeProps0
{
command
(
delete_atoms
porosity
raceways
noBlanks
dollar
curlyOpen
fDelRun
curlyClose
blanks
label
compress
no
);
labels
(
123457
);
runFirst off;
runLast off;
runEveryCouplingStep off;
runEveryWriteStep off;
startTime 0.0;
endTime 10000;
timeInterval 0.1;
}
executeProps1
{
command
(
write_restart
noBlanks
dotdot
slash
DEM
slash
post
slash
restart
slash
liggghts.restartSequence
);
runFirst off;
runLast on;
runEveryCouplingStep off;
runEveryWriteStep off;
}
executeProps2
{
command
(
delete_atoms
region
freeboard
compress
no
);
runFirst off;
runLast off;
runEveryCouplingStep on;
runEveryWriteStep off;
}
executeProps3
{
command
(
set
region
raceways
noBlanks
property
slash
atom
blanks
Temp
noBlanks
dollar
curlyOpen
Tinlet
curlyClose
);
runFirst off;
runLast off;
runEveryCouplingStep on;
runEveryWriteStep off;
}

View File

@ -0,0 +1,51 @@
/*--------------------------------*- C++ -*----------------------------------*\
| ========= | |
| \\ / F ield | OpenFOAM: The Open Source CFD Toolbox |
| \\ / O peration | Version: 2.3.0 |
| \\ / A nd | Web: www.OpenFOAM.org |
| \\/ M anipulation | |
\*---------------------------------------------------------------------------*/
FoamFile
{
version 2.0;
format ascii;
class dictionary;
location "constant";
object transportProperties;
}
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
//Properties from https://www.jstage.jst.go.jp/article/tetsutohagane/100/8/100_925/_pdf
phases
(
iron
{
transportModel Newtonian;
nu nu [ 0 2 -1 0 0 0 0 ] 1e-06;
rho rho [ 1 -3 0 0 0 0 0 ] 6700;
Cp Cp [ 0 2 -2 -1 0 0 0 ] 850;
kf kf [ 1 1 -3 -1 0 0 0 ] 330; // sped up! 16.5*20;
D D [ 0 2 -1 0 0 0 0 ] 0.17e-6; // sped up! 0.85e-8*20;
Cs Cs [ 1 -3 0 0 0 0 0 ] 335;
}
air
{
transportModel Newtonian;
nu nu [ 0 2 -1 0 0 0 0 ] 3e-04;
rho rho [ 1 -3 0 0 0 0 0 ] 0.25;
Cp Cp [ 0 2 -2 -1 0 0 0 ] 1200;
kf kf [ 1 1 -3 -1 0 0 0 ] 2.0; // sped up! 0.1*20;
D D [ 0 2 -1 0 0 0 0 ] 0.17e-6; // sped up! 0.85e-8*20; // dummy
Cs Cs [ 1 -3 0 0 0 0 0 ] 0.00025;
}
);
sigmas
(
(iron air) 1.65 // N/m
);
// ************************************************************************* //

View File

@ -0,0 +1,21 @@
/*--------------------------------*- C++ -*----------------------------------*\
| ========= | |
| \\ / F ield | OpenFOAM: The Open Source CFD Toolbox |
| \\ / O peration | Version: 1.6 |
| \\ / A nd | Web: www.OpenFOAM.org |
| \\/ M anipulation | |
\*---------------------------------------------------------------------------*/
FoamFile
{
version 2.0;
format ascii;
class dictionary;
location "constant";
object turbulenceProperties;
}
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
simulationType laminar;
// ************************************************************************* //

View File

@ -0,0 +1,44 @@
/*--------------------------------*- C++ -*----------------------------------*\
| ========= | |
| \\ / F ield | OpenFOAM: The Open Source CFD Toolbox |
| \\ / O peration | Version: 4.x |
| \\ / A nd | Web: www.OpenFOAM.org |
| \\/ M anipulation | |
\*---------------------------------------------------------------------------*/
FoamFile
{
version 2.0;
format ascii;
class volScalarField;
location "1";
object C;
}
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
dimensions [1 -3 0 0 0 0 0];
internalField uniform 0; // see setFieldsDict
boundaryField
{
atmosphere
{
type zeroGradient;
}
walls
{
type zeroGradient;
}
outlet
{
type zeroGradient;
}
inlet
{
type fixedValue;
value uniform 135;
}
}
// ************************************************************************* //

View File

@ -0,0 +1,43 @@
/*--------------------------------*- C++ -*----------------------------------*\
| ========= | |
| \\ / F ield | OpenFOAM: The Open Source CFD Toolbox |
| \\ / O peration | Version: 4.x |
| \\ / A nd | Web: www.OpenFOAM.org |
| \\/ M anipulation | |
\*---------------------------------------------------------------------------*/
FoamFile
{
version 2.0;
format ascii;
class volScalarField;
location "0";
object Ksl;
}
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
dimensions [1 -3 -1 0 0 0 0];
internalField uniform 0;
boundaryField
{
atmosphere
{
type zeroGradient;
}
walls
{
type zeroGradient;
}
outlet
{
type zeroGradient;
}
inlet
{
type zeroGradient;
}
}
// ************************************************************************* //

View File

@ -0,0 +1,44 @@
/*--------------------------------*- C++ -*----------------------------------*\
| ========= | |
| \\ / F ield | OpenFOAM: The Open Source CFD Toolbox |
| \\ / O peration | Version: 4.x |
| \\ / A nd | Web: www.OpenFOAM.org |
| \\/ M anipulation | |
\*---------------------------------------------------------------------------*/
FoamFile
{
version 2.0;
format ascii;
class volScalarField;
location "1";
object T;
}
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
dimensions [0 0 0 1 0 0 0];
internalField uniform 1623.15;
boundaryField
{
atmosphere
{
type zeroGradient;
}
walls
{
type zeroGradient;
}
outlet
{
type zeroGradient;
}
inlet
{
type fixedValue;
value uniform 1823.15;
}
}
// ************************************************************************* //

View File

@ -0,0 +1,47 @@
/*--------------------------------*- C++ -*----------------------------------*\
| ========= | |
| \\ / F ield | OpenFOAM: The Open Source CFD Toolbox |
| \\ / O peration | Version: 4.x |
| \\ / A nd | Web: www.OpenFOAM.org |
| \\/ M anipulation | |
\*---------------------------------------------------------------------------*/
FoamFile
{
version 2.0;
format ascii;
class volVectorField;
location "0";
object U;
}
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
dimensions [0 1 -1 0 0 0 0];
internalField uniform (0 0 0);
boundaryField
{
atmosphere
{
type pressureInletOutletVelocity;
value uniform (0 0 0);
}
walls
{
type fixedValue;
value uniform (0 0 0);
}
outlet
{
type zeroGradient;
}
inlet
{
type flowRateInletVelocity;
volumetricFlowRate 0.00037; // (1 kg coke/s) / (400 kg coke/tonne iron) / (6.7 tonne/m3) = 3.7e-4 m3/s
value uniform (0 0 0); // placeholder
}
}
// ************************************************************************* //

View File

@ -0,0 +1,43 @@
/*--------------------------------*- C++ -*----------------------------------*\
| ========= | |
| \\ / F ield | OpenFOAM: The Open Source CFD Toolbox |
| \\ / O peration | Version: 4.x |
| \\ / A nd | Web: www.OpenFOAM.org |
| \\/ M anipulation | |
\*---------------------------------------------------------------------------*/
FoamFile
{
version 2.0;
format ascii;
class volVectorField;
location "0";
object Us;
}
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
dimensions [0 1 -1 0 0 0 0];
internalField uniform (0 0 0);
boundaryField
{
atmosphere
{
type zeroGradient;
}
walls
{
type zeroGradient;
}
outlet
{
type zeroGradient;
}
inlet
{
type zeroGradient;
}
}
// ************************************************************************* //

View File

@ -0,0 +1,47 @@
/*--------------------------------*- C++ -*----------------------------------*\
| ========= | |
| \\ / F ield | OpenFOAM: The Open Source CFD Toolbox |
| \\ / O peration | Version: 4.x |
| \\ / A nd | Web: www.OpenFOAM.org |
| \\/ M anipulation | |
\*---------------------------------------------------------------------------*/
FoamFile
{
version 2.0;
format ascii;
class volScalarField;
location "0";
object alpha.air;
}
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
dimensions [0 0 0 0 0 0 0];
internalField uniform 0;
boundaryField
{
atmosphere
{
type fixedValue;
value uniform 1;
}
walls
{
type alphaContactAngle;
thetaProperties 1 (( iron air ) 90 0 0 0);
value uniform 0;
}
outlet
{
type zeroGradient;
}
inlet
{
type fixedValue;
value uniform 0;
}
}
// ************************************************************************* //

View File

@ -0,0 +1,45 @@
/*--------------------------------*- C++ -*----------------------------------*\
| ========= | |
| \\ / F ield | OpenFOAM: The Open Source CFD Toolbox |
| \\ / O peration | Version: 4.x |
| \\ / A nd | Web: www.OpenFOAM.org |
| \\/ M anipulation | |
\*---------------------------------------------------------------------------*/
FoamFile
{
version 2.0;
format ascii;
class volScalarField;
location "0";
object alpha.iron;
}
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
dimensions [0 0 0 0 0 0 0];
internalField uniform 0;
boundaryField
{
atmosphere
{
type fixedValue;
value uniform 0;
}
walls
{
type zeroGradient;
}
outlet
{
type zeroGradient;
}
inlet
{
type fixedValue;
value uniform 1;
}
}
// ************************************************************************* //

View File

@ -0,0 +1,47 @@
/*--------------------------------*- C++ -*----------------------------------*\
| ========= | |
| \\ / F ield | OpenFOAM: The Open Source CFD Toolbox |
| \\ / O peration | Version: 1.6 |
| \\ / A nd | Web: http://www.OpenFOAM.org |
| \\/ M anipulation | |
\*---------------------------------------------------------------------------*/
FoamFile
{
version 2.0;
format ascii;
class volScalarField;
object pSmoothField;
}
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
dimensions [1 -1 -2 0 0 0 0]; //Pa
internalField uniform 0;
boundaryField
{
walls
{
type zeroGradient;
}
outlet
{
type fixedValue;
value uniform 0;
}
atmosphere
{
type fixedValue;
value uniform 140000;
}
inlet
{
type zeroGradient;
}
}
// ************************************************************************* //

View File

@ -0,0 +1,47 @@
/*--------------------------------*- C++ -*----------------------------------*\
| ========= | |
| \\ / F ield | OpenFOAM: The Open Source CFD Toolbox |
| \\ / O peration | Version: 4.x |
| \\ / A nd | Web: www.OpenFOAM.org |
| \\/ M anipulation | |
\*---------------------------------------------------------------------------*/
FoamFile
{
version 2.0;
format ascii;
class volScalarField;
location "0";
object p_rgh;
}
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
dimensions [1 -1 -2 0 0 0 0]; //Pa
internalField uniform 0;
boundaryField
{
atmosphere
{
type fixedValue;
value uniform 140000;
}
walls
{
type fixedFluxPressure;
value uniform 0;
}
outlet
{
type fixedValue;
value uniform 0;
}
inlet
{
type fixedFluxPressure;
value uniform 0;
}
}
// ************************************************************************* //

View File

@ -0,0 +1,43 @@
/*--------------------------------*- C++ -*----------------------------------*\
| ========= | |
| \\ / F ield | OpenFOAM: The Open Source CFD Toolbox |
| \\ / O peration | Version: 4.x |
| \\ / A nd | Web: www.OpenFOAM.org |
| \\/ M anipulation | |
\*---------------------------------------------------------------------------*/
FoamFile
{
version 2.0;
format ascii;
class volScalarField;
location "0";
object sSmoothField;
}
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
dimensions [0 1 0 0 0 0 0];
internalField uniform 0;
boundaryField
{
atmosphere
{
type zeroGradient;
}
walls
{
type zeroGradient;
}
outlet
{
type zeroGradient;
}
inlet
{
type zeroGradient;
}
}
// ************************************************************************* //

View File

@ -0,0 +1,43 @@
/*--------------------------------*- C++ -*----------------------------------*\
| ========= | |
| \\ / F ield | OpenFOAM: The Open Source CFD Toolbox |
| \\ / O peration | Version: 4.x |
| \\ / A nd | Web: www.OpenFOAM.org |
| \\/ M anipulation | |
\*---------------------------------------------------------------------------*/
FoamFile
{
version 2.0;
format ascii;
class volVectorField;
location "0";
object vSmoothField;
}
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
dimensions [0 1 0 0 0 0 0];
internalField uniform (0 0 0);
boundaryField
{
atmosphere
{
type zeroGradient;
}
walls
{
type zeroGradient;
}
outlet
{
type zeroGradient;
}
inlet
{
type zeroGradient;
}
}
// ************************************************************************* //

View File

@ -0,0 +1,45 @@
/*--------------------------------*- C++ -*----------------------------------*\
| ========= | |
| \\ / F ield | OpenFOAM: The Open Source CFD Toolbox |
| \\ / O peration | Version: 4.x |
| \\ / A nd | Web: www.OpenFOAM.org |
| \\/ M anipulation | |
\*---------------------------------------------------------------------------*/
FoamFile
{
version 2.0;
format ascii;
class volScalarField;
location "0";
object voidfraction;
}
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
dimensions [0 0 0 0 0 0 0];
internalField uniform 0;
boundaryField
{
atmosphere
{
type fixedValue;
value uniform 1;
}
walls
{
type zeroGradient;
}
outlet
{
type zeroGradient;
}
inlet
{
type fixedValue;
value uniform 1;
}
}
// ************************************************************************* //

View File

@ -0,0 +1,44 @@
/*--------------------------------*- C++ -*----------------------------------*\
| ========= | |
| \\ / F ield | OpenFOAM: The Open Source CFD Toolbox |
| \\ / O peration | Version: 4.x |
| \\ / A nd | Web: www.OpenFOAM.org |
| \\/ M anipulation | |
\*---------------------------------------------------------------------------*/
FoamFile
{
version 2.0;
format ascii;
class volScalarField;
location "0";
object wallTemp;
}
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
dimensions [0 0 0 1 0 0 0];
internalField uniform 0;
boundaryField
{
atmosphere
{
type zeroGradient;
}
walls
{
type fixedValue;
value uniform 1473.15;
}
outlet
{
type zeroGradient;
}
inlet
{
type zeroGradient;
}
}
// ************************************************************************* //

View File

@ -0,0 +1,129 @@
/*--------------------------------*- C++ -*----------------------------------*\
| ========= | |
| \\ / F ield | OpenFOAM: The Open Source CFD Toolbox |
| \\ / O peration | Version: 1.6 |
| \\ / A nd | Web: www.OpenFOAM.org |
| \\/ M anipulation | |
\*---------------------------------------------------------------------------*/
FoamFile
{
version 2.0;
format ascii;
class dictionary;
location "system";
object controlDict;
}
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
application pisoFoam;
startFrom startTime;
startTime 0;
stopAt endTime;
endTime 60.0;
deltaT 0.0005;
writeControl adjustableRunTime;
writeInterval 0.5;
purgeWrite 0;
writeFormat ascii;
writePrecision 6;
writeCompression uncompressed;
timeFormat general;
timePrecision 6;
runTimeModifiable yes;
adjustTimeStep no;
maxCo 0.1;
maxAlphaCo 0.1;
libs
(
);
functions
{
#includeFunc flowRatePatch(name=inlet)
#includeFunc flowRatePatch(name=outlet)
#includeFunc patchAverage(alpha.iron,name=inlet)
#includeFunc patchAverage(alpha.iron,name=outlet)
liquidLevel
{
functionObjectLibs ("libutilityFunctionObjects.so");
type coded;
name integral;
executeControl writeTime;
executeInterval 1;
writeControl writeTime;
writeInterval 1;
codeExecute
#{
scalar hearthRadius = 0.5;
scalar hearthArea = M_PI*hearthRadius*hearthRadius;
const volScalarField& alphaIron = mesh().lookupObject<volScalarField>("alpha.iron");
scalar liquidVol = 0;
forAll (mesh().V(), cellI)
{
liquidVol += alphaIron[cellI]*mesh().V()[cellI];
}
reduce(liquidVol, sumOp<scalar>());
scalar liquidLevel = liquidVol/hearthArea;
Info << "liquid level: " << liquidLevel << " m" << endl;
if(Pstream::master()) {
// output file
if(!isDir(mesh().time().path()/".."/"postProcessing"))
mkDir(mesh().time().path()/".."/"postProcessing");
fileName outputFile(mesh().time().path()/".."/"postProcessing"/"liquidLevel.dat");
std::ofstream file;
// header
if(!isFile(outputFile)) {
file.open(outputFile,ios_base::out);
file << "#time(s) \t liquid_lev(m)" << std::endl;
file.close();
}
// output to file
file.open(outputFile,ios_base::out | ios_base::app);
file << mesh().time().value() << " \t";
file << liquidLevel << std::endl;
file.close();
}
#};
}
}
// ************************************************************************* //

View File

@ -0,0 +1,35 @@
/*-------------------------------*- C++ -*---------------------------------*\
| ========= |
| \\ / OpenFOAM |
| \\ / |
| \\ / The Open Source CFD Toolbox |
| \\/ http://www.OpenFOAM.org |
\*-------------------------------------------------------------------------*/
FoamFile
{
version 2.0;
format ascii;
class dictionary;
note "mesh decomposition control dictionary";
location "system";
object decomposeParDict;
}
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
numberOfSubdomains 8;
//method scotch;
method simple;
simpleCoeffs
{
n (2 2 2);
delta 0.001;
}
// ************************************************************************* //

View File

@ -0,0 +1,64 @@
/*--------------------------------*- C++ -*----------------------------------*\
| ========= | |
| \\ / F ield | OpenFOAM: The Open Source CFD Toolbox |
| \\ / O peration | Version: 2.3.0 |
| \\ / A nd | Web: www.OpenFOAM.org |
| \\/ M anipulation | |
\*---------------------------------------------------------------------------*/
FoamFile
{
version 2.0;
format ascii;
class dictionary;
location "system";
object fvSchemes;
}
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
ddtSchemes
{
default Euler;
}
gradSchemes
{
default Gauss linear;
grad(U) Gauss linear;
grad(gamma) Gauss linear;
}
divSchemes
{
default Gauss linear;
div(rhoPhi,U) Gauss upwind;
div(phi,alpha) Gauss vanLeer;
div(phirb,alpha) Gauss interfaceCompression;
div(phi,T) Gauss limitedLinear 1;
div(phi,C) Gauss limitedLinear 1;
}
laplacianSchemes
{
default Gauss linear corrected;
}
interpolationSchemes
{
default linear;
}
snGradSchemes
{
default corrected;
}
fluxRequired
{
default no;
pcorr;
p_rgh;
"alpha.*";
}
// ************************************************************************* //

View File

@ -0,0 +1,168 @@
/*--------------------------------*- C++ -*----------------------------------*\
| ========= | |
| \\ / F ield | OpenFOAM: The Open Source CFD Toolbox |
| \\ / O peration | Version: 2.3.0 |
| \\ / A nd | Web: www.OpenFOAM.org |
| \\/ M anipulation | |
\*---------------------------------------------------------------------------*/
FoamFile
{
version 2.0;
format ascii;
class dictionary;
location "system";
object fvSolution;
}
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
solvers
{
"alpha.*"
{
nAlphaSubCycles 1;
cAlpha 1;
nAlphaCorr 2;
MULESCorr yes;
nLimiterIter 10;
alphaApplyPrevCorr no;
solver smoothSolver;
smoother symGaussSeidel;
tolerance 1e-8;
relTol 0;
minIter 1;
}
pcorr
{
solver PCG;
preconditioner
{
preconditioner GAMG;
tolerance 1e-05;
relTol 0;
smoother GaussSeidel;
nPreSweeps 0;
nPostSweeps 2;
nFinestSweeps 2;
cacheAgglomeration on;
nCellsInCoarsestLevel 10;
agglomerator faceAreaPair;
mergeLevels 1;
}
tolerance 1e-05;
relTol 0;
maxIter 100;
}
p_rgh
{
solver GAMG;
tolerance 1e-8;
relTol 1e-6;
smoother GaussSeidel;
nPreSweeps 0;
nPostSweeps 2;
nFinestSweeps 2;
cacheAgglomeration on;
nCellsInCoarsestLevel 10;
agglomerator faceAreaPair;
mergeLevels 1;
}
"(p_rghFinal|pSmoothFinal)"
{
solver PCG;
preconditioner
{
preconditioner GAMG;
tolerance 1e-8;
relTol 0;
nVcycles 2;
smoother GaussSeidel;
nPreSweeps 0;
nPostSweeps 2;
nFinestSweeps 2;
cacheAgglomeration on;
nCellsInCoarsestLevel 10;
agglomerator faceAreaPair;
mergeLevels 1;
}
tolerance 1e-8;
relTol 0;
maxIter 20;
}
"(k|epsilon|R|nuTilda)"
{
solver smoothSolver;
smoother GaussSeidel;
tolerance 1e-9;
relTol 0;
nSweeps 1;
}
"(voidfraction|Us|Ksl|UsNext|voidfractionNext|pSmooth)"
{
solver PCG;
preconditioner DIC;
tolerance 1e-06;
relTol 0;
}
"(vSmoothField|sSmoothField)"
{
solver PCG;
preconditioner FDIC;
tolerance 1e-04;
relTol 0;
}
U
{
solver smoothSolver;
smoother GaussSeidel;
tolerance 1e-08;
relTol 1e-06;
nSweeps 1;
}
UFinal
{
$U;
tolerance 1e-08;
relTol 0;
}
"(T|C)"
{
solver PBiCGStab;
preconditioner DILU;
tolerance 1e-8;
relTol 0;
}
}
PIMPLE
{
momentumPredictor yes;
nOuterCorrectors 1;
nCorrectors 2;
nNonOrthogonalCorrectors 1;
maxCo 0.25;
maxAlphaCo 0.25;
}
relaxationFactors
{
fields
{
}
equations
{
"U.*" 1;
}
}
// ************************************************************************* //

View File

@ -0,0 +1,42 @@
/*--------------------------------*- C++ -*----------------------------------*\
| ========= | |
| \\ / F ield | OpenFOAM: The Open Source CFD Toolbox |
| \\ / O peration | Version: 2.3.0 |
| \\ / A nd | Web: www.OpenFOAM.org |
| \\/ M anipulation | |
\*---------------------------------------------------------------------------*/
FoamFile
{
version 2.0;
format ascii;
class dictionary;
location "system";
object setFieldsDict;
}
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
defaultFieldValues
(
volScalarFieldValue alpha.air 1
volScalarFieldValue alpha.iron 0
volScalarFieldValue C 0
);
regions
(
cylinderToCell
{
p1 (0 0 0); //center point, min
p2 (0 0 0.4); //center point, max
radius 0.5;
fieldValues
(
volScalarFieldValue alpha.iron 1
volScalarFieldValue alpha.air 0
volScalarFieldValue C 235
);
}
);
// ************************************************************************* //

View File

@ -0,0 +1,11 @@
# Material properties required for granular pair styles
fix m1 all property/global youngsModulus peratomtype 5.e6
fix m2 all property/global poissonsRatio peratomtype 0.3
fix m3 all property/global coefficientRestitution peratomtypepair 1 0.3
fix m4 all property/global coefficientFriction peratomtypepair 1 0.5
fix m5 all property/global coefficientRollingFriction peratomtypepair 1 0.2
fix m6 all property/global coefficientRollingViscousDamping peratomtypepair 1 0.3
# pair style
pair_style gran model hertz tangential history rolling_friction epsd
pair_coeff * *

View File

@ -0,0 +1,67 @@
# hearth settings
variable hearthRadius equal 0.5 # hearth radius (m)
variable coreRadius equal 0.15 # radius of core region (m)
variable liquidLevel equal 0.4 # initial liquid level (m) [set in setFieldsDict as well!]
variable liquidDensity equal 6700. # liquid density (kg/m3)
# heat/mass transfer settings
variable particlekInit equal 5000 # particle thermal conductivity during init (W/Km)
variable particlekRun equal 40.0 # particle thermal conductivity during run (W/Km) [sped up! 2.0*20!]
variable particleCp equal 870 # particle heat capacity (J/kgK)
variable Tinlet equal 1823.15 # particle inlet temperature (K) [set in CFD as well!]
variable Tinit equal 1623.15 # initial temperature (K) [set in CFD as well!]
variable Twall equal 1423.15 # wall temperature (K) [set in CFD as well!]
variable rRemove equal 0.001 # radius at which dissolved particles are removed (m)
# zone definitions
variable forceZmin equal 0.70 # lower boundary of force zone (m)
variable forceZmax equal 0.80 # upper boundary of force zone (m)
variable insZmin equal 0.70 # lower boundary of insertion zone (m)
variable insZmax equal 0.80 # upper boundary of insertion zone (m)
region bedReg cylinder z 0 0 ${hearthRadius} 0 ${insZmax}
region coreReg cylinder z 0 0 ${coreRadius} 0 ${insZmax} side in
region invCoreReg cylinder z 0 0 ${coreRadius} 0 ${insZmax} side out
region shellReg intersect 2 bedReg invCoreReg
region insReg cylinder z 0 0 ${hearthRadius} ${insZmin} ${insZmax}
region insCoreReg intersect 2 insReg coreReg
region insShellReg intersect 2 insReg invCoreReg
region forceReg cylinder z 0 0 ${hearthRadius} ${forceZmin} ${forceZmax}
region freeboard cylinder z 0 0 ${hearthRadius} ${insZmax} INF
region mushroom block 0.4 0.5 -0.05 0.05 0.2 0.3 side out # mushroom cutout
region initReg intersect 2 bedReg mushroom # entire bed minus mushroom
region initCoreReg intersect 2 initReg coreReg
region initShellReg intersect 2 initReg invCoreReg
# total burden weight
variable pressureMin equal 2000 # lower pressure value (Pa), near wall
variable pressureMax equal 20000 # upper pressure value (Pa), near core
# kinetic energy
variable kinEn equal ke # kinetic energy (J)
variable kinEnMax equal 2. # kinetic energy threshold for init (J)
# coke removal settings
variable cokeRateInit equal 20. # coke combustion rate during init (kg/s)
variable cokeRateRun equal 1. # coke combustion rate during run (kg/s)
variable delInt equal 0.1 # removal interval (s) [set in liggghtsCommands as well!]
variable nFreeboard equal count(all,freeboard)
variable nRaceways equal count(all,raceways)
variable mRaceways equal mass(all,raceways)
variable avMass equal "v_mRaceways/(v_nRaceways+1e-3)"
variable delIntSteps equal "floor(v_delInt/dt)"
variable nDelInit equal "v_delIntSteps*dt*v_cokeRateInit/v_avMass"
variable fDelInit equal "v_nDelInit/(v_nRaceways+1e-3)"
variable nDelRun equal "v_delIntSteps*dt*v_cokeRateRun/v_avMass"
variable fDelRun equal "v_nDelRun/(v_nRaceways+1e-3)"

View File

@ -0,0 +1,121 @@
echo both
log ../log/log.liggghts_init
atom_style granular
atom_modify map array
boundary f f f
newton off
communicate single vel yes
units si
processors 2 2 2
region reg block -0.5 0.5 -0.5 0.5 -0.0025 1 units box
create_box 1 reg
neighbor 0.007 bin
neigh_modify delay 0
# contact model
include in.contact_settings
# timestep
timestep 1e-4
# hearth settings
include in.hearth_settings
# heat transfer
fix m7 all property/global thermalConductivity peratomtype ${particlekInit} # lambda in [W/(K*m)]
fix m8 all property/global thermalCapacity peratomtype ${particleCp} # cp in [J/(kg*K)]
fix heattransfer all heat/gran/conduction initial_temperature ${Tinlet}
# walls
include in.wall_settings
# gravity
fix gravi all gravity 9.81 vector 0.0 0.0 -1.0
######################################
# particle distribution
include in.particleSizeDistribution1
include in.particleSizeDistribution2
# raceways
include in.raceways
######################################
# add a wall between core and shell regions
fix coreWall all wall/gran model hertz tangential history primitive type 1 zcylinder ${coreRadius} 0 0
# insert in bed volume
fix ins1 all insert/pack seed 32452843 distributiontemplate pdd1 all_in yes insert_every 100 overlapcheck yes region initShellReg volumefraction_region 0.7
fix ins2 all insert/pack seed 32452843 distributiontemplate pdd2 all_in yes insert_every 100 overlapcheck yes region initCoreReg volumefraction_region 0.7
# insert the first particles
run 1
# apply nve integration to all particles
fix integr all nve/sphere
######################################
# add load
include in.pressure_profile
# add buoyancy
fix archi all buoyancy density ${liquidDensity} dim z level ${liquidLevel}
######################################
# output settings
thermo_style custom step time atoms ke v_nForceReg v_totalForce v_avForcePerPart
thermo 100
# dump settings
dump dmp all custom 1000 post/dump*.liggghts_init id type x y z ix iy iz vx vy vz fx fy fz omegax omegay omegaz radius density f_Temp[0]
######################################
# run for some steps
label run1
run 1000 post no
# repeat until kinetic energy is below treshold
if "${kinEn} > ${kinEnMax}" then "jump SELF run1"
# remove wall between core and shell regions and run some more steps
unfix coreWall
run 5000 pre no post no
######################################
# stop insertion
unfix ins1
unfix ins2
######################################
# set all temperatures
set region bedReg property/atom Temp ${Tinit}
# insert in insertion volume
fix ins3 all insert/pack seed 32452843 distributiontemplate pdd1 all_in yes insert_every ${delIntSteps} overlapcheck yes region insShellReg volumefraction_region 0.7
fix ins4 all insert/pack seed 32452843 distributiontemplate pdd2 all_in yes insert_every ${delIntSteps} overlapcheck yes region insCoreReg volumefraction_region 0.7
# run for some steps and remove particles in raceways
label run2
run 100000 pre no post yes every ${delIntSteps} "delete_atoms porosity raceways ${fDelInit} 123457 compress no" "delete_atoms region freeboard compress no" "set region raceways property/atom Temp ${Tinlet}"
######################################
# remove buoyancy
unfix archi
# write restart file
write_restart post/restart/liggghts.restart

View File

@ -0,0 +1,78 @@
echo both
log ../log/log.liggghts_run
thermo_log ../log/thermo.txt
atom_style granular
atom_modify map array
boundary f f f
newton off
communicate single vel yes
units si
processors 2 2 2
# read the restart file
read_restart ../DEM/post/restart/liggghts.restartSequence
neighbor 0.007 bin
neigh_modify delay 0
# contact model
include ../DEM/in.contact_settings
# hearth settings
include ../DEM/in.hearth_settings
# timestep
timestep 1e-4
# cfd coupling
fix cfd all couple/cfd couple_every 100 mpi
fix cfd2 all couple/cfd/force/implicit
# heat transfer
fix m7 all property/global thermalConductivity peratomtype ${particlekRun} # lambda in [W/(K*m)]
fix m8 all property/global thermalCapacity peratomtype ${particleCp} # cp in [J/(kg*K)]
fix heattransfer all heat/gran/conduction initial_temperature ${Tinlet}
fix cfd3 all couple/cfd/convection T0 ${Tinlet}
# mass transfer
fix cfd4 all couple/cfd/dissolve rmin ${rRemove}
# walls
include ../DEM/in.wall_settings
# gravity
fix gravi all gravity 9.81 vector 0.0 0.0 -1.0
######################################
# particle distribution
include ../DEM/in.particleSizeDistribution1
include ../DEM/in.particleSizeDistribution2
# raceways
include ../DEM/in.raceways
# burden weight
include ../DEM/in.pressure_profile
# insert in insertion volume
fix ins3 all insert/pack seed 32452843 distributiontemplate pdd1 all_in yes insert_every ${delIntSteps} overlapcheck yes region insShellReg volumefraction_region 0.7
fix ins4 all insert/pack seed 32452843 distributiontemplate pdd2 all_in yes insert_every ${delIntSteps} overlapcheck yes region insCoreReg volumefraction_region 0.7
######################################
# apply nve integration to all particles
fix integr all nve/sphere
# output settings
thermo_style custom step time atoms ke v_totalForce v_avForcePerPart v_nDelRun
thermo 10
# dump settings
dump dmp all custom 5000 ../DEM/post/dump*.liggghts_run id type x y z ix iy iz vx vy vz fx fy fz omegax omegay omegaz radius density f_Temp[0] f_convectiveHeatFlux[0] f_convectiveMassFlux[0]
#5000
run 0

View File

@ -0,0 +1,9 @@
# Particle size distribution for LIGGGHTS
# mean radius = 0.0100000 m
# standard deviation = 0.00000 m
# density = 900 kg/m3
fix pts1 all particletemplate/sphere 10007 atom_type 1 density constant 900 radius constant 0.01
fix pdd1 all particledistribution/discrete 10009 1 pts1 1.000000

View File

@ -0,0 +1,9 @@
# Particle size distribution for LIGGGHTS
# mean radius = 0.0125000 m
# standard deviation = 0.00000 m
# density = 900 kg/m3
fix pts2 all particletemplate/sphere 10037 atom_type 1 density constant 900 radius constant 0.0125
fix pdd2 all particledistribution/discrete 10039 1 pts2 1.000000

View File

@ -0,0 +1,162 @@
# Pressure profile definition for LIGGGHTS
# reactor radius = 0.500000 m
# R1 = 0.150000 m
# R2 = 0.400000 m
# number of bins = 12
# Region01
region forceReg01 cylinder z 0 0 0.15 ${forceZmin} ${forceZmax} side in # center region
variable nForceReg01 equal count(all,forceReg01) # number of particles inside
variable forceRegArea01 equal 0.070686 # ring area (m2)
variable forceFact01 equal 1 # force factor [0-1] (-)
variable totalForce01 equal "-(v_forceFact01*(v_pressureMax-v_pressureMin)+v_pressureMin)*v_forceRegArea01" # total force (N)
variable forcePerPart01 equal "v_totalForce01/(v_nForceReg01+1e-3)" # force per particle (N)
fix force01 all addforce 0 0 v_forcePerPart01 region forceReg01 # apply force
# Region02
region forceRegIn02 cylinder z 0 0 0.15 ${forceZmin} ${forceZmax} side out # inner region
region forceRegOut02 cylinder z 0 0 0.17083 ${forceZmin} ${forceZmax} side in # outer region
region forceReg02 intersect 2 forceRegIn02 forceRegOut02 # annular region
variable nForceReg02 equal count(all,forceReg02) # number of particles inside
variable forceRegArea02 equal 0.020998 # ring area (m2)
variable forceFact02 equal 0.95833 # force factor [0-1] (-)
variable totalForce02 equal "-(v_forceFact02*(v_pressureMax-v_pressureMin)+v_pressureMin)*v_forceRegArea02" # total force (N)
variable forcePerPart02 equal "v_totalForce02/(v_nForceReg02+1e-3)" # force per particle (N)
fix force02 all addforce 0 0 v_forcePerPart02 region forceReg02 # apply force
# Region03
region forceRegIn03 cylinder z 0 0 0.17083 ${forceZmin} ${forceZmax} side out # inner region
region forceRegOut03 cylinder z 0 0 0.19167 ${forceZmin} ${forceZmax} side in # outer region
region forceReg03 intersect 2 forceRegIn03 forceRegOut03 # annular region
variable nForceReg03 equal count(all,forceReg03) # number of particles inside
variable forceRegArea03 equal 0.023726 # ring area (m2)
variable forceFact03 equal 0.875 # force factor [0-1] (-)
variable totalForce03 equal "-(v_forceFact03*(v_pressureMax-v_pressureMin)+v_pressureMin)*v_forceRegArea03" # total force (N)
variable forcePerPart03 equal "v_totalForce03/(v_nForceReg03+1e-3)" # force per particle (N)
fix force03 all addforce 0 0 v_forcePerPart03 region forceReg03 # apply force
# Region04
region forceRegIn04 cylinder z 0 0 0.19167 ${forceZmin} ${forceZmax} side out # inner region
region forceRegOut04 cylinder z 0 0 0.2125 ${forceZmin} ${forceZmax} side in # outer region
region forceReg04 intersect 2 forceRegIn04 forceRegOut04 # annular region
variable nForceReg04 equal count(all,forceReg04) # number of particles inside
variable forceRegArea04 equal 0.026453 # ring area (m2)
variable forceFact04 equal 0.79167 # force factor [0-1] (-)
variable totalForce04 equal "-(v_forceFact04*(v_pressureMax-v_pressureMin)+v_pressureMin)*v_forceRegArea04" # total force (N)
variable forcePerPart04 equal "v_totalForce04/(v_nForceReg04+1e-3)" # force per particle (N)
fix force04 all addforce 0 0 v_forcePerPart04 region forceReg04 # apply force
# Region05
region forceRegIn05 cylinder z 0 0 0.2125 ${forceZmin} ${forceZmax} side out # inner region
region forceRegOut05 cylinder z 0 0 0.23333 ${forceZmin} ${forceZmax} side in # outer region
region forceReg05 intersect 2 forceRegIn05 forceRegOut05 # annular region
variable nForceReg05 equal count(all,forceReg05) # number of particles inside
variable forceRegArea05 equal 0.02918 # ring area (m2)
variable forceFact05 equal 0.70833 # force factor [0-1] (-)
variable totalForce05 equal "-(v_forceFact05*(v_pressureMax-v_pressureMin)+v_pressureMin)*v_forceRegArea05" # total force (N)
variable forcePerPart05 equal "v_totalForce05/(v_nForceReg05+1e-3)" # force per particle (N)
fix force05 all addforce 0 0 v_forcePerPart05 region forceReg05 # apply force
# Region06
region forceRegIn06 cylinder z 0 0 0.23333 ${forceZmin} ${forceZmax} side out # inner region
region forceRegOut06 cylinder z 0 0 0.25417 ${forceZmin} ${forceZmax} side in # outer region
region forceReg06 intersect 2 forceRegIn06 forceRegOut06 # annular region
variable nForceReg06 equal count(all,forceReg06) # number of particles inside
variable forceRegArea06 equal 0.031907 # ring area (m2)
variable forceFact06 equal 0.625 # force factor [0-1] (-)
variable totalForce06 equal "-(v_forceFact06*(v_pressureMax-v_pressureMin)+v_pressureMin)*v_forceRegArea06" # total force (N)
variable forcePerPart06 equal "v_totalForce06/(v_nForceReg06+1e-3)" # force per particle (N)
fix force06 all addforce 0 0 v_forcePerPart06 region forceReg06 # apply force
# Region07
region forceRegIn07 cylinder z 0 0 0.25417 ${forceZmin} ${forceZmax} side out # inner region
region forceRegOut07 cylinder z 0 0 0.275 ${forceZmin} ${forceZmax} side in # outer region
region forceReg07 intersect 2 forceRegIn07 forceRegOut07 # annular region
variable nForceReg07 equal count(all,forceReg07) # number of particles inside
variable forceRegArea07 equal 0.034634 # ring area (m2)
variable forceFact07 equal 0.54167 # force factor [0-1] (-)
variable totalForce07 equal "-(v_forceFact07*(v_pressureMax-v_pressureMin)+v_pressureMin)*v_forceRegArea07" # total force (N)
variable forcePerPart07 equal "v_totalForce07/(v_nForceReg07+1e-3)" # force per particle (N)
fix force07 all addforce 0 0 v_forcePerPart07 region forceReg07 # apply force
# Region08
region forceRegIn08 cylinder z 0 0 0.275 ${forceZmin} ${forceZmax} side out # inner region
region forceRegOut08 cylinder z 0 0 0.29583 ${forceZmin} ${forceZmax} side in # outer region
region forceReg08 intersect 2 forceRegIn08 forceRegOut08 # annular region
variable nForceReg08 equal count(all,forceReg08) # number of particles inside
variable forceRegArea08 equal 0.037361 # ring area (m2)
variable forceFact08 equal 0.45833 # force factor [0-1] (-)
variable totalForce08 equal "-(v_forceFact08*(v_pressureMax-v_pressureMin)+v_pressureMin)*v_forceRegArea08" # total force (N)
variable forcePerPart08 equal "v_totalForce08/(v_nForceReg08+1e-3)" # force per particle (N)
fix force08 all addforce 0 0 v_forcePerPart08 region forceReg08 # apply force
# Region09
region forceRegIn09 cylinder z 0 0 0.29583 ${forceZmin} ${forceZmax} side out # inner region
region forceRegOut09 cylinder z 0 0 0.31667 ${forceZmin} ${forceZmax} side in # outer region
region forceReg09 intersect 2 forceRegIn09 forceRegOut09 # annular region
variable nForceReg09 equal count(all,forceReg09) # number of particles inside
variable forceRegArea09 equal 0.040088 # ring area (m2)
variable forceFact09 equal 0.375 # force factor [0-1] (-)
variable totalForce09 equal "-(v_forceFact09*(v_pressureMax-v_pressureMin)+v_pressureMin)*v_forceRegArea09" # total force (N)
variable forcePerPart09 equal "v_totalForce09/(v_nForceReg09+1e-3)" # force per particle (N)
fix force09 all addforce 0 0 v_forcePerPart09 region forceReg09 # apply force
# Region10
region forceRegIn10 cylinder z 0 0 0.31667 ${forceZmin} ${forceZmax} side out # inner region
region forceRegOut10 cylinder z 0 0 0.3375 ${forceZmin} ${forceZmax} side in # outer region
region forceReg10 intersect 2 forceRegIn10 forceRegOut10 # annular region
variable nForceReg10 equal count(all,forceReg10) # number of particles inside
variable forceRegArea10 equal 0.042815 # ring area (m2)
variable forceFact10 equal 0.29167 # force factor [0-1] (-)
variable totalForce10 equal "-(v_forceFact10*(v_pressureMax-v_pressureMin)+v_pressureMin)*v_forceRegArea10" # total force (N)
variable forcePerPart10 equal "v_totalForce10/(v_nForceReg10+1e-3)" # force per particle (N)
fix force10 all addforce 0 0 v_forcePerPart10 region forceReg10 # apply force
# Region11
region forceRegIn11 cylinder z 0 0 0.3375 ${forceZmin} ${forceZmax} side out # inner region
region forceRegOut11 cylinder z 0 0 0.35833 ${forceZmin} ${forceZmax} side in # outer region
region forceReg11 intersect 2 forceRegIn11 forceRegOut11 # annular region
variable nForceReg11 equal count(all,forceReg11) # number of particles inside
variable forceRegArea11 equal 0.045542 # ring area (m2)
variable forceFact11 equal 0.20833 # force factor [0-1] (-)
variable totalForce11 equal "-(v_forceFact11*(v_pressureMax-v_pressureMin)+v_pressureMin)*v_forceRegArea11" # total force (N)
variable forcePerPart11 equal "v_totalForce11/(v_nForceReg11+1e-3)" # force per particle (N)
fix force11 all addforce 0 0 v_forcePerPart11 region forceReg11 # apply force
# Region12
region forceRegIn12 cylinder z 0 0 0.35833 ${forceZmin} ${forceZmax} side out # inner region
region forceRegOut12 cylinder z 0 0 0.37917 ${forceZmin} ${forceZmax} side in # outer region
region forceReg12 intersect 2 forceRegIn12 forceRegOut12 # annular region
variable nForceReg12 equal count(all,forceReg12) # number of particles inside
variable forceRegArea12 equal 0.048269 # ring area (m2)
variable forceFact12 equal 0.125 # force factor [0-1] (-)
variable totalForce12 equal "-(v_forceFact12*(v_pressureMax-v_pressureMin)+v_pressureMin)*v_forceRegArea12" # total force (N)
variable forcePerPart12 equal "v_totalForce12/(v_nForceReg12+1e-3)" # force per particle (N)
fix force12 all addforce 0 0 v_forcePerPart12 region forceReg12 # apply force
# Region13
region forceRegIn13 cylinder z 0 0 0.37917 ${forceZmin} ${forceZmax} side out # inner region
region forceRegOut13 cylinder z 0 0 0.4 ${forceZmin} ${forceZmax} side in # outer region
region forceReg13 intersect 2 forceRegIn13 forceRegOut13 # annular region
variable nForceReg13 equal count(all,forceReg13) # number of particles inside
variable forceRegArea13 equal 0.050996 # ring area (m2)
variable forceFact13 equal 0.041667 # force factor [0-1] (-)
variable totalForce13 equal "-(v_forceFact13*(v_pressureMax-v_pressureMin)+v_pressureMin)*v_forceRegArea13" # total force (N)
variable forcePerPart13 equal "v_totalForce13/(v_nForceReg13+1e-3)" # force per particle (N)
fix force13 all addforce 0 0 v_forcePerPart13 region forceReg13 # apply force
# Region14
region forceRegIn14 cylinder z 0 0 0.4 ${forceZmin} ${forceZmax} side out # inner region
region forceRegOut14 cylinder z 0 0 0.5 ${forceZmin} ${forceZmax} side in # outer region
region forceReg14 intersect 2 forceRegIn14 forceRegOut14 # annular region
variable nForceReg14 equal count(all,forceReg14) # number of particles inside
variable forceRegArea14 equal 0.28274 # ring area (m2)
variable forceFact14 equal 0 # force factor [0-1] (-)
variable totalForce14 equal "-(v_forceFact14*(v_pressureMax-v_pressureMin)+v_pressureMin)*v_forceRegArea14" # total force (N)
variable forcePerPart14 equal "v_totalForce14/(v_nForceReg14+1e-3)" # force per particle (N)
fix force14 all addforce 0 0 v_forcePerPart14 region forceReg14 # apply force
variable totalForce equal "v_forcePerPart01*v_nForceReg01+v_forcePerPart02*v_nForceReg02+v_forcePerPart03*v_nForceReg03+v_forcePerPart04*v_nForceReg04+v_forcePerPart05*v_nForceReg05+v_forcePerPart06*v_nForceReg06+v_forcePerPart07*v_nForceReg07+v_forcePerPart08*v_nForceReg08+v_forcePerPart09*v_nForceReg09+v_forcePerPart10*v_nForceReg10+v_forcePerPart11*v_nForceReg11+v_forcePerPart12*v_nForceReg12+v_forcePerPart13*v_nForceReg13+v_forcePerPart14*v_nForceReg14" # sum of all forces (N)
variable nForceReg equal "v_nForceReg01+v_nForceReg02+v_nForceReg03+v_nForceReg04+v_nForceReg05+v_nForceReg06+v_nForceReg07+v_nForceReg08+v_nForceReg09+v_nForceReg10+v_nForceReg11+v_nForceReg12+v_nForceReg13+v_nForceReg14" # sum of all numbers of particles (N)
variable avForcePerPart equal "v_totalForce/(v_nForceReg+1e-3)" # average force per particle (N)

View File

@ -0,0 +1,26 @@
# Raceway definition for LIGGGHTS
# reactor radius = 0.500000 m
# raceway height = 0.500000 m
# raceway diameter = 0.100000 m
# raceway length = 0.100000 m
# number of raceways = 8
variable angle1 equal 0.000000
region raceway1 cylinder x 0.000000 0.500000 0.050000 0.400000 0.500000 rotate v_angle1 0 0 0 0 0 1
variable angle2 equal 0.785398
region raceway2 cylinder x 0.000000 0.500000 0.050000 0.400000 0.500000 rotate v_angle2 0 0 0 0 0 1
variable angle3 equal 1.570796
region raceway3 cylinder x 0.000000 0.500000 0.050000 0.400000 0.500000 rotate v_angle3 0 0 0 0 0 1
variable angle4 equal 2.356194
region raceway4 cylinder x 0.000000 0.500000 0.050000 0.400000 0.500000 rotate v_angle4 0 0 0 0 0 1
variable angle5 equal 3.141593
region raceway5 cylinder x 0.000000 0.500000 0.050000 0.400000 0.500000 rotate v_angle5 0 0 0 0 0 1
variable angle6 equal 3.926991
region raceway6 cylinder x 0.000000 0.500000 0.050000 0.400000 0.500000 rotate v_angle6 0 0 0 0 0 1
variable angle7 equal 4.712389
region raceway7 cylinder x 0.000000 0.500000 0.050000 0.400000 0.500000 rotate v_angle7 0 0 0 0 0 1
variable angle8 equal 5.497787
region raceway8 cylinder x 0.000000 0.500000 0.050000 0.400000 0.500000 rotate v_angle8 0 0 0 0 0 1
region raceways union 8 raceway1 raceway2 raceway3 raceway4 raceway5 raceway6 raceway7 raceway8

View File

@ -0,0 +1,3 @@
fix sides all mesh/surface file mesh/small_hearth_sides.stl type 1 temperature ${Twall} curvature 1e-5
fix bottom all mesh/surface file mesh/small_hearth_bottom.stl type 1 temperature ${Twall}
fix granwalls all wall/gran model hertz tangential history rolling_friction epsd mesh n_meshes 2 meshes sides bottom temperature ${Twall}

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

View File

@ -0,0 +1,5 @@
outlet
{
type fixedValue;
value uniform (0 0 0);
}

View File

@ -0,0 +1,6 @@
outlet
{
type alphaContactAngle;
thetaProperties 1 (( iron air ) 90 0 0 0);
value uniform 0;
}

View File

@ -0,0 +1,4 @@
outlet
{
type zeroGradient;
}

View File

@ -0,0 +1,5 @@
outlet
{
type fixedFluxPressure;
value uniform 0;
}

View File

@ -0,0 +1,4 @@
outlet
{
type zeroGradient;
}

View File

@ -0,0 +1,4 @@
outlet
{
type zeroGradient;
}

View File

@ -0,0 +1,4 @@
outlet
{
type zeroGradient;
}

View File

@ -0,0 +1,5 @@
outlet
{
type fixedValue;
value uniform 0;
}

View File

@ -0,0 +1,48 @@
outlet
{
type codedFixedValue;
value uniform 0;
redirectType tapholePressure;
code
#{
const fvPatch& patchI = patch();
const fvsPatchField<scalar>& phi = patch().lookupPatchField<surfaceScalarField, scalar>("phi");
const fvPatchField<scalar>& rho = patch().lookupPatchField<volScalarField, scalar>("rho");
scalarField& field = *this;
scalar tapholeDiam = 0.05; // m
scalar tapholeArea = M_PI/4*tapholeDiam*tapholeDiam; // m2
scalar p0 = 0.0; // Pa
scalar kf = 1.0; // friction factor
// get total flowrate and average viscosity and density
scalar patchFlow = 0.0; // m3/s
scalar phiRho = 0.0; // phi*rho
forAll(patchI, faceI)
{
patchFlow += phi[faceI];
phiRho += phi[faceI]*rho[faceI];
}
reduce(patchFlow, sumOp<scalar>()); // sum across procs
reduce(phiRho, sumOp<scalar>()); // sum across procs
// calculate pressure drop
scalar dP = 0;
if (patchFlow>0) {
scalar tapholeRho = phiRho/patchFlow; // kg/m3
scalar tapholeVel = patchFlow/tapholeArea; // m/2
dP = 0.5*tapholeRho*kf*tapholeVel*tapholeVel; // pressure drop, Pa
Info << "dP = " << dP << endl;
}
// set value
forAll(patchI, faceI)
{
field[faceI] = p0 + dP;
}
#};
}

View File

@ -0,0 +1,30 @@
outlet
{
type codedFixedValue;
value uniform 0;
redirectType tapholeVoidfraction;
code
#{
// set voidfraction such that patchArea*voidfraction = tapholeArea
const fvPatch& patchI = patch();
scalarField& field = *this;
scalar tapholeDiam = 0.05; //m
scalar tapholeArea = M_PI/4*tapholeDiam*tapholeDiam; //m2
// get patchArea
scalar patchArea = 0.0; //m2
forAll(patchI, faceI)
{
patchArea += patchI.magSf()[faceI];
}
reduce(patchArea, sumOp<scalar>()); // sum across procs
// set value
forAll(patchI, faceI)
{
field[faceI] = tapholeArea/patchArea;
}
#};
}

View File

@ -0,0 +1,25 @@
#===================================================================#
# small_hearth
# Tim MJ Nijssen - September 2021
#===================================================================#
This tutorial case provides a demonstration of various functions:
- The cfdemSolverMultiphaseScalar solver
- The ParmarBassetForce model
- The wallHeatTransferYagi model
- The massTransferGunn model
- The couple/cfd/dissolve command
- using scripted boundary conditions to obtain frictional outflow conditions
- using external scripting to interface with simulations and adapt conditions and settings
#===================================================================#
The following scripts are available in the /scripts directory:
- cleanCase.sh: Cleans the case directory from all previous output. Prompts the user whether to remove LIGGGHTS restart files, CFD mesh files and result directories
- runAllPar.sh: Runs LIGGGHTS initialisation if no previous restart file is found, then performs a coupled run according to the start and end times set in CFD/system.controlDict. Afterwards, the case is reconstructed and results moved to a separate directory.
- runAllParSequence.sh: Runs LIGGGHTS initialisation if no previous restart file is found, then performs a coupled run according to the settings in the sequenceSettings file. This allows for time-based switching of boundary conditions. Afterwards, the case is reconstructed and results moved to a separate directory.
- runAllParTapping.sh: Runs LIGGGHTS initialisation if no previous restart file is found, then performs a coupled run according to the settings in the tappingSettings file. This allows for conditional switching of boundary conditions. Afterwards, the case is reconstructed and results moved to a separate directory.
NOTE: the latter to scripts rely on Perl (www.perl.org) to function. Perl comes included in most linux distibutions, or can be installed through the package manager.

View File

@ -0,0 +1,152 @@
#===================================================================#
# runAllParSequence
# Tim MJ Nijssen - October 2019
#===================================================================#
Argument(s):
- casePath (optional): path to the CFDEM case to run (default: cd)
- sequenceSettingsPath (optional): path to the sequenceSettings file (default: casePath/sequenceSettings)
#===================================================================#
Example(s):
- cd ~/CFDEM/user/run/exampleCase
runAllParSequence
- runAllParSequence ~/CFDEM/user/run/exampleCase ~/CFDEM/user/run/exampleCase/sequenceSettings
#===================================================================#
Prerequisites:
- sequence_files: directory containing directories for each available set of boundary conditions.
- sequenceSettings: file specifying which set of boundary conditions to use with corresponding start and end times.
- liggghts.restartSequence: LIGGGHTS restart file being updated after each step in the sequence.
#===================================================================#
Description:
runAllParSequence runs a parralel CFDEM job using multiple sets of boundary conditions in a predifined sequence. This way, e.g. the opening and closing of a valve can be simulated by alternatingly defining the valve path as a wall or an outlet. runAllParSequence will execute the following tasks:
- preRunAllPar
- duplicate liggghts.restart to liggghts.restartSequence
- for everyline in sequenceSettings:
-- update controlDict with the specified start and end times
-- replace boundary conditions at startTime with the set specified
-- runCFDDEMPar
- postRunAllPar
#===================================================================#
sequence_files:
This directory is located in the case directory. It contains separate directories for each set of boundary conditions. An example of the file structure is given below:
- exampleCase
-- sequence_files
--- valve_closed
---- U
---- p
--- valve_open
---- U
---- p
Each of the boundary condition files is of the same name and structure as the boundary condition files located in the org.0 directory. It is important that ONLY the boundaryField information of the relevant patches is present in files. The FOAMFile header, internalField and other patches should be removed. Examples of such files are given below:
caseDir/sequence_files/valve_closed/U:
valve
{
type fixedValue;
value uniform (0 0 0);
}
caseDir/sequence_files/valve_closed/p:
valve
{
type zeroGradient;
}
caseDir/sequence_files/valve_open/U:
valve
{
type zeroGradient;
}
caseDir/sequence_files/valve_open/p:
valve
{
type fixedValue;
value uniform 0;
}
runAllParSequence will use replaceBC.pl to place these boundary conditions in the simulation at the appropriate times. C-style comments (single-line and multi-line) are allowed in these files.
#===================================================================#
sequenceSettings:
This file is contained in the case directory by default, though an alternative path can be passed as an argument. Every line contains the name of a set of boundary conditions (corresponding with the name of the directory in sequence_files/) and the corresponding start and end times. C-style and bash-style single-line comments are supported. An example is given below:
caseDir/sequenceSettings:
#stepName startTime endTime
valve_open 0.0 1.0
valve_closed 1.0 2.0
valve_open 2.0 3.0
valve_closed 3.0 4.0
#===================================================================#
liggghts.restartSequence:
runAllParSequence uses DEM/post/restart/liggghts.restartSequence to save the DEM state between runs. Before the first run, the DEM initialisation file liggghts.restart is duplicated to liggghts.restartSequence. It can then be overwritten after every run by adding the code below to CFD/constant/liggghtsCommands. Add 'execute' to the list of liggghtsCommandsModels and set <N> accordingly. Please refer to the liggghtsCommands page in CFDEMCoupling documentation for details.
caseDir/CFD/constant/liggghtsCommands:
executeProps<N>
{
command
(
write_restart
noBlanks
dotdot
slash
DEM
slash
post
slash
restart
slash
liggghts.restartSequence
);
runFirst off;
runLast on;
runEveryCouplingStep off;
runEveryWriteStep off;
}
To ensure the correct restart file is read, ensure that DEM/in.liggghts_run contains the following line:
caseDir/DEM/in.liggghts_run:
read_restart ../DEM/post/restart/liggghts.restartSequence
#===================================================================#

View File

@ -0,0 +1,191 @@
#===================================================================#
# runAllParTapping
# Tim MJ Nijssen - September 2021
#===================================================================#
NOTE: the runAllParTapping script is very similar and heavily depends on the runAllParSequence script. It is recommend to read the runAllParSequence documentation first.
#===================================================================#
Argument(s):
- casePath (optional): path to the CFDEM case to run (default: cd)
- tappingSettingsPath (optional): path to the tappingSettings file (default: casePath/tappingSettings)
#===================================================================#
Example(s):
- cd ~/CFDEM/user/run/exampleCase
runAllParTapping
- runAllParTapping ~/CFDEM/user/run/exampleCase ~/CFDEM/user/run/exampleCase/TappingSettings
#===================================================================#
Prerequisites:
- sequence_files: directory containing directories for each available set of boundary conditions.
- tappingSettings: file specifying which set of boundary conditions to use with corresponding start and end times.
- liggghts.restartSequence: LIGGGHTS restart file being updated after each step in the sequence.
- variable.dat: OpenFOAM output file containing a variable on which the conditional switching will operate
#===================================================================#
Description:
runAllParTapping runs a parralel CFDEM job using multiple sets of boundary conditions in a conditional sequence. This way, e.g. the conditional opening and closing of a valve can be simulated by alternatingly defining the valve path as a wall or an outlet. runAllParTapping will execute the following tasks:
- preRunAllPar
- duplicate liggghts.restart to liggghts.restartSequence
- for every line in tappingSettings:
-- replace boundary conditions at startTime with the set specified
-- until either the specified condition is met or nRunsMax is reached:
--- update controlDict with the apropriate start and end times
--- runCFDDEMPar
--- check the specified condition, break loop if true
- postRunAllPar
#===================================================================#
sequence_files:
Please refer to the runAllParSequence documentation instead.
#===================================================================#
tappingSettings:
This file is contained in the case directory by default, though an alternative path can be passed as an argument. Every line contains:
- the name of a set of boundary conditions (corresponding with the name of the directory in sequence_files/)
- the name of a variable for the condition to operate on (corresponding with the name of the file in CFD/postProcessing)
- a condition to check (consisting of a boolean operator and a value)
- the interval at which to check the condition (in s)
- the maximum number of checks to preform
C-style and bash-style single-line comments are supported. An example is given below:
caseDir/tappingSettings:
#stepName variable operator value interval (s) nRunsMax
valve_open liquidLevel <= 1.00 10.0 10
valve_closed liquidLevel >= 2.00 10.0 10
valve_open liquidLevel <= 1.00 10.0 10
valve_closed liquidLevel >= 2.00 10.0 10
valve_open liquidLevel <= 1.00 10.0 10
valve_closed liquidLevel >= 2.00 10.0 10
#===================================================================#
liggghts.restartSequence:
Please refer to the runAllParSequence documentation instead.
#===================================================================#
variable.dat:
This file should be contained in CFD/postProcessing, and its should must correspond with the variable in the tappingSettings file. It should be updated on run time to contain the value which the conditional switching should check. Standard OpenFOAM postprocessing procedure can be used to generate this file. This is usually done by adding a function to the controlDict. Examples of such a function and the resulting variable.dat file are given below:
caseDir/CFD/system/controlDict:
[the regular controlDict contents go here]
functions
{
liquidLevel
{
functionObjectLibs ("libutilityFunctionObjects.so");
type coded;
name integral;
executeControl writeTime;
executeInterval 1;
writeControl writeTime;
writeInterval 1;
codeExecute
#{
scalar vesselRadius = 1.0; //m
scalar vesselArea = M_PI*vesselRadius*vesselRadius;
const volScalarField& alphaWater = mesh().lookupObject<volScalarField>("alpha.water");
scalar liquidVol = 0;
forAll (mesh().V(), cellI)
{
liquidVol += alphaWater[cellI]*mesh().V()[cellI];
}
reduce(liquidVol, sumOp<scalar>()); // sum over all processors
scalar liquidLevel = liquidVol/vesselArea;
Info << "liquid level: " << liquidLevel << " m" << endl;
if(Pstream::master()) {
// output file
if(!isDir(mesh().time().path()/".."/"postProcessing"))
mkDir(mesh().time().path()/".."/"postProcessing");
fileName outputFile(mesh().time().path()/".."/"postProcessing"/"liquidLevel.dat");
std::ofstream file;
// header
if(!isFile(outputFile)) {
file.open(outputFile,ios_base::out);
file << "#time(s) \t liquid_lev(m)" << std::endl;
file.close();
}
// output to file
file.open(outputFile,ios_base::out | ios_base::app);
file << mesh().time().value() << " \t";
file << liquidLevel << std::endl;
file.close();
}
#};
}
}
The resulting variable.dat file:
caseDir/CFD/postProcessing/liquidLevel.dat:
#time(s) liquid_lev(m)
0.5 2.000000
1 1.950000
1.5 1.900000
2 1.850000
2.5 1.800000
3 1.750000
3.5 1.700000
4 1.650000
4.5 1.600000
5.5 1.550000
6 1.500000
6.5 1.450000
7 1.400000
7.5 1.350000
8 1.300000
8.5 1.250000
9 1.200000
9.5 1.150000
10 1.100000
#===================================================================#

View File

@ -0,0 +1,46 @@
#!/bin/bash
#===================================================================#
# run settings for case
# Tim MJ Nijssen - September 2021
#===================================================================#
#- decide what run settings to use
if [ -z "$1" ]; then
#- ask runtype if not specified
echo "Please specify runtype (DEM/CFDDEM):"
read runType
else
#- use specified type
runType=$1
fi
#- check runType
if [ "$runType" == DEM ] || [ "$runType" == CFDDEM ]; then
echo "Running settings for $runType"
else
echo "Error: invalid runType"
read
fi
if [ "$runType" == DEM ]; then
#- DEM run settings
nrProcs="8"
runTitle="DEMrun"
headerText="$runTitle"
logfileName="log_DEM"
solverName="in.liggghts_init"
machineFileName="none" # yourMachinefileName | none
debugMode="off"
fi
if [ "$runType" == CFDDEM ]; then
#- CFDDEM run settings
nrProcs="8"
headerText="$runTitle"
logfileName="log_CFDDEM"
solverName="cfdemSolverMultiphaseScalar"
machineFileName="none" # yourMachinefileName | none
debugMode="off" # on | off| strict
testHarnessPath="$CFDEM_TEST_HARNESS_PATH"
fi

View File

@ -0,0 +1,42 @@
#!/bin/bash
#===================================================================#
# construct mesh
#===================================================================#
#--------------------------------------------------------------------------------#
#- run settings file
scriptPath="$( cd "$( dirname "${BASH_SOURCE[0]}" )" &> /dev/null && pwd )"
. $scriptPath/scriptSettings.sh $1
#--------------------------------------------------------------------------------#
cd $casePath/CFD
# blockmesh
if [ -f "$casePath/CFD/constant/polyMesh/blockMeshDict" ]; then
echo "Meshing with blockMesh"
blockMesh
fi
# snappyhexmesh
if [ -f "$casePath/CFD/system/snappyHexMeshDict" ]; then
echo "Meshing with snappyHexMesh"
surfaceFeatureExtract
decomposePar
mpirun -np $nrProcs snappyHexMesh -overwrite -parallel
reconstructParMesh -constant -mergeTol 1e-6
rm -r processor*
fi
# UNV to foam
if ls $casePath/CFD/constant/polyMesh/*.unv 1> /dev/null 2>&1; then
echo "Meshing with ideasUnvToFoam"
ideasUnvToFoam $casePath/CFD/constant/polyMesh/*.unv
fi
cd $currentPath

View File

@ -0,0 +1,101 @@
#!/bin/bash
#===================================================================#
# clean script for case
# Tim MJ Nijssen - September 2021
# Based on: Christoph Goniva - Feb. 2011
#===================================================================#
#--------------------------------------------------------------------------------#
#- run settings file
scriptPath="$( cd "$( dirname "${BASH_SOURCE[0]}" )" &> /dev/null && pwd )"
. $scriptPath/scriptSettings.sh $1
#--------------------------------------------------------------------------------#
#- clean up case
rm -r $casePath/*~
rm -r $casePath/#*#
rm -r $casePath/DEM/*~
rm -r $casePath/DEM/#*#
rm -r $casePath/CFD/*~
rm -r $casePath/CFD/#*#
rm -r $casePath/*.e*
rm -r $casePath/*.o*
rm -r $casePath/log*
rm -r $casePath/CFD/0*
rm -r $casePath/CFD/1*
rm -r $casePath/CFD/2*
rm -r $casePath/CFD/3*
rm -r $casePath/CFD/4*
rm -r $casePath/CFD/5*
rm -r $casePath/CFD/6*
rm -r $casePath/CFD/7*
rm -r $casePath/CFD/8*
rm -r $casePath/CFD/9*
rm -r $casePath/CFD/log*
rm -r $casePath/CFD/org.0/*~
rm -r $casePath/CFD/constant/*~
rm -r $casePath/CFD/system/*~
rm -r $casePath/DEM/*~
rm -r $casePath/CFD/processor*
rm -r $casePath/CFD/clockData
rm -r $casePath/CFD/VTK
rm -r $casePath/CFD/particleProbes
rm -r $casePath/CFD/postProcessing
rm -r $casePath/DEM/log*
rm -r $casePath/DEM/post/dump*
rm -r $casePath/DEM/post/*.vtk
rm -r $casePath/DEM/post/*.txt
#- liggghts restart
if [ -f "$casePath/DEM/post/restart/liggghts.restart" ]; then
echo -n "Clean LIGGGHTS restart file(s)? (y/N)? "
read -t 10 answer
if echo "$answer" | grep -iq "^y" ;then
rm -r $casePath/DEM/post/restart/*
fi
fi
#- CFD mesh
if [ -f "$casePath/CFD/constant/polyMesh/points" ]; then
echo -n "Clean CFD mesh? (y/N)? "
read -t 10 answer
if echo "$answer" | grep -iq "^y" ;then
rm -r $casePath/CFD/constant/extendedFeatureEdgeMesh
rm $casePath/CFD/constant/triSurface/*.eMesh
rm $casePath/CFD/constant/polyMesh/boundary
rm $casePath/CFD/constant/polyMesh/faces
rm $casePath/CFD/constant/polyMesh/neighbour
rm $casePath/CFD/constant/polyMesh/owner
rm $casePath/CFD/constant/polyMesh/points
fi
fi
#- results
if ls $casePath/results* 1> /dev/null 2>&1; then
echo -n "Clean results? (y/N)? "
read -t 10 answer
if echo "$answer" | grep -iq "^y" ;then
rm -r $casePath/results*
fi
fi
#- function objects
if [ -d "$casePath/CFD/dynamicCode" ]; then
echo -n "Clean dynamicCode? (y/N)? "
read -t 10 answer
if echo "$answer" | grep -iq "^y" ;then
rm -r $casePath/CFD/dynamicCode
fi
fi
cd $currentPath

View File

@ -0,0 +1,77 @@
#!/bin/bash
#===================================================================#
# post-run script for case
# Tim MJ Nijssen - September 2021
#===================================================================#
#--------------------------------------------------------------------------------#
#- run settings file
scriptPath="$( cd "$( dirname "${BASH_SOURCE[0]}" )" &> /dev/null && pwd )"
. $scriptPath/scriptSettings.sh $1
#--------------------------------------------------------------------------------#
#- make results directories
dateTime=$(date +%y%m%d_%H%M%S)
resultsPath="$casePath"/results_"$runTitle"_"$dateTime"
mkdir $resultsPath
mkdir $resultsPath/DEM
mkdir $resultsPath/DEM/dump_run
mkdir $resultsPath/CFD
mkdir $resultsPath/log
mkdir $resultsPath/VTK
#- reconstruct and convert CFD data
cd $casePath/CFD
reconstructPar -noLagrangian
foamToVTK
#- move CFD files
mv $casePath/CFD/0* $resultsPath/CFD/
mv $casePath/CFD/1* $resultsPath/CFD/
mv $casePath/CFD/2* $resultsPath/CFD/
mv $casePath/CFD/3* $resultsPath/CFD/
mv $casePath/CFD/4* $resultsPath/CFD/
mv $casePath/CFD/5* $resultsPath/CFD/
mv $casePath/CFD/6* $resultsPath/CFD/
mv $casePath/CFD/7* $resultsPath/CFD/
mv $casePath/CFD/8* $resultsPath/CFD/
mv $casePath/CFD/9* $resultsPath/CFD/
mv $casePath/CFD/particleProbes* $resultsPath/CFD/
mv $casePath/CFD/postProcessing* $resultsPath/CFD/
mv $casePath/CFD/dynamicCode* $resultsPath/CFD/
mv $casePath/CFD/VTK/CFD* $resultsPath/VTK/
cp -r $casePath/CFD/org* $resultsPath/CFD/
cp -r $casePath/CFD/constant $resultsPath/CFD/
cp -r $casePath/CFD/system $resultsPath/CFD/
cp -r $casePath/CFD/clockData $resultsPath/CFD/
#- copy DEM data
cp $casePath/DEM/* $resultsPath/DEM/
cp -r $casePath/DEM/mesh $resultsPath/DEM/
#- move and convert DEM init files
if ls $casePath/DEM/post/*init* 1> /dev/null 2>&1; then
mkdir $resultsPath/DEM/dump_init
mv $casePath/DEM/post/*init* $resultsPath/DEM/dump_init/
cd $resultsPath/DEM/dump_init
python2 $CFDEM_LPP_DIR/lpp.py dump*
mv $resultsPath/DEM/dump_init/*.vtk $resultsPath/VTK/
fi
#- move and convert DEM run files
mv $casePath/DEM/post/*run* $resultsPath/DEM/dump_run/
cd $resultsPath/DEM/dump_run
python2 $CFDEM_LPP_DIR/lpp.py dump*
mv $resultsPath/DEM/dump_run/*.vtk $resultsPath/VTK/
#- copy log files
cp $casePath/log/* $resultsPath/log/
mv $casePath/slurm* $resultsPath/log/
#- return to path
cd $currentPath

View File

@ -0,0 +1,57 @@
#!/bin/bash
#===================================================================#
# all tasks before actual CFD-DEM run
# Tim MJ Nijssen - September 2021
# based on: Christoph Goniva - August 2011
#===================================================================#
#--------------------------------------------------------------------------------#
#- run settings file
scriptPath="$( cd "$( dirname "${BASH_SOURCE[0]}" )" &> /dev/null && pwd )"
. $scriptPath/scriptSettings.sh $1
#--------------------------------------------------------------------------------#
runTitle=$(basename "$casePath")
#- prompt for costum title
echo -n "Add custom simulation title? (y/N)?"
read -t 10 answer
if echo "$answer" | grep -iq "^y" ;then
echo -n "Enter simulation title:"
read runTitle
fi
#- run DEM init
if [ -f "$casePath/DEM/in.liggghts_init" ]; then
if [ -f "$casePath/DEM/post/restart/liggghts.restart" ]; then
echo "preRunAllPar: Using existing restart file"
else
echo "preRunAllPar: Running DEM init"
. $scriptPath/runDEMPar.sh $casePath
fi
fi
#- copy 0.org
echo "preRunAllPar: Copying 0.org"
cp -r $casePath/CFD/org.0 $casePath/CFD/0
#- mesh
if [ -f "$casePath/CFD/constant/polyMesh/points" ]; then
echo "preRunAllPar: using old mesh"
else
echo "preRunAllPar: Building mesh"
. $scriptPath/buildMesh.sh $casePath > $logPath/log.mesh
fi
#- set fields
if [ -f "$casePath/CFD/system/setFieldsDict" ]; then
echo "preRunAllPar: Setting fields"
cd $casePath/CFD
setFields
fi
#- decompose
echo "preRunAllPar: Decomposing"
cd $casePath/CFD
decomposePar
cd $currentPath

View File

@ -0,0 +1,210 @@
#!/usr/bin/perl
#===================================================================#
#
# replaceBC: replace boundary conditions in OpenFOAM files
# Tim MJ Nijssen - Oktober 2019
#
# called as:
# perl replaceBC.pl oPath rPath nPath
#
# oPath: path to original file containing BCs
# rPath: path to file containing BCs to be substituted in oFile
# nPath: path where the updated file will be written to
#
# explaination of variable names:
# o refers to the original file
# r refers to the replacement file
# n refers to the new file
#
#===================================================================#
use strict;
use warnings;
# read input from commandline
my $oPath = $ARGV[0];
my $rPath = $ARGV[1];
my $nPath = $ARGV[2];
# throw error if one of the files is missing
if ($oPath eq '') {
die "No path to original file supplied";
}
if ($rPath eq '') {
die "No path to replacement file supplied";
}
if ($nPath eq '') {
die "No path to new file supplied";
}
# read file into array
open(my $input1, "<", $oPath) or die "Can't open original file";
my @oFile = <$input1>;
open(my $input2, "<", $rPath) or die "Can't open replacement file";
my @rFile = <$input2>;
open(my $output, ">", $nPath) or die "Can't open new file";
my @nFile = @oFile;
my $rStartLine = -1; # line index patch starts at (-1 is not found)
my $rEndLine = -1; # line index patch ends at (-1 is not found)
my $rPatchName = ""; # name of patch
my $rMultiComment = 0; # inside multi-line comment
my $rCodeBlock = 0; # inside code block
for (my $i=0; $i<@rFile; $i++) {
my $rLine = $rFile[$i]; # current line
my $rLineCompress = join('',split(" ",$rLine)); # remove all whitespace
# remove single-line comments
if ($rLineCompress=~'//') {
$rLineCompress = substr($rLineCompress, 0, index($rLineCompress, '//'));
}
# remove multi-line comments
if (!$rMultiComment && $rLineCompress=~'/[*]') {
# get part before /*
$rLineCompress = substr($rLineCompress, 0, index($rLineCompress, '/[*]')+1);
$rMultiComment = 1;
}
if ($rMultiComment && $rLineCompress=~'[*]/') {
# get part after */
(undef, $rLineCompress) = split('[*]/',$rLineCompress);
$rMultiComment = 0;
}
# remove code blocks
if (!$rCodeBlock && $rLineCompress=~'#\{') {
# get part before #{
$rLineCompress = substr($rLineCompress, 0, index($rLineCompress, '#\{')+1);
$rCodeBlock = 1;
}
if ($rCodeBlock && $rLineCompress=~'#\};') {
# get part after #};
(undef, $rLineCompress) = split('#\};',$rLineCompress);
$rCodeBlock = 0;
}
if (!($rMultiComment|$rCodeBlock)) {
# if no patch start found, look for one
if ($rStartLine==-1) {
if (!length($rLineCompress)==0) { # if line is not empty
$rStartLine = $i;
$rEndLine = -1;
$rPatchName = $rLineCompress;
$rPatchName =~ s/{//; # remove { from patch name
print("Patch $rPatchName starts at line $rStartLine of replacement file\n");
}
}
# if patch start is found, look for end
else {
if ($rLineCompress=~/}/) { # if line contains }
$rEndLine = $i;
print("Patch $rPatchName ends at line $rEndLine of replacement file\n");
# find patch in original file
my $oStartLine = -1; # line index patch starts at (-1 is not found)
my $oEndLine = -1; # line index patch ends at (-1 is not found)
my $oMultiComment = 0; # inside multi-line comment
my $oCodeBlock = 0; # inside code block
for (my $j=0; $j<@nFile; $j++) { # nFile is the latest version of oFile
my $oLine = $nFile[$j]; # current line
my $oLineCompress = join('',split(" ",$oLine)); # remove all whitespace
# remove single-line comments
if ($oLineCompress=~'//') {
$oLineCompress = substr($rLineCompress, 0, index($rLineCompress, '//'));
}
# remove multi-line comments
if (!$oMultiComment && $oLineCompress=~'/[*]') {
# get part before /*
$oLineCompress = substr($oLineCompress, 0, index($oLineCompress, '/[*]')+1);
$oMultiComment = 1;
}
if ($oMultiComment && $oLineCompress=~'[*]/') {
# get part after */
(undef, $oLineCompress) = split('[*]/',$oLineCompress);
$oMultiComment = 0;
}
# remove code blocks
if (!$oCodeBlock && $oLineCompress=~'#\{') {
# get part before #{
$oLineCompress = substr($oLineCompress, 0, index($oLineCompress, '#\{')+1);
$oCodeBlock = 1;
}
if ($oCodeBlock && $oLineCompress=~'#\};') {
# get part after #};
(undef, $oLineCompress) = split('#\};',$oLineCompress);
$oCodeBlock = 0;
}
if (!($oMultiComment|$oCodeBlock)) {
# if no matching patch is found, look for one
if ($oStartLine==-1) {
if ($oLine=~/$rPatchName/) {
$oStartLine = $j;
print("Patch $rPatchName starts at line $oStartLine of original file\n");
}
# if end of file is reached without finding matching patch, throw warning
if ($j==(@nFile-1)) {
print("WARNING: Patch $rPatchName not found in original file\n");
}
}
# if matching patch is found, look for end
else {
if ($oLineCompress=~/}/) {
$oEndLine = $j;
print("Patch $rPatchName ends at line $oEndLine of original file\n");
print("replaceBC: replacing patch $rPatchName\n");
# replace patch in original file with patch in replacement file
# start with original part before patch
my @tempFile = @nFile[0..($oStartLine-1)];
# add replacement patch
push(@tempFile,@rFile[($rStartLine)..($rEndLine)]);
# add original part after patch
push(@tempFile,@nFile[($oEndLine+1)..(@nFile-1)]);
# update nFile
@nFile = @tempFile;
last; # break loop, return to scanning replacement file for next patch
}
else {
# throw error if end of patch is not found
if ($j==(@nFile-1)) {
die "End of patch $rPatchName not found in original file"
}
}
}
}
}
# reset for next replacement
$rPatchName = "";
$rStartLine = -1;
}
else {
# throw error if end of patch is not found
if ($i==(@rFile-1)) {
die "End of patch $rPatchName not found in replacement file"
}
}
}
}
}
# print new file
print $output @nFile;

View File

@ -0,0 +1,26 @@
#!/bin/bash
#===================================================================#
# allrun script
# Tim MJ Nijssen - September 2021
# based on: Christoph Goniva - August 2011
#===================================================================#
#--------------------------------------------------------------------------------#
#- run settings file
scriptPath="$( cd "$( dirname "${BASH_SOURCE[0]}" )" &> /dev/null && pwd )"
. $scriptPath/scriptSettings.sh $1
#--------------------------------------------------------------------------------#
#- do all tasks before actual run
echo "runAllPar: calling preRunAllPar"
. $scriptPath/preRunAllPar.sh $casePath
#- run parallel CFD-DEM
echo "runAllPar: Running CFD-DEM"
. $scriptPath/runCFDDEMPar.sh $casePath
#- do all tasks after actual run
echo "runAllPar: calling postRunAllPar"
. $scriptPath/postRunAllPar.sh $casePath

View File

@ -0,0 +1,86 @@
#!/bin/bash
#===================================================================#
# allrun sequential script
# Tim MJ Nijssen - September 2021
#===================================================================#
#--------------------------------------------------------------------------------#
#- run settings file
scriptPath="$( cd "$( dirname "${BASH_SOURCE[0]}" )" &> /dev/null && pwd )"
. $scriptPath/scriptSettings.sh $1
#--------------------------------------------------------------------------------#
#- find sequenceSettings file
if [ -z "$2" ]; then
#- current path if not other specified
sequenceSettingsPath=$casePath/sequenceSettings
else
#- read input
sequenceSettingsPath="$(dirname "$(readlink -f $2)/.")"
fi
#- other paths
boundaryFilesPath=$casePath/boundary_files
#- do all tasks before actual run
perl $scriptPath/updateControlDict.pl $casePath/CFD/system/controlDict $casePath/CFD/system/controlDict 0 ' ' # set startTime to 0 before decomposing
. $scriptPath/preRunAllPar.sh $casePath
echo "RunAllParSequence: duplicating LIGGGHTS restart file"
cp $casePath/DEM/post/restart/liggghts.restart $casePath/DEM/post/restart/liggghts.restartSequence # duplicate restart file to restartSequence
#- read sequenceSettings file line by line
while IFS= read -r stepLine || [[ -n "$stepLine" ]]; do
if [ ! -z "$stepLine" ]; then # skip empty lines
if [ "${stepLine:0:1}" != "#" ]; then # skip bash style comments
if [ "${stepLine:0:2}" != "//" ] ; then # skip c style comments
stepWords=( $stepLine );
stepName=${stepWords[0]}
startTime=${stepWords[1]}
endTime=${stepWords[2]}
echo "runAllParSequence: running step $stepName from t=$startTime to t=$endTime"
# update start and end times in controlDict
perl $scriptPath/updateControlDict.pl $casePath/CFD/system/controlDict $casePath/CFD/system/controlDict $startTime $endTime
# find and update boundary conditions
for timeDir in $casePath/CFD/processor0/*/ ; do # loop over time directories
timeName=$(basename $timeDir) # get time folder name
# check if numeric
re='^[0-9]+([.][0-9]+)?$'
if [[ $timeName =~ $re ]] ; then
# find startTime folder
if (( $(echo "$timeName == $startTime" |bc -l) )); then
for rFile in $boundaryFilesPath/$stepName/* ; do # loop over replacement files
if [ "${rFile: -1}" != "~" ]; then # skip temp files
rFileName=$(basename $rFile) # get file name
echo "runAllParSequence: updating boundary conditions in processor*/$timeName/$rFileName"
for procDir in $casePath/CFD/processor* ; do # loop over processor directories
oFile="$procDir/$timeName/$rFileName" # path to original file in CFD/processorX/time
perl $scriptPath/replaceBC.pl $oFile $rFile $oFile # update boundary conditions
done
fi
done
fi
fi
done
#- run parallel CFD-DEM
echo "runAllParSequence: Running CFD-DEM"
. $scriptPath/runCFDDEMPar.sh $casePath </dev/null
fi
fi
fi
done < "$sequenceSettingsPath"
#- do all tasks after actual run
perl $scriptPath/updateControlDict.pl $casePath/CFD/system/controlDict $casePath/CFD/system/controlDict 0 ' ' # set startTime to 0 before reconstructing
. $scriptPath/postRunAllPar.sh $casePath

View File

@ -0,0 +1,165 @@
#!/bin/bash
#===================================================================#
# allrun conditional sequential script
# Tim MJ Nijssen - September 2021
#===================================================================#
#--------------------------------------------------------------------------------#
#- run settings file
scriptPath="$( cd "$( dirname "${BASH_SOURCE[0]}" )" &> /dev/null && pwd )"
. $scriptPath/scriptSettings.sh $1
#--------------------------------------------------------------------------------#
#- find sequenceSettings file
if [ -z "$2" ]; then
#- current path if not other specified
tappingSettingsPath=$casePath/tappingSettings
else
#- read input
tappingSettingsPath="$(dirname "$(readlink -f $2)/.")"
fi
#- other paths
boundaryFilesPath=$casePath/boundary_files
#- search for startTime setting
sequenceStartTime=0
while IFS= read -r line || [[ -n "$line" ]]; do
if [ ! -z "$line" ]; then # skip empty lines
if [ "${line:0:1}" != "#" ]; then # skip bash style comments
if [ "${line:0:2}" != "//" ] ; then # skip c style comments
if [ "${line:0:9}" == "startTime" ] ; then # read startTime from file
timeWords=( $line );
timeSetting=${timeWords[1]}
# check if numeric
re='^[0-9]+([.][0-9]+)?$'
if [[ $timeSetting =~ $re ]] ; then
echo "RunAllParSequence: found startTime=$timeSetting"
sequenceStartTime=$timeSetting
break
else
echo "RunAllParSequence: ERROR invalid startTime setting: $timeSetting"
return 1
fi
fi
fi
fi
fi
done < "$tappingSettingsPath"
#- do all tasks before actual run
echo "RunAllParSequence: setting time to $sequenceStartTime"
perl $scriptPath/updateControlDict.pl $casePath/CFD/system/controlDict $casePath/CFD/system/controlDict $sequenceStartTime ' ' # set startTime before decomposing
currentTime=$sequenceStartTime
. $scriptPath/preRunAllPar.sh $casePath
if (( $sequenceStartTime == 0 )); then
echo "RunAllParSequence: duplicating LIGGGHTS restart file"
cp $casePath/DEM/post/restart/liggghts.restart $casePath/DEM/post/restart/liggghts.restartSequence # duplicate restart file to restartSequence
else
echo "RunAllParSequence: starting from existing restartSequence file"
fi
#- read sequenceSettings file line by line
while IFS= read -r stepLine || [[ -n "$stepLine" ]]; do
if [ ! -z "$stepLine" ]; then # skip empty lines
if [ "${stepLine:0:1}" != "#" ]; then # skip bash style comments
if [ "${stepLine:0:2}" != "//" ] ; then # skip c style comments
if [ "${stepLine:0:9}" != "startTime" ] ; then # skip startTime line
stepWords=( $stepLine );
stepName=${stepWords[0]}
variable=${stepWords[1]}
operator=${stepWords[2]}
value=${stepWords[3]}
interval=${stepWords[4]}
nRunsMax=${stepWords[5]}
echo "runAllParTapping: running step $stepName until $variable $operator $value"
#- find and update boundary conditions
for timeDir in $casePath/CFD/processor0/*/ ; do # loop over time directories
timeName=$(basename $timeDir) # get time folder name
# check if numeric
re='^[0-9]+([.][0-9]+)?$'
if [[ $timeName =~ $re ]] ; then
# find startTime folder
if (( $(echo "$timeName == $currentTime" |bc -l) )); then
for rFile in $boundaryFilesPath/$stepName/* ; do # loop over replacement files
if [ "${rFile: -1}" != "~" ]; then # skip temp files
rFileName=$(basename $rFile) # get file name
echo "runAllParTapping: updating boundary conditions in processor*/$timeName/$rFileName"
for procDir in $casePath/CFD/processor* ; do # loop over processor directories
oFile="$procDir/$timeName/$rFileName" # path to original file in CFD/processorX/time
perl $scriptPath/replaceBC.pl $oFile $rFile $oFile # update boundary conditions
done
fi
done
fi
fi
done
#- loop up to the maximum number of runs
for (( iRun=1; iRun<=$nRunsMax; iRun++ )); do
startTime=$currentTime
endTime=$(echo $currentTime + $interval | bc)
# update start and end times in controlDict
perl $scriptPath/updateControlDict.pl $casePath/CFD/system/controlDict $casePath/CFD/system/controlDict $startTime $endTime
#- run parallel CFD-DEM
echo "runAllParTapping: Running CFD-DEM (nRuns = $iRun)"
. $scriptPath/runCFDDEMPar.sh $casePath </dev/null
#- update current time
currentTime=$endTime
#- check for maximum number of runs
if (( $iRun == $nRunsMax )); then
echo "runAllParTapping: maximum number of runs ($nRunsMax) reached, proceeding to next step"
break
fi
#- find the variable
variablePath="$casePath/CFD/postProcessing/$variable.dat"
if [ ! -f "$variablePath" ]; then
echo "runAllParTapping: ERROR $variablePath does not exist"
return 1
fi
#- read variable
lastLine=$( tail -n 1 $variablePath )
lastWord=`echo ${lastLine##* }`
echo "runAllParTapping: $variable = $lastWord"
#- check condition
condition="$lastWord $operator $value"
goToNextStep=$(echo $condition | bc -l )
#- do another run or skip to next step
if (( $goToNextStep == 1 )); then
echo "runAllParTapping: $variable $operator $value returned TRUE, proceeding to next step"
break
else
echo "runAllParTapping: $variable $operator $value returned FALSE, doing another run"
fi
done
fi
fi
fi
fi
done < "$tappingSettingsPath"
#- do all tasks after actual run
perl $scriptPath/updateControlDict.pl $casePath/CFD/system/controlDict $casePath/CFD/system/controlDict $sequenceStartTime ' ' # set startTime before reconstructing
. $scriptPath/postRunAllPar.sh $casePath

View File

@ -0,0 +1,56 @@
#!/bin/bash
#===================================================================#
# CFDDEMrun script for case
# Tim MJ Nijssen - September 2021
# based on: Christoph Goniva - May. 2011
#===================================================================#
#- include functions
source $CFDEM_PROJECT_DIR/etc/functions.sh
#--------------------------------------------------------------------------------#
#- run settings file
scriptPath="$( cd "$( dirname "${BASH_SOURCE[0]}" )" &> /dev/null && pwd )"
. $scriptPath/scriptSettings.sh $1
#--------------------------------------------------------------------------------#
#- run case settings file
. $casePath/runSettings.sh "CFDDEM"
#--------------------------------------------------------------------------------#
cd $casePath/CFD
if [ $debugMode == "on" ]; then
debugMode="valgrind"
elif [ $debugMode == "strict" ]; then
debugMode="valgrind --tool=memcheck --leak-check=yes --show-reachable=yes --num-callers=20 --track-fds=yes"
else
debugMode=""
fi
#- make proc dirs visible
count=0
for i in `seq $nrProcs`
do
let count=$i-1
(cd $casePath/CFD/processor$count && touch file.foam)
done
#- header
echo 2>&1 | tee -a /$logpath/$logfileName
echo "// $headerText //" 2>&1 | tee -a $logpath/$logfileName
echo 2>&1 | tee -a $logpath/$logfileName
#- write path
pwd 2>&1 | tee -a $logpath/$logfileName
echo 2>&1 | tee -a $logpath/$logfileName
#- run applictaion
if [[ $machineFileName == "none" ]]; then
mpirun -np $nrProcs $debugMode $solverName -parallel 2>&1 | tee -a $logpath/$logfileName
else
mpirun -machinefile $machineFileName -np $nrProcs $debugMode $solverName -parallel 2>&1 | tee -a $logpath/$logfileName
fi
#- return
cd $currentPath

View File

@ -0,0 +1,27 @@
#!/bin/bash
#===================================================================#
# DEMrun script for case (init)
# Tim MJ Nijssen - September 2021
# based on: Daniel Queteschiner - June 2014
#===================================================================#
#- include functions
source $CFDEM_PROJECT_DIR/etc/functions.sh
#--------------------------------------------------------------------------------#
#- run settings file
scriptPath="$( cd "$( dirname "${BASH_SOURCE[0]}" )" &> /dev/null && pwd )"
. $scriptPath/scriptSettings.sh $1
#--------------------------------------------------------------------------------#
#- run case settings file
. $casePath/runSettings.sh "DEM"
#--------------------------------------------------------------------------------#
echo $logPath $logfileName $casePath $headerText $solverName $nrProcs $machineFileName $debugMode
#- call function to run DEM case
parDEMrun $logPath $logfileName $casePath $headerText $solverName $nrProcs $machineFileName $debugMode
#- return
cd $currentPath

View File

@ -0,0 +1,23 @@
#!/bin/bash
#===================================================================#
# sets variables for CFDEM utility scripts
# Tim MJ Nijssen - September 2021
#===================================================================#
#- casepath
currentPath=$(pwd)
if [ -z "$1" ]; then
#- parent directory if no other path is specified
casePath="$(dirname "$scriptPath")"
else
#- read input
casePath="$(dirname "$(readlink -f $1)/.")"
fi
#- other paths
logPath=$casePath/log
mkdir $logPath

View File

@ -0,0 +1,119 @@
#!/usr/bin/perl
#===================================================================#
#
# updateControlDict: update OpenFOAM controlDict with new start/endtimes
# Tim MJ Nijssen - Oktober 2019
#
# called as:
# perl updateControlDict.pl oPath nPath startTime endTime
#
# oPath: path to original constroldict
# nPath: path where the updated controlDict will be written to
# nStartTime: new value of startTime. Leave empty (use ' ') to leave unchanged.
# nEndTime: new value of endTime. Leave empty (use ' ') to leave unchanged.
#
# explaination of variable names:
# o refers to the original file
# r refers to the replacement file
# n refers to the new file
#
#===================================================================#
use strict;
use warnings;
use Scalar::Util qw(looks_like_number);
# read input from commandline
my $oPath = $ARGV[0];
my $nPath = $ARGV[1];
my $nStartTime = $ARGV[2];
my $nEndTime = $ARGV[3];
my $updateStartTime = 0;
my $updateEndTime = 0;
# throw error if one of the files is missing
if ($oPath eq '') {
die "No path to original file supplied";
}
if ($nPath eq '') {
die "No path to new file supplied";
}
# read startTime input
if ($nStartTime eq ''|| $nStartTime eq ' ') {
print("updateControlDict: Leaving startTime unchanged\n");
}
else {
if (looks_like_number($nStartTime)) {
$updateStartTime = 1;
}
else {
die "startTime is non-numeric";
}
}
# read endTime input
if ($nEndTime eq ''|| $nEndTime eq ' ') {
print("updateControlDict: Leaving endTime unchanged\n");
}
else {
if (looks_like_number($nEndTime)) {
$updateEndTime = 1;
}
else {
die "endTime is non-numeric";
}
}
# read file into array
open(my $input1, "<", $oPath) or die "Can't open original file";
my @oFile = <$input1>;
open(my $output, ">", $nPath) or die "Can't open new file";
my @nFile = @oFile;
for (my $i=0; $i<@nFile; $i++) {
my $line = $nFile[$i]; # current line
my @words = split(' ',$line);
if (@words == 2) {
if ($updateStartTime && $words[0]=~'startTime') {
my $oStartTime = $words[1];
$oStartTime =~ s/;//; # remove ; from number
# throw error if original startTime is non-numeric
if (!looks_like_number($oStartTime)) {
die "startTime in original file is non-numeric";
}
# replace number
print("updateControlDict: Updating startTime from $oStartTime to $nStartTime\n");
$line =~ s/$oStartTime/$nStartTime/;
# write new line to array
$nFile[$i] = $line;
}
if ($updateEndTime && $words[0]=~'endTime') {
my $oEndTime = $words[1];
$oEndTime =~ s/;//; # remove ; from number
# throw error if original endTime is non-numeric
if (!looks_like_number($oEndTime)) {
die "startTime in original file is non-numeric";
}
# replace number
print("updateControlDict: Updating endTime from $oEndTime to $nEndTime\n");
$line =~ s/$oEndTime/$nEndTime/;
# write new line to array
$nFile[$i] = $line;
}
}
}
# print new file
print $output @nFile;

View File

@ -0,0 +1,7 @@
#stepName startTime endTime
taphole_open 00.0 10.0
taphole_closed 10.0 20.0
taphole_open 20.0 30.0
taphole_closed 30.0 40.0
taphole_open 40.0 50.0
taphole_closed 50.0 60.0

View File

@ -0,0 +1,7 @@
#stepName variable operator value interval nRunsMax
taphole_open liquidLevel <= 0.30 5.0 20
taphole_closed liquidLevel >= 0.40 5.0 20
taphole_open liquidLevel <= 0.30 5.0 20
taphole_closed liquidLevel >= 0.40 5.0 20
taphole_open liquidLevel <= 0.30 5.0 20
taphole_closed liquidLevel >= 0.40 5.0 20

View File

@ -0,0 +1,259 @@
/*---------------------------------------------------------------------------*\
| ========= | |
| \\ / F ield | OpenFOAM: The Open Source CFD Toolbox |
| \\ / O peration | Version: 1.4 |
| \\ / A nd | Web: http://www.openfoam.org |
| \\/ M anipulation | |
\*---------------------------------------------------------------------------*/
FoamFile
{
version 2.0;
format ascii;
root "";
case "";
instance "";
local "";
class dictionary;
object couplingProperties;
}
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
//===========================================================================//
// sub-models & settings
syncMode false;
modelType "A";
couplingInterval 100;
voidFractionModel divided;
locateModel engine;
meshMotionModel noMeshMotion;
regionModel allRegion;
IOModel basicIO;
probeModel off;//particleProbe;
dataExchangeModel twoWayMPI;
averagingModel dense;
clockModel standardClock;
smoothingModel constDiffSmoothing;//off;
//useDDTvoidfraction;
forceModels
(
gradPForce//Smooth
viscForce
Archimedes
BeetstraDrag
//DiFeliceDrag
//KochHillDrag
//GidaspowDrag
//SchillerNaumannDrag
virtualMassForce
MeiLift
ParmarBassetForce
dSauter
);
getParticleDensities true;
getParticleAngVels true;
momCoupleModels
(
implicitCouple
);
turbulenceModelType "turbulenceProperties";
//===========================================================================//
// sub-model properties
particleProbeProps
{
particleIDsToSample (0 1000 2000 3000 4000 5000);
verboseToFile;
verbose;
printEvery 500;
sampleAll;
probeDebug;
includePosition;
writePrecision 4;
}
ParmarBassetForceProps
{
velFieldName "U";
granVelFieldName "Us";
useUs true;
interpolation true;
nIntegral 20;
discretisationOrder 1;
smoothingModel constDiffAndTemporalSmoothing;
constDiffAndTemporalSmoothingProps
{
lowerLimit 1e-8;
upperLimit 1e8;
smoothingLength 0.0015; // dp
smoothingStrength 0.01; // timescale = dt/gamma
correctBoundary true;
}
}
BeetstraDragProps
{
velFieldName "U";
granVelFieldName "Us";
voidfractionFieldName "voidfraction";
interpolation true;
verbose false;
polydisperse false;
implForceDEM true;
dSauterFieldName "voidfraction";
suppressProbe true;
}
DiFeliceDragProps
{
velFieldName "U";
granVelFieldName "Us";
voidfractionFieldName "voidfraction";
interpolation true;
verbose false;
implForceDEM true;
}
KochHillDragProps
{
velFieldName "U";
granVelFieldName "Us";
voidfractionFieldName "voidfraction";
interpolation true;
verbose false;
implForceDEM true;
}
GidaspowDragProps
{
velFieldName "U";
granVelFieldName "Us";
voidfractionFieldName "voidfraction";
interpolation true;
verbose false;
implForceDEM true;
phi 1.0;
}
SchillerNaumannDragProps
{
velFieldName "U";
granVelFieldName "Us";
voidfractionFieldName "voidfraction";
interpolation true;
verbose false;
implForceDEM true;
}
virtualMassForceProps
{
velFieldName "U";
voidfractionFieldName "voidfraction";
granVelFieldName "Us";
phiFieldName "phi";
useUs true;
useFelderhof true;
interpolation true;
smoothingModel constDiffAndTemporalSmoothing;
constDiffAndTemporalSmoothingProps
{
lowerLimit 1e-8;
upperLimit 1e8;
smoothingLength 0.0015; // dp
smoothingStrength 0.01; // timescale = dt/gamma
correctBoundary true;
}
}
MeiLiftProps
{
velFieldName "U";
useShearInduced true;
useSpinInduced true;
combineShearSpin false;
interpolation true;
verbose false;
}
dSauterProps
{
}
ArchimedesProps
{
gravityFieldName "g";
treatForceDEM true; // needed for models "A" or "Bfull"
}
gradPForceProps
{
pFieldName "p";
voidfractionFieldName "voidfraction";
velocityFieldName "U";
interpolation true;
}
gradPForceSmoothProps
{
pFieldName "p";
voidfractionFieldName "voidfraction";
velocityFieldName "U";
smoothingModel "temporalSmoothing";
temporalSmoothingProps
{
lowerLimit 1e-8;
upperLimit 1e8;
refField "p";
gamma 0.01; // timescale = dt/gamma
}
}
viscForceProps
{
velocityFieldName "U";
interpolation true;
}
constDiffSmoothingProps
{
lowerLimit 1e-8;
upperLimit 1e8;
smoothingLength 0.0015; //dp
}
engineProps
{
treeSearch true;
}
dividedProps
{
alphaMin 0.01;
scaleUpVol 1.0;
}
twoWayMPIProps
{
liggghtsPath "../DEM/in.liggghts_run";
}
implicitCoupleProps
{
velFieldName "U";
granVelFieldName "Us";
voidfractionFieldName "voidfraction";
}
// ************************************************************************* //

View File

@ -0,0 +1,22 @@
/*--------------------------------*- C++ -*----------------------------------*\
| ========= | |
| \\ / F ield | OpenFOAM: The Open Source CFD Toolbox |
| \\ / O peration | Version: 1.6 |
| \\ / A nd | Web: www.OpenFOAM.org |
| \\/ M anipulation | |
\*---------------------------------------------------------------------------*/
FoamFile
{
version 2.0;
format ascii;
class uniformDimensionedVectorField;
location "constant";
object g;
}
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
dimensions [0 1 -2 0 0 0 0];
value ( 0 0 -9.81);
// ************************************************************************* //

View File

@ -0,0 +1,43 @@
/*---------------------------------------------------------------------------*\
| ========= | |
| \\ / F ield | OpenFOAM: The Open Source CFD Toolbox |
| \\ / O peration | Version: 1.4 |
| \\ / A nd | Web: http://www.openfoam.org |
| \\/ M anipulation | |
\*---------------------------------------------------------------------------*/
FoamFile
{
version 2.0;
format ascii;
root "";
case "";
instance "";
local "";
class dictionary;
object liggghtsCommands;
}
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
liggghtsCommandModels
(
runLiggghts
writeLiggghts
);
// ************************************************************************* //
/*runLiggghtsProps
{
preNo false;
}*/
writeLiggghtsProps
{
writeLast on;
writeName "post/restart/liggghts.restartCFDEM";
overwrite on;
}

File diff suppressed because it is too large Load Diff

View File

@ -0,0 +1,23 @@
/*--------------------------------*- C++ -*----------------------------------*\
| ========= | |
| \\ / F ield | OpenFOAM: The Open Source CFD Toolbox |
| \\ / O peration | Version: 1.6 |
| \\ / A nd | Web: www.OpenFOAM.org |
| \\/ M anipulation | |
\*---------------------------------------------------------------------------*/
FoamFile
{
version 2.0;
format ascii;
class dictionary;
location "constant";
object transportProperties;
}
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
transportModel Newtonian;
nu nu [ 0 2 -1 0 0 0 0 ] 1.00708e-06;
}
// ************************************************************************* //

View File

@ -0,0 +1,31 @@
/*--------------------------------*- C++ -*----------------------------------*\
| ========= | |
| \\ / F ield | OpenFOAM: The Open Source CFD Toolbox |
| \\ / O peration | Version: 1.6 |
| \\ / A nd | Web: www.OpenFOAM.org |
| \\/ M anipulation | |
\*---------------------------------------------------------------------------*/
FoamFile
{
version 2.0;
format ascii;
class dictionary;
location "constant";
object turbulenceProperties;
}
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
simulationType laminar;
/*
simulationType RAS;
RAS
{
RASModel kEpsilon;
turbulence on;
printCoeffs on;
} */
// ************************************************************************* //

View File

@ -0,0 +1,39 @@
/*--------------------------------*- C++ -*----------------------------------*\
| ========= | |
| \\ / F ield | OpenFOAM: The Open Source CFD Toolbox |
| \\ / O peration | Version: 1.6 |
| \\ / A nd | Web: www.OpenFOAM.org |
| \\/ M anipulation | |
\*---------------------------------------------------------------------------*/
FoamFile
{
version 2.0;
format ascii;
class volScalarField;
location "0";
object Ksl;
}
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
dimensions [1 -3 -1 0 0 0 0];
internalField uniform 0;
boundaryField
{
inlet
{
type zeroGradient;
}
outlet
{
type zeroGradient;
}
walls
{
type zeroGradient;
}
}
// ************************************************************************* //

View File

@ -0,0 +1,40 @@
/*--------------------------------*- C++ -*----------------------------------*\
| ========= | |
| \\ / F ield | OpenFOAM: The Open Source CFD Toolbox |
| \\ / O peration | Version: 4.x |
| \\ / A nd | Web: www.OpenFOAM.org |
| \\/ M anipulation | |
\*---------------------------------------------------------------------------*/
FoamFile
{
version 2.0;
format ascii;
class volVectorField;
location "0";
object U;
}
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
dimensions [0 1 -1 0 0 0 0];
internalField uniform (0 0 0);
boundaryField
{
inlet
{
type fixedValue;
value uniform (0 0 0.142);
}
outlet
{
type zeroGradient;
}
walls
{
type slip;
}
}
// ************************************************************************* //

View File

@ -0,0 +1,39 @@
/*--------------------------------*- C++ -*----------------------------------*\
| ========= | |
| \\ / F ield | OpenFOAM: The Open Source CFD Toolbox |
| \\ / O peration | Version: 1.6 |
| \\ / A nd | Web: www.OpenFOAM.org |
| \\/ M anipulation | |
\*---------------------------------------------------------------------------*/
FoamFile
{
version 2.0;
format ascii;
class volVectorField;
location "0";
object Us;
}
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
dimensions [0 1 -1 0 0 0 0];
internalField uniform (0 0 0);
boundaryField
{
inlet
{
type zeroGradient;
}
outlet
{
type zeroGradient;
}
walls
{
type zeroGradient;
}
}
// ************************************************************************* //

View File

@ -0,0 +1,40 @@
/*--------------------------------*- C++ -*----------------------------------*\
| ========= | |
| \\ / F ield | OpenFOAM: The Open Source CFD Toolbox |
| \\ / O peration | Version: 4.x |
| \\ / A nd | Web: www.OpenFOAM.org |
| \\/ M anipulation | |
\*---------------------------------------------------------------------------*/
FoamFile
{
version 2.0;
format ascii;
class volScalarField;
location "0";
object p;
}
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
dimensions [0 2 -2 0 0 0 0];
internalField uniform 0;
boundaryField
{
inlet
{
type zeroGradient;
}
outlet
{
type fixedValue;
value uniform 0;
}
walls
{
type zeroGradient;
}
}
// ************************************************************************* //

View File

@ -0,0 +1,37 @@
/*--------------------------------*- C++ -*----------------------------------*\
| ========= | |
| \\ / F ield | OpenFOAM: The Open Source CFD Toolbox |
| \\ / O peration | Version: 1.6 |
| \\ / A nd | Web: http://www.OpenFOAM.org |
| \\/ M anipulation | |
\*---------------------------------------------------------------------------*/
FoamFile
{
version 2.0;
format ascii;
class volScalarField;
object rho;
}
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
dimensions [1 -3 0 0 0 0 0];
internalField uniform 998.20413;
boundaryField
{
inlet
{
type zeroGradient;
}
outlet
{
type zeroGradient;
}
walls
{
type zeroGradient;
}
}
// ************************************************************************* //

View File

@ -0,0 +1,37 @@
/*--------------------------------*- C++ -*----------------------------------*\
| ========= | |
| \\ / F ield | OpenFOAM: The Open Source CFD Toolbox |
| \\ / O peration | Version: 1.6 |
| \\ / A nd | Web: http://www.OpenFOAM.org |
| \\/ M anipulation | |
\*---------------------------------------------------------------------------*/
FoamFile
{
version 2.0;
format ascii;
class volScalarField;
object sSmoothField;
}
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
dimensions [0 1 0 0 0 0 0];
internalField uniform 0;
boundaryField
{
inlet
{
type zeroGradient;
}
outlet
{
type zeroGradient;
}
walls
{
type zeroGradient;
}
}
// ************************************************************************* //

View File

@ -0,0 +1,37 @@
/*--------------------------------*- C++ -*----------------------------------*\
| ========= | |
| \\ / F ield | OpenFOAM: The Open Source CFD Toolbox |
| \\ / O peration | Version: 1.6 |
| \\ / A nd | Web: http://www.OpenFOAM.org |
| \\/ M anipulation | |
\*---------------------------------------------------------------------------*/
FoamFile
{
version 2.0;
format ascii;
class volVectorField;
object vSmoothField;
}
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
dimensions [0 1 0 0 0 0 0];
internalField uniform (0 0 0);
boundaryField
{
inlet
{
type zeroGradient;
}
outlet
{
type zeroGradient;
}
walls
{
type zeroGradient;
}
}
// ************************************************************************* //

View File

@ -0,0 +1,40 @@
/*--------------------------------*- C++ -*----------------------------------*\
| ========= | |
| \\ / F ield | OpenFOAM: The Open Source CFD Toolbox |
| \\ / O peration | Version: 1.6 |
| \\ / A nd | Web: www.OpenFOAM.org |
| \\/ M anipulation | |
\*---------------------------------------------------------------------------*/
FoamFile
{
version 2.0;
format ascii;
class volScalarField;
location "0";
object voidfraction;
}
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
dimensions [0 0 0 0 0 0 0];
internalField uniform 1;
boundaryField
{
inlet
{
type fixedValue;
value uniform 1;
}
outlet
{
type zeroGradient;
}
walls
{
type zeroGradient;
}
}
// ************************************************************************* //

View File

@ -0,0 +1,57 @@
/*--------------------------------*- C++ -*----------------------------------*\
| ========= | |
| \\ / F ield | OpenFOAM: The Open Source CFD Toolbox |
| \\ / O peration | Version: 1.6 |
| \\ / A nd | Web: www.OpenFOAM.org |
| \\/ M anipulation | |
\*---------------------------------------------------------------------------*/
FoamFile
{
version 2.0;
format ascii;
class dictionary;
location "system";
object controlDict;
}
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
application pisoFoam;
startFrom startTime;
startTime 0;
stopAt endTime;
endTime 25;
deltaT 0.001;
writeControl adjustableRunTime;
writeInterval 0.1;
purgeWrite 0;
writeFormat ascii;
writePrecision 6;
writeCompression uncompressed;
timeFormat general;
timePrecision 6;
runTimeModifiable yes;
adjustTimeStep no;
maxCo 0.1;
functions
{
}
// ************************************************************************* //

View File

@ -0,0 +1,117 @@
/*--------------------------------*- C++ -*----------------------------------*\
| ========= | |
| \\ / F ield | OpenFOAM: The Open Source CFD Toolbox |
| \\ / O peration | Version: 1.6 |
| \\ / A nd | Web: www.OpenFOAM.org |
| \\/ M anipulation | |
\*---------------------------------------------------------------------------*/
FoamFile
{
version 2.0;
format ascii;
class dictionary;
location "system";
object controlDict;
}
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
application pisoFoam;
startFrom startTime;
startTime 0;
stopAt endTime;
endTime 0.1;//0.01;
deltaT 0.001;
writeControl adjustableRunTime;
writeInterval 0.001;//0.01;
purgeWrite 0;
writeFormat ascii;
writePrecision 6;
writeCompression uncompressed;
timeFormat general;
timePrecision 6;
runTimeModifiable yes;
adjustTimeStep no;
maxCo 0.1;
libs ("libOpenFOAM.so" "libgroovyBC.so");
functions
{
probes
{
type probes;
// Where to load it from
functionObjectLibs ( "libsampling.so" );
// Name of the directory for probe data
name probes;
probeLocations
(
(0 0 0.0001)
(0 0 0.0026)
(0 0 0.0051)
(0 0 0.0076)
(0 0 0.0101)
(0 0 0.0126)
(0 0 0.0151)
(0 0 0.0176)
(0 0 0.0201)
(0 0 0.0226)
(0 0 0.0251)
(0 0 0.0276)
(0 0 0.0301)
(0 0 0.0326)
(0 0 0.0351)
(0 0 0.0375)
(0 0 0.0401)
(0 0 0.0426)
(0 0 0.0451)
(0 0 0.0476)
(0 0 0.0529)
);
// Fields to be probed
fields ( p U voidfraction volAverage_voidfraction);
// Write at same frequency as fields
writeControl timeStep;//outputTime;
writeInterval 1;
}
/*pressureDrop
{
type patchAverage;
functionObjectLibs
(
"libsimpleFunctionObjects.so"
);
verbose true;
patches
(
inlet
outlet
);
fields
(
p
);
factor 1;
}*/
}
// ************************************************************************* //

View File

@ -0,0 +1,86 @@
/*-------------------------------*- C++ -*---------------------------------*\
| ========= |
| \\ / OpenFOAM |
| \\ / |
| \\ / The Open Source CFD Toolbox |
| \\/ http://www.OpenFOAM.org |
\*-------------------------------------------------------------------------*/
FoamFile
{
version 2.0;
format ascii;
class dictionary;
note "mesh decomposition control dictionary";
location "system";
object decomposeParDict;
}
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
numberOfSubdomains 16;
//- Keep owner and neighbour on same processor for faces in zones:
// preserveFaceZones (heater solid1 solid3);
//method scotch;
// method hierarchical;
method simple;
// method metis;
// method manual;
simpleCoeffs
{
n (2 2 4);
delta 0.001;
}
hierarchicalCoeffs
{
n (2 1 1);
delta 0.001;
order xyz;
}
metisCoeffs
{
/*
processorWeights
(
1
1
1
1
);
*/
}
scotchCoeffs
{
//processorWeights
//(
// 1
// 1
// 1
// 1
//);
//writeGraph true;
//strategy "b";
}
manualCoeffs
{
dataFile "decompositionData";
}
//// Is the case distributed
//distributed yes;
//// Per slave (so nProcs-1 entries) the directory above the case.
//roots
//(
// "/tmp"
// "/tmp"
//);
// ************************************************************************* //

View File

@ -0,0 +1,81 @@
/*--------------------------------*- C++ -*----------------------------------*\
| ========= | |
| \\ / F ield | OpenFOAM: The Open Source CFD Toolbox |
| \\ / O peration | Version: 1.6 |
| \\ / A nd | Web: www.OpenFOAM.org |
| \\/ M anipulation | |
\*---------------------------------------------------------------------------*/
FoamFile
{
version 2.0;
format ascii;
class dictionary;
location "system";
object fvSchemes;
}
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
ddtSchemes
{
default Euler;
}
d2dt2Schemes
{
default Euler;
}
gradSchemes
{
default Gauss linear;
grad(p) cellLimited Gauss linear 1;
grad(U) Gauss linear;
}
divSchemes
{
default Gauss linear;
div(phi,U) Gauss limitedLinearV 1;
div(phi,k) Gauss limitedLinear 1;
div(phi,epsilon) Gauss limitedLinear 1;
div(phi,R) Gauss limitedLinear 1;
div(R) Gauss linear;
div(phi,nuTilda) Gauss limitedLinear 1;
div((viscousTerm*dev(grad(U).T()))) Gauss linear;
div((nu*dev(grad(U).T()))) Gauss linear;
div((nuEff*dev(grad(U).T()))) Gauss linear;
}
laplacianSchemes
{
default Gauss linear corrected;
laplacian(viscousTerm,U) Gauss linear corrected;
laplacian(nu,U) Gauss linear corrected;
laplacian(nuEff,U) Gauss linear corrected;
laplacian((1|A(U)),p) Gauss linear corrected;
laplacian((voidfraction2|A(U)),p) Gauss linear corrected;
laplacian(DkEff,k) Gauss linear corrected;
laplacian(DepsilonEff,epsilon) Gauss linear corrected;
laplacian(DREff,R) Gauss linear corrected;
laplacian(DnuTildaEff,nuTilda) Gauss linear corrected;
}
interpolationSchemes
{
default linear;
interpolate(U) linear;
}
snGradSchemes
{
default corrected;
}
fluxRequired
{
default no;
p ;
}
// ************************************************************************* //

View File

@ -0,0 +1,84 @@
/*--------------------------------*- C++ -*----------------------------------*\
| ========= | |
| \\ / F ield | OpenFOAM: The Open Source CFD Toolbox |
| \\ / O peration | Version: 1.6 |
| \\ / A nd | Web: www.OpenFOAM.org |
| \\/ M anipulation | |
\*---------------------------------------------------------------------------*/
FoamFile
{
version 2.0;
format ascii;
class dictionary;
location "system";
object fvSolution;
}
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
solvers
{
"(p)"
{
solver PCG;
preconditioner
{
preconditioner GAMG;
tolerance 1e-8;
relTol 0;
smoother GaussSeidel;
nPreSweeps 0;
nPostSweeps 2;
nFinestSweeps 2;
cacheAgglomeration on;
nCellsInCoarsestLevel 100;
agglomerator faceAreaPair;
mergeLevels 1;
}
tolerance 1e-8;
relTol 0.01;
maxIter 100;
}
pFinal
{
solver GAMG;
tolerance 1e-8;
relTol 0;
smoother GaussSeidel;
nPreSweeps 0;
nPostSweeps 2;
nFinestSweeps 2;
cacheAgglomeration on;
nCellsInCoarsestLevel 100;
agglomerator faceAreaPair;
mergeLevels 1;
}
"(U|k|epsilon|R|nuTilda)"
{
solver smoothSolver;
smoother GaussSeidel;
tolerance 1e-8;
relTol 0.0;
nSweeps 1;
}
"(voidfraction|Us|Ksl|dSmoothing|UsNext|voidfractionNext|sSmoothField|vSmoothField|UrelSmooth)"
{
solver PCG;
preconditioner DIC;
tolerance 1e-5;
relTol 0;
}
}
PISO
{
nCorrectors 3;
nNonOrthogonalCorrectors 1;
pRefPoint (0 0.025 0);
pRefValue 0;
}
// ************************************************************************* //

View File

@ -0,0 +1,64 @@
# Pour granular particles into a cylinder, then induce flow
echo both
atom_style granular
atom_modify map array
communicate single vel yes
processors 4 4 1
boundary f f f
newton off
units si
region reg block -0.03 0.03 -0.03 0.03 0 2.0 units box
create_box 1 reg
neighbor 0.0005 bin #0.0003
neigh_modify delay 0
# Material properties required for granular pair styles
fix m1 all property/global youngsModulus peratomtype 5.e6
fix m2 all property/global poissonsRatio peratomtype 0.45
fix m3 all property/global coefficientRestitution peratomtypepair 1 0.8
fix m4 all property/global coefficientFriction peratomtypepair 1 0.5
# walls
fix mesh all mesh/surface file mesh/walls.stl type 1 move 0 0 0
fix walls all wall/gran model hertz tangential history mesh n_meshes 1 meshes mesh
fix bottom all wall/gran model hertz tangential history primitive type 1 zplane 0
fix top all wall/gran model hertz tangential history primitive type 1 zplane 2
# pair style
pair_style gran model hertz tangential history
pair_coeff * *
# timestep, gravity
timestep 1e-5
fix gravi all gravity 9.81 vector 0.0 0.0 -1.0
# particle distributions and insertion
region bc cylinder z 0.0 0.0 0.0285 0 0.6 units box #insertion region
include in.particleSizeDistribution
fix ins all insert/pack seed 100001 distributiontemplate pdd1 vel constant 0 0 0 insert_every 10000 overlapcheck yes all_in yes mass_in_region 0.87 region bc
# apply nve integration to all particles that are inserted as single particles
fix integr all nve/sphere
# screen output
compute rke all erotate/sphere
thermo_style custom step atoms ke c_rke vol
thermo 1000
# insert the first particles so that dump is not empty
run 1
dump dmp all custom 1000 ../DEM/post/dump*.liggghts_init id type x y z vx vy vz fx fy fz omegax omegay omegaz radius
# run for some steps
label run
run 10000
# repeat until kinetic energy is below treshold
variable kinEn equal ke
if "${kinEn} > 0.00001" then "jump SELF run"
# write restart file
write_restart post/restart/liggghts.restart

View File

@ -0,0 +1,55 @@
# Pour granular particles into a cylinder, then induce flow
log ../DEM/log.liggghts
thermo_log ../DEM/post/thermo.txt
atom_style granular
atom_modify map array
communicate single vel yes
boundary f f f
newton off
units si
processors 4 4 1
# read the restart file
read_restart ../DEM/post/restart/liggghts.restart
neighbor 0.0005 bin #0.0003
neigh_modify delay 0
# Material properties required for granular pair styles
fix m1 all property/global youngsModulus peratomtype 5.e6
fix m2 all property/global poissonsRatio peratomtype 0.45
fix m3 all property/global coefficientRestitution peratomtypepair 1 0.3
fix m4 all property/global coefficientFriction peratomtypepair 1 0.05
# walls
fix mesh all mesh/surface file ../mesh/walls.stl type 1 move 0 0 0
fix walls all wall/gran model hertz tangential history mesh n_meshes 1 meshes mesh
fix bottom all wall/gran model hertz tangential history primitive type 1 zplane 0
fix top all wall/gran model hertz tangential history primitive type 1 zplane 2
# pair style
pair_style gran model hertz tangential history
pair_coeff * *
# timestep, gravity
timestep 1e-5
fix gravi all gravity 9.81 vector 0.0 0.0 -1.0
# cfd coupling
fix cfd all couple/cfd couple_every 100 mpi
fix cfd2 all couple/cfd/force/implicit
# apply nve integration to all particles that are inserted as single particles
fix integr all nve/sphere
# screen output
compute rke all erotate/sphere
thermo_style custom step atoms ke c_rke vol
thermo 10
dump dmp all custom 50000 ../DEM/post/dump*.liggghts_run id type x y z vx vy vz fx fy fz radius omegax omegay omegaz
run 1

View File

@ -0,0 +1,59 @@
# Particle size distribution for LIGGGHTS
# normal distribution
# mean radius = 0.000775 m
# standard deviation = 0.000080 m
# density = 2575 kg/m3
fix pts1 all particletemplate/sphere 10007 atom_type 1 density constant 2575 radius constant 0.000540
fix pts2 all particletemplate/sphere 10009 atom_type 1 density constant 2575 radius constant 0.000549
fix pts3 all particletemplate/sphere 10037 atom_type 1 density constant 2575 radius constant 0.000559
fix pts4 all particletemplate/sphere 10039 atom_type 1 density constant 2575 radius constant 0.000569
fix pts5 all particletemplate/sphere 10061 atom_type 1 density constant 2575 radius constant 0.000578
fix pts6 all particletemplate/sphere 10067 atom_type 1 density constant 2575 radius constant 0.000588
fix pts7 all particletemplate/sphere 10069 atom_type 1 density constant 2575 radius constant 0.000597
fix pts8 all particletemplate/sphere 10079 atom_type 1 density constant 2575 radius constant 0.000607
fix pts9 all particletemplate/sphere 10091 atom_type 1 density constant 2575 radius constant 0.000617
fix pts10 all particletemplate/sphere 10093 atom_type 1 density constant 2575 radius constant 0.000626
fix pts11 all particletemplate/sphere 10099 atom_type 1 density constant 2575 radius constant 0.000636
fix pts12 all particletemplate/sphere 10103 atom_type 1 density constant 2575 radius constant 0.000645
fix pts13 all particletemplate/sphere 10111 atom_type 1 density constant 2575 radius constant 0.000655
fix pts14 all particletemplate/sphere 10133 atom_type 1 density constant 2575 radius constant 0.000665
fix pts15 all particletemplate/sphere 10139 atom_type 1 density constant 2575 radius constant 0.000674
fix pts16 all particletemplate/sphere 10141 atom_type 1 density constant 2575 radius constant 0.000684
fix pts17 all particletemplate/sphere 10151 atom_type 1 density constant 2575 radius constant 0.000693
fix pts18 all particletemplate/sphere 10159 atom_type 1 density constant 2575 radius constant 0.000703
fix pts19 all particletemplate/sphere 10163 atom_type 1 density constant 2575 radius constant 0.000713
fix pts20 all particletemplate/sphere 10169 atom_type 1 density constant 2575 radius constant 0.000722
fix pts21 all particletemplate/sphere 10177 atom_type 1 density constant 2575 radius constant 0.000732
fix pts22 all particletemplate/sphere 10181 atom_type 1 density constant 2575 radius constant 0.000741
fix pts23 all particletemplate/sphere 10193 atom_type 1 density constant 2575 radius constant 0.000751
fix pts24 all particletemplate/sphere 10211 atom_type 1 density constant 2575 radius constant 0.000761
fix pts25 all particletemplate/sphere 10223 atom_type 1 density constant 2575 radius constant 0.000770
fix pts26 all particletemplate/sphere 10243 atom_type 1 density constant 2575 radius constant 0.000780
fix pts27 all particletemplate/sphere 10247 atom_type 1 density constant 2575 radius constant 0.000789
fix pts28 all particletemplate/sphere 10253 atom_type 1 density constant 2575 radius constant 0.000799
fix pts29 all particletemplate/sphere 10259 atom_type 1 density constant 2575 radius constant 0.000809
fix pts30 all particletemplate/sphere 10267 atom_type 1 density constant 2575 radius constant 0.000818
fix pts31 all particletemplate/sphere 10271 atom_type 1 density constant 2575 radius constant 0.000828
fix pts32 all particletemplate/sphere 10273 atom_type 1 density constant 2575 radius constant 0.000837
fix pts33 all particletemplate/sphere 10289 atom_type 1 density constant 2575 radius constant 0.000847
fix pts34 all particletemplate/sphere 10301 atom_type 1 density constant 2575 radius constant 0.000857
fix pts35 all particletemplate/sphere 10303 atom_type 1 density constant 2575 radius constant 0.000866
fix pts36 all particletemplate/sphere 10313 atom_type 1 density constant 2575 radius constant 0.000876
fix pts37 all particletemplate/sphere 10321 atom_type 1 density constant 2575 radius constant 0.000885
fix pts38 all particletemplate/sphere 10331 atom_type 1 density constant 2575 radius constant 0.000895
fix pts39 all particletemplate/sphere 10333 atom_type 1 density constant 2575 radius constant 0.000905
fix pts40 all particletemplate/sphere 10337 atom_type 1 density constant 2575 radius constant 0.000914
fix pts41 all particletemplate/sphere 10343 atom_type 1 density constant 2575 radius constant 0.000924
fix pts42 all particletemplate/sphere 10357 atom_type 1 density constant 2575 radius constant 0.000933
fix pts43 all particletemplate/sphere 10369 atom_type 1 density constant 2575 radius constant 0.000943
fix pts44 all particletemplate/sphere 10391 atom_type 1 density constant 2575 radius constant 0.000953
fix pts45 all particletemplate/sphere 10399 atom_type 1 density constant 2575 radius constant 0.000962
fix pts46 all particletemplate/sphere 10427 atom_type 1 density constant 2575 radius constant 0.000972
fix pts47 all particletemplate/sphere 10429 atom_type 1 density constant 2575 radius constant 0.000981
fix pts48 all particletemplate/sphere 10433 atom_type 1 density constant 2575 radius constant 0.000991
fix pts49 all particletemplate/sphere 10453 atom_type 1 density constant 2575 radius constant 0.001001
fix pts50 all particletemplate/sphere 10457 atom_type 1 density constant 2575 radius constant 0.001010
fix pdd1 all particledistribution/discrete 10459 50 pts1 0.000637 pts2 0.000900 pts3 0.001254 pts4 0.001721 pts5 0.002329 pts6 0.003106 pts7 0.004084 pts8 0.005292 pts9 0.006760 pts10 0.008512 pts11 0.010564 pts12 0.012923 pts13 0.015584 pts14 0.018524 pts15 0.021703 pts16 0.025064 pts17 0.028532 pts18 0.032016 pts19 0.035412 pts20 0.038607 pts21 0.041490 pts22 0.043949 pts23 0.045890 pts24 0.047231 pts25 0.047916 pts26 0.047916 pts27 0.047231 pts28 0.045890 pts29 0.043949 pts30 0.041490 pts31 0.038607 pts32 0.035412 pts33 0.032016 pts34 0.028532 pts35 0.025064 pts36 0.021703 pts37 0.018524 pts38 0.015584 pts39 0.012923 pts40 0.010564 pts41 0.008512 pts42 0.006760 pts43 0.005292 pts44 0.004084 pts45 0.003106 pts46 0.002329 pts47 0.001721 pts48 0.001254 pts49 0.000900 pts50 0.000637

File diff suppressed because it is too large Load Diff

View File

@ -0,0 +1,18 @@
#===================================================================#
# small_hearth
# Tim MJ Nijssen - Oktober 2021
#===================================================================#
This tutorial case provides a demonstration of the extended liquid-solid coupling by Nijssen et al. (2020). The case represents a liquid-solid fluidised bed pellet softening reactor, as described by Nijssen et al. (2021).
#===================================================================#
The following scripts are available in the /scripts directory:
- cleanCase.sh: Cleans the case directory from all previous output. Prompts the user whether to remove LIGGGHTS restart files, CFD mesh files and result directories
- runAllPar.sh: Runs LIGGGHTS initialisation if no previous restart file is found, then performs a coupled run according to the start and end times set in CFD/system.controlDict. Afterwards, the case is reconstructed and results moved to a separate directory.
#===================================================================#
T.M.J. Nijssen, J.A.M. Kuipers, J. van der Stel, A.T. Adema, K.A. Buist. Complete liquid-solid momentum coupling for unresolved CFD-DEM simulations. International Journal of Multiphase Flow, 2020.
T.M.J. Nijssen, O.J.I. Kramer, P.J. de Moel, J. Rahman, J.P. Kroon, P. Berhanu, E.S. Boek, K.A. Buist, J.P. van der Hoek, J.T. Padding, J.A.M. Kuipers. Experimental and numerical insights into heterogeneous liquid-solid behaviour in drinking water softening reactors. Chemical Engineering Science: X, 2021.

View File

@ -0,0 +1,46 @@
#!/bin/bash
#===================================================================#
# run settings for case
# Tim MJ Nijssen - May 2018
#===================================================================#
#- decide what run settings to use
if [ -z "$1" ]; then
#- ask runtype if not specified
echo "Please specify runtype (DEM/CFDDEM):"
read runType
else
#- use specified type
runType=$1
fi
#- check runType
if [ "$runType" == DEM ] || [ "$runType" == CFDDEM ]; then
echo "Running settings for $runType"
else
echo "Error: invalid runType"
read
fi
if [ "$runType" == DEM ]; then
#- DEM run settings
nrProcs="16"
runTitle="DEMrun"
headerText="$runTitle"
logfileName="log_DEM"
solverName="in.liggghts_init"
machineFileName="none" # yourMachinefileName | none
debugMode="off"
fi
if [ "$runType" == CFDDEM ]; then
#- CFDDEM run settings
nrProcs="16"
headerText="$runTitle"
logfileName="log_CFDDEM"
solverName="cfdemSolverPiso"
machineFileName="none" # yourMachinefileName | none
debugMode="off" # on | off| strict
testHarnessPath="$CFDEM_TEST_HARNESS_PATH"
fi

View File

@ -0,0 +1,42 @@
#!/bin/bash
#===================================================================#
# construct mesh
#===================================================================#
#--------------------------------------------------------------------------------#
#- run settings file
scriptPath="$( cd "$( dirname "${BASH_SOURCE[0]}" )" &> /dev/null && pwd )"
. $scriptPath/scriptSettings.sh $1
#--------------------------------------------------------------------------------#
cd $casePath/CFD
# blockmesh
if [ -f "$casePath/CFD/constant/polyMesh/blockMeshDict" ]; then
echo "Meshing with blockMesh"
blockMesh
fi
# snappyhexmesh
if [ -f "$casePath/CFD/system/snappyHexMeshDict" ]; then
echo "Meshing with snappyHexMesh"
surfaceFeatureExtract
decomposePar
mpirun -np $nrProcs snappyHexMesh -overwrite -parallel
reconstructParMesh -constant -mergeTol 1e-6
rm -r processor*
fi
# UNV to foam
if ls $casePath/CFD/constant/polyMesh/*.unv 1> /dev/null 2>&1; then
echo "Meshing with ideasUnvToFoam"
ideasUnvToFoam $casePath/CFD/constant/polyMesh/*.unv
fi
cd $currentPath

View File

@ -0,0 +1,101 @@
#!/bin/bash
#===================================================================#
# clean script for case
# Tim MJ Nijssen - September 2021
# Based on: Christoph Goniva - Feb. 2011
#===================================================================#
#--------------------------------------------------------------------------------#
#- run settings file
scriptPath="$( cd "$( dirname "${BASH_SOURCE[0]}" )" &> /dev/null && pwd )"
. $scriptPath/scriptSettings.sh $1
#--------------------------------------------------------------------------------#
#- clean up case
rm -r $casePath/*~
rm -r $casePath/#*#
rm -r $casePath/DEM/*~
rm -r $casePath/DEM/#*#
rm -r $casePath/CFD/*~
rm -r $casePath/CFD/#*#
rm -r $casePath/*.e*
rm -r $casePath/*.o*
rm -r $casePath/log*
rm -r $casePath/CFD/0*
rm -r $casePath/CFD/1*
rm -r $casePath/CFD/2*
rm -r $casePath/CFD/3*
rm -r $casePath/CFD/4*
rm -r $casePath/CFD/5*
rm -r $casePath/CFD/6*
rm -r $casePath/CFD/7*
rm -r $casePath/CFD/8*
rm -r $casePath/CFD/9*
rm -r $casePath/CFD/log*
rm -r $casePath/CFD/org.0/*~
rm -r $casePath/CFD/constant/*~
rm -r $casePath/CFD/system/*~
rm -r $casePath/DEM/*~
rm -r $casePath/CFD/processor*
rm -r $casePath/CFD/clockData
rm -r $casePath/CFD/VTK
rm -r $casePath/CFD/particleProbes
rm -r $casePath/CFD/postProcessing
rm -r $casePath/DEM/log*
rm -r $casePath/DEM/post/dump*
rm -r $casePath/DEM/post/*.vtk
rm -r $casePath/DEM/post/*.txt
#- liggghts restart
if [ -f "$casePath/DEM/post/restart/liggghts.restart" ]; then
echo -n "Clean LIGGGHTS restart file(s)? (y/N)? "
read -t 10 answer
if echo "$answer" | grep -iq "^y" ;then
rm -r $casePath/DEM/post/restart/*
fi
fi
#- CFD mesh
if [ -f "$casePath/CFD/constant/polyMesh/points" ]; then
echo -n "Clean CFD mesh? (y/N)? "
read -t 10 answer
if echo "$answer" | grep -iq "^y" ;then
rm -r $casePath/CFD/constant/extendedFeatureEdgeMesh
rm $casePath/CFD/constant/triSurface/*.eMesh
rm $casePath/CFD/constant/polyMesh/boundary
rm $casePath/CFD/constant/polyMesh/faces
rm $casePath/CFD/constant/polyMesh/neighbour
rm $casePath/CFD/constant/polyMesh/owner
rm $casePath/CFD/constant/polyMesh/points
fi
fi
#- results
if ls $casePath/results* 1> /dev/null 2>&1; then
echo -n "Clean results? (y/N)? "
read -t 10 answer
if echo "$answer" | grep -iq "^y" ;then
rm -r $casePath/results*
fi
fi
#- function objects
if [ -d "$casePath/CFD/dynamicCode" ]; then
echo -n "Clean dynamicCode? (y/N)? "
read -t 10 answer
if echo "$answer" | grep -iq "^y" ;then
rm -r $casePath/CFD/dynamicCode
fi
fi
cd $currentPath

View File

@ -0,0 +1,77 @@
#!/bin/bash
#===================================================================#
# post-run script for case
# Tim MJ Nijssen - September 2021
#===================================================================#
#--------------------------------------------------------------------------------#
#- run settings file
scriptPath="$( cd "$( dirname "${BASH_SOURCE[0]}" )" &> /dev/null && pwd )"
. $scriptPath/scriptSettings.sh $1
#--------------------------------------------------------------------------------#
#- make results directories
dateTime=$(date +%y%m%d_%H%M%S)
resultsPath="$casePath"/results_"$runTitle"_"$dateTime"
mkdir $resultsPath
mkdir $resultsPath/DEM
mkdir $resultsPath/DEM/dump_run
mkdir $resultsPath/CFD
mkdir $resultsPath/log
mkdir $resultsPath/VTK
#- reconstruct and convert CFD data
cd $casePath/CFD
reconstructPar -noLagrangian
foamToVTK
#- move CFD files
mv $casePath/CFD/0* $resultsPath/CFD/
mv $casePath/CFD/1* $resultsPath/CFD/
mv $casePath/CFD/2* $resultsPath/CFD/
mv $casePath/CFD/3* $resultsPath/CFD/
mv $casePath/CFD/4* $resultsPath/CFD/
mv $casePath/CFD/5* $resultsPath/CFD/
mv $casePath/CFD/6* $resultsPath/CFD/
mv $casePath/CFD/7* $resultsPath/CFD/
mv $casePath/CFD/8* $resultsPath/CFD/
mv $casePath/CFD/9* $resultsPath/CFD/
mv $casePath/CFD/particleProbes* $resultsPath/CFD/
mv $casePath/CFD/postProcessing* $resultsPath/CFD/
mv $casePath/CFD/dynamicCode* $resultsPath/CFD/
mv $casePath/CFD/VTK/CFD* $resultsPath/VTK/
cp -r $casePath/CFD/org* $resultsPath/CFD/
cp -r $casePath/CFD/constant $resultsPath/CFD/
cp -r $casePath/CFD/system $resultsPath/CFD/
cp -r $casePath/CFD/clockData $resultsPath/CFD/
#- copy DEM data
cp $casePath/DEM/* $resultsPath/DEM/
cp -r $casePath/DEM/mesh $resultsPath/DEM/
#- move and convert DEM init files
if ls $casePath/DEM/post/*init* 1> /dev/null 2>&1; then
mkdir $resultsPath/DEM/dump_init
mv $casePath/DEM/post/*init* $resultsPath/DEM/dump_init/
cd $resultsPath/DEM/dump_init
python2 $CFDEM_LPP_DIR/lpp.py dump*
mv $resultsPath/DEM/dump_init/*.vtk $resultsPath/VTK/
fi
#- move and convert DEM run files
mv $casePath/DEM/post/*run* $resultsPath/DEM/dump_run/
cd $resultsPath/DEM/dump_run
python2 $CFDEM_LPP_DIR/lpp.py dump*
mv $resultsPath/DEM/dump_run/*.vtk $resultsPath/VTK/
#- copy log files
cp $casePath/log/* $resultsPath/log/
mv $casePath/slurm* $resultsPath/log/
#- return to path
cd $currentPath

View File

@ -0,0 +1,57 @@
#!/bin/bash
#===================================================================#
# all tasks before actual CFD-DEM run
# Tim MJ Nijssen - September 2021
# based on: Christoph Goniva - August 2011
#===================================================================#
#--------------------------------------------------------------------------------#
#- run settings file
scriptPath="$( cd "$( dirname "${BASH_SOURCE[0]}" )" &> /dev/null && pwd )"
. $scriptPath/scriptSettings.sh $1
#--------------------------------------------------------------------------------#
runTitle=$(basename "$casePath")
#- prompt for costum title
echo -n "Add custom simulation title? (y/N)?"
read -t 10 answer
if echo "$answer" | grep -iq "^y" ;then
echo -n "Enter simulation title:"
read runTitle
fi
#- run DEM init
if [ -f "$casePath/DEM/in.liggghts_init" ]; then
if [ -f "$casePath/DEM/post/restart/liggghts.restart" ]; then
echo "preRunAllPar: Using existing restart file"
else
echo "preRunAllPar: Running DEM init"
. $scriptPath/runDEMPar.sh $casePath
fi
fi
#- copy 0.org
echo "preRunAllPar: Copying 0.org"
cp -r $casePath/CFD/org.0 $casePath/CFD/0
#- mesh
if [ -f "$casePath/CFD/constant/polyMesh/points" ]; then
echo "preRunAllPar: using old mesh"
else
echo "preRunAllPar: Building mesh"
. $scriptPath/buildMesh.sh $casePath > $logPath/log.mesh
fi
#- set fields
if [ -f "$casePath/CFD/system/setFieldsDict" ]; then
echo "preRunAllPar: Setting fields"
cd $casePath/CFD
setFields
fi
#- decompose
echo "preRunAllPar: Decomposing"
cd $casePath/CFD
decomposePar
cd $currentPath

View File

@ -0,0 +1,26 @@
#!/bin/bash
#===================================================================#
# allrun script
# Tim MJ Nijssen - September 2021
# based on: Christoph Goniva - August 2011
#===================================================================#
#--------------------------------------------------------------------------------#
#- run settings file
scriptPath="$( cd "$( dirname "${BASH_SOURCE[0]}" )" &> /dev/null && pwd )"
. $scriptPath/scriptSettings.sh $1
#--------------------------------------------------------------------------------#
#- do all tasks before actual run
echo "runAllPar: calling preRunAllPar"
. $scriptPath/preRunAllPar.sh $casePath
#- run parallel CFD-DEM
echo "runAllPar: Running CFD-DEM"
. $scriptPath/runCFDDEMPar.sh $casePath
#- do all tasks after actual run
echo "runAllPar: calling postRunAllPar"
. $scriptPath/postRunAllPar.sh $casePath

View File

@ -0,0 +1,56 @@
#!/bin/bash
#===================================================================#
# CFDDEMrun script for case
# Tim MJ Nijssen - September 2021
# based on: Christoph Goniva - May. 2011
#===================================================================#
#- include functions
source $CFDEM_PROJECT_DIR/etc/functions.sh
#--------------------------------------------------------------------------------#
#- run settings file
scriptPath="$( cd "$( dirname "${BASH_SOURCE[0]}" )" &> /dev/null && pwd )"
. $scriptPath/scriptSettings.sh $1
#--------------------------------------------------------------------------------#
#- run case settings file
. $casePath/runSettings.sh "CFDDEM"
#--------------------------------------------------------------------------------#
cd $casePath/CFD
if [ $debugMode == "on" ]; then
debugMode="valgrind"
elif [ $debugMode == "strict" ]; then
debugMode="valgrind --tool=memcheck --leak-check=yes --show-reachable=yes --num-callers=20 --track-fds=yes"
else
debugMode=""
fi
#- make proc dirs visible
count=0
for i in `seq $nrProcs`
do
let count=$i-1
(cd $casePath/CFD/processor$count && touch file.foam)
done
#- header
echo 2>&1 | tee -a /$logpath/$logfileName
echo "// $headerText //" 2>&1 | tee -a $logpath/$logfileName
echo 2>&1 | tee -a $logpath/$logfileName
#- write path
pwd 2>&1 | tee -a $logpath/$logfileName
echo 2>&1 | tee -a $logpath/$logfileName
#- run applictaion
if [[ $machineFileName == "none" ]]; then
mpirun -np $nrProcs $debugMode $solverName -parallel 2>&1 | tee -a $logpath/$logfileName
else
mpirun -machinefile $machineFileName -np $nrProcs $debugMode $solverName -parallel 2>&1 | tee -a $logpath/$logfileName
fi
#- return
cd $currentPath

View File

@ -0,0 +1,27 @@
#!/bin/bash
#===================================================================#
# DEMrun script for case (init)
# Tim MJ Nijssen - September 2021
# based on: Daniel Queteschiner - June 2014
#===================================================================#
#- include functions
source $CFDEM_PROJECT_DIR/etc/functions.sh
#--------------------------------------------------------------------------------#
#- run settings file
scriptPath="$( cd "$( dirname "${BASH_SOURCE[0]}" )" &> /dev/null && pwd )"
. $scriptPath/scriptSettings.sh $1
#--------------------------------------------------------------------------------#
#- run case settings file
. $casePath/runSettings.sh "DEM"
#--------------------------------------------------------------------------------#
echo $logPath $logfileName $casePath $headerText $solverName $nrProcs $machineFileName $debugMode
#- call function to run DEM case
parDEMrun $logPath $logfileName $casePath $headerText $solverName $nrProcs $machineFileName $debugMode
#- return
cd $currentPath

Some files were not shown because too many files have changed in this diff Show More