Skip to content
GitLab
Explore
Sign in
Register
Primary navigation
Search or go to…
Project
openfoam
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Deploy
Releases
Model registry
Analyze
Contributor analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Development
openfoam
Commits
61a0fb16
Commit
61a0fb16
authored
13 years ago
by
Henry
Browse files
Options
Downloads
Patches
Plain Diff
twoPhaseEulerFoam/pEqn.H: use cell-based drag in momentum corrector
parent
97e659a5
No related branches found
No related tags found
No related merge requests found
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
applications/solvers/multiphase/twoPhaseEulerFoam/pEqn.H
+24
-29
24 additions, 29 deletions
applications/solvers/multiphase/twoPhaseEulerFoam/pEqn.H
applications/solvers/multiphase/twoPhaseEulerFoam/pEqn.H.old
+118
-0
118 additions, 0 deletions
applications/solvers/multiphase/twoPhaseEulerFoam/pEqn.H.old
with
142 additions
and
29 deletions
applications/solvers/multiphase/twoPhaseEulerFoam/pEqn.H
+
24
−
29
View file @
61a0fb16
...
@@ -5,8 +5,8 @@
...
@@ -5,8 +5,8 @@
volScalarField
rAU1
(
1
.
0
/
U1Eqn
.
A
());
volScalarField
rAU1
(
1
.
0
/
U1Eqn
.
A
());
volScalarField
rAU2
(
1
.
0
/
U2Eqn
.
A
());
volScalarField
rAU2
(
1
.
0
/
U2Eqn
.
A
());
rAU1f
=
fvc
::
interpolate
(
rA
U1
);
rAU1f
=
1
.
0
/
fvc
::
interpolate
(
U1
Eqn
.
A
()
);
surfaceScalarField
rAU2f
(
fvc
::
interpolate
(
rA
U2
));
surfaceScalarField
rAU2f
(
1
.
0
/
fvc
::
interpolate
(
U2
Eqn
.
A
()
));
volVectorField
HbyA1
(
"HbyA1"
,
U1
);
volVectorField
HbyA1
(
"HbyA1"
,
U1
);
HbyA1
=
rAU1
*
U1Eqn
.
H
();
HbyA1
=
rAU1
*
U1Eqn
.
H
();
...
@@ -16,39 +16,19 @@
...
@@ -16,39 +16,19 @@
mrfZones
.
absoluteFlux
(
phi1
.
oldTime
());
mrfZones
.
absoluteFlux
(
phi1
.
oldTime
());
mrfZones
.
absoluteFlux
(
phi1
);
mrfZones
.
absoluteFlux
(
phi1
);
mrfZones
.
absoluteFlux
(
phi2
.
oldTime
());
mrfZones
.
absoluteFlux
(
phi2
.
oldTime
());
mrfZones
.
absoluteFlux
(
phi2
);
mrfZones
.
absoluteFlux
(
phi2
);
surfaceScalarField
phiDrag1
surfaceScalarField
ppDrag
(
"ppDrag"
,
0
.
0
*
phi1
);
(
fvc
::
interpolate
(
alpha2
/
rho1
*
K
*
rAU1
)
*
phi2
+
rAU1f
*
(
g
&
mesh
.
Sf
())
);
if
(
g0
.
value
()
>
0
.
0
)
if
(
g0
.
value
()
>
0
.
0
)
{
{
p
hi
Drag
1
-=
ppMagf
*
fvc
::
snGrad
(
alpha1
)
*
mesh
.
magSf
();
p
p
Drag
-=
ppMagf
*
fvc
::
snGrad
(
alpha1
)
*
mesh
.
magSf
();
}
}
if
(
kineticTheory
.
on
())
if
(
kineticTheory
.
on
())
{
{
phiDrag1
-=
rAU1f
*
fvc
::
snGrad
(
kineticTheory
.
pa
()
/
rho1
)
*
mesh
.
magSf
();
ppDrag
-=
rAU1f
*
fvc
::
snGrad
(
kineticTheory
.
pa
()
/
rho1
)
*
mesh
.
magSf
();
}
surfaceScalarField
phiDrag2
(
fvc
::
interpolate
(
alpha1
/
rho2
*
K
*
rAU2
)
*
phi1
+
rAU2f
*
(
g
&
mesh
.
Sf
())
);
// Fix for gravity on outlet boundary.
forAll
(
p
.
boundaryField
(),
patchi
)
{
if
(
isA
<
zeroGradientFvPatchScalarField
>
(
p
.
boundaryField
()[
patchi
]))
{
phiDrag1
.
boundaryField
()[
patchi
]
=
0
.
0
;
phiDrag2
.
boundaryField
()[
patchi
]
=
0
.
0
;
}
}
}
surfaceScalarField
phiHbyA1
surfaceScalarField
phiHbyA1
...
@@ -56,7 +36,9 @@
...
@@ -56,7 +36,9 @@
"phiHbyA1"
,
"phiHbyA1"
,
(
fvc
::
interpolate
(
HbyA1
)
&
mesh
.
Sf
())
(
fvc
::
interpolate
(
HbyA1
)
&
mesh
.
Sf
())
+
fvc
::
ddtPhiCorr
(
rAU1
,
U1
,
phi1
)
+
fvc
::
ddtPhiCorr
(
rAU1
,
U1
,
phi1
)
+
phiDrag1
+
fvc
::
interpolate
(
alpha2
/
rho1
*
K
*
rAU1
)
*
phi2
+
ppDrag
+
rAU1f
*
(
g
&
mesh
.
Sf
())
);
);
mrfZones
.
relativeFlux
(
phiHbyA1
);
mrfZones
.
relativeFlux
(
phiHbyA1
);
...
@@ -65,7 +47,8 @@
...
@@ -65,7 +47,8 @@
"phiHbyA2"
,
"phiHbyA2"
,
(
fvc
::
interpolate
(
HbyA2
)
&
mesh
.
Sf
())
(
fvc
::
interpolate
(
HbyA2
)
&
mesh
.
Sf
())
+
fvc
::
ddtPhiCorr
(
rAU2
,
U2
,
phi2
)
+
fvc
::
ddtPhiCorr
(
rAU2
,
U2
,
phi2
)
+
phiDrag2
+
fvc
::
interpolate
(
alpha1
/
rho2
*
K
*
rAU2
)
*
phi1
+
rAU2f
*
(
g
&
mesh
.
Sf
())
);
);
mrfZones
.
relativeFlux
(
phiHbyA2
);
mrfZones
.
relativeFlux
(
phiHbyA2
);
...
@@ -76,6 +59,9 @@
...
@@ -76,6 +59,9 @@
surfaceScalarField
phiHbyA
(
"phiHbyA"
,
alpha1f
*
phiHbyA1
+
alpha2f
*
phiHbyA2
);
surfaceScalarField
phiHbyA
(
"phiHbyA"
,
alpha1f
*
phiHbyA1
+
alpha2f
*
phiHbyA2
);
HbyA1
+=
alpha2
*
(
1
.
0
/
rho1
)
*
rAU1
*
K
*
U2
;
HbyA2
+=
alpha1
*
(
1
.
0
/
rho2
)
*
rAU2
*
K
*
U1
;
surfaceScalarField
Dp
surfaceScalarField
Dp
(
(
"Dp"
,
"Dp"
,
...
@@ -104,10 +90,19 @@
...
@@ -104,10 +90,19 @@
p
.
relax
();
p
.
relax
();
SfGradp
=
pEqn
.
flux
()
/
Dp
;
SfGradp
=
pEqn
.
flux
()
/
Dp
;
U1
=
HbyA1
+
fvc
::
reconstruct
(
phiDrag1
-
rAU1f
*
SfGradp
/
rho1
);
U1
=
HbyA1
+
fvc
::
reconstruct
(
ppDrag
+
rAU1f
*
((
g
&
mesh
.
Sf
())
-
SfGradp
/
rho1
)
);
U1
.
correctBoundaryConditions
();
U1
.
correctBoundaryConditions
();
U2
=
HbyA2
+
fvc
::
reconstruct
(
phiDrag2
-
rAU2f
*
SfGradp
/
rho2
);
U2
=
HbyA2
+
fvc
::
reconstruct
(
rAU2f
*
((
g
&
mesh
.
Sf
())
-
SfGradp
/
rho2
)
);
U2
.
correctBoundaryConditions
();
U2
.
correctBoundaryConditions
();
U
=
alpha1
*
U1
+
alpha2
*
U2
;
U
=
alpha1
*
U1
+
alpha2
*
U2
;
...
...
This diff is collapsed.
Click to expand it.
applications/solvers/multiphase/twoPhaseEulerFoam/pEqn.H.old
0 → 100644
+
118
−
0
View file @
61a0fb16
{
surfaceScalarField alpha1f(fvc::interpolate(alpha1));
surfaceScalarField alpha2f(scalar(1) - alpha1f);
volScalarField rAU1(1.0/U1Eqn.A());
volScalarField rAU2(1.0/U2Eqn.A());
rAU1f = fvc::interpolate(rAU1);
surfaceScalarField rAU2f(fvc::interpolate(rAU2));
volVectorField HbyA1("HbyA1", U1);
HbyA1 = rAU1*U1Eqn.H();
volVectorField HbyA2("HbyA2", U2);
HbyA2 = rAU2*U2Eqn.H();
mrfZones.absoluteFlux(phi1.oldTime());
mrfZones.absoluteFlux(phi1);
mrfZones.absoluteFlux(phi2.oldTime());
mrfZones.absoluteFlux(phi2);
surfaceScalarField phiDrag1
(
fvc::interpolate(alpha2/rho1*K*rAU1)*phi2 + rAU1f*(g & mesh.Sf())
);
if (g0.value() > 0.0)
{
phiDrag1 -= ppMagf*fvc::snGrad(alpha1)*mesh.magSf();
}
if (kineticTheory.on())
{
phiDrag1 -= rAU1f*fvc::snGrad(kineticTheory.pa()/rho1)*mesh.magSf();
}
surfaceScalarField phiDrag2
(
fvc::interpolate(alpha1/rho2*K*rAU2)*phi1 + rAU2f*(g & mesh.Sf())
);
// Fix for gravity on outlet boundary.
forAll(p.boundaryField(), patchi)
{
if (isA<zeroGradientFvPatchScalarField>(p.boundaryField()[patchi]))
{
phiDrag1.boundaryField()[patchi] = 0.0;
phiDrag2.boundaryField()[patchi] = 0.0;
}
}
surfaceScalarField phiHbyA1
(
"phiHbyA1",
(fvc::interpolate(HbyA1) & mesh.Sf())
+ fvc::ddtPhiCorr(rAU1, U1, phi1)
+ phiDrag1
);
mrfZones.relativeFlux(phiHbyA1);
surfaceScalarField phiHbyA2
(
"phiHbyA2",
(fvc::interpolate(HbyA2) & mesh.Sf())
+ fvc::ddtPhiCorr(rAU2, U2, phi2)
+ phiDrag2
);
mrfZones.relativeFlux(phiHbyA2);
mrfZones.relativeFlux(phi1.oldTime());
mrfZones.relativeFlux(phi1);
mrfZones.relativeFlux(phi2.oldTime());
mrfZones.relativeFlux(phi2);
surfaceScalarField phiHbyA("phiHbyA", alpha1f*phiHbyA1 + alpha2f*phiHbyA2);
surfaceScalarField Dp
(
"Dp",
alpha1f*rAU1f/rho1 + alpha2f*rAU2f/rho2
);
while (pimple.correctNonOrthogonal())
{
fvScalarMatrix pEqn
(
fvm::laplacian(Dp, p) == fvc::div(phiHbyA)
);
pEqn.setReference(pRefCell, pRefValue);
pEqn.solve(mesh.solver(p.select(pimple.finalInnerIter())));
if (pimple.finalNonOrthogonalIter())
{
surfaceScalarField SfGradp(pEqn.flux()/Dp);
phi1 = phiHbyA1 - rAU1f*SfGradp/rho1;
phi2 = phiHbyA2 - rAU2f*SfGradp/rho2;
phi = alpha1f*phi1 + alpha2f*phi2;
p.relax();
SfGradp = pEqn.flux()/Dp;
U1 = HbyA1 + fvc::reconstruct(phiDrag1 - rAU1f*SfGradp/rho1);
U1.correctBoundaryConditions();
U2 = HbyA2 + fvc::reconstruct(phiDrag2 - rAU2f*SfGradp/rho2);
U2.correctBoundaryConditions();
U = alpha1*U1 + alpha2*U2;
}
}
}
#include "continuityErrs.H"
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment