Commit 9873774e authored by Henry's avatar Henry Committed by Andrew Heather
Browse files

VoF solvers: rationalize the relationship between VoF solvers

Improve code reuse
Add multiphaseInterDyMFoam
Retire MRFinterFoam -> now handled by interFoam with fvOptions
Update tutorials
parent b87f76cf
......@@ -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)
);
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()
......
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()
);
......
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
......
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();
}
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
)
);
......
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 \
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment