mirror of
https://develop.openfoam.com/Development/openfoam.git
synced 2025-11-28 03:28:01 +00:00
VoF solvers: rationalize the relationship between VoF solvers
Improve code reuse Add multiphaseInterDyMFoam Retire MRFinterFoam -> now handled by interFoam with fvOptions Update tutorials
This commit is contained in:
@ -57,12 +57,12 @@
|
||||
|
||||
Info<< "Reading transportProperties\n" << endl;
|
||||
|
||||
incompressibleTwoPhaseMixture twoPhaseProperties(U, phi);
|
||||
incompressibleTwoPhaseMixture mixture(U, phi);
|
||||
|
||||
volScalarField& alphav(twoPhaseProperties.alpha1());
|
||||
volScalarField& alphav(mixture.alpha1());
|
||||
alphav.oldTime();
|
||||
|
||||
volScalarField& alphal(twoPhaseProperties.alpha2());
|
||||
volScalarField& alphal(mixture.alpha2());
|
||||
|
||||
Info<< "Creating compressibilityModel\n" << endl;
|
||||
autoPtr<barotropicCompressibilityModel> psiModel =
|
||||
@ -85,5 +85,5 @@
|
||||
// Create incompressible turbulence model
|
||||
autoPtr<incompressible::turbulenceModel> turbulence
|
||||
(
|
||||
incompressible::turbulenceModel::New(U, phi, twoPhaseProperties)
|
||||
incompressible::turbulenceModel::New(U, phi, mixture)
|
||||
);
|
||||
|
||||
@ -1,5 +1,6 @@
|
||||
EXE_INC = \
|
||||
-ItwoPhaseMixtureThermo \
|
||||
-I$(LIB_SRC)/transportModels/compressible/lnInclude \
|
||||
-I$(LIB_SRC)/thermophysicalModels/basic/lnInclude \
|
||||
-I$(LIB_SRC)/transportModels/twoPhaseMixture/lnInclude \
|
||||
-I$(LIB_SRC)/transportModels/interfaceProperties/lnInclude \
|
||||
|
||||
@ -3,19 +3,19 @@
|
||||
(
|
||||
fvm::ddt(rho, T)
|
||||
+ fvm::div(rhoPhi, T)
|
||||
- fvm::laplacian(twoPhaseProperties.alphaEff(turbulence->mut()), T)
|
||||
- fvm::laplacian(mixture.alphaEff(turbulence->mut()), T)
|
||||
+ (
|
||||
fvc::div(fvc::absolute(phi, U), p)
|
||||
+ fvc::ddt(rho, K) + fvc::div(rhoPhi, K)
|
||||
)
|
||||
*(
|
||||
alpha1/twoPhaseProperties.thermo1().Cv()
|
||||
+ alpha2/twoPhaseProperties.thermo2().Cv()
|
||||
alpha1/mixture.thermo1().Cv()
|
||||
+ alpha2/mixture.thermo2().Cv()
|
||||
)
|
||||
);
|
||||
|
||||
TEqn.relax();
|
||||
TEqn.solve();
|
||||
|
||||
twoPhaseProperties.correct();
|
||||
mixture.correct();
|
||||
}
|
||||
|
||||
@ -16,7 +16,7 @@
|
||||
fvc::reconstruct
|
||||
(
|
||||
(
|
||||
fvc::interpolate(interface.sigmaK())*fvc::snGrad(alpha1)
|
||||
interface.surfaceTensionForce()
|
||||
- ghf*fvc::snGrad(rho)
|
||||
- fvc::snGrad(p_rgh)
|
||||
) * mesh.magSf()
|
||||
|
||||
@ -1,6 +1,7 @@
|
||||
EXE_INC = \
|
||||
-I.. \
|
||||
-I../twoPhaseMixtureThermo \
|
||||
-I$(LIB_SRC)/transportModels/compressible/lnInclude \
|
||||
-I$(LIB_SRC)/thermophysicalModels/basic/lnInclude \
|
||||
-I$(LIB_SRC)/transportModels/twoPhaseMixture/lnInclude \
|
||||
-I$(LIB_SRC)/transportModels/interfaceProperties/lnInclude \
|
||||
|
||||
@ -15,7 +15,7 @@
|
||||
surfaceScalarField phig
|
||||
(
|
||||
(
|
||||
fvc::interpolate(interface.sigmaK())*fvc::snGrad(alpha1)
|
||||
interface.surfaceTensionForce()
|
||||
- ghf*fvc::snGrad(rho)
|
||||
)*rAUf*mesh.magSf()
|
||||
);
|
||||
|
||||
@ -29,19 +29,19 @@
|
||||
#include "createPhi.H"
|
||||
|
||||
Info<< "Constructing twoPhaseMixtureThermo\n" << endl;
|
||||
twoPhaseMixtureThermo twoPhaseProperties(mesh);
|
||||
twoPhaseMixtureThermo mixture(mesh);
|
||||
|
||||
volScalarField& alpha1(twoPhaseProperties.alpha1());
|
||||
volScalarField& alpha2(twoPhaseProperties.alpha2());
|
||||
volScalarField& alpha1(mixture.alpha1());
|
||||
volScalarField& alpha2(mixture.alpha2());
|
||||
|
||||
Info<< "Reading thermophysical properties\n" << endl;
|
||||
|
||||
volScalarField& p = twoPhaseProperties.p();
|
||||
volScalarField& T = twoPhaseProperties.T();
|
||||
volScalarField& rho1 = twoPhaseProperties.thermo1().rho();
|
||||
const volScalarField& psi1 = twoPhaseProperties.thermo1().psi();
|
||||
volScalarField& rho2 = twoPhaseProperties.thermo2().rho();
|
||||
const volScalarField& psi2 = twoPhaseProperties.thermo2().psi();
|
||||
volScalarField& p = mixture.p();
|
||||
volScalarField& T = mixture.T();
|
||||
volScalarField& rho1 = mixture.thermo1().rho();
|
||||
const volScalarField& psi1 = mixture.thermo1().psi();
|
||||
volScalarField& rho2 = mixture.thermo2().rho();
|
||||
const volScalarField& psi2 = mixture.thermo2().psi();
|
||||
|
||||
volScalarField rho
|
||||
(
|
||||
@ -57,7 +57,7 @@
|
||||
);
|
||||
|
||||
|
||||
dimensionedScalar pMin(twoPhaseProperties.lookup("pMin"));
|
||||
dimensionedScalar pMin(mixture.lookup("pMin"));
|
||||
|
||||
Info<< "Calculating field g.h\n" << endl;
|
||||
volScalarField gh("gh", g & mesh.C());
|
||||
@ -85,12 +85,12 @@
|
||||
);
|
||||
|
||||
// Construct interface from alpha1 distribution
|
||||
interfaceProperties interface(alpha1, U, twoPhaseProperties);
|
||||
interfaceProperties interface(alpha1, U, mixture);
|
||||
|
||||
// Construct compressible turbulence model
|
||||
autoPtr<compressible::turbulenceModel> turbulence
|
||||
(
|
||||
compressible::turbulenceModel::New(rho, U, rhoPhi, twoPhaseProperties)
|
||||
compressible::turbulenceModel::New(rho, U, rhoPhi, mixture)
|
||||
);
|
||||
|
||||
Info<< "Creating field kinetic energy K\n" << endl;
|
||||
|
||||
@ -15,7 +15,7 @@
|
||||
surfaceScalarField phig
|
||||
(
|
||||
(
|
||||
fvc::interpolate(interface.sigmaK())*fvc::snGrad(alpha1)
|
||||
interface.surfaceTensionForce()
|
||||
- ghf*fvc::snGrad(rho)
|
||||
)*rAUf*mesh.magSf()
|
||||
);
|
||||
|
||||
@ -1,4 +1,5 @@
|
||||
EXE_INC = \
|
||||
-I$(LIB_SRC)/transportModels/compressible/lnInclude \
|
||||
-I$(LIB_SRC)/thermophysicalModels/basic/lnInclude \
|
||||
-I$(LIB_SRC)/transportModels/twoPhaseMixture/lnInclude \
|
||||
-I$(LIB_SRC)/finiteVolume/lnInclude
|
||||
|
||||
@ -1,5 +1,7 @@
|
||||
EXE_INC = \
|
||||
-I../interFoam \
|
||||
-ImultiphaseMixtureThermo/lnInclude \
|
||||
-I$(LIB_SRC)/transportModels/compressible/lnInclude \
|
||||
-I$(LIB_SRC)/thermophysicalModels/basic/lnInclude \
|
||||
-I$(LIB_SRC)/transportModels/twoPhaseMixture/lnInclude \
|
||||
-I$(LIB_SRC)/transportModels/interfaceProperties/lnInclude \
|
||||
|
||||
@ -2,16 +2,16 @@
|
||||
fvScalarMatrix TEqn
|
||||
(
|
||||
fvm::ddt(rho, T)
|
||||
+ fvm::div(multiphaseProperties.rhoPhi(), T)
|
||||
- fvm::laplacian(multiphaseProperties.alphaEff(turbulence->mut()), T)
|
||||
+ fvm::div(mixture.rhoPhi(), T)
|
||||
- fvm::laplacian(mixture.alphaEff(turbulence->mut()), T)
|
||||
+ (
|
||||
fvc::div(fvc::absolute(phi, U), p)
|
||||
+ fvc::ddt(rho, K) + fvc::div(multiphaseProperties.rhoPhi(), K)
|
||||
)*multiphaseProperties.rCv()
|
||||
+ fvc::ddt(rho, K) + fvc::div(mixture.rhoPhi(), K)
|
||||
)*mixture.rCv()
|
||||
);
|
||||
|
||||
TEqn.relax();
|
||||
TEqn.solve();
|
||||
|
||||
multiphaseProperties.correct();
|
||||
mixture.correct();
|
||||
}
|
||||
|
||||
@ -1,7 +1,7 @@
|
||||
fvVectorMatrix UEqn
|
||||
(
|
||||
fvm::ddt(rho, U)
|
||||
+ fvm::div(multiphaseProperties.rhoPhi(), U)
|
||||
+ fvm::div(mixture.rhoPhi(), U)
|
||||
+ turbulence->divDevRhoReff(U)
|
||||
);
|
||||
|
||||
@ -16,7 +16,7 @@
|
||||
fvc::reconstruct
|
||||
(
|
||||
(
|
||||
multiphaseProperties.surfaceTensionForce()
|
||||
mixture.surfaceTensionForce()
|
||||
- ghf*fvc::snGrad(rho)
|
||||
- fvc::snGrad(p_rgh)
|
||||
) * mesh.magSf()
|
||||
|
||||
@ -2,7 +2,7 @@
|
||||
========= |
|
||||
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
|
||||
\\ / O peration |
|
||||
\\ / A nd | Copyright (C) 2013 OpenFOAM Foundation
|
||||
\\ / A nd | Copyright (C) 2013-2014 OpenFOAM Foundation
|
||||
\\/ M anipulation |
|
||||
-------------------------------------------------------------------------------
|
||||
License
|
||||
@ -76,9 +76,9 @@ int main(int argc, char *argv[])
|
||||
// --- Pressure-velocity PIMPLE corrector loop
|
||||
while (pimple.loop())
|
||||
{
|
||||
multiphaseProperties.solve();
|
||||
mixture.solve();
|
||||
|
||||
solve(fvm::ddt(rho) + fvc::div(multiphaseProperties.rhoPhi()));
|
||||
solve(fvm::ddt(rho) + fvc::div(mixture.rhoPhi()));
|
||||
|
||||
#include "UEqn.H"
|
||||
#include "TEqn.H"
|
||||
|
||||
@ -29,10 +29,10 @@
|
||||
#include "createPhi.H"
|
||||
|
||||
Info<< "Constructing multiphaseMixtureThermo\n" << endl;
|
||||
multiphaseMixtureThermo multiphaseProperties(U, phi);
|
||||
multiphaseMixtureThermo mixture(U, phi);
|
||||
|
||||
volScalarField& p = multiphaseProperties.p();
|
||||
volScalarField& T = multiphaseProperties.T();
|
||||
volScalarField& p = mixture.p();
|
||||
volScalarField& T = mixture.T();
|
||||
|
||||
volScalarField rho
|
||||
(
|
||||
@ -43,12 +43,12 @@
|
||||
mesh,
|
||||
IOobject::READ_IF_PRESENT
|
||||
),
|
||||
multiphaseProperties.rho()
|
||||
mixture.rho()
|
||||
);
|
||||
|
||||
Info<< max(rho) << min(rho);
|
||||
|
||||
dimensionedScalar pMin(multiphaseProperties.lookup("pMin"));
|
||||
dimensionedScalar pMin(mixture.lookup("pMin"));
|
||||
|
||||
|
||||
Info<< "Calculating field g.h\n" << endl;
|
||||
@ -62,8 +62,8 @@
|
||||
(
|
||||
rho,
|
||||
U,
|
||||
multiphaseProperties.rhoPhi(),
|
||||
multiphaseProperties
|
||||
mixture.rhoPhi(),
|
||||
mixture
|
||||
)
|
||||
);
|
||||
|
||||
|
||||
@ -1,4 +1,5 @@
|
||||
EXE_INC = \
|
||||
-I$(LIB_SRC)/transportModels/compressible/lnInclude \
|
||||
-I$(LIB_SRC)/thermophysicalModels/basic/lnInclude \
|
||||
-I$(LIB_SRC)/finiteVolume/lnInclude
|
||||
|
||||
|
||||
@ -15,7 +15,7 @@
|
||||
surfaceScalarField phig
|
||||
(
|
||||
(
|
||||
multiphaseProperties.surfaceTensionForce()
|
||||
mixture.surfaceTensionForce()
|
||||
- ghf*fvc::snGrad(rho)
|
||||
)*rAUf*mesh.magSf()
|
||||
);
|
||||
@ -32,13 +32,13 @@
|
||||
)/(mesh.magSf().boundaryField()*rAUf.boundaryField())
|
||||
);
|
||||
|
||||
PtrList<fvScalarMatrix> p_rghEqnComps(multiphaseProperties.phases().size());
|
||||
PtrList<fvScalarMatrix> p_rghEqnComps(mixture.phases().size());
|
||||
|
||||
label phasei = 0;
|
||||
forAllConstIter
|
||||
(
|
||||
PtrDictionary<phaseModel>,
|
||||
multiphaseProperties.phases(),
|
||||
mixture.phases(),
|
||||
phase
|
||||
)
|
||||
{
|
||||
@ -74,7 +74,7 @@
|
||||
forAllConstIter
|
||||
(
|
||||
PtrDictionary<phaseModel>,
|
||||
multiphaseProperties.phases(),
|
||||
mixture.phases(),
|
||||
phase
|
||||
)
|
||||
{
|
||||
@ -105,14 +105,14 @@
|
||||
|
||||
if (pimple.finalNonOrthogonalIter())
|
||||
{
|
||||
// p = max(p_rgh + multiphaseProperties.rho()*gh, pMin);
|
||||
// p_rgh = p - multiphaseProperties.rho()*gh;
|
||||
// p = max(p_rgh + mixture.rho()*gh, pMin);
|
||||
// p_rgh = p - mixture.rho()*gh;
|
||||
|
||||
phasei = 0;
|
||||
forAllIter
|
||||
(
|
||||
PtrDictionary<phaseModel>,
|
||||
multiphaseProperties.phases(),
|
||||
mixture.phases(),
|
||||
phase
|
||||
)
|
||||
{
|
||||
@ -129,11 +129,11 @@
|
||||
}
|
||||
}
|
||||
|
||||
p = max(p_rgh + multiphaseProperties.rho()*gh, pMin);
|
||||
p = max(p_rgh + mixture.rho()*gh, pMin);
|
||||
|
||||
// Update densities from change in p_rgh
|
||||
multiphaseProperties.correctRho(p_rgh - p_rgh_0);
|
||||
rho = multiphaseProperties.rho();
|
||||
mixture.correctRho(p_rgh - p_rgh_0);
|
||||
rho = mixture.rho();
|
||||
|
||||
K = 0.5*magSqr(U);
|
||||
|
||||
|
||||
@ -4,7 +4,6 @@ set -x
|
||||
|
||||
wclean
|
||||
wclean interDyMFoam
|
||||
wclean MRFInterFoam
|
||||
wclean porousInterFoam
|
||||
wclean LTSInterFoam
|
||||
wclean interMixingFoam
|
||||
|
||||
@ -4,7 +4,6 @@ set -x
|
||||
|
||||
wmake
|
||||
wmake interDyMFoam
|
||||
wmake MRFInterFoam
|
||||
wmake porousInterFoam
|
||||
wmake LTSInterFoam
|
||||
wmake interMixingFoam
|
||||
|
||||
@ -40,8 +40,7 @@ Description
|
||||
#include "fvCFD.H"
|
||||
#include "CMULES.H"
|
||||
#include "subCycle.H"
|
||||
#include "interfaceProperties.H"
|
||||
#include "incompressibleTwoPhaseMixture.H"
|
||||
#include "immiscibleIncompressibleTwoPhaseMixture.H"
|
||||
#include "turbulenceModel.H"
|
||||
#include "fvcSmooth.H"
|
||||
#include "pimpleControl.H"
|
||||
@ -82,12 +81,12 @@ int main(int argc, char *argv[])
|
||||
{
|
||||
#include "alphaControls.H"
|
||||
|
||||
twoPhaseProperties.correct();
|
||||
|
||||
#define LTSSOLVE
|
||||
#include "alphaEqnSubCycle.H"
|
||||
#undef LTSSOLVE
|
||||
|
||||
mixture.correct();
|
||||
|
||||
turbulence->correct();
|
||||
|
||||
#include "UEqn.H"
|
||||
|
||||
@ -5,16 +5,14 @@ EXE_INC = \
|
||||
-I$(LIB_SRC)/transportModels/incompressible/lnInclude \
|
||||
-I$(LIB_SRC)/transportModels/interfaceProperties/lnInclude \
|
||||
-I$(LIB_SRC)/turbulenceModels/incompressible/turbulenceModel \
|
||||
-I$(LIB_SRC)/transportModels/immiscibleIncompressibleTwoPhaseMixture/lnInclude \
|
||||
-I$(LIB_SRC)/finiteVolume/lnInclude \
|
||||
-I$(LIB_SRC)/meshTools/lnInclude \
|
||||
-I$(LIB_SRC)/fvOptions/lnInclude \
|
||||
-I$(LIB_SRC)/sampling/lnInclude
|
||||
|
||||
EXE_LIBS = \
|
||||
-linterfaceProperties \
|
||||
-ltwoPhaseMixture \
|
||||
-ltwoPhaseProperties \
|
||||
-lincompressibleTransportModels \
|
||||
-limmiscibleIncompressibleTwoPhaseMixture \
|
||||
-lincompressibleTurbulenceModel \
|
||||
-lincompressibleRASModels \
|
||||
-lincompressibleLESModels \
|
||||
|
||||
@ -1,3 +0,0 @@
|
||||
MRFInterFoam.C
|
||||
|
||||
EXE = $(FOAM_APPBIN)/MRFInterFoam
|
||||
@ -1,38 +0,0 @@
|
||||
surfaceScalarField muEff
|
||||
(
|
||||
"muEff",
|
||||
twoPhaseProperties.muf()
|
||||
+ fvc::interpolate(rho*turbulence->nut())
|
||||
);
|
||||
|
||||
fvVectorMatrix UEqn
|
||||
(
|
||||
fvm::ddt(rho, U)
|
||||
+ fvm::div(rhoPhi, U)
|
||||
- fvm::laplacian(muEff, U)
|
||||
- (fvc::grad(U) & fvc::grad(muEff))
|
||||
//- fvc::div(muEff*(fvc::interpolate(dev(fvc::grad(U))) & mesh.Sf()))
|
||||
==
|
||||
fvOptions(rho, U)
|
||||
);
|
||||
|
||||
mrfZones.addCoriolis(rho, UEqn);
|
||||
UEqn.relax();
|
||||
fvOptions.constrain(UEqn);
|
||||
|
||||
if (pimple.momentumPredictor())
|
||||
{
|
||||
solve
|
||||
(
|
||||
UEqn
|
||||
==
|
||||
fvc::reconstruct
|
||||
(
|
||||
(
|
||||
fvc::interpolate(interface.sigmaK())*fvc::snGrad(alpha1)
|
||||
- ghf*fvc::snGrad(rho)
|
||||
- fvc::snGrad(p_rgh)
|
||||
) * mesh.magSf()
|
||||
)
|
||||
);
|
||||
}
|
||||
@ -1,2 +0,0 @@
|
||||
IOMRFZoneList mrfZones(mesh);
|
||||
mrfZones.correctBoundaryVelocity(U);
|
||||
@ -1,72 +0,0 @@
|
||||
{
|
||||
volScalarField rAU("rAU", 1.0/UEqn.A());
|
||||
surfaceScalarField rAUf("rAUf", fvc::interpolate(rAU));
|
||||
|
||||
volVectorField HbyA("HbyA", U);
|
||||
HbyA = rAU*UEqn.H();
|
||||
|
||||
surfaceScalarField phiHbyA
|
||||
(
|
||||
"phiHbyA",
|
||||
(fvc::interpolate(HbyA) & mesh.Sf())
|
||||
+ fvc::interpolate(rho*rAU)*fvc::ddtCorr(U, phi)
|
||||
);
|
||||
adjustPhi(phiHbyA, U, p_rgh);
|
||||
mrfZones.makeRelative(phiHbyA);
|
||||
|
||||
surfaceScalarField phig
|
||||
(
|
||||
(
|
||||
fvc::interpolate(interface.sigmaK())*fvc::snGrad(alpha1)
|
||||
- ghf*fvc::snGrad(rho)
|
||||
)*rAUf*mesh.magSf()
|
||||
);
|
||||
|
||||
phiHbyA += phig;
|
||||
|
||||
// Update the fixedFluxPressure BCs to ensure flux consistency
|
||||
setSnGrad<fixedFluxPressureFvPatchScalarField>
|
||||
(
|
||||
p_rgh.boundaryField(),
|
||||
(
|
||||
phiHbyA.boundaryField()
|
||||
- mrfZones.relative(mesh.Sf().boundaryField() & U.boundaryField())
|
||||
)/(mesh.magSf().boundaryField()*rAUf.boundaryField())
|
||||
);
|
||||
|
||||
while (pimple.correctNonOrthogonal())
|
||||
{
|
||||
fvScalarMatrix p_rghEqn
|
||||
(
|
||||
fvm::laplacian(rAUf, p_rgh) == fvc::div(phiHbyA)
|
||||
);
|
||||
|
||||
p_rghEqn.setReference(pRefCell, getRefCellValue(p_rgh, pRefCell));
|
||||
|
||||
p_rghEqn.solve(mesh.solver(p_rgh.select(pimple.finalInnerIter())));
|
||||
|
||||
if (pimple.finalNonOrthogonalIter())
|
||||
{
|
||||
phi = phiHbyA - p_rghEqn.flux();
|
||||
|
||||
U = HbyA + rAU*fvc::reconstruct((phig - p_rghEqn.flux())/rAUf);
|
||||
U.correctBoundaryConditions();
|
||||
fvOptions.correct(U);
|
||||
}
|
||||
}
|
||||
|
||||
#include "continuityErrs.H"
|
||||
|
||||
p == p_rgh + rho*gh;
|
||||
|
||||
if (p_rgh.needReference())
|
||||
{
|
||||
p += dimensionedScalar
|
||||
(
|
||||
"p",
|
||||
p.dimensions(),
|
||||
pRefValue - getRefCellValue(p, pRefCell)
|
||||
);
|
||||
p_rgh = p - rho*gh;
|
||||
}
|
||||
}
|
||||
@ -1,21 +0,0 @@
|
||||
{
|
||||
const scalarField& V = mesh.V();
|
||||
|
||||
forAll(mesh.cellZones(), czi)
|
||||
{
|
||||
const labelList& cellLabels = mesh.cellZones()[czi];
|
||||
|
||||
scalar phaseVolume = 0;
|
||||
|
||||
forAll(cellLabels, cli)
|
||||
{
|
||||
label celli = cellLabels[cli];
|
||||
phaseVolume += alpha1[celli]*V[celli];
|
||||
}
|
||||
|
||||
reduce(phaseVolume, sumOp<scalar>());
|
||||
|
||||
Info<< "Phase volume in zone " << mesh.cellZones()[czi].name()
|
||||
<< " = " << phaseVolume*1e6 << " ml " << endl;
|
||||
}
|
||||
}
|
||||
@ -1,23 +1,21 @@
|
||||
EXE_INC = -ggdb3 \
|
||||
EXE_INC = \
|
||||
-I$(LIB_SRC)/transportModels/twoPhaseMixture/lnInclude \
|
||||
-I$(LIB_SRC)/transportModels \
|
||||
-I$(LIB_SRC)/transportModels/incompressible/lnInclude \
|
||||
-I$(LIB_SRC)/transportModels/interfaceProperties/lnInclude \
|
||||
-I$(LIB_SRC)/turbulenceModels/incompressible/turbulenceModel \
|
||||
-I$(LIB_SRC)/transportModels/immiscibleIncompressibleTwoPhaseMixture/lnInclude \
|
||||
-I$(LIB_SRC)/finiteVolume/lnInclude \
|
||||
-I$(LIB_SRC)/meshTools/lnInclude \
|
||||
-I$(LIB_SRC)/fvOptions/lnInclude \
|
||||
-I$(LIB_SRC)/meshTools/lnInclude \
|
||||
-I$(LIB_SRC)/sampling/lnInclude
|
||||
|
||||
EXE_LIBS = \
|
||||
-ltwoPhaseMixture \
|
||||
-linterfaceProperties \
|
||||
-ltwoPhaseProperties \
|
||||
-lincompressibleTransportModels \
|
||||
-limmiscibleIncompressibleTwoPhaseMixture \
|
||||
-lincompressibleTurbulenceModel \
|
||||
-lincompressibleRASModels \
|
||||
-lincompressibleLESModels \
|
||||
-lfiniteVolume \
|
||||
-lmeshTools \
|
||||
-lfvOptions \
|
||||
-lmeshTools \
|
||||
-lsampling
|
||||
|
||||
@ -3,10 +3,14 @@
|
||||
fvm::ddt(rho, U)
|
||||
+ fvm::div(rhoPhi, U)
|
||||
+ turbulence->divDevRhoReff(rho, U)
|
||||
==
|
||||
fvOptions(rho, U)
|
||||
);
|
||||
|
||||
UEqn.relax();
|
||||
|
||||
fvOptions.constrain(UEqn);
|
||||
|
||||
if (pimple.momentumPredictor())
|
||||
{
|
||||
solve
|
||||
@ -16,10 +20,12 @@
|
||||
fvc::reconstruct
|
||||
(
|
||||
(
|
||||
fvc::interpolate(interface.sigmaK())*fvc::snGrad(alpha1)
|
||||
mixture.surfaceTensionForce()
|
||||
- ghf*fvc::snGrad(rho)
|
||||
- fvc::snGrad(p_rgh)
|
||||
) * mesh.magSf()
|
||||
)
|
||||
);
|
||||
|
||||
fvOptions.correct(U);
|
||||
}
|
||||
|
||||
@ -2,7 +2,7 @@
|
||||
========= |
|
||||
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
|
||||
\\ / O peration |
|
||||
\\ / A nd | Copyright (C) 2011 OpenFOAM Foundation
|
||||
\\ / A nd | Copyright (C) 2011-2014 OpenFOAM Foundation
|
||||
\\/ M anipulation |
|
||||
-------------------------------------------------------------------------------
|
||||
License
|
||||
@ -41,7 +41,7 @@ if (mesh.nInternalFaces())
|
||||
{
|
||||
scalarField sumPhi
|
||||
(
|
||||
pos(alpha1 - 0.01)*pos(0.99 - alpha1)
|
||||
mixture.nearInterface()().internalField()
|
||||
*fvc::surfaceSum(mag(phi))().internalField()
|
||||
);
|
||||
|
||||
|
||||
@ -3,13 +3,13 @@
|
||||
word alpharScheme("div(phirb,alpha)");
|
||||
|
||||
// Standard face-flux compression coefficient
|
||||
surfaceScalarField phic(interface.cAlpha()*mag(phi/mesh.magSf()));
|
||||
surfaceScalarField phic(mixture.cAlpha()*mag(phi/mesh.magSf()));
|
||||
|
||||
// Add the optional isotropic compression contribution
|
||||
if (icAlpha > 0)
|
||||
{
|
||||
phic *= (1.0 - icAlpha);
|
||||
phic += (interface.cAlpha()*icAlpha)*fvc::interpolate(mag(U));
|
||||
phic += (mixture.cAlpha()*icAlpha)*fvc::interpolate(mag(U));
|
||||
}
|
||||
|
||||
// Do not compress interface at non-coupled boundary faces
|
||||
@ -74,12 +74,12 @@
|
||||
|
||||
alpha2 = 1.0 - alpha1;
|
||||
|
||||
interface.correct();
|
||||
mixture.correct();
|
||||
}
|
||||
|
||||
for (int aCorr=0; aCorr<nAlphaCorr; aCorr++)
|
||||
{
|
||||
surfaceScalarField phir(phic*interface.nHatf());
|
||||
surfaceScalarField phir(phic*mixture.nHatf());
|
||||
|
||||
tmp<surfaceScalarField> tphiAlphaUn
|
||||
(
|
||||
@ -132,7 +132,7 @@
|
||||
|
||||
alpha2 = 1.0 - alpha1;
|
||||
|
||||
interface.correct();
|
||||
mixture.correct();
|
||||
}
|
||||
|
||||
rhoPhi = tphiAlpha()*(rho1 - rho2) + phi*rho2;
|
||||
|
||||
@ -30,13 +30,13 @@
|
||||
|
||||
|
||||
Info<< "Reading transportProperties\n" << endl;
|
||||
incompressibleTwoPhaseMixture twoPhaseProperties(U, phi);
|
||||
immiscibleIncompressibleTwoPhaseMixture mixture(U, phi);
|
||||
|
||||
volScalarField& alpha1(twoPhaseProperties.alpha1());
|
||||
volScalarField& alpha2(twoPhaseProperties.alpha2());
|
||||
volScalarField& alpha1(mixture.alpha1());
|
||||
volScalarField& alpha2(mixture.alpha2());
|
||||
|
||||
const dimensionedScalar& rho1 = twoPhaseProperties.rho1();
|
||||
const dimensionedScalar& rho2 = twoPhaseProperties.rho2();
|
||||
const dimensionedScalar& rho1 = mixture.rho1();
|
||||
const dimensionedScalar& rho2 = mixture.rho2();
|
||||
|
||||
|
||||
// Need to store rho for ddt(rho, U)
|
||||
@ -70,14 +70,10 @@
|
||||
);
|
||||
|
||||
|
||||
// Construct interface from alpha1 distribution
|
||||
interfaceProperties interface(alpha1, U, twoPhaseProperties);
|
||||
|
||||
|
||||
// Construct incompressible turbulence model
|
||||
autoPtr<incompressible::turbulenceModel> turbulence
|
||||
(
|
||||
incompressible::turbulenceModel::New(U, phi, twoPhaseProperties)
|
||||
incompressible::turbulenceModel::New(U, phi, mixture)
|
||||
);
|
||||
|
||||
#include "readGravitationalAcceleration.H"
|
||||
@ -131,7 +127,9 @@
|
||||
p_rgh = p - rho*gh;
|
||||
}
|
||||
|
||||
|
||||
fv::IOoptionList fvOptions(mesh);
|
||||
|
||||
|
||||
// MULES Correction
|
||||
tmp<surfaceScalarField> tphiAlphaCorr0;
|
||||
|
||||
@ -5,6 +5,7 @@ EXE_INC = \
|
||||
-I$(LIB_SRC)/transportModels/incompressible/lnInclude \
|
||||
-I$(LIB_SRC)/transportModels/interfaceProperties/lnInclude \
|
||||
-I$(LIB_SRC)/turbulenceModels/incompressible/turbulenceModel \
|
||||
-I$(LIB_SRC)/transportModels/immiscibleIncompressibleTwoPhaseMixture/lnInclude \
|
||||
-I$(LIB_SRC)/finiteVolume/lnInclude \
|
||||
-I$(LIB_SRC)/dynamicMesh/lnInclude \
|
||||
-I$(LIB_SRC)/dynamicFvMesh/lnInclude \
|
||||
@ -13,10 +14,7 @@ EXE_INC = \
|
||||
-I$(LIB_SRC)/sampling/lnInclude
|
||||
|
||||
EXE_LIBS = \
|
||||
-ltwoPhaseMixture \
|
||||
-linterfaceProperties \
|
||||
-ltwoPhaseProperties \
|
||||
-lincompressibleTransportModels \
|
||||
-limmiscibleIncompressibleTwoPhaseMixture \
|
||||
-lincompressibleTurbulenceModel \
|
||||
-lincompressibleRASModels \
|
||||
-lincompressibleLESModels \
|
||||
|
||||
@ -36,8 +36,7 @@ Description
|
||||
#include "dynamicFvMesh.H"
|
||||
#include "CMULES.H"
|
||||
#include "subCycle.H"
|
||||
#include "interfaceProperties.H"
|
||||
#include "incompressibleTwoPhaseMixture.H"
|
||||
#include "immiscibleIncompressibleTwoPhaseMixture.H"
|
||||
#include "turbulenceModel.H"
|
||||
#include "pimpleControl.H"
|
||||
#include "fvIOoptionList.H"
|
||||
@ -121,7 +120,7 @@ int main(int argc, char *argv[])
|
||||
// Make the flux relative to the mesh motion
|
||||
fvc::makeRelative(phi, U);
|
||||
|
||||
interface.correct();
|
||||
mixture.correct();
|
||||
}
|
||||
|
||||
if (mesh.changing() && checkMeshCourantNo)
|
||||
@ -131,11 +130,9 @@ int main(int argc, char *argv[])
|
||||
}
|
||||
|
||||
#include "alphaControls.H"
|
||||
|
||||
twoPhaseProperties.correct();
|
||||
|
||||
#include "alphaEqnSubCycle.H"
|
||||
interface.correct();
|
||||
|
||||
mixture.correct();
|
||||
|
||||
#include "UEqn.H"
|
||||
|
||||
|
||||
@ -22,7 +22,7 @@
|
||||
surfaceScalarField phig
|
||||
(
|
||||
(
|
||||
fvc::interpolate(interface.sigmaK())*fvc::snGrad(alpha1)
|
||||
mixture.surfaceTensionForce()
|
||||
- ghf*fvc::snGrad(rho)
|
||||
)*rAUf*mesh.magSf()
|
||||
);
|
||||
|
||||
@ -2,7 +2,7 @@
|
||||
========= |
|
||||
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
|
||||
\\ / O peration |
|
||||
\\ / A nd | Copyright (C) 2011-2013 OpenFOAM Foundation
|
||||
\\ / A nd | Copyright (C) 2011-2014 OpenFOAM Foundation
|
||||
\\/ M anipulation |
|
||||
-------------------------------------------------------------------------------
|
||||
License
|
||||
@ -40,8 +40,7 @@ Description
|
||||
#include "fvCFD.H"
|
||||
#include "CMULES.H"
|
||||
#include "subCycle.H"
|
||||
#include "interfaceProperties.H"
|
||||
#include "incompressibleTwoPhaseMixture.H"
|
||||
#include "immiscibleIncompressibleTwoPhaseMixture.H"
|
||||
#include "turbulenceModel.H"
|
||||
#include "pimpleControl.H"
|
||||
#include "fvIOoptionList.H"
|
||||
@ -84,11 +83,9 @@ int main(int argc, char *argv[])
|
||||
while (pimple.loop())
|
||||
{
|
||||
#include "alphaControls.H"
|
||||
|
||||
twoPhaseProperties.correct();
|
||||
|
||||
#include "alphaEqnSubCycle.H"
|
||||
interface.correct();
|
||||
|
||||
mixture.correct();
|
||||
|
||||
#include "UEqn.H"
|
||||
|
||||
|
||||
@ -1,5 +1,6 @@
|
||||
incompressibleThreePhaseMixture/threePhaseMixture.C
|
||||
incompressibleThreePhaseMixture/incompressibleThreePhaseMixture.C
|
||||
threePhaseInterfaceProperties/threePhaseInterfaceProperties.C
|
||||
immiscibleIncompressibleThreePhaseMixture/immiscibleIncompressibleThreePhaseMixture.C
|
||||
interMixingFoam.C
|
||||
|
||||
EXE = $(FOAM_APPBIN)/interMixingFoam
|
||||
|
||||
@ -1,6 +1,7 @@
|
||||
EXE_INC = \
|
||||
-I.. \
|
||||
-I$(LIB_SRC)/transportModels/twoPhaseMixture/lnInclude \
|
||||
-IimmiscibleIncompressibleThreePhaseMixture \
|
||||
-IincompressibleThreePhaseMixture \
|
||||
-IthreePhaseInterfaceProperties \
|
||||
-I$(LIB_SRC)/transportModels/interfaceProperties/lnInclude \
|
||||
|
||||
@ -12,7 +12,7 @@
|
||||
IOobject::NO_READ,
|
||||
IOobject::NO_WRITE
|
||||
),
|
||||
interface.cAlpha()*mag(phi/mesh.magSf())*interface.nHatf()
|
||||
mixture.cAlpha()*mag(phi/mesh.magSf())*mixture.nHatf()
|
||||
);
|
||||
|
||||
for (int gCorr=0; gCorr<nAlphaCorr; gCorr++)
|
||||
|
||||
@ -28,17 +28,17 @@
|
||||
|
||||
#include "createPhi.H"
|
||||
|
||||
threePhaseMixture threePhaseProperties(U, phi);
|
||||
immiscibleIncompressibleThreePhaseMixture mixture(U, phi);
|
||||
|
||||
volScalarField& alpha1(threePhaseProperties.alpha1());
|
||||
volScalarField& alpha2(threePhaseProperties.alpha2());
|
||||
volScalarField& alpha3(threePhaseProperties.alpha3());
|
||||
volScalarField& alpha1(mixture.alpha1());
|
||||
volScalarField& alpha2(mixture.alpha2());
|
||||
volScalarField& alpha3(mixture.alpha3());
|
||||
|
||||
const dimensionedScalar& rho1 = threePhaseProperties.rho1();
|
||||
const dimensionedScalar& rho2 = threePhaseProperties.rho2();
|
||||
const dimensionedScalar& rho3 = threePhaseProperties.rho3();
|
||||
const dimensionedScalar& rho1 = mixture.rho1();
|
||||
const dimensionedScalar& rho2 = mixture.rho2();
|
||||
const dimensionedScalar& rho3 = mixture.rho3();
|
||||
|
||||
dimensionedScalar D23(threePhaseProperties.lookup("D23"));
|
||||
dimensionedScalar D23(mixture.lookup("D23"));
|
||||
|
||||
// Need to store rho for ddt(rho, U)
|
||||
volScalarField rho
|
||||
@ -73,14 +73,10 @@
|
||||
);
|
||||
|
||||
|
||||
// Construct interface from alpha distribution
|
||||
threePhaseInterfaceProperties interface(threePhaseProperties);
|
||||
|
||||
|
||||
// Construct incompressible turbulence model
|
||||
autoPtr<incompressible::turbulenceModel> turbulence
|
||||
(
|
||||
incompressible::turbulenceModel::New(U, phi, threePhaseProperties)
|
||||
incompressible::turbulenceModel::New(U, phi, mixture)
|
||||
);
|
||||
|
||||
|
||||
|
||||
@ -2,7 +2,7 @@
|
||||
========= |
|
||||
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
|
||||
\\ / O peration |
|
||||
\\ / A nd | Copyright (C) 2013 OpenFOAM Foundation
|
||||
\\ / A nd | Copyright (C) 2014 OpenFOAM Foundation
|
||||
\\/ M anipulation |
|
||||
-------------------------------------------------------------------------------
|
||||
License
|
||||
@ -21,37 +21,26 @@ License
|
||||
You should have received a copy of the GNU General Public License
|
||||
along with OpenFOAM. If not, see <http://www.gnu.org/licenses/>.
|
||||
|
||||
Global
|
||||
CourantNo
|
||||
|
||||
Description
|
||||
Calculates and outputs the mean and maximum Courant Numbers.
|
||||
|
||||
\*---------------------------------------------------------------------------*/
|
||||
|
||||
scalar maxAlphaCo
|
||||
#include "immiscibleIncompressibleThreePhaseMixture.H"
|
||||
|
||||
|
||||
// * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * //
|
||||
|
||||
Foam::immiscibleIncompressibleThreePhaseMixture::
|
||||
immiscibleIncompressibleThreePhaseMixture
|
||||
(
|
||||
readScalar(runTime.controlDict().lookup("maxAlphaCo"))
|
||||
);
|
||||
|
||||
scalar alphaCoNum = 0.0;
|
||||
scalar meanAlphaCoNum = 0.0;
|
||||
|
||||
if (mesh.nInternalFaces())
|
||||
{
|
||||
scalarField sumPhi
|
||||
const volVectorField& U,
|
||||
const surfaceScalarField& phi
|
||||
)
|
||||
:
|
||||
incompressibleThreePhaseMixture(U, phi),
|
||||
threePhaseInterfaceProperties
|
||||
(
|
||||
multiphaseProperties.nearInterface()().internalField()
|
||||
* fvc::surfaceSum(mag(phi))().internalField()
|
||||
);
|
||||
static_cast<incompressibleThreePhaseMixture&>(*this)
|
||||
)
|
||||
{}
|
||||
|
||||
alphaCoNum = 0.5*gMax(sumPhi/mesh.V().field())*runTime.deltaTValue();
|
||||
|
||||
meanAlphaCoNum =
|
||||
0.5*(gSum(sumPhi)/gSum(mesh.V().field()))*runTime.deltaTValue();
|
||||
}
|
||||
|
||||
Info<< "Interface Courant Number mean: " << meanAlphaCoNum
|
||||
<< " max: " << alphaCoNum << endl;
|
||||
|
||||
// ************************************************************************* //
|
||||
@ -0,0 +1,92 @@
|
||||
/*---------------------------------------------------------------------------*\
|
||||
========= |
|
||||
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
|
||||
\\ / O peration |
|
||||
\\ / A nd | Copyright (C) 2014 OpenFOAM Foundation
|
||||
\\/ M anipulation |
|
||||
-------------------------------------------------------------------------------
|
||||
License
|
||||
This file is part of OpenFOAM.
|
||||
|
||||
OpenFOAM is free software: you can redistribute it and/or modify it
|
||||
under the terms of the GNU General Public License as published by
|
||||
the Free Software Foundation, either version 3 of the License, or
|
||||
(at your option) any later version.
|
||||
|
||||
OpenFOAM is distributed in the hope that it will be useful, but WITHOUT
|
||||
ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
|
||||
FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
|
||||
for more details.
|
||||
|
||||
You should have received a copy of the GNU General Public License
|
||||
along with OpenFOAM. If not, see <http://www.gnu.org/licenses/>.
|
||||
|
||||
Class
|
||||
Foam::immiscibleIncompressibleThreePhaseMixture
|
||||
|
||||
Description
|
||||
An immiscible incompressible two-phase mixture transport model
|
||||
|
||||
SourceFiles
|
||||
immiscibleIncompressibleThreePhaseMixture.C
|
||||
|
||||
\*---------------------------------------------------------------------------*/
|
||||
|
||||
#ifndef immiscibleIncompressibleThreePhaseMixture_H
|
||||
#define immiscibleIncompressibleThreePhaseMixture_H
|
||||
|
||||
#include "incompressibleThreePhaseMixture.H"
|
||||
#include "threePhaseInterfaceProperties.H"
|
||||
|
||||
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
||||
|
||||
namespace Foam
|
||||
{
|
||||
|
||||
/*---------------------------------------------------------------------------*\
|
||||
Class immiscibleIncompressibleThreePhaseMixture Declaration
|
||||
\*---------------------------------------------------------------------------*/
|
||||
|
||||
class immiscibleIncompressibleThreePhaseMixture
|
||||
:
|
||||
public incompressibleThreePhaseMixture,
|
||||
public threePhaseInterfaceProperties
|
||||
{
|
||||
|
||||
public:
|
||||
|
||||
// Constructors
|
||||
|
||||
//- Construct from components
|
||||
immiscibleIncompressibleThreePhaseMixture
|
||||
(
|
||||
const volVectorField& U,
|
||||
const surfaceScalarField& phi
|
||||
);
|
||||
|
||||
|
||||
//- Destructor
|
||||
virtual ~immiscibleIncompressibleThreePhaseMixture()
|
||||
{}
|
||||
|
||||
|
||||
// Member Functions
|
||||
|
||||
//- Correct the transport and interface properties
|
||||
virtual void correct()
|
||||
{
|
||||
incompressibleThreePhaseMixture::correct();
|
||||
threePhaseInterfaceProperties::correct();
|
||||
}
|
||||
};
|
||||
|
||||
|
||||
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
||||
|
||||
} // End namespace Foam
|
||||
|
||||
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
||||
|
||||
#endif
|
||||
|
||||
// ************************************************************************* //
|
||||
@ -2,7 +2,7 @@
|
||||
========= |
|
||||
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
|
||||
\\ / O peration |
|
||||
\\ / A nd | Copyright (C) 2011-2013 OpenFOAM Foundation
|
||||
\\ / A nd | Copyright (C) 2011-2014 OpenFOAM Foundation
|
||||
\\/ M anipulation |
|
||||
-------------------------------------------------------------------------------
|
||||
License
|
||||
@ -23,7 +23,7 @@ License
|
||||
|
||||
\*---------------------------------------------------------------------------*/
|
||||
|
||||
#include "threePhaseMixture.H"
|
||||
#include "incompressibleThreePhaseMixture.H"
|
||||
#include "addToRunTimeSelectionTable.H"
|
||||
#include "surfaceFields.H"
|
||||
#include "fvc.H"
|
||||
@ -31,7 +31,7 @@ License
|
||||
// * * * * * * * * * * * * Private Member Functions * * * * * * * * * * * * //
|
||||
|
||||
//- Calculate and return the laminar viscosity
|
||||
void Foam::threePhaseMixture::calcNu()
|
||||
void Foam::incompressibleThreePhaseMixture::calcNu()
|
||||
{
|
||||
nuModel1_->correct();
|
||||
nuModel2_->correct();
|
||||
@ -44,7 +44,7 @@ void Foam::threePhaseMixture::calcNu()
|
||||
|
||||
// * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * //
|
||||
|
||||
Foam::threePhaseMixture::threePhaseMixture
|
||||
Foam::incompressibleThreePhaseMixture::incompressibleThreePhaseMixture
|
||||
(
|
||||
const volVectorField& U,
|
||||
const surfaceScalarField& phi
|
||||
@ -163,7 +163,8 @@ Foam::threePhaseMixture::threePhaseMixture
|
||||
|
||||
// * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * * //
|
||||
|
||||
Foam::tmp<Foam::volScalarField> Foam::threePhaseMixture::mu() const
|
||||
Foam::tmp<Foam::volScalarField>
|
||||
Foam::incompressibleThreePhaseMixture::mu() const
|
||||
{
|
||||
return tmp<volScalarField>
|
||||
(
|
||||
@ -178,7 +179,8 @@ Foam::tmp<Foam::volScalarField> Foam::threePhaseMixture::mu() const
|
||||
}
|
||||
|
||||
|
||||
Foam::tmp<Foam::surfaceScalarField> Foam::threePhaseMixture::muf() const
|
||||
Foam::tmp<Foam::surfaceScalarField>
|
||||
Foam::incompressibleThreePhaseMixture::muf() const
|
||||
{
|
||||
surfaceScalarField alpha1f(fvc::interpolate(alpha1_));
|
||||
surfaceScalarField alpha2f(fvc::interpolate(alpha2_));
|
||||
@ -197,7 +199,8 @@ Foam::tmp<Foam::surfaceScalarField> Foam::threePhaseMixture::muf() const
|
||||
}
|
||||
|
||||
|
||||
Foam::tmp<Foam::surfaceScalarField> Foam::threePhaseMixture::nuf() const
|
||||
Foam::tmp<Foam::surfaceScalarField>
|
||||
Foam::incompressibleThreePhaseMixture::nuf() const
|
||||
{
|
||||
surfaceScalarField alpha1f(fvc::interpolate(alpha1_));
|
||||
surfaceScalarField alpha2f(fvc::interpolate(alpha2_));
|
||||
@ -218,7 +221,7 @@ Foam::tmp<Foam::surfaceScalarField> Foam::threePhaseMixture::nuf() const
|
||||
}
|
||||
|
||||
|
||||
bool Foam::threePhaseMixture::read()
|
||||
bool Foam::incompressibleThreePhaseMixture::read()
|
||||
{
|
||||
if (transportModel::read())
|
||||
{
|
||||
@ -2,7 +2,7 @@
|
||||
========= |
|
||||
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
|
||||
\\ / O peration |
|
||||
\\ / A nd | Copyright (C) 2011-2013 OpenFOAM Foundation
|
||||
\\ / A nd | Copyright (C) 2011-2014 OpenFOAM Foundation
|
||||
\\/ M anipulation |
|
||||
-------------------------------------------------------------------------------
|
||||
License
|
||||
@ -22,17 +22,17 @@ License
|
||||
along with OpenFOAM. If not, see <http://www.gnu.org/licenses/>.
|
||||
|
||||
Class
|
||||
threePhaseMixture
|
||||
incompressibleThreePhaseMixture
|
||||
|
||||
Description
|
||||
|
||||
SourceFiles
|
||||
threePhaseMixture.C
|
||||
incompressibleThreePhaseMixture.C
|
||||
|
||||
\*---------------------------------------------------------------------------*/
|
||||
|
||||
#ifndef threePhaseMixture_H
|
||||
#define threePhaseMixture_H
|
||||
#ifndef incompressibleThreePhaseMixture_H
|
||||
#define incompressibleThreePhaseMixture_H
|
||||
|
||||
#include "incompressible/transportModel/transportModel.H"
|
||||
#include "IOdictionary.H"
|
||||
@ -46,10 +46,10 @@ namespace Foam
|
||||
{
|
||||
|
||||
/*---------------------------------------------------------------------------*\
|
||||
Class threePhaseMixture Declaration
|
||||
Class incompressibleThreePhaseMixture Declaration
|
||||
\*---------------------------------------------------------------------------*/
|
||||
|
||||
class threePhaseMixture
|
||||
class incompressibleThreePhaseMixture
|
||||
:
|
||||
public IOdictionary,
|
||||
public transportModel
|
||||
@ -89,7 +89,7 @@ public:
|
||||
// Constructors
|
||||
|
||||
//- Construct from components
|
||||
threePhaseMixture
|
||||
incompressibleThreePhaseMixture
|
||||
(
|
||||
const volVectorField& U,
|
||||
const surfaceScalarField& phi
|
||||
@ -97,7 +97,7 @@ public:
|
||||
|
||||
|
||||
//- Destructor
|
||||
~threePhaseMixture()
|
||||
~incompressibleThreePhaseMixture()
|
||||
{}
|
||||
|
||||
|
||||
@ -33,8 +33,7 @@ Description
|
||||
#include "fvCFD.H"
|
||||
#include "CMULES.H"
|
||||
#include "subCycle.H"
|
||||
#include "threePhaseMixture.H"
|
||||
#include "threePhaseInterfaceProperties.H"
|
||||
#include "immiscibleIncompressibleThreePhaseMixture.H"
|
||||
#include "turbulenceModel.H"
|
||||
#include "pimpleControl.H"
|
||||
#include "fvIOoptionList.H"
|
||||
@ -78,13 +77,9 @@ int main(int argc, char *argv[])
|
||||
while (pimple.loop())
|
||||
{
|
||||
#include "alphaControls.H"
|
||||
|
||||
threePhaseProperties.correct();
|
||||
|
||||
#include "alphaEqnsSubCycle.H"
|
||||
interface.correct();
|
||||
|
||||
#define twoPhaseProperties threePhaseProperties
|
||||
mixture.correct();
|
||||
|
||||
#include "UEqn.H"
|
||||
|
||||
|
||||
@ -2,7 +2,7 @@
|
||||
========= |
|
||||
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
|
||||
\\ / O peration |
|
||||
\\ / A nd | Copyright (C) 2011-2013 OpenFOAM Foundation
|
||||
\\ / A nd | Copyright (C) 2011-2014 OpenFOAM Foundation
|
||||
\\/ M anipulation |
|
||||
-------------------------------------------------------------------------------
|
||||
License
|
||||
@ -37,6 +37,7 @@ Description
|
||||
#include "surfaceInterpolate.H"
|
||||
#include "fvcDiv.H"
|
||||
#include "fvcGrad.H"
|
||||
#include "fvcSnGrad.H"
|
||||
|
||||
// * * * * * * * * * * * * * * * Static Member Data * * * * * * * * * * * * //
|
||||
|
||||
@ -166,7 +167,7 @@ void Foam::threePhaseInterfaceProperties::calculateK()
|
||||
|
||||
Foam::threePhaseInterfaceProperties::threePhaseInterfaceProperties
|
||||
(
|
||||
const threePhaseMixture& mixture
|
||||
const incompressibleThreePhaseMixture& mixture
|
||||
)
|
||||
:
|
||||
mixture_(mixture),
|
||||
@ -212,4 +213,25 @@ Foam::threePhaseInterfaceProperties::threePhaseInterfaceProperties
|
||||
}
|
||||
|
||||
|
||||
// * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * * //
|
||||
|
||||
Foam::tmp<Foam::surfaceScalarField>
|
||||
Foam::threePhaseInterfaceProperties::surfaceTensionForce() const
|
||||
{
|
||||
return fvc::interpolate(sigmaK())*fvc::snGrad(mixture_.alpha1());
|
||||
}
|
||||
|
||||
|
||||
Foam::tmp<Foam::volScalarField>
|
||||
Foam::threePhaseInterfaceProperties::nearInterface() const
|
||||
{
|
||||
return max
|
||||
(
|
||||
pos(mixture_.alpha1() - 0.01)*pos(0.99 - mixture_.alpha1()),
|
||||
pos(mixture_.alpha2() - 0.01)*pos(0.99 - mixture_.alpha2())
|
||||
);
|
||||
}
|
||||
|
||||
|
||||
|
||||
// ************************************************************************* //
|
||||
|
||||
@ -2,7 +2,7 @@
|
||||
========= |
|
||||
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
|
||||
\\ / O peration |
|
||||
\\ / A nd | Copyright (C) 2011-2012 OpenFOAM Foundation
|
||||
\\ / A nd | Copyright (C) 2011-2014 OpenFOAM Foundation
|
||||
\\/ M anipulation |
|
||||
-------------------------------------------------------------------------------
|
||||
License
|
||||
@ -37,7 +37,7 @@ SourceFiles
|
||||
#ifndef threePhaseInterfaceProperties_H
|
||||
#define threePhaseInterfaceProperties_H
|
||||
|
||||
#include "threePhaseMixture.H"
|
||||
#include "incompressibleThreePhaseMixture.H"
|
||||
#include "surfaceFields.H"
|
||||
|
||||
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
||||
@ -53,7 +53,7 @@ class threePhaseInterfaceProperties
|
||||
{
|
||||
// Private data
|
||||
|
||||
const threePhaseMixture& mixture_;
|
||||
const incompressibleThreePhaseMixture& mixture_;
|
||||
|
||||
//- Compression coefficient
|
||||
scalar cAlpha_;
|
||||
@ -98,7 +98,10 @@ public:
|
||||
// Constructors
|
||||
|
||||
//- Construct from volume fraction field alpha and IOdictionary
|
||||
threePhaseInterfaceProperties(const threePhaseMixture& mixture);
|
||||
threePhaseInterfaceProperties
|
||||
(
|
||||
const incompressibleThreePhaseMixture& mixture
|
||||
);
|
||||
|
||||
|
||||
// Member Functions
|
||||
@ -138,6 +141,12 @@ public:
|
||||
return sigma()*K_;
|
||||
}
|
||||
|
||||
tmp<surfaceScalarField> surfaceTensionForce() const;
|
||||
|
||||
//- Indicator of the proximity of the interface
|
||||
// Field values are 1 near and 0 away for the interface.
|
||||
tmp<volScalarField> nearInterface() const;
|
||||
|
||||
void correct()
|
||||
{
|
||||
calculateK();
|
||||
|
||||
@ -11,13 +11,13 @@
|
||||
(fvc::interpolate(HbyA) & mesh.Sf())
|
||||
+ fvc::interpolate(rho*rAU)*fvc::ddtCorr(U, phi)
|
||||
);
|
||||
|
||||
adjustPhi(phiHbyA, U, p_rgh);
|
||||
fvOptions.makeRelative(phiHbyA);
|
||||
|
||||
surfaceScalarField phig
|
||||
(
|
||||
(
|
||||
fvc::interpolate(interface.sigmaK())*fvc::snGrad(alpha1)
|
||||
mixture.surfaceTensionForce()
|
||||
- ghf*fvc::snGrad(rho)
|
||||
)*rAUf*mesh.magSf()
|
||||
);
|
||||
@ -30,7 +30,7 @@
|
||||
p_rgh.boundaryField(),
|
||||
(
|
||||
phiHbyA.boundaryField()
|
||||
- (mesh.Sf().boundaryField() & U.boundaryField())
|
||||
- fvOptions.relative(mesh.Sf().boundaryField() & U.boundaryField())
|
||||
)/(mesh.magSf().boundaryField()*rAUf.boundaryField())
|
||||
);
|
||||
|
||||
|
||||
@ -4,6 +4,7 @@ EXE_INC = \
|
||||
-I$(LIB_SRC)/transportModels \
|
||||
-I$(LIB_SRC)/transportModels/incompressible/lnInclude \
|
||||
-I$(LIB_SRC)/transportModels/interfaceProperties/lnInclude \
|
||||
-I$(LIB_SRC)/transportModels/immiscibleIncompressibleTwoPhaseMixture/lnInclude \
|
||||
-I$(LIB_SRC)/turbulenceModels/incompressible/turbulenceModel \
|
||||
-I$(LIB_SRC)/finiteVolume/lnInclude \
|
||||
-I$(LIB_SRC)/meshTools/lnInclude \
|
||||
@ -11,9 +12,7 @@ EXE_INC = \
|
||||
-I$(LIB_SRC)/sampling/lnInclude
|
||||
|
||||
EXE_LIBS = \
|
||||
-ltwoPhaseMixture \
|
||||
-linterfaceProperties \
|
||||
-ltwoPhaseProperties \
|
||||
-limmiscibleIncompressibleTwoPhaseMixture \
|
||||
-lincompressibleTransportModels \
|
||||
-lincompressibleTurbulenceModel \
|
||||
-lincompressibleRASModels \
|
||||
|
||||
@ -1,12 +1,12 @@
|
||||
surfaceScalarField muEff
|
||||
(
|
||||
"muEff",
|
||||
twoPhaseProperties.muf()
|
||||
mixture.muf()
|
||||
+ fvc::interpolate(rho*turbulence->nut())
|
||||
);
|
||||
|
||||
// Calculate and cache mu for the porous media
|
||||
volScalarField mu(twoPhaseProperties.mu());
|
||||
volScalarField mu(mixture.mu());
|
||||
|
||||
fvVectorMatrix UEqn
|
||||
(
|
||||
@ -33,7 +33,7 @@
|
||||
fvc::reconstruct
|
||||
(
|
||||
(
|
||||
fvc::interpolate(interface.sigmaK())*fvc::snGrad(alpha1)
|
||||
mixture.surfaceTensionForce()
|
||||
- ghf*fvc::snGrad(rho)
|
||||
- fvc::snGrad(p_rgh)
|
||||
) * mesh.magSf()
|
||||
|
||||
@ -41,8 +41,7 @@ Description
|
||||
#include "fvCFD.H"
|
||||
#include "CMULES.H"
|
||||
#include "subCycle.H"
|
||||
#include "interfaceProperties.H"
|
||||
#include "incompressibleTwoPhaseMixture.H"
|
||||
#include "immiscibleIncompressibleTwoPhaseMixture.H"
|
||||
#include "turbulenceModel.H"
|
||||
#include "IOporosityModelList.H"
|
||||
#include "pimpleControl.H"
|
||||
@ -87,11 +86,9 @@ int main(int argc, char *argv[])
|
||||
while (pimple.loop())
|
||||
{
|
||||
#include "alphaControls.H"
|
||||
|
||||
twoPhaseProperties.correct();
|
||||
|
||||
#include "alphaEqnSubCycle.H"
|
||||
interface.correct();
|
||||
|
||||
mixture.correct();
|
||||
|
||||
#include "UEqn.H"
|
||||
|
||||
|
||||
@ -17,7 +17,7 @@
|
||||
fvc::reconstruct
|
||||
(
|
||||
(
|
||||
fvc::interpolate(interface.sigmaK())*fvc::snGrad(alpha1)
|
||||
interface.surfaceTensionForce()
|
||||
- ghf*fvc::snGrad(rho)
|
||||
- fvc::snGrad(p_rgh)
|
||||
) * mesh.magSf()
|
||||
|
||||
@ -5,7 +5,7 @@
|
||||
surfaceScalarField phir("phir", phic*interface.nHatf());
|
||||
|
||||
Pair<tmp<volScalarField> > vDotAlphal =
|
||||
twoPhaseProperties->vDotAlphal();
|
||||
mixture->vDotAlphal();
|
||||
const volScalarField& vDotcAlphal = vDotAlphal[0]();
|
||||
const volScalarField& vDotvAlphal = vDotAlphal[1]();
|
||||
const volScalarField vDotvmcAlphal(vDotvAlphal - vDotcAlphal);
|
||||
|
||||
@ -30,15 +30,15 @@
|
||||
|
||||
|
||||
Info<< "Creating phaseChangeTwoPhaseMixture\n" << endl;
|
||||
autoPtr<phaseChangeTwoPhaseMixture> twoPhaseProperties =
|
||||
autoPtr<phaseChangeTwoPhaseMixture> mixture =
|
||||
phaseChangeTwoPhaseMixture::New(U, phi);
|
||||
|
||||
volScalarField& alpha1(twoPhaseProperties->alpha1());
|
||||
volScalarField& alpha2(twoPhaseProperties->alpha2());
|
||||
volScalarField& alpha1(mixture->alpha1());
|
||||
volScalarField& alpha2(mixture->alpha2());
|
||||
|
||||
const dimensionedScalar& rho1 = twoPhaseProperties->rho1();
|
||||
const dimensionedScalar& rho2 = twoPhaseProperties->rho2();
|
||||
const dimensionedScalar& pSat = twoPhaseProperties->pSat();
|
||||
const dimensionedScalar& rho1 = mixture->rho1();
|
||||
const dimensionedScalar& rho2 = mixture->rho2();
|
||||
const dimensionedScalar& pSat = mixture->pSat();
|
||||
|
||||
|
||||
// Need to store rho for ddt(rho, U)
|
||||
@ -58,12 +58,12 @@
|
||||
|
||||
|
||||
// Construct interface from alpha1 distribution
|
||||
interfaceProperties interface(alpha1, U, twoPhaseProperties());
|
||||
interfaceProperties interface(alpha1, U, mixture());
|
||||
|
||||
// Construct incompressible turbulence model
|
||||
autoPtr<incompressible::turbulenceModel> turbulence
|
||||
(
|
||||
incompressible::turbulenceModel::New(U, phi, twoPhaseProperties())
|
||||
incompressible::turbulenceModel::New(U, phi, mixture())
|
||||
);
|
||||
|
||||
|
||||
|
||||
@ -154,7 +154,7 @@ int main(int argc, char *argv[])
|
||||
dimensionedScalar("0", dimMass/dimTime, 0)
|
||||
);
|
||||
|
||||
twoPhaseProperties->correct();
|
||||
mixture->correct();
|
||||
|
||||
#include "alphaEqnSubCycle.H"
|
||||
interface.correct();
|
||||
|
||||
@ -22,7 +22,7 @@
|
||||
surfaceScalarField phig
|
||||
(
|
||||
(
|
||||
fvc::interpolate(interface.sigmaK())*fvc::snGrad(alpha1)
|
||||
interface.surfaceTensionForce()
|
||||
- ghf*fvc::snGrad(rho)
|
||||
)*rAUf*mesh.magSf()
|
||||
);
|
||||
@ -39,7 +39,7 @@
|
||||
)/(mesh.magSf().boundaryField()*rAUf.boundaryField())
|
||||
);
|
||||
|
||||
Pair<tmp<volScalarField> > vDotP = twoPhaseProperties->vDotP();
|
||||
Pair<tmp<volScalarField> > vDotP = mixture->vDotP();
|
||||
const volScalarField& vDotcP = vDotP[0]();
|
||||
const volScalarField& vDotvP = vDotP[1]();
|
||||
|
||||
|
||||
@ -100,7 +100,7 @@ int main(int argc, char *argv[])
|
||||
dimensionedScalar("0", dimMass/dimTime, 0)
|
||||
);
|
||||
|
||||
twoPhaseProperties->correct();
|
||||
mixture->correct();
|
||||
|
||||
#include "alphaEqnSubCycle.H"
|
||||
interface.correct();
|
||||
|
||||
@ -16,7 +16,7 @@
|
||||
surfaceScalarField phig
|
||||
(
|
||||
(
|
||||
fvc::interpolate(interface.sigmaK())*fvc::snGrad(alpha1)
|
||||
interface.surfaceTensionForce()
|
||||
- ghf*fvc::snGrad(rho)
|
||||
)*rAUf*mesh.magSf()
|
||||
);
|
||||
@ -33,7 +33,7 @@
|
||||
)/(mesh.magSf().boundaryField()*rAUf.boundaryField())
|
||||
);
|
||||
|
||||
Pair<tmp<volScalarField> > vDotP = twoPhaseProperties->vDotP();
|
||||
Pair<tmp<volScalarField> > vDotP = mixture->vDotP();
|
||||
const volScalarField& vDotcP = vDotP[0]();
|
||||
const volScalarField& vDotvP = vDotP[1]();
|
||||
|
||||
|
||||
@ -4,5 +4,6 @@ set -x
|
||||
|
||||
wclean libso multiphaseMixture
|
||||
wclean
|
||||
wclean multiphaseInterDyMFoam
|
||||
|
||||
# ----------------------------------------------------------------- end-of-file
|
||||
|
||||
@ -4,5 +4,6 @@ set -x
|
||||
|
||||
wmake libso multiphaseMixture
|
||||
wmake
|
||||
wmake multiphaseInterDyMFoam
|
||||
|
||||
# ----------------------------------------------------------------- end-of-file
|
||||
|
||||
@ -1,31 +0,0 @@
|
||||
fvVectorMatrix UEqn
|
||||
(
|
||||
fvm::ddt(rho, U)
|
||||
+ fvm::div(mixture.rhoPhi(), U)
|
||||
+ turbulence->divDevRhoReff(rho, U)
|
||||
==
|
||||
fvOptions(rho, U)
|
||||
);
|
||||
|
||||
UEqn.relax();
|
||||
|
||||
fvOptions.constrain(UEqn);
|
||||
|
||||
if (pimple.momentumPredictor())
|
||||
{
|
||||
solve
|
||||
(
|
||||
UEqn
|
||||
==
|
||||
fvc::reconstruct
|
||||
(
|
||||
(
|
||||
mixture.surfaceTensionForce()
|
||||
- ghf*fvc::snGrad(rho)
|
||||
- fvc::snGrad(p_rgh)
|
||||
) * mesh.magSf()
|
||||
)
|
||||
);
|
||||
|
||||
fvOptions.correct(U);
|
||||
}
|
||||
@ -44,6 +44,7 @@
|
||||
);
|
||||
rho.oldTime();
|
||||
|
||||
const surfaceScalarField& rhoPhi(mixture.rhoPhi());
|
||||
|
||||
// Construct incompressible turbulence model
|
||||
autoPtr<incompressible::turbulenceModel> turbulence
|
||||
|
||||
@ -0,0 +1,3 @@
|
||||
multiphaseInterDyMFoam.C
|
||||
|
||||
EXE = $(FOAM_APPBIN)/multiphaseInterDyMFoam
|
||||
@ -1,24 +1,30 @@
|
||||
EXE_INC = \
|
||||
-I.. \
|
||||
-I$(LIB_SRC)/transportModels/twoPhaseMixture/lnInclude \
|
||||
-I../../interFoam/interDyMFoam \
|
||||
-I../../interFoam \
|
||||
-I../multiphaseMixture/lnInclude \
|
||||
-I$(LIB_SRC)/transportModels \
|
||||
-I$(LIB_SRC)/transportModels/incompressible/lnInclude \
|
||||
-I$(LIB_SRC)/transportModels/interfaceProperties/lnInclude \
|
||||
-I$(LIB_SRC)/turbulenceModels/incompressible/turbulenceModel \
|
||||
-I$(LIB_SRC)/finiteVolume/lnInclude \
|
||||
-I$(LIB_SRC)/meshTools/lnInclude \
|
||||
-I$(LIB_SRC)/dynamicMesh/lnInclude \
|
||||
-I$(LIB_SRC)/dynamicFvMesh/lnInclude \
|
||||
-I$(LIB_SRC)/fvOptions/lnInclude \
|
||||
-I$(LIB_SRC)/meshTools/lnInclude \
|
||||
-I$(LIB_SRC)/sampling/lnInclude
|
||||
|
||||
EXE_LIBS = \
|
||||
-ltwoPhaseMixture \
|
||||
-lmultiphaseInterFoam \
|
||||
-linterfaceProperties \
|
||||
-ltwoPhaseProperties \
|
||||
-lincompressibleTransportModels \
|
||||
-lincompressibleTurbulenceModel \
|
||||
-lincompressibleRASModels \
|
||||
-lincompressibleLESModels \
|
||||
-lfiniteVolume \
|
||||
-lmeshTools \
|
||||
-ldynamicMesh \
|
||||
-ldynamicFvMesh \
|
||||
-ltopoChangerFvMesh \
|
||||
-lfvOptions \
|
||||
-lmeshTools \
|
||||
-lsampling
|
||||
@ -22,27 +22,20 @@ License
|
||||
along with OpenFOAM. If not, see <http://www.gnu.org/licenses/>.
|
||||
|
||||
Application
|
||||
MRFInterFoam
|
||||
multiphaseInterFoam
|
||||
|
||||
Description
|
||||
Solver for 2 incompressible, isothermal immiscible fluids using a VOF
|
||||
(volume of fluid) phase-fraction based interface capturing approach.
|
||||
The momentum and other fluid properties are of the "mixture" and a single
|
||||
momentum equation is solved.
|
||||
Solver for n incompressible fluids which captures the interfaces and
|
||||
includes surface-tension and contact-angle effects for each phase.
|
||||
|
||||
Turbulence modelling is generic, i.e. laminar, RAS or LES may be selected.
|
||||
|
||||
For a two-fluid approach see twoPhaseEulerFoam.
|
||||
|
||||
\*---------------------------------------------------------------------------*/
|
||||
|
||||
#include "fvCFD.H"
|
||||
#include "CMULES.H"
|
||||
#include "subCycle.H"
|
||||
#include "interfaceProperties.H"
|
||||
#include "incompressibleTwoPhaseMixture.H"
|
||||
#include "dynamicFvMesh.H"
|
||||
#include "multiphaseMixture.H"
|
||||
#include "turbulenceModel.H"
|
||||
#include "IOMRFZoneList.H"
|
||||
#include "pimpleControl.H"
|
||||
#include "fvIOoptionList.H"
|
||||
#include "fixedFluxPressureFvPatchScalarField.H"
|
||||
@ -53,16 +46,31 @@ int main(int argc, char *argv[])
|
||||
{
|
||||
#include "setRootCase.H"
|
||||
#include "createTime.H"
|
||||
#include "createMesh.H"
|
||||
#include "createDynamicFvMesh.H"
|
||||
#include "initContinuityErrs.H"
|
||||
#include "createFields.H"
|
||||
#include "createMRFZones.H"
|
||||
#include "readTimeControls.H"
|
||||
|
||||
pimpleControl pimple(mesh);
|
||||
|
||||
#include "createFields.H"
|
||||
#include "readTimeControls.H"
|
||||
#include "createPrghCorrTypes.H"
|
||||
|
||||
volScalarField rAU
|
||||
(
|
||||
IOobject
|
||||
(
|
||||
"rAU",
|
||||
runTime.timeName(),
|
||||
mesh,
|
||||
IOobject::READ_IF_PRESENT,
|
||||
IOobject::AUTO_WRITE
|
||||
),
|
||||
mesh,
|
||||
dimensionedScalar("rAUf", dimTime/rho.dimensions(), 1.0)
|
||||
);
|
||||
|
||||
#include "correctPhi.H"
|
||||
#include "createUf.H"
|
||||
#include "CourantNo.H"
|
||||
#include "setInitialDeltaT.H"
|
||||
|
||||
@ -72,9 +80,10 @@ int main(int argc, char *argv[])
|
||||
|
||||
while (runTime.run())
|
||||
{
|
||||
#include "readTimeControls.H"
|
||||
#include "readControls.H"
|
||||
#include "CourantNo.H"
|
||||
#include "alphaCourantNo.H"
|
||||
|
||||
#include "setDeltaT.H"
|
||||
|
||||
runTime++;
|
||||
@ -84,13 +93,43 @@ int main(int argc, char *argv[])
|
||||
// --- Pressure-velocity PIMPLE corrector loop
|
||||
while (pimple.loop())
|
||||
{
|
||||
#include "alphaControls.H"
|
||||
if (pimple.firstIter() || moveMeshOuterCorrectors)
|
||||
{
|
||||
scalar timeBeforeMeshUpdate = runTime.elapsedCpuTime();
|
||||
|
||||
twoPhaseProperties.correct();
|
||||
mesh.update();
|
||||
|
||||
#include "alphaEqnSubCycle.H"
|
||||
interface.correct();
|
||||
#include "zonePhaseVolumes.H"
|
||||
if (mesh.changing())
|
||||
{
|
||||
Info<< "Execution time for mesh.update() = "
|
||||
<< runTime.elapsedCpuTime() - timeBeforeMeshUpdate
|
||||
<< " s" << endl;
|
||||
|
||||
gh = g & mesh.C();
|
||||
ghf = g & mesh.Cf();
|
||||
}
|
||||
|
||||
if (mesh.changing() && correctPhi)
|
||||
{
|
||||
// Calculate absolute flux from the mapped surface velocity
|
||||
phi = mesh.Sf() & Uf;
|
||||
|
||||
#include "correctPhi.H"
|
||||
|
||||
// Make the flux relative to the mesh motion
|
||||
fvc::makeRelative(phi, U);
|
||||
|
||||
mixture.correct();
|
||||
}
|
||||
|
||||
if (mesh.changing() && checkMeshCourantNo)
|
||||
{
|
||||
#include "meshCourantNo.H"
|
||||
}
|
||||
}
|
||||
|
||||
mixture.solve();
|
||||
rho = mixture.rho();
|
||||
|
||||
#include "UEqn.H"
|
||||
|
||||
@ -298,10 +298,7 @@ Foam::multiphaseMixture::surfaceTensionForce() const
|
||||
|
||||
void Foam::multiphaseMixture::solve()
|
||||
{
|
||||
forAllIter(PtrDictionary<phase>, phases_, iter)
|
||||
{
|
||||
iter().correct();
|
||||
}
|
||||
correct();
|
||||
|
||||
const Time& runTime = mesh_.time();
|
||||
|
||||
@ -347,7 +344,12 @@ void Foam::multiphaseMixture::solve()
|
||||
|
||||
|
||||
void Foam::multiphaseMixture::correct()
|
||||
{}
|
||||
{
|
||||
forAllIter(PtrDictionary<phase>, phases_, iter)
|
||||
{
|
||||
iter().correct();
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Foam::tmp<Foam::surfaceVectorField> Foam::multiphaseMixture::nHatfv
|
||||
|
||||
@ -1,72 +0,0 @@
|
||||
{
|
||||
volScalarField rAU("rAU", 1.0/UEqn.A());
|
||||
surfaceScalarField rAUf("rAUf", fvc::interpolate(rAU));
|
||||
|
||||
volVectorField HbyA("HbyA", U);
|
||||
HbyA = rAU*UEqn.H();
|
||||
|
||||
surfaceScalarField phiHbyA
|
||||
(
|
||||
"phiHbyA",
|
||||
(fvc::interpolate(HbyA) & mesh.Sf())
|
||||
+ fvc::interpolate(rho*rAU)*fvc::ddtCorr(U, phi)
|
||||
);
|
||||
adjustPhi(phiHbyA, U, p_rgh);
|
||||
fvOptions.makeRelative(phiHbyA);
|
||||
|
||||
surfaceScalarField phig
|
||||
(
|
||||
(
|
||||
mixture.surfaceTensionForce()
|
||||
- ghf*fvc::snGrad(rho)
|
||||
)*rAUf*mesh.magSf()
|
||||
);
|
||||
|
||||
phiHbyA += phig;
|
||||
|
||||
// Update the fixedFluxPressure BCs to ensure flux consistency
|
||||
setSnGrad<fixedFluxPressureFvPatchScalarField>
|
||||
(
|
||||
p_rgh.boundaryField(),
|
||||
(
|
||||
phiHbyA.boundaryField()
|
||||
- fvOptions.relative(mesh.Sf().boundaryField() & U.boundaryField())
|
||||
)/(mesh.magSf().boundaryField()*rAUf.boundaryField())
|
||||
);
|
||||
|
||||
while (pimple.correctNonOrthogonal())
|
||||
{
|
||||
fvScalarMatrix p_rghEqn
|
||||
(
|
||||
fvm::laplacian(rAUf, p_rgh) == fvc::div(phiHbyA)
|
||||
);
|
||||
|
||||
p_rghEqn.setReference(pRefCell, getRefCellValue(p_rgh, pRefCell));
|
||||
|
||||
p_rghEqn.solve(mesh.solver(p_rgh.select(pimple.finalInnerIter())));
|
||||
|
||||
if (pimple.finalNonOrthogonalIter())
|
||||
{
|
||||
phi = phiHbyA - p_rghEqn.flux();
|
||||
|
||||
U = HbyA + rAU*fvc::reconstruct((phig - p_rghEqn.flux())/rAUf);
|
||||
U.correctBoundaryConditions();
|
||||
fvOptions.correct(U);
|
||||
}
|
||||
}
|
||||
|
||||
#include "continuityErrs.H"
|
||||
|
||||
p == p_rgh + rho*gh;
|
||||
|
||||
if (p_rgh.needReference())
|
||||
{
|
||||
p += dimensionedScalar
|
||||
(
|
||||
"p",
|
||||
p.dimensions(),
|
||||
pRefValue - getRefCellValue(p, pRefCell)
|
||||
);
|
||||
p_rgh = p - rho*gh;
|
||||
}
|
||||
}
|
||||
@ -2,7 +2,7 @@
|
||||
========= |
|
||||
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
|
||||
\\ / O peration |
|
||||
\\ / A nd | Copyright (C) 2011 OpenFOAM Foundation
|
||||
\\ / A nd | Copyright (C) 2011-2014 OpenFOAM Foundation
|
||||
\\/ M anipulation |
|
||||
-------------------------------------------------------------------------------
|
||||
License
|
||||
@ -22,7 +22,7 @@ License
|
||||
along with OpenFOAM. If not, see <http://www.gnu.org/licenses/>.
|
||||
|
||||
Global
|
||||
CourantNo
|
||||
alphaCourantNo
|
||||
|
||||
Description
|
||||
Calculates and outputs the mean and maximum Courant Numbers.
|
||||
@ -41,8 +41,8 @@ if (mesh.nInternalFaces())
|
||||
{
|
||||
scalarField sumPhi
|
||||
(
|
||||
mixture.nearInterface()().internalField()
|
||||
* fvc::surfaceSum(mag(phi))().internalField()
|
||||
pos(alpha1 - 0.01)*pos(0.99 - alpha1)
|
||||
*fvc::surfaceSum(mag(phi))().internalField()
|
||||
);
|
||||
|
||||
alphaCoNum = 0.5*gMax(sumPhi/mesh.V().field())*runTime.deltaTValue();
|
||||
@ -29,18 +29,18 @@
|
||||
#include "createPhi.H"
|
||||
|
||||
Info<< "Reading transportProperties\n" << endl;
|
||||
incompressibleTwoPhaseMixture twoPhaseProperties(U, phi);
|
||||
incompressibleTwoPhaseMixture mixture(U, phi);
|
||||
|
||||
volScalarField& alpha1(twoPhaseProperties.alpha1());
|
||||
volScalarField& alpha2(twoPhaseProperties.alpha2());
|
||||
volScalarField& alpha1(mixture.alpha1());
|
||||
volScalarField& alpha2(mixture.alpha2());
|
||||
|
||||
const dimensionedScalar& rho1 = twoPhaseProperties.rho1();
|
||||
const dimensionedScalar& rho2 = twoPhaseProperties.rho2();
|
||||
const dimensionedScalar& rho1 = mixture.rho1();
|
||||
const dimensionedScalar& rho2 = mixture.rho2();
|
||||
|
||||
dimensionedScalar Dab(twoPhaseProperties.lookup("Dab"));
|
||||
dimensionedScalar Dab(mixture.lookup("Dab"));
|
||||
|
||||
// Read the reciprocal of the turbulent Schmidt number
|
||||
dimensionedScalar alphatab(twoPhaseProperties.lookup("alphatab"));
|
||||
dimensionedScalar alphatab(mixture.lookup("alphatab"));
|
||||
|
||||
// Need to store rho for ddt(rho, U)
|
||||
volScalarField rho("rho", alpha1*rho1 + alpha2*rho2);
|
||||
@ -66,7 +66,7 @@
|
||||
// Construct incompressible turbulence model
|
||||
autoPtr<incompressible::turbulenceModel> turbulence
|
||||
(
|
||||
incompressible::turbulenceModel::New(U, phi, twoPhaseProperties)
|
||||
incompressible::turbulenceModel::New(U, phi, mixture)
|
||||
);
|
||||
|
||||
Info<< "Calculating field g.h\n" << endl;
|
||||
|
||||
@ -2,7 +2,7 @@
|
||||
========= |
|
||||
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
|
||||
\\ / O peration |
|
||||
\\ / A nd | Copyright (C) 2011-2013 OpenFOAM Foundation
|
||||
\\ / A nd | Copyright (C) 2011-2014 OpenFOAM Foundation
|
||||
\\/ M anipulation |
|
||||
-------------------------------------------------------------------------------
|
||||
License
|
||||
@ -70,7 +70,7 @@ int main(int argc, char *argv[])
|
||||
|
||||
Info<< "Time = " << runTime.timeName() << nl << endl;
|
||||
|
||||
twoPhaseProperties.correct();
|
||||
mixture.correct();
|
||||
|
||||
#include "alphaEqnSubCycle.H"
|
||||
#include "alphaDiffusionEqn.H"
|
||||
|
||||
@ -7,5 +7,7 @@ wmake $makeType twoPhaseMixture
|
||||
wmake $makeType interfaceProperties
|
||||
wmake $makeType twoPhaseProperties
|
||||
wmake $makeType incompressible
|
||||
wmake $makeType compressible
|
||||
wmake $makeType immiscibleIncompressibleTwoPhaseMixture
|
||||
|
||||
# ----------------------------------------------------------------- end-of-file
|
||||
|
||||
3
src/transportModels/compressible/Make/files
Normal file
3
src/transportModels/compressible/Make/files
Normal file
@ -0,0 +1,3 @@
|
||||
compressibleTransportModel/compressibleTransportModel.C
|
||||
|
||||
LIB = $(FOAM_LIBBIN)/libcompressibleTransportModels
|
||||
5
src/transportModels/compressible/Make/options
Normal file
5
src/transportModels/compressible/Make/options
Normal file
@ -0,0 +1,5 @@
|
||||
EXE_INC = \
|
||||
-I$(LIB_SRC)/finiteVolume/lnInclude
|
||||
|
||||
LIB_LIBS = \
|
||||
-lfiniteVolume
|
||||
@ -2,7 +2,7 @@
|
||||
========= |
|
||||
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
|
||||
\\ / O peration |
|
||||
\\ / A nd | Copyright (C) 2011-2012 OpenFOAM Foundation
|
||||
\\ / A nd | Copyright (C) 2014 OpenFOAM Foundation
|
||||
\\/ M anipulation |
|
||||
-------------------------------------------------------------------------------
|
||||
License
|
||||
@ -21,40 +21,29 @@ License
|
||||
You should have received a copy of the GNU General Public License
|
||||
along with OpenFOAM. If not, see <http://www.gnu.org/licenses/>.
|
||||
|
||||
Global
|
||||
CourantNo
|
||||
|
||||
Description
|
||||
Calculates and outputs the mean and maximum Courant Numbers.
|
||||
|
||||
\*---------------------------------------------------------------------------*/
|
||||
|
||||
scalar maxAlphaCo
|
||||
(
|
||||
readScalar(runTime.controlDict().lookup("maxAlphaCo"))
|
||||
);
|
||||
#include "compressibleTransportModel.H"
|
||||
|
||||
scalar alphaCoNum = 0.0;
|
||||
scalar meanAlphaCoNum = 0.0;
|
||||
// * * * * * * * * * * * * * * Static Data Members * * * * * * * * * * * * * //
|
||||
|
||||
if (mesh.nInternalFaces())
|
||||
namespace Foam
|
||||
{
|
||||
scalarField sumPhi
|
||||
(
|
||||
max
|
||||
(
|
||||
pos(alpha1 - 0.01)*pos(0.99 - alpha1),
|
||||
pos(alpha2 - 0.01)*pos(0.99 - alpha2)
|
||||
)*fvc::surfaceSum(mag(phi))().internalField()
|
||||
);
|
||||
|
||||
alphaCoNum = 0.5*gMax(sumPhi/mesh.V().field())*runTime.deltaTValue();
|
||||
|
||||
meanAlphaCoNum =
|
||||
0.5*(gSum(sumPhi)/gSum(mesh.V().field()))*runTime.deltaTValue();
|
||||
defineTypeNameAndDebug(compressibleTransportModel, 0);
|
||||
}
|
||||
|
||||
Info<< "Interface Courant Number mean: " << meanAlphaCoNum
|
||||
<< " max: " << alphaCoNum << endl;
|
||||
|
||||
// * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * //
|
||||
|
||||
Foam::compressibleTransportModel::compressibleTransportModel
|
||||
()
|
||||
{}
|
||||
|
||||
|
||||
// * * * * * * * * * * * * * * * * Destructors * * * * * * * * * * * * * * * //
|
||||
|
||||
Foam::compressibleTransportModel::~compressibleTransportModel()
|
||||
{}
|
||||
|
||||
|
||||
// ************************************************************************* //
|
||||
@ -0,0 +1,104 @@
|
||||
/*---------------------------------------------------------------------------*\
|
||||
========= |
|
||||
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
|
||||
\\ / O peration |
|
||||
\\ / A nd | Copyright (C) 2014 OpenFOAM Foundation
|
||||
\\/ M anipulation |
|
||||
-------------------------------------------------------------------------------
|
||||
License
|
||||
This file is part of OpenFOAM.
|
||||
|
||||
OpenFOAM is free software: you can redistribute it and/or modify it
|
||||
under the terms of the GNU General Public License as published by
|
||||
the Free Software Foundation, either version 3 of the License, or
|
||||
(at your option) any later version.
|
||||
|
||||
OpenFOAM is distributed in the hope that it will be useful, but WITHOUT
|
||||
ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
|
||||
FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
|
||||
for more details.
|
||||
|
||||
You should have received a copy of the GNU General Public License
|
||||
along with OpenFOAM. If not, see <http://www.gnu.org/licenses/>.
|
||||
|
||||
Class
|
||||
Foam::compressibleTransportModel
|
||||
|
||||
Description
|
||||
Base-class for all transport models used by the compressible turbulence
|
||||
models.
|
||||
|
||||
SourceFiles
|
||||
compressibleTransportModel.C
|
||||
|
||||
\*---------------------------------------------------------------------------*/
|
||||
|
||||
#ifndef compressibleTransportModel_H
|
||||
#define compressibleTransportModel_H
|
||||
|
||||
#include "primitiveFieldsFwd.H"
|
||||
#include "volFieldsFwd.H"
|
||||
#include "surfaceFieldsFwd.H"
|
||||
|
||||
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
||||
|
||||
namespace Foam
|
||||
{
|
||||
|
||||
/*---------------------------------------------------------------------------*\
|
||||
Class compressibleTransportModel Declaration
|
||||
\*---------------------------------------------------------------------------*/
|
||||
|
||||
class compressibleTransportModel
|
||||
{
|
||||
// Private Member Functions
|
||||
|
||||
//- Disallow copy construct
|
||||
compressibleTransportModel(const compressibleTransportModel&);
|
||||
|
||||
//- Disallow default bitwise assignment
|
||||
void operator=(const compressibleTransportModel&);
|
||||
|
||||
|
||||
public:
|
||||
|
||||
//- Runtime type information
|
||||
TypeName("compressibleTransportModel");
|
||||
|
||||
|
||||
// Constructors
|
||||
|
||||
//- Construct from components
|
||||
compressibleTransportModel
|
||||
();
|
||||
|
||||
|
||||
//- Destructor
|
||||
virtual ~compressibleTransportModel();
|
||||
|
||||
|
||||
// Member Functions
|
||||
|
||||
//- Return the dynamic laminar viscosity
|
||||
virtual tmp<volScalarField> mu() const = 0;
|
||||
|
||||
//- Return the dynamic laminar viscosity for patch
|
||||
virtual tmp<scalarField> mu(const label patchi) const = 0;
|
||||
|
||||
//- Return the laminar viscosity
|
||||
virtual tmp<volScalarField> nu() const = 0;
|
||||
|
||||
//- Return the laminar viscosity for patch
|
||||
virtual tmp<scalarField> nu(const label patchi) const = 0;
|
||||
};
|
||||
|
||||
|
||||
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
||||
|
||||
} // End namespace Foam
|
||||
|
||||
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
||||
|
||||
#endif
|
||||
|
||||
// ************************************************************************* //
|
||||
@ -0,0 +1,3 @@
|
||||
immiscibleIncompressibleTwoPhaseMixture.C
|
||||
|
||||
LIB = $(FOAM_LIBBIN)/libimmiscibleIncompressibleTwoPhaseMixture
|
||||
@ -0,0 +1,13 @@
|
||||
EXE_INC = \
|
||||
-I.. \
|
||||
-I../incompressible/lnInclude \
|
||||
-I../interfaceProperties/lnInclude \
|
||||
-I../twoPhaseMixture/lnInclude \
|
||||
-I$(LIB_SRC)/finiteVolume/lnInclude
|
||||
|
||||
LIB_LIBS = \
|
||||
-ltwoPhaseMixture \
|
||||
-lincompressibleTransportModels \
|
||||
-linterfaceProperties \
|
||||
-ltwoPhaseProperties \
|
||||
-lfiniteVolume
|
||||
@ -0,0 +1,43 @@
|
||||
/*---------------------------------------------------------------------------*\
|
||||
========= |
|
||||
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
|
||||
\\ / O peration |
|
||||
\\ / A nd | Copyright (C) 2014 OpenFOAM Foundation
|
||||
\\/ M anipulation |
|
||||
-------------------------------------------------------------------------------
|
||||
License
|
||||
This file is part of OpenFOAM.
|
||||
|
||||
OpenFOAM is free software: you can redistribute it and/or modify it
|
||||
under the terms of the GNU General Public License as published by
|
||||
the Free Software Foundation, either version 3 of the License, or
|
||||
(at your option) any later version.
|
||||
|
||||
OpenFOAM is distributed in the hope that it will be useful, but WITHOUT
|
||||
ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
|
||||
FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
|
||||
for more details.
|
||||
|
||||
You should have received a copy of the GNU General Public License
|
||||
along with OpenFOAM. If not, see <http://www.gnu.org/licenses/>.
|
||||
|
||||
\*---------------------------------------------------------------------------*/
|
||||
|
||||
#include "immiscibleIncompressibleTwoPhaseMixture.H"
|
||||
|
||||
|
||||
// * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * //
|
||||
|
||||
Foam::immiscibleIncompressibleTwoPhaseMixture::
|
||||
immiscibleIncompressibleTwoPhaseMixture
|
||||
(
|
||||
const volVectorField& U,
|
||||
const surfaceScalarField& phi
|
||||
)
|
||||
:
|
||||
incompressibleTwoPhaseMixture(U, phi),
|
||||
interfaceProperties(alpha1(), U, *this)
|
||||
{}
|
||||
|
||||
|
||||
// ************************************************************************* //
|
||||
@ -0,0 +1,92 @@
|
||||
/*---------------------------------------------------------------------------*\
|
||||
========= |
|
||||
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
|
||||
\\ / O peration |
|
||||
\\ / A nd | Copyright (C) 2014 OpenFOAM Foundation
|
||||
\\/ M anipulation |
|
||||
-------------------------------------------------------------------------------
|
||||
License
|
||||
This file is part of OpenFOAM.
|
||||
|
||||
OpenFOAM is free software: you can redistribute it and/or modify it
|
||||
under the terms of the GNU General Public License as published by
|
||||
the Free Software Foundation, either version 3 of the License, or
|
||||
(at your option) any later version.
|
||||
|
||||
OpenFOAM is distributed in the hope that it will be useful, but WITHOUT
|
||||
ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
|
||||
FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
|
||||
for more details.
|
||||
|
||||
You should have received a copy of the GNU General Public License
|
||||
along with OpenFOAM. If not, see <http://www.gnu.org/licenses/>.
|
||||
|
||||
Class
|
||||
Foam::immiscibleIncompressibleTwoPhaseMixture
|
||||
|
||||
Description
|
||||
An immiscible incompressible two-phase mixture transport model
|
||||
|
||||
SourceFiles
|
||||
immiscibleIncompressibleTwoPhaseMixture.C
|
||||
|
||||
\*---------------------------------------------------------------------------*/
|
||||
|
||||
#ifndef immiscibleIncompressibleTwoPhaseMixture_H
|
||||
#define immiscibleIncompressibleTwoPhaseMixture_H
|
||||
|
||||
#include "incompressibleTwoPhaseMixture.H"
|
||||
#include "interfaceProperties.H"
|
||||
|
||||
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
||||
|
||||
namespace Foam
|
||||
{
|
||||
|
||||
/*---------------------------------------------------------------------------*\
|
||||
Class immiscibleIncompressibleTwoPhaseMixture Declaration
|
||||
\*---------------------------------------------------------------------------*/
|
||||
|
||||
class immiscibleIncompressibleTwoPhaseMixture
|
||||
:
|
||||
public incompressibleTwoPhaseMixture,
|
||||
public interfaceProperties
|
||||
{
|
||||
|
||||
public:
|
||||
|
||||
// Constructors
|
||||
|
||||
//- Construct from components
|
||||
immiscibleIncompressibleTwoPhaseMixture
|
||||
(
|
||||
const volVectorField& U,
|
||||
const surfaceScalarField& phi
|
||||
);
|
||||
|
||||
|
||||
//- Destructor
|
||||
virtual ~immiscibleIncompressibleTwoPhaseMixture()
|
||||
{}
|
||||
|
||||
|
||||
// Member Functions
|
||||
|
||||
//- Correct the transport and interface properties
|
||||
virtual void correct()
|
||||
{
|
||||
incompressibleTwoPhaseMixture::correct();
|
||||
interfaceProperties::correct();
|
||||
}
|
||||
};
|
||||
|
||||
|
||||
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
||||
|
||||
} // End namespace Foam
|
||||
|
||||
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
||||
|
||||
#endif
|
||||
|
||||
// ************************************************************************* //
|
||||
@ -2,7 +2,7 @@
|
||||
========= |
|
||||
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
|
||||
\\ / O peration |
|
||||
\\ / A nd | Copyright (C) 2011-2013 OpenFOAM Foundation
|
||||
\\ / A nd | Copyright (C) 2011-2014 OpenFOAM Foundation
|
||||
\\/ M anipulation |
|
||||
-------------------------------------------------------------------------------
|
||||
License
|
||||
@ -206,4 +206,20 @@ Foam::interfaceProperties::interfaceProperties
|
||||
}
|
||||
|
||||
|
||||
// * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * * //
|
||||
|
||||
Foam::tmp<Foam::surfaceScalarField>
|
||||
Foam::interfaceProperties::surfaceTensionForce() const
|
||||
{
|
||||
return fvc::interpolate(sigmaK())*fvc::snGrad(alpha1_);
|
||||
}
|
||||
|
||||
|
||||
Foam::tmp<Foam::volScalarField>
|
||||
Foam::interfaceProperties::nearInterface() const
|
||||
{
|
||||
return pos(alpha1_ - 0.01)*pos(0.99 - alpha1_);
|
||||
}
|
||||
|
||||
|
||||
// ************************************************************************* //
|
||||
|
||||
@ -2,7 +2,7 @@
|
||||
========= |
|
||||
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
|
||||
\\ / O peration |
|
||||
\\ / A nd | Copyright (C) 2011 OpenFOAM Foundation
|
||||
\\ / A nd | Copyright (C) 2011-2014 OpenFOAM Foundation
|
||||
\\/ M anipulation |
|
||||
-------------------------------------------------------------------------------
|
||||
License
|
||||
@ -142,6 +142,12 @@ public:
|
||||
return sigma_*K_;
|
||||
}
|
||||
|
||||
tmp<surfaceScalarField> surfaceTensionForce() const;
|
||||
|
||||
//- Indicator of the proximity of the interface
|
||||
// Field values are 1 near and 0 away for the interface.
|
||||
tmp<volScalarField> nearInterface() const;
|
||||
|
||||
void correct()
|
||||
{
|
||||
calculateK();
|
||||
|
||||
File diff suppressed because it is too large
Load Diff
@ -4,7 +4,7 @@ cd ${0%/*} || exit 1 # run from this directory
|
||||
# Source tutorial clean functions
|
||||
. $WM_PROJECT_DIR/bin/tools/CleanFunctions
|
||||
|
||||
keepCases="damBreak capillaryRise"
|
||||
keepCases="damBreak capillaryRise mixerVessel2D"
|
||||
loseCases="damBreakFine"
|
||||
|
||||
for case in $keepCases
|
||||
|
||||
@ -52,13 +52,10 @@ cloneCase damBreak damBreakFine
|
||||
)
|
||||
|
||||
# Do capillaryRise
|
||||
(
|
||||
cd capillaryRise || exit
|
||||
(cd capillaryRise && foamRunTutorials)
|
||||
|
||||
# Do mixerVessel2D
|
||||
(cd mixerVessel2D && foamRunTutorials)
|
||||
|
||||
runApplication blockMesh
|
||||
cp 0/alpha.water.org 0/alpha.water
|
||||
runApplication setFields
|
||||
runApplication `getApplication`
|
||||
)
|
||||
|
||||
# ----------------------------------------------------------------- end-of-file
|
||||
|
||||
14
tutorials/multiphase/interFoam/laminar/capillaryRise/Allrun
Executable file
14
tutorials/multiphase/interFoam/laminar/capillaryRise/Allrun
Executable file
@ -0,0 +1,14 @@
|
||||
#!/bin/sh
|
||||
cd ${0%/*} || exit 1 # run from this directory
|
||||
|
||||
# Source tutorial run functions
|
||||
. $WM_PROJECT_DIR/bin/tools/RunFunctions
|
||||
|
||||
application=`getApplication`
|
||||
|
||||
runApplication blockMesh
|
||||
cp 0/alpha.water.org 0/alpha.water
|
||||
runApplication setFields
|
||||
runApplication $application
|
||||
|
||||
# ----------------------------------------------------------------- end-of-file
|
||||
@ -1,7 +1,7 @@
|
||||
/*--------------------------------*- C++ -*----------------------------------*\
|
||||
| ========= | |
|
||||
| \\ / F ield | OpenFOAM: The Open Source CFD Toolbox |
|
||||
| \\ / O peration | Version: 2.3.0 |
|
||||
| \\ / O peration | Version: 2.3.x |
|
||||
| \\ / A nd | Web: www.OpenFOAM.org |
|
||||
| \\/ M anipulation | |
|
||||
\*---------------------------------------------------------------------------*/
|
||||
@ -32,6 +32,7 @@ FoamFile
|
||||
walls
|
||||
{
|
||||
type wall;
|
||||
inGroups 1(wall);
|
||||
nFaces 800;
|
||||
startFace 15620;
|
||||
}
|
||||
|
||||
@ -1,7 +1,7 @@
|
||||
/*--------------------------------*- C++ -*----------------------------------*\
|
||||
| ========= | |
|
||||
| \\ / F ield | OpenFOAM: The Open Source CFD Toolbox |
|
||||
| \\ / O peration | Version: 2.3.0 |
|
||||
| \\ / O peration | Version: 2.3.x |
|
||||
| \\ / A nd | Web: www.OpenFOAM.org |
|
||||
| \\/ M anipulation | |
|
||||
\*---------------------------------------------------------------------------*/
|
||||
@ -1,7 +1,7 @@
|
||||
/*--------------------------------*- C++ -*----------------------------------*\
|
||||
| ========= | |
|
||||
| \\ / F ield | OpenFOAM: The Open Source CFD Toolbox |
|
||||
| \\ / O peration | Version: 2.3.0 |
|
||||
| \\ / O peration | Version: 2.3.x |
|
||||
| \\ / A nd | Web: www.OpenFOAM.org |
|
||||
| \\/ M anipulation | |
|
||||
\*---------------------------------------------------------------------------*/
|
||||
@ -1,7 +1,7 @@
|
||||
/*--------------------------------*- C++ -*----------------------------------*\
|
||||
| ========= | |
|
||||
| \\ / F ield | OpenFOAM: The Open Source CFD Toolbox |
|
||||
| \\ / O peration | Version: 2.3.0 |
|
||||
| \\ / O peration | Version: 2.3.x |
|
||||
| \\ / A nd | Web: www.OpenFOAM.org |
|
||||
| \\/ M anipulation | |
|
||||
\*---------------------------------------------------------------------------*/
|
||||
@ -7,6 +7,8 @@ cd ${0%/*} || exit 1 # run from this directory
|
||||
application=`getApplication`
|
||||
|
||||
runApplication ./makeMesh
|
||||
cp 0/alpha.water.org 0/alpha.water
|
||||
runApplication setFields
|
||||
runApplication $application
|
||||
|
||||
# ----------------------------------------------------------------- end-of-file
|
||||
@ -1,7 +1,7 @@
|
||||
/*--------------------------------*- C++ -*----------------------------------*\
|
||||
| ========= | |
|
||||
| \\ / F ield | OpenFOAM: The Open Source CFD Toolbox |
|
||||
| \\ / O peration | Version: 2.3.0 |
|
||||
| \\ / O peration | Version: 2.3.x |
|
||||
| \\ / A nd | Web: www.OpenFOAM.org |
|
||||
| \\/ M anipulation | |
|
||||
\*---------------------------------------------------------------------------*/
|
||||
@ -1,7 +1,7 @@
|
||||
/*--------------------------------*- C++ -*----------------------------------*\
|
||||
| ========= | |
|
||||
| \\ / F ield | OpenFOAM: The Open Source CFD Toolbox |
|
||||
| \\ / O peration | Version: 2.3.0 |
|
||||
| \\ / O peration | Version: 2.3.x |
|
||||
| \\ / A nd | Web: www.OpenFOAM.org |
|
||||
| \\/ M anipulation | |
|
||||
\*---------------------------------------------------------------------------*/
|
||||
@ -1,7 +1,7 @@
|
||||
/*--------------------------------*- C++ -*----------------------------------*\
|
||||
| ========= | |
|
||||
| \\ / F ield | OpenFOAM: The Open Source CFD Toolbox |
|
||||
| \\ / O peration | Version: 2.3.0 |
|
||||
| \\ / O peration | Version: 2.3.x |
|
||||
| \\ / A nd | Web: www.OpenFOAM.org |
|
||||
| \\/ M anipulation | |
|
||||
\*---------------------------------------------------------------------------*/
|
||||
@ -1,7 +1,7 @@
|
||||
/*--------------------------------*- C++ -*----------------------------------*\
|
||||
| ========= | |
|
||||
| \\ / F ield | OpenFOAM: The Open Source CFD Toolbox |
|
||||
| \\ / O peration | Version: 2.3.0 |
|
||||
| \\ / O peration | Version: 2.3.x |
|
||||
| \\ / A nd | Web: www.OpenFOAM.org |
|
||||
| \\/ M anipulation | |
|
||||
\*---------------------------------------------------------------------------*/
|
||||
@ -20,12 +20,14 @@ FoamFile
|
||||
rotor
|
||||
{
|
||||
type wall;
|
||||
inGroups 1(wall);
|
||||
nFaces 192;
|
||||
startFace 5952;
|
||||
}
|
||||
stator
|
||||
{
|
||||
type wall;
|
||||
inGroups 1(wall);
|
||||
nFaces 192;
|
||||
startFace 6144;
|
||||
}
|
||||
@ -1,7 +1,7 @@
|
||||
/*--------------------------------*- C++ -*----------------------------------*\
|
||||
| ========= | |
|
||||
| \\ / F ield | OpenFOAM: The Open Source CFD Toolbox |
|
||||
| \\ / O peration | Version: 2.3.0 |
|
||||
| \\ / O peration | Version: 2.3.x |
|
||||
| \\ / A nd | Web: www.OpenFOAM.org |
|
||||
| \\/ M anipulation | |
|
||||
\*---------------------------------------------------------------------------*/
|
||||
@ -1,7 +1,7 @@
|
||||
/*--------------------------------*- C++ -*----------------------------------*\
|
||||
| ========= | |
|
||||
| \\ / F ield | OpenFOAM: The Open Source CFD Toolbox |
|
||||
| \\ / O peration | Version: 2.3.0 |
|
||||
| \\ / O peration | Version: 2.3.x |
|
||||
| \\ / A nd | Web: www.OpenFOAM.org |
|
||||
| \\/ M anipulation | |
|
||||
\*---------------------------------------------------------------------------*/
|
||||
@ -1,7 +1,7 @@
|
||||
/*--------------------------------*- C++ -*----------------------------------*\
|
||||
| ========= | |
|
||||
| \\ / F ield | OpenFOAM: The Open Source CFD Toolbox |
|
||||
| \\ / O peration | Version: 2.3.0 |
|
||||
| \\ / O peration | Version: 2.3.x |
|
||||
| \\ / A nd | Web: www.OpenFOAM.org |
|
||||
| \\/ M anipulation | |
|
||||
\*---------------------------------------------------------------------------*/
|
||||
@ -15,7 +15,7 @@ FoamFile
|
||||
}
|
||||
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
||||
|
||||
application MRFInterFoam;
|
||||
application interFoam;
|
||||
|
||||
startFrom startTime;
|
||||
|
||||
@ -0,0 +1,37 @@
|
||||
/*--------------------------------*- C++ -*----------------------------------*\
|
||||
| ========= | |
|
||||
| \\ / F ield | OpenFOAM: The Open Source CFD Toolbox |
|
||||
| \\ / O peration | Version: 2.3.x |
|
||||
| \\ / A nd | Web: www.OpenFOAM.org |
|
||||
| \\/ M anipulation | |
|
||||
\*---------------------------------------------------------------------------*/
|
||||
FoamFile
|
||||
{
|
||||
version 2.0;
|
||||
format ascii;
|
||||
class dictionary;
|
||||
location "system";
|
||||
object fvOptions;
|
||||
}
|
||||
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
||||
|
||||
MRF1
|
||||
{
|
||||
type MRFSource;
|
||||
active yes;
|
||||
selectionMode cellZone;
|
||||
cellZone rotor;
|
||||
|
||||
MRFSourceCoeffs
|
||||
{
|
||||
// Fixed patches (by default they 'move' with the MRF zone)
|
||||
nonRotatingPatches ();
|
||||
|
||||
origin (0 0 0);
|
||||
axis (0 0 1);
|
||||
omega constant 6.2831853;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
// ************************************************************************* //
|
||||
@ -1,7 +1,7 @@
|
||||
/*--------------------------------*- C++ -*----------------------------------*\
|
||||
| ========= | |
|
||||
| \\ / F ield | OpenFOAM: The Open Source CFD Toolbox |
|
||||
| \\ / O peration | Version: 2.3.0 |
|
||||
| \\ / O peration | Version: 2.3.x |
|
||||
| \\ / A nd | Web: www.OpenFOAM.org |
|
||||
| \\/ M anipulation | |
|
||||
\*---------------------------------------------------------------------------*/
|
||||
@ -1,7 +1,7 @@
|
||||
/*--------------------------------*- C++ -*----------------------------------*\
|
||||
| ========= | |
|
||||
| \\ / F ield | OpenFOAM: The Open Source CFD Toolbox |
|
||||
| \\ / O peration | Version: 2.3.0 |
|
||||
| \\ / O peration | Version: 2.3.x |
|
||||
| \\ / A nd | Web: www.OpenFOAM.org |
|
||||
| \\/ M anipulation | |
|
||||
\*---------------------------------------------------------------------------*/
|
||||
@ -1,7 +1,7 @@
|
||||
/*--------------------------------*- C++ -*----------------------------------*\
|
||||
| ========= | |
|
||||
| \\ / F ield | OpenFOAM: The Open Source CFD Toolbox |
|
||||
| \\ / O peration | Version: 2.3.0 |
|
||||
| \\ / O peration | Version: 2.3.x |
|
||||
| \\ / A nd | Web: www.OpenFOAM.org |
|
||||
| \\/ M anipulation | |
|
||||
\*---------------------------------------------------------------------------*/
|
||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user