Skip to content

Commit cc5f67a

Browse files
author
Henry Weller
committed
reactingMultiphaseEulerFoam: New Euler-Euler multiphase solver
Supporting any number of phases with heat and mass transfer, phase-change and reactions
1 parent 7c87973 commit cc5f67a

File tree

172 files changed

+13507
-148
lines changed

Some content is hidden

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

172 files changed

+13507
-148
lines changed

applications/solvers/multiphase/multiphaseEulerFoam/UEqns.H

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@ forAllIter(PtrDictionary<phaseModel>, fluid.phases(), iter)
1818
new fvVectorMatrix
1919
(
2020
fvm::ddt(alpha, U)
21-
+ fvm::div(phase.phiAlpha(), U)
21+
+ fvm::div(phase.alphaPhi(), U)
2222

2323
+ (alpha/phase.rho())*fluid.Cvm(phase)*
2424
(

applications/solvers/multiphase/multiphaseEulerFoam/multiphaseSystem/multiphaseSystem.C

Lines changed: 17 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -61,18 +61,18 @@ void Foam::multiphaseSystem::calcAlphas()
6161

6262
void Foam::multiphaseSystem::solveAlphas()
6363
{
64-
PtrList<surfaceScalarField> phiAlphaCorrs(phases_.size());
64+
PtrList<surfaceScalarField> alphaPhiCorrs(phases_.size());
6565
int phasei = 0;
6666

6767
forAllIter(PtrDictionary<phaseModel>, phases_, iter)
6868
{
6969
phaseModel& phase1 = iter();
7070
volScalarField& alpha1 = phase1;
7171

72-
phase1.phiAlpha() =
72+
phase1.alphaPhi() =
7373
dimensionedScalar("0", dimensionSet(0, 3, -1, 0, 0), 0);
7474

75-
phiAlphaCorrs.set
75+
alphaPhiCorrs.set
7676
(
7777
phasei,
7878
new surfaceScalarField
@@ -87,7 +87,7 @@ void Foam::multiphaseSystem::solveAlphas()
8787
)
8888
);
8989

90-
surfaceScalarField& phiAlphaCorr = phiAlphaCorrs[phasei];
90+
surfaceScalarField& alphaPhiCorr = alphaPhiCorrs[phasei];
9191

9292
forAllIter(PtrDictionary<phaseModel>, phases_, iter2)
9393
{
@@ -118,7 +118,7 @@ void Foam::multiphaseSystem::solveAlphas()
118118
"div(phir," + alpha2.name() + ',' + alpha1.name() + ')'
119119
);
120120

121-
phiAlphaCorr += fvc::flux
121+
alphaPhiCorr += fvc::flux
122122
(
123123
-fvc::flux(-phir, phase2, phirScheme),
124124
phase1,
@@ -127,21 +127,21 @@ void Foam::multiphaseSystem::solveAlphas()
127127
}
128128

129129
// Ensure that the flux at inflow BCs is preserved
130-
forAll(phiAlphaCorr.boundaryField(), patchi)
130+
forAll(alphaPhiCorr.boundaryField(), patchi)
131131
{
132-
fvsPatchScalarField& phiAlphaCorrp =
133-
phiAlphaCorr.boundaryField()[patchi];
132+
fvsPatchScalarField& alphaPhiCorrp =
133+
alphaPhiCorr.boundaryField()[patchi];
134134

135-
if (!phiAlphaCorrp.coupled())
135+
if (!alphaPhiCorrp.coupled())
136136
{
137137
const scalarField& phi1p = phase1.phi().boundaryField()[patchi];
138138
const scalarField& alpha1p = alpha1.boundaryField()[patchi];
139139

140-
forAll(phiAlphaCorrp, facei)
140+
forAll(alphaPhiCorrp, facei)
141141
{
142142
if (phi1p[facei] < 0)
143143
{
144-
phiAlphaCorrp[facei] = alpha1p[facei]*phi1p[facei];
144+
alphaPhiCorrp[facei] = alpha1p[facei]*phi1p[facei];
145145
}
146146
}
147147
}
@@ -153,7 +153,7 @@ void Foam::multiphaseSystem::solveAlphas()
153153
geometricOneField(),
154154
phase1,
155155
phi_,
156-
phiAlphaCorr,
156+
alphaPhiCorr,
157157
zeroField(),
158158
zeroField(),
159159
1,
@@ -164,7 +164,7 @@ void Foam::multiphaseSystem::solveAlphas()
164164
phasei++;
165165
}
166166

167-
MULES::limitSum(phiAlphaCorrs);
167+
MULES::limitSum(alphaPhiCorrs);
168168

169169
volScalarField sumAlpha
170170
(
@@ -184,19 +184,19 @@ void Foam::multiphaseSystem::solveAlphas()
184184
{
185185
phaseModel& phase1 = iter();
186186

187-
surfaceScalarField& phiAlpha = phiAlphaCorrs[phasei];
188-
phiAlpha += upwind<scalar>(mesh_, phi_).flux(phase1);
187+
surfaceScalarField& alphaPhi = alphaPhiCorrs[phasei];
188+
alphaPhi += upwind<scalar>(mesh_, phi_).flux(phase1);
189189

190190
MULES::explicitSolve
191191
(
192192
geometricOneField(),
193193
phase1,
194-
phiAlpha,
194+
alphaPhi,
195195
zeroField(),
196196
zeroField()
197197
);
198198

199-
phase1.phiAlpha() += phiAlpha;
199+
phase1.alphaPhi() += alphaPhi;
200200

201201
Info<< phase1.name() << " volume fraction, min, max = "
202202
<< phase1.weightedAverage(mesh_.V()).value()

applications/solvers/multiphase/multiphaseEulerFoam/multiphaseSystem/phaseModel/phaseModel.C

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -100,11 +100,11 @@ Foam::phaseModel::phaseModel
100100
mesh,
101101
dimensionedVector("0", dimVelocity/dimTime, vector::zero)
102102
),
103-
phiAlpha_
103+
alphaPhi_
104104
(
105105
IOobject
106106
(
107-
IOobject::groupName("phiAlpha", phaseName),
107+
IOobject::groupName("alphaPhi", phaseName),
108108
mesh.time().timeName(),
109109
mesh
110110
),

applications/solvers/multiphase/multiphaseEulerFoam/multiphaseSystem/phaseModel/phaseModel.H

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -80,7 +80,7 @@ class phaseModel
8080
volVectorField DDtU_;
8181

8282
//- Volumetric flux of the phase
83-
surfaceScalarField phiAlpha_;
83+
surfaceScalarField alphaPhi_;
8484

8585
//- Volumetric flux for the phase
8686
autoPtr<surfaceScalarField> phiPtr_;
@@ -198,14 +198,14 @@ public:
198198
return phiPtr_();
199199
}
200200

201-
const surfaceScalarField& phiAlpha() const
201+
const surfaceScalarField& alphaPhi() const
202202
{
203-
return phiAlpha_;
203+
return alphaPhi_;
204204
}
205205

206-
surfaceScalarField& phiAlpha()
206+
surfaceScalarField& alphaPhi()
207207
{
208-
return phiAlpha_;
208+
return alphaPhi_;
209209
}
210210

211211
//- Correct the phase properties

applications/solvers/multiphase/reactingEulerFoam/Allwclean

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,5 +6,6 @@ wclean libso phaseSystems
66
wclean libso interfacialModels
77
wclean libso interfacialCompositionModels
88
reactingTwoPhaseEulerFoam/Allwclean
9+
reactingMultiphaseEulerFoam/Allwclean
910

1011
# ----------------------------------------------------------------- end-of-file

applications/solvers/multiphase/reactingEulerFoam/Allwmake

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,5 +8,6 @@ wmake libso phaseSystems
88
wmake libso interfacialModels
99
wmake libso interfacialCompositionModels
1010
reactingTwoPhaseEulerFoam/Allwmake
11+
reactingMultiphaseEulerFoam/Allwmake
1112

1213
# ----------------------------------------------------------------- end-of-file

applications/solvers/multiphase/reactingEulerFoam/interfacialCompositionModels/Make/options

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,6 @@ EXE_INC = \
2121
-I$(LIB_SRC)/meshTools/lnInclude
2222

2323
LIB_LIBS = \
24-
-lreactingTwoPhaseSystem \
2524
-lfluidThermophysicalModels \
2625
-lreactionThermophysicalModels \
2726
-lspecie

applications/solvers/multiphase/reactingEulerFoam/interfacialModels/Make/options

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,6 @@ EXE_INC = \
1010
-I$(LIB_SRC)/meshTools/lnInclude
1111

1212
LIB_LIBS = \
13-
-lreactingTwoPhaseSystem \
1413
-lcompressibleTransportModels \
1514
-lfluidThermophysicalModels \
1615
-lspecie

applications/solvers/multiphase/reactingEulerFoam/interfacialModels/dragModels/segregated/segregated.C

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -132,7 +132,10 @@ Foam::tmp<Foam::volScalarField> Foam::dragModels::segregated::K() const
132132
volScalarField muAlphaI
133133
(
134134
alpha1*rho1*nu1*alpha2*rho2*nu2
135-
/(alpha1*rho1*nu1 + alpha2*rho2*nu2)
135+
/(
136+
max(alpha1, pair_.phase1().residualAlpha())*rho1*nu1
137+
+ max(alpha2, pair_.phase2().residualAlpha())*rho2*nu2
138+
)
136139
);
137140

138141
volScalarField ReI

applications/solvers/multiphase/reactingEulerFoam/phaseSystems/PhaseSystems/HeatAndMassTransferPhaseSystem/HeatAndMassTransferPhaseSystem.C

Lines changed: 54 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -164,6 +164,60 @@ Foam::HeatAndMassTransferPhaseSystem<BasePhaseSystem>::dmdt
164164
}
165165

166166

167+
template<class BasePhaseSystem>
168+
Foam::tmp<Foam::volScalarField>
169+
Foam::HeatAndMassTransferPhaseSystem<BasePhaseSystem>::dmdt
170+
(
171+
const Foam::phaseModel& phase
172+
) const
173+
{
174+
tmp<volScalarField> tdmdt
175+
(
176+
new volScalarField
177+
(
178+
IOobject
179+
(
180+
IOobject::groupName("dmdt", phase.name()),
181+
this->mesh_.time().timeName(),
182+
this->mesh_
183+
),
184+
this->mesh_,
185+
dimensionedScalar("zero", dimDensity/dimTime, 0)
186+
)
187+
);
188+
189+
forAllConstIter
190+
(
191+
phaseSystem::phasePairTable,
192+
this->phasePairs_,
193+
phasePairIter
194+
)
195+
{
196+
const phasePair& pair(phasePairIter());
197+
198+
if (pair.ordered())
199+
{
200+
continue;
201+
}
202+
203+
const phaseModel* phase1 = &pair.phase1();
204+
const phaseModel* phase2 = &pair.phase2();
205+
206+
forAllConstIter(phasePair, pair, iter)
207+
{
208+
if (phase1 == &phase)
209+
{
210+
tdmdt() += this->dmdt(pair);
211+
}
212+
213+
Swap(phase1, phase2);
214+
}
215+
}
216+
217+
return tdmdt;
218+
}
219+
220+
167221
template<class BasePhaseSystem>
168222
Foam::autoPtr<Foam::phaseSystem::momentumTransferTable>
169223
Foam::HeatAndMassTransferPhaseSystem<BasePhaseSystem>::momentumTransfer() const

0 commit comments

Comments
 (0)