Skip to content

Commit 16a415a

Browse files
authored
Merge pull request #125 from ParticulateFlow/release
Release 21.11
2 parents 32283e8 + 84842df commit 16a415a

File tree

709 files changed

+2462103
-1174
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

709 files changed

+2462103
-1174
lines changed

applications/solvers/cfdemSolverMultiphase/multiphaseMixture/multiphaseMixture.C

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -55,14 +55,21 @@ Foam::multiphaseMixture::calcNu() const
5555
{
5656
PtrDictionary<phase>::const_iterator iter = phases_.begin();
5757

58+
// 1/nu
59+
tmp<volScalarField> tnuInv = iter()/iter().nu();
60+
volScalarField& nuInv = tnuInv.ref();
61+
62+
// nu
5863
tmp<volScalarField> tnu = iter()*iter().nu();
5964
volScalarField& nu = tnu.ref();
6065

6166
for (++iter; iter != phases_.end(); ++iter)
6267
{
63-
nu += iter()*iter().nu();
68+
nuInv += iter()/iter().nu();
6469
}
6570

71+
nu = 1/nuInv;
72+
6673
return tnu;
6774
}
6875

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
#!/bin/sh
2+
cd ${0%/*} || exit 1 # Run from this directory
3+
set -x
4+
5+
wclean libso multiphaseMixture
6+
wclean
7+
8+
#------------------------------------------------------------------------------
Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
#!/bin/sh
2+
cd ${0%/*} || exit 1 # Run from this directory
3+
4+
# Parse arguments for library compilation
5+
targetType=libso
6+
. $WM_PROJECT_DIR/wmake/scripts/AllwmakeParseArguments
7+
set -x
8+
9+
wmake $targetType multiphaseMixture
10+
wmake
11+
12+
#------------------------------------------------------------------------------
Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,22 @@
1+
// get mixture properties
2+
Cs = mixture.Cs();
3+
diffusionCorrection = mixture.diffusionCorrection();
4+
Deff = particleCloud.diffCoeffM().diffCoeff();
5+
6+
// get scalar source from DEM
7+
particleCloud.massContributions(Sm);
8+
particleCloud.massCoefficients(Smi);
9+
10+
fvScalarMatrix CEqn
11+
(
12+
fvm::ddt(voidfraction,C)
13+
+ fvm::div(phi,C)
14+
- fvm::laplacian(Deff*voidfraction,C)
15+
+ fvm::div(fvc::interpolate(Deff*voidfraction)*diffusionCorrection*mesh.magSf(), C)
16+
==
17+
Sm + fvm::Sp(Smi,C)
18+
);
19+
20+
CEqn.relax();
21+
fvOptions.constrain(CEqn);
22+
CEqn.solve();
Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,22 @@
1+
// get mixture properties
2+
Cp = mixture.Cp();
3+
kf = mixture.kf();
4+
5+
// get scalar source from DEM
6+
particleCloud.energyContributions(Qsource);
7+
particleCloud.energyCoefficients(QCoeff);
8+
9+
fvScalarMatrix EEqn
10+
(
11+
rho*Cp*(fvm::ddt(voidfraction,T)
12+
+ fvm::div(phi,T))
13+
- fvm::laplacian(thCond*voidfraction,T)
14+
==
15+
Qsource + fvm::Sp(QCoeff,T)
16+
);
17+
18+
19+
EEqn.relax();
20+
fvOptions.constrain(EEqn);
21+
EEqn.solve();
22+
Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
cfdemSolverMultiphaseScalar.C
2+
3+
EXE = $(CFDEM_APP_DIR)/cfdemSolverMultiphaseScalar
Lines changed: 35 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,35 @@
1+
FOAM_VERSION_MAJOR := $(word 1,$(subst ., ,$(WM_PROJECT_VERSION)))
2+
PFLAGS+= -DOPENFOAM_VERSION_MAJOR=$(FOAM_VERSION_MAJOR)
3+
4+
include $(CFDEM_ADD_LIBS_DIR)/additionalLibs
5+
6+
EXE_INC = \
7+
$(PFLAGS) \
8+
-I$(CFDEM_OFVERSION_DIR) \
9+
-ImultiphaseMixture/lnInclude \
10+
-I$(LIB_SRC)/transportModels \
11+
-I$(LIB_SRC)/transportModels/incompressible/lnInclude \
12+
-I$(LIB_SRC)/transportModels/interfaceProperties/lnInclude \
13+
-I$(LIB_SRC)/TurbulenceModels/turbulenceModels/lnInclude \
14+
-I$(LIB_SRC)/TurbulenceModels/incompressible/lnInclude \
15+
-I$(LIB_SRC)/finiteVolume/lnInclude \
16+
-I$(LIB_SRC)/meshTools/lnInclude \
17+
-I$(LIB_SRC)/sampling/lnInclude \
18+
-I$(CFDEM_SRC_DIR)/lagrangian/cfdemParticle/lnInclude \
19+
-I$(CFDEM_SRC_DIR)/lagrangian/cfdemParticle/cfdTools \
20+
-Wno-deprecated-copy
21+
22+
EXE_LIBS = \
23+
-L$(CFDEM_LIB_DIR)\
24+
-lcfdemMultiphaseInterFoamScalar \
25+
-linterfaceProperties \
26+
-lincompressibleTransportModels \
27+
-lturbulenceModels \
28+
-lincompressibleTurbulenceModels \
29+
-lfiniteVolume \
30+
-lfvOptions \
31+
-lmeshTools \
32+
-lsampling \
33+
-l$(CFDEM_LIB_NAME) \
34+
$(CFDEM_ADD_LIB_PATHS) \
35+
$(CFDEM_ADD_LIBS)
Lines changed: 61 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,61 @@
1+
const surfaceScalarField& rhoPhi(mixture.rhoPhi());
2+
3+
volScalarField muEff = rho*(turbulence->nu() + turbulence->nut());
4+
5+
if (modelType == "A")
6+
muEff *= voidfraction;
7+
8+
fvVectorMatrix UEqn
9+
(
10+
fvm::ddt(rhoEps, U) - fvm::Sp(fvc::ddt(rhoEps),U)
11+
+ fvm::div(rhoPhi, U) - fvm::Sp(fvc::div(rhoPhi),U)
12+
//+ particleCloud.divVoidfractionTau(U, voidfraction)
13+
- fvm::laplacian(muEff, U) - fvc::div(muEff*dev2(fvc::grad(U)().T()))
14+
==
15+
fvOptions(rho, U)
16+
- fvm::Sp(Ksl,U)
17+
);
18+
19+
UEqn.relax();
20+
21+
fvOptions.constrain(UEqn);
22+
23+
if (pimple.momentumPredictor() && (modelType=="B" || modelType=="Bfull"))
24+
{
25+
solve
26+
(
27+
UEqn
28+
==
29+
fvc::reconstruct
30+
(
31+
(- ghf*fvc::snGrad(rho) - fvc::snGrad(p_rgh)) * mesh.magSf()
32+
)
33+
+
34+
fvc::reconstruct
35+
(
36+
mixture.surfaceTensionForce() * mesh.magSf()
37+
) * voidfraction
38+
+ Ksl*Us
39+
);
40+
41+
fvOptions.correct(U);
42+
}
43+
else if (pimple.momentumPredictor())
44+
{
45+
solve
46+
(
47+
UEqn
48+
==
49+
fvc::reconstruct
50+
(
51+
(
52+
mixture.surfaceTensionForce()
53+
- ghf*fvc::snGrad(rho)
54+
- fvc::snGrad(p_rgh)
55+
) * mesh.magSf()
56+
) * voidfraction
57+
+ Ksl*Us
58+
);
59+
60+
fvOptions.correct(U);
61+
}
Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
// Additional solver-specific checks
2+
3+
// Useful if one wants to e.g. initialize floating particles using the Archimedes model
4+
if (particleCloud.couplingProperties().found("unrestrictedForceModelSelection"))
5+
{
6+
Warning << "Using unrestrictedForceModelSelection, results may be incorrect!" << endl;
7+
} else
8+
{
9+
#include "checkModelType.H"
10+
}
11+
12+
word modelType = particleCloud.modelType();
13+
14+
if(!particleCloud.couplingProperties().found("useDDTvoidfraction"))
15+
{
16+
Warning << "Suppressing ddt(voidfraction) is not recommended with this solver as it may generate incorrect results!" << endl;
17+
}
Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
scalar alphaCoNum = 0.0;
2+
scalar meanAlphaCoNum = 0.0;
3+
4+
if (mesh.nInternalFaces())
5+
{
6+
scalarField sumPhi
7+
(
8+
mixture.nearInterface()().primitiveField()
9+
*fvc::surfaceSum(mag(phi))().primitiveField()
10+
);
11+
12+
alphaCoNum = 0.5*gMax(sumPhi/mesh.V().field())*runTime.deltaTValue();
13+
14+
meanAlphaCoNum =
15+
0.5*(gSum(sumPhi)/gSum(mesh.V().field()))*runTime.deltaTValue();
16+
}
17+
18+
Info<< "Interface Courant Number mean: " << meanAlphaCoNum
19+
<< " max: " << alphaCoNum << endl;
20+
21+
// ************************************************************************* //

0 commit comments

Comments
 (0)