Skip to content
GitLab
Menu
Projects
Groups
Snippets
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Menu
Open sidebar
Development
openfoam
Commits
bf95b5c2
Commit
bf95b5c2
authored
Jun 26, 2015
by
Henry Weller
Browse files
reactingTwoPhaseEulerFoam: Change the implicit handling of phase-pressure and dispersion
to support any number of phases
parent
4d6823c3
Changes
11
Hide whitespace changes
Inline
Side-by-side
applications/solvers/multiphase/reactingTwoPhaseEulerFoam/pU/pEqn.H
View file @
bf95b5c2
...
...
@@ -39,7 +39,7 @@ tmp<surfaceScalarField> phiF2;
volScalarField
D
(
fluid
.
D
());
// Phase-1 turbulent dispersion and particle-pressure flux
surfaceScalarField
D
f
1
tmp
<
surfaceScalarField
>
D
byA
1
(
fvc
::
interpolate
(
...
...
@@ -48,7 +48,7 @@ tmp<surfaceScalarField> phiF2;
);
// Phase-2 turbulent dispersion and particle-pressure flux
surfaceScalarField
D
f
2
tmp
<
surfaceScalarField
>
D
byA
2
(
fvc
::
interpolate
(
...
...
@@ -56,13 +56,6 @@ tmp<surfaceScalarField> phiF2;
)
);
// Cache the net diffusivity for implicit diffusion treatment in the
// phase-fraction equation
if
(
implicitPhasePressure
)
{
fluid
.
pPrimeByA
()
=
Df1
+
Df2
;
}
// Lift and wall-lubrication forces
volVectorField
F
(
fluid
.
F
());
...
...
@@ -72,16 +65,24 @@ tmp<surfaceScalarField> phiF2;
// Phase-1 dispersion, lift and wall-lubrication flux
phiF1
=
(
D
f1
*
snGradAlpha1
D
byA1
()
*
snGradAlpha1
+
(
fvc
::
interpolate
(
rAU1
*
F
)
&
mesh
.
Sf
())
);
// Phase-2 dispersion, lift and wall-lubrication flux
phiF2
=
(
-
D
f2
*
snGradAlpha1
-
D
byA2
()
*
snGradAlpha1
-
(
fvc
::
interpolate
(
rAU2
*
F
)
&
mesh
.
Sf
())
);
// Cache the phase diffusivities for implicit treatment in the
// phase-fraction equation
if
(
implicitPhasePressure
)
{
phase1
.
DbyA
(
DbyA1
);
phase2
.
DbyA
(
DbyA2
);
}
}
...
...
applications/solvers/multiphase/reactingTwoPhaseEulerFoam/pUf/pEqn.H
View file @
bf95b5c2
...
...
@@ -69,11 +69,12 @@ tmp<surfaceScalarField> Ff2;
fvc
::
interpolate
(
D
+
phase2
.
turbulence
().
pPrime
())
);
// Cache the
net
diffusivit
y
for implicit
diffusion
treatment in the
// Cache the
phase
diffusivit
ies
for implicit treatment in the
// phase-fraction equation
if
(
implicitPhasePressure
)
{
fluid
.
pPrimeByA
()
=
rAUf1
*
Df1
+
rAUf2
*
Df2
;
phase1
.
DbyA
(
rAUf1
*
Df1
);
phase2
.
DbyA
(
rAUf2
*
Df2
);
}
// Lift and wall-lubrication forces
...
...
applications/solvers/multiphase/reactingTwoPhaseEulerFoam/phaseSystems/phaseModel/AnisothermalPhaseModel/AnisothermalPhaseModel.C
View file @
bf95b5c2
...
...
@@ -139,7 +139,7 @@ bool Foam::AnisothermalPhaseModel<BasePhaseModel>::compressible() const
template
<
class
BasePhaseModel
>
Foam
::
tmp
<
Foam
::
volScalarField
>
const
Foam
::
volScalarField
&
Foam
::
AnisothermalPhaseModel
<
BasePhaseModel
>::
divU
()
const
{
return
divU_
;
...
...
applications/solvers/multiphase/reactingTwoPhaseEulerFoam/phaseSystems/phaseModel/AnisothermalPhaseModel/AnisothermalPhaseModel.H
View file @
bf95b5c2
...
...
@@ -90,7 +90,7 @@ public:
virtual
bool
compressible
()
const
;
//- Phase dilatation rate (d(alpha)/dt + div(alpha*phi))
virtual
tmp
<
volScalarField
>
divU
()
const
;
virtual
const
volScalarField
&
divU
()
const
;
//- Set phase dilatation rate (d(alpha)/dt + div(alpha*phi))
virtual
void
divU
(
const
volScalarField
&
divU
);
...
...
applications/solvers/multiphase/reactingTwoPhaseEulerFoam/phaseSystems/phaseModel/MovingPhaseModel/MovingPhaseModel.C
View file @
bf95b5c2
...
...
@@ -257,6 +257,31 @@ Foam::MovingPhaseModel<BasePhaseModel>::UEqn()
}
template
<
class
BasePhaseModel
>
const
Foam
::
surfaceScalarField
&
Foam
::
MovingPhaseModel
<
BasePhaseModel
>::
DbyA
()
const
{
if
(
DbyA_
.
valid
())
{
return
DbyA_
;
}
else
{
return
surfaceScalarField
::
null
();
}
}
template
<
class
BasePhaseModel
>
void
Foam
::
MovingPhaseModel
<
BasePhaseModel
>::
DbyA
(
const
tmp
<
surfaceScalarField
>&
DbyA
)
{
DbyA_
=
DbyA
;
}
template
<
class
BasePhaseModel
>
Foam
::
tmp
<
Foam
::
volVectorField
>
Foam
::
MovingPhaseModel
<
BasePhaseModel
>::
U
()
const
...
...
applications/solvers/multiphase/reactingTwoPhaseEulerFoam/phaseSystems/phaseModel/MovingPhaseModel/MovingPhaseModel.H
View file @
bf95b5c2
...
...
@@ -88,6 +88,10 @@ class MovingPhaseModel
//- Continuity error
volScalarField
continuityError_
;
//- Phase diffusivity divided by the momentum coefficient.
// Used for implicit treatment of the phase pressure and dispersion
tmp
<
surfaceScalarField
>
DbyA_
;
// Private static member functions
...
...
@@ -124,6 +128,16 @@ public:
//- Return the momentum equation
virtual
tmp
<
fvVectorMatrix
>
UEqn
();
// Implicit phase pressure and dispersion support
//- Return the phase diffusivity divided by the momentum coefficient
virtual
const
surfaceScalarField
&
DbyA
()
const
;
//- Set the phase diffusivity divided by the momentum coefficient
virtual
void
DbyA
(
const
tmp
<
surfaceScalarField
>&
DbyA
);
// Momentum
//- Constant access the velocity
...
...
applications/solvers/multiphase/reactingTwoPhaseEulerFoam/phaseSystems/phaseModel/phaseModel/phaseModel.C
View file @
bf95b5c2
...
...
@@ -140,9 +140,10 @@ bool Foam::phaseModel::compressible() const
}
Foam
::
tmp
<
Foam
::
volScalarField
>
Foam
::
phaseModel
::
divU
()
const
const
Foam
::
volScalarField
&
Foam
::
phaseModel
::
divU
()
const
{
return
tmp
<
volScalarField
>
();
notImplemented
(
"Foam::phaseModel::divU()"
);
return
volScalarField
::
null
();
}
...
...
@@ -154,4 +155,18 @@ void Foam::phaseModel::divU(const volScalarField& divU)
}
const
Foam
::
surfaceScalarField
&
Foam
::
phaseModel
::
DbyA
()
const
{
return
surfaceScalarField
::
null
();
}
void
Foam
::
phaseModel
::
DbyA
(
const
tmp
<
surfaceScalarField
>&
DbyA
)
{
WarningIn
(
"phaseModel::DbyA(const surfaceScalarField& DbyA)"
)
<<
"Attempt to set the dilatation rate of an incompressible phase"
<<
endl
;
}
// ************************************************************************* //
applications/solvers/multiphase/reactingTwoPhaseEulerFoam/phaseSystems/phaseModel/phaseModel/phaseModel.H
View file @
bf95b5c2
...
...
@@ -169,13 +169,22 @@ public:
//- Return true if the phase is compressible otherwise false
virtual
bool
compressible
()
const
;
//-
P
hase dilatation rate (d(alpha)/dt + div(alpha*phi))
virtual
tmp
<
volScalarField
>
divU
()
const
;
//-
Return the p
hase dilatation rate (d(alpha)/dt + div(alpha*phi))
virtual
const
volScalarField
&
divU
()
const
;
//- Set phase dilatation rate (d(alpha)/dt + div(alpha*phi))
//- Set
the
phase dilatation rate (d(alpha)/dt + div(alpha*phi))
virtual
void
divU
(
const
volScalarField
&
divU
);
// Implicit phase pressure and dispersion support
//- Return the phase diffusivity divided by the momentum coefficient
virtual
const
surfaceScalarField
&
DbyA
()
const
;
//- Set the phase diffusivity divided by the momentum coefficient
virtual
void
DbyA
(
const
tmp
<
surfaceScalarField
>&
DbyA
);
// Thermo
//- Return const access to the thermophysical model
...
...
applications/solvers/multiphase/reactingTwoPhaseEulerFoam/phaseSystems/twoPhaseSystem/twoPhaseSystem.C
View file @
bf95b5c2
...
...
@@ -190,9 +190,9 @@ void Foam::twoPhaseSystem::solve()
tdgdt
=
(
alpha2
.
dimensionedInternalField
()
*
phase1_
.
divU
()
()
.
dimensionedInternalField
()
*
phase1_
.
divU
().
dimensionedInternalField
()
-
alpha1
.
dimensionedInternalField
()
*
phase2_
.
divU
()
()
.
dimensionedInternalField
()
*
phase2_
.
divU
().
dimensionedInternalField
()
);
}
else
if
(
phase1_
.
compressible
())
...
...
@@ -200,7 +200,7 @@ void Foam::twoPhaseSystem::solve()
tdgdt
=
(
alpha2
.
dimensionedInternalField
()
*
phase1_
.
divU
()
()
.
dimensionedInternalField
()
*
phase1_
.
divU
().
dimensionedInternalField
()
);
}
else
if
(
phase2_
.
compressible
())
...
...
@@ -208,7 +208,7 @@ void Foam::twoPhaseSystem::solve()
tdgdt
=
(
-
alpha1
.
dimensionedInternalField
()
*
phase2_
.
divU
()
()
.
dimensionedInternalField
()
*
phase2_
.
divU
().
dimensionedInternalField
()
);
}
...
...
@@ -218,20 +218,18 @@ void Foam::twoPhaseSystem::solve()
surfaceScalarField
phic
(
"phic"
,
phi
);
surfaceScalarField
phir
(
"phir"
,
phi1
-
phi2
);
tmp
<
surfaceScalarField
>
alpha
1alpha2f
;
tmp
<
surfaceScalarField
>
alpha
DbyA
;
if
(
pPrimeByA_
.
valid
(
))
if
(
notNull
(
phase1_
.
DbyA
())
&&
notNull
(
phase2_
.
DbyA
()
))
{
alpha1alpha2f
=
fvc
::
interpolate
(
max
(
alpha1
,
scalar
(
0
)))
*
fvc
::
interpolate
(
max
(
alpha2
,
scalar
(
0
)));
surfaceScalarField
DbyA
(
phase1_
.
DbyA
()
+
phase2_
.
DbyA
());
surfaceScalarField
phiP
(
pPrimeByA_
()
*
fvc
::
snGrad
(
alpha
1
,
"bounded"
)
*
mesh_
.
magSf
(
)
)
;
alphaDbyA
=
fvc
::
interpolate
(
max
(
alpha1
,
scalar
(
0
)))
*
fvc
::
interpolate
(
max
(
alpha
2
,
scalar
(
0
))
)
*
DbyA
;
phir
+=
phiP
;
phir
+=
DbyA
*
fvc
::
snGrad
(
alpha1
,
"bounded"
)
*
mesh_
.
magSf
()
;
}
for
(
int
acorr
=
0
;
acorr
<
nAlphaCorr
;
acorr
++
)
...
...
@@ -367,12 +365,12 @@ void Foam::twoPhaseSystem::solve()
phase1_
.
alphaPhi
()
=
alphaPhic1
;
}
if
(
pPrimeB
yA
_
.
valid
())
if
(
alphaDb
yA
.
valid
())
{
fvScalarMatrix
alpha1Eqn
(
fvm
::
ddt
(
alpha1
)
-
fvc
::
ddt
(
alpha1
)
-
fvm
::
laplacian
(
alpha
1alpha2f
*
pPrimeByA_
()
,
alpha1
,
"bounded"
)
-
fvm
::
laplacian
(
alpha
DbyA
,
alpha1
,
"bounded"
)
);
alpha1Eqn
.
relax
();
...
...
applications/solvers/multiphase/reactingTwoPhaseEulerFoam/phaseSystems/twoPhaseSystem/twoPhaseSystem.H
View file @
bf95b5c2
...
...
@@ -63,9 +63,6 @@ protected:
//- Phase model 2
phaseModel
&
phase2_
;
//- Optional dispersion diffusivity
tmp
<
surfaceScalarField
>
pPrimeByA_
;
public:
...
...
@@ -173,9 +170,6 @@ public:
//- Return the virtual mass model for the given phase
const
virtualMassModel
&
virtualMass
(
const
phaseModel
&
phase
)
const
;
//- Return non-const access to the dispersion diffusivity
inline
tmp
<
surfaceScalarField
>&
pPrimeByA
();
};
...
...
applications/solvers/multiphase/reactingTwoPhaseEulerFoam/phaseSystems/twoPhaseSystem/twoPhaseSystemI.H
View file @
bf95b5c2
...
...
@@ -65,10 +65,4 @@ inline const Foam::phaseModel& Foam::twoPhaseSystem::otherPhase
}
inline
Foam
::
tmp
<
Foam
::
surfaceScalarField
>&
Foam
::
twoPhaseSystem
::
pPrimeByA
()
{
return
pPrimeByA_
;
}
// ************************************************************************* //
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment